// Generated by Futhark 0.22.0
// git: ed22762 (Sat Jan 15 01:09:59 2022 +0100)

// We need to define _GNU_SOURCE before
// _any_ headers files are imported to get
// the usage statistics of a thread (i.e. have RUSAGE_THREAD) on GNU/Linux
// https://manpages.courier-mta.org/htmlman2/getrusage.2.html
#ifndef _GNU_SOURCE // Avoid possible double-definition warning.
#define _GNU_SOURCE
#endif

#ifdef __clang__
#pragma clang diagnostic ignored "-Wunused-function"
#pragma clang diagnostic ignored "-Wunused-variable"
#pragma clang diagnostic ignored "-Wparentheses"
#pragma clang diagnostic ignored "-Wunused-label"
#elif __GNUC__
#pragma GCC diagnostic ignored "-Wunused-function"
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wparentheses"
#pragma GCC diagnostic ignored "-Wunused-label"
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
#endif

// Headers\n")
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include <stdio.h>
#include <float.h>

#define CL_TARGET_OPENCL_VERSION 120
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
#ifdef __APPLE__
#define CL_SILENCE_DEPRECATION
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

// Initialisation
struct futhark_context_config;
struct futhark_context_config *futhark_context_config_new(void);
void futhark_context_config_free(struct futhark_context_config *cfg);
void futhark_context_config_add_build_option(struct futhark_context_config *cfg,
                                             const char *opt);
void futhark_context_config_set_debugging(struct futhark_context_config *cfg,
                                          int flag);
void futhark_context_config_set_profiling(struct futhark_context_config *cfg,
                                          int flag);
void futhark_context_config_set_logging(struct futhark_context_config *cfg,
                                        int flag);
void futhark_context_config_set_device(struct futhark_context_config *cfg, const
                                       char *s);
void futhark_context_config_set_platform(struct futhark_context_config *cfg,
                                         const char *s);
void
futhark_context_config_select_device_interactively(struct futhark_context_config *cfg);
void futhark_context_config_list_devices(struct futhark_context_config *cfg);
void futhark_context_config_dump_program_to(struct futhark_context_config *cfg,
                                            const char *path);
void
futhark_context_config_load_program_from(struct futhark_context_config *cfg,
                                         const char *path);
void futhark_context_config_dump_binary_to(struct futhark_context_config *cfg,
                                           const char *path);
void futhark_context_config_load_binary_from(struct futhark_context_config *cfg,
                                             const char *path);
void
futhark_context_config_set_default_group_size(struct futhark_context_config *cfg,
                                              int size);
void
futhark_context_config_set_default_num_groups(struct futhark_context_config *cfg,
                                              int num);
void
futhark_context_config_set_default_tile_size(struct futhark_context_config *cfg,
                                             int num);
void
futhark_context_config_set_default_reg_tile_size(struct futhark_context_config *cfg,
                                                 int num);
void
futhark_context_config_set_default_threshold(struct futhark_context_config *cfg,
                                             int num);
int futhark_context_config_set_tuning_param(struct futhark_context_config *cfg,
                                            const char *param_name,
                                            size_t new_value);
struct futhark_context;
struct futhark_context *futhark_context_new(struct futhark_context_config *cfg);
struct futhark_context
*futhark_context_new_with_command_queue(struct futhark_context_config *cfg,
                                        cl_command_queue queue);
void futhark_context_free(struct futhark_context *ctx);
cl_command_queue futhark_context_get_command_queue(struct futhark_context *ctx);
int futhark_get_tuning_param_count(void);
const char *futhark_get_tuning_param_name(int);
const char *futhark_get_tuning_param_class(int);

// Arrays
struct futhark_f32_2d;
struct futhark_f32_2d *futhark_new_f32_2d(struct futhark_context *ctx, const
                                          float *data, int64_t dim0,
                                          int64_t dim1);
struct futhark_f32_2d *futhark_new_raw_f32_2d(struct futhark_context *ctx, const
                                              cl_mem data, int64_t offset,
                                              int64_t dim0, int64_t dim1);
int futhark_free_f32_2d(struct futhark_context *ctx,
                        struct futhark_f32_2d *arr);
int futhark_values_f32_2d(struct futhark_context *ctx,
                          struct futhark_f32_2d *arr, float *data);
cl_mem futhark_values_raw_f32_2d(struct futhark_context *ctx,
                                 struct futhark_f32_2d *arr);
const int64_t *futhark_shape_f32_2d(struct futhark_context *ctx,
                                    struct futhark_f32_2d *arr);

// Opaque values


// Entry points
int futhark_entry_main(struct futhark_context *ctx,
                       struct futhark_f32_2d **out0, const
                       struct futhark_f32_2d *in0, const int64_t in1, const
                       int64_t in2, const int64_t in3, const int64_t in4, const
                       int64_t in5);

// Miscellaneous
int futhark_context_sync(struct futhark_context *ctx);
char *futhark_context_report(struct futhark_context *ctx);
char *futhark_context_get_error(struct futhark_context *ctx);
void futhark_context_set_logging_file(struct futhark_context *ctx, FILE *f);
void futhark_context_pause_profiling(struct futhark_context *ctx);
void futhark_context_unpause_profiling(struct futhark_context *ctx);
int futhark_context_clear_caches(struct futhark_context *ctx);
#define FUTHARK_BACKEND_opencl

#ifdef __cplusplus
}
#endif

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>
#include <stdint.h>
// If NDEBUG is set, the assert() macro will do nothing. Since Futhark
// (unfortunately) makes use of assert() for error detection (and even some
// side effects), we want to avoid that.
#undef NDEBUG
#include <assert.h>
#include <stdarg.h>
// Start of util.h.
//
// Various helper functions that are useful in all generated C code.

#include <errno.h>
#include <string.h>

static const char *fut_progname = "(embedded Futhark)";

static void futhark_panic(int eval, const char *fmt, ...) __attribute__((noreturn));
static char* msgprintf(const char *s, ...);
static void* slurp_file(const char *filename, size_t *size);
static int dump_file(const char *file, const void *buf, size_t n);
struct str_builder;
static void str_builder_init(struct str_builder *b);
static void str_builder(struct str_builder *b, const char *s, ...);

static void futhark_panic(int eval, const char *fmt, ...) {
  va_list ap;
  va_start(ap, fmt);
  fprintf(stderr, "%s: ", fut_progname);
  vfprintf(stderr, fmt, ap);
  va_end(ap);
  exit(eval);
}

// For generating arbitrary-sized error messages.  It is the callers
// responsibility to free the buffer at some point.
static char* msgprintf(const char *s, ...) {
  va_list vl;
  va_start(vl, s);
  size_t needed = 1 + (size_t)vsnprintf(NULL, 0, s, vl);
  char *buffer = (char*) malloc(needed);
  va_start(vl, s); // Must re-init.
  vsnprintf(buffer, needed, s, vl);
  return buffer;
}

static inline void check_err(int errval, int sets_errno, const char *fun, int line,
                            const char *msg, ...) {
  if (errval) {
    char errnum[10];

    va_list vl;
    va_start(vl, msg);

    fprintf(stderr, "ERROR: ");
    vfprintf(stderr, msg, vl);
    fprintf(stderr, " in %s() at line %d with error code %s\n",
            fun, line,
            sets_errno ? strerror(errno) : errnum);
    exit(errval);
  }
}

#define CHECK_ERR(err, ...) check_err(err, 0, __func__, __LINE__, __VA_ARGS__)
#define CHECK_ERRNO(err, ...) check_err(err, 1, __func__, __LINE__, __VA_ARGS__)

// Read the rest of an open file into a NUL-terminated string; returns
// NULL on error.
static void* fslurp_file(FILE *f, size_t *size) {
  long start = ftell(f);
  fseek(f, 0, SEEK_END);
  long src_size = ftell(f)-start;
  fseek(f, start, SEEK_SET);
  unsigned char *s = (unsigned char*) malloc((size_t)src_size + 1);
  if (fread(s, 1, (size_t)src_size, f) != (size_t)src_size) {
    free(s);
    s = NULL;
  } else {
    s[src_size] = '\0';
  }

  if (size) {
    *size = (size_t)src_size;
  }

  return s;
}

// Read a file into a NUL-terminated string; returns NULL on error.
static void* slurp_file(const char *filename, size_t *size) {
  FILE *f = fopen(filename, "rb"); // To avoid Windows messing with linebreaks.
  if (f == NULL) return NULL;
  unsigned char *s = fslurp_file(f, size);
  fclose(f);
  return s;
}

// Dump 'n' bytes from 'buf' into the file at the designated location.
// Returns 0 on success.
static int dump_file(const char *file, const void *buf, size_t n) {
  FILE *f = fopen(file, "w");

  if (f == NULL) {
    return 1;
  }

  if (fwrite(buf, sizeof(char), n, f) != n) {
    return 1;
  }

  if (fclose(f) != 0) {
    return 1;
  }

  return 0;
}

struct str_builder {
  char *str;
  size_t capacity; // Size of buffer.
  size_t used; // Bytes used, *not* including final zero.
};

static void str_builder_init(struct str_builder *b) {
  b->capacity = 10;
  b->used = 0;
  b->str = malloc(b->capacity);
  b->str[0] = 0;
}

static void str_builder(struct str_builder *b, const char *s, ...) {
  va_list vl;
  va_start(vl, s);
  size_t needed = (size_t)vsnprintf(NULL, 0, s, vl);

  while (b->capacity < b->used + needed + 1) {
    b->capacity *= 2;
    b->str = realloc(b->str, b->capacity);
  }

  va_start(vl, s); // Must re-init.
  vsnprintf(b->str+b->used, b->capacity-b->used, s, vl);
  b->used += needed;
}

// End of util.h.
// Start of half.h.

// Conversion functions are from http://half.sourceforge.net/, but
// translated to C.
//
// Copyright (c) 2012-2021 Christian Rau
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#ifndef __OPENCL_VERSION__
#define __constant
#endif

__constant static const uint16_t base_table[512] = {
  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100,
  0x0200, 0x0400, 0x0800, 0x0C00, 0x1000, 0x1400, 0x1800, 0x1C00, 0x2000, 0x2400, 0x2800, 0x2C00, 0x3000, 0x3400, 0x3800, 0x3C00,
  0x4000, 0x4400, 0x4800, 0x4C00, 0x5000, 0x5400, 0x5800, 0x5C00, 0x6000, 0x6400, 0x6800, 0x6C00, 0x7000, 0x7400, 0x7800, 0x7C00,
  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,
  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,
  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,
  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,
  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,
  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,
  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,
  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,
  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8001, 0x8002, 0x8004, 0x8008, 0x8010, 0x8020, 0x8040, 0x8080, 0x8100,
  0x8200, 0x8400, 0x8800, 0x8C00, 0x9000, 0x9400, 0x9800, 0x9C00, 0xA000, 0xA400, 0xA800, 0xAC00, 0xB000, 0xB400, 0xB800, 0xBC00,
  0xC000, 0xC400, 0xC800, 0xCC00, 0xD000, 0xD400, 0xD800, 0xDC00, 0xE000, 0xE400, 0xE800, 0xEC00, 0xF000, 0xF400, 0xF800, 0xFC00,
  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,
  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,
  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,
  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,
  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,
  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,
  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00 };

__constant static const unsigned char shift_table[512] = {
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 13,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 13 };

__constant static const uint32_t mantissa_table[2048] = {
  0x00000000, 0x33800000, 0x34000000, 0x34400000, 0x34800000, 0x34A00000, 0x34C00000, 0x34E00000, 0x35000000, 0x35100000, 0x35200000, 0x35300000, 0x35400000, 0x35500000, 0x35600000, 0x35700000,
  0x35800000, 0x35880000, 0x35900000, 0x35980000, 0x35A00000, 0x35A80000, 0x35B00000, 0x35B80000, 0x35C00000, 0x35C80000, 0x35D00000, 0x35D80000, 0x35E00000, 0x35E80000, 0x35F00000, 0x35F80000,
  0x36000000, 0x36040000, 0x36080000, 0x360C0000, 0x36100000, 0x36140000, 0x36180000, 0x361C0000, 0x36200000, 0x36240000, 0x36280000, 0x362C0000, 0x36300000, 0x36340000, 0x36380000, 0x363C0000,
  0x36400000, 0x36440000, 0x36480000, 0x364C0000, 0x36500000, 0x36540000, 0x36580000, 0x365C0000, 0x36600000, 0x36640000, 0x36680000, 0x366C0000, 0x36700000, 0x36740000, 0x36780000, 0x367C0000,
  0x36800000, 0x36820000, 0x36840000, 0x36860000, 0x36880000, 0x368A0000, 0x368C0000, 0x368E0000, 0x36900000, 0x36920000, 0x36940000, 0x36960000, 0x36980000, 0x369A0000, 0x369C0000, 0x369E0000,
  0x36A00000, 0x36A20000, 0x36A40000, 0x36A60000, 0x36A80000, 0x36AA0000, 0x36AC0000, 0x36AE0000, 0x36B00000, 0x36B20000, 0x36B40000, 0x36B60000, 0x36B80000, 0x36BA0000, 0x36BC0000, 0x36BE0000,
  0x36C00000, 0x36C20000, 0x36C40000, 0x36C60000, 0x36C80000, 0x36CA0000, 0x36CC0000, 0x36CE0000, 0x36D00000, 0x36D20000, 0x36D40000, 0x36D60000, 0x36D80000, 0x36DA0000, 0x36DC0000, 0x36DE0000,
  0x36E00000, 0x36E20000, 0x36E40000, 0x36E60000, 0x36E80000, 0x36EA0000, 0x36EC0000, 0x36EE0000, 0x36F00000, 0x36F20000, 0x36F40000, 0x36F60000, 0x36F80000, 0x36FA0000, 0x36FC0000, 0x36FE0000,
  0x37000000, 0x37010000, 0x37020000, 0x37030000, 0x37040000, 0x37050000, 0x37060000, 0x37070000, 0x37080000, 0x37090000, 0x370A0000, 0x370B0000, 0x370C0000, 0x370D0000, 0x370E0000, 0x370F0000,
  0x37100000, 0x37110000, 0x37120000, 0x37130000, 0x37140000, 0x37150000, 0x37160000, 0x37170000, 0x37180000, 0x37190000, 0x371A0000, 0x371B0000, 0x371C0000, 0x371D0000, 0x371E0000, 0x371F0000,
  0x37200000, 0x37210000, 0x37220000, 0x37230000, 0x37240000, 0x37250000, 0x37260000, 0x37270000, 0x37280000, 0x37290000, 0x372A0000, 0x372B0000, 0x372C0000, 0x372D0000, 0x372E0000, 0x372F0000,
  0x37300000, 0x37310000, 0x37320000, 0x37330000, 0x37340000, 0x37350000, 0x37360000, 0x37370000, 0x37380000, 0x37390000, 0x373A0000, 0x373B0000, 0x373C0000, 0x373D0000, 0x373E0000, 0x373F0000,
  0x37400000, 0x37410000, 0x37420000, 0x37430000, 0x37440000, 0x37450000, 0x37460000, 0x37470000, 0x37480000, 0x37490000, 0x374A0000, 0x374B0000, 0x374C0000, 0x374D0000, 0x374E0000, 0x374F0000,
  0x37500000, 0x37510000, 0x37520000, 0x37530000, 0x37540000, 0x37550000, 0x37560000, 0x37570000, 0x37580000, 0x37590000, 0x375A0000, 0x375B0000, 0x375C0000, 0x375D0000, 0x375E0000, 0x375F0000,
  0x37600000, 0x37610000, 0x37620000, 0x37630000, 0x37640000, 0x37650000, 0x37660000, 0x37670000, 0x37680000, 0x37690000, 0x376A0000, 0x376B0000, 0x376C0000, 0x376D0000, 0x376E0000, 0x376F0000,
  0x37700000, 0x37710000, 0x37720000, 0x37730000, 0x37740000, 0x37750000, 0x37760000, 0x37770000, 0x37780000, 0x37790000, 0x377A0000, 0x377B0000, 0x377C0000, 0x377D0000, 0x377E0000, 0x377F0000,
  0x37800000, 0x37808000, 0x37810000, 0x37818000, 0x37820000, 0x37828000, 0x37830000, 0x37838000, 0x37840000, 0x37848000, 0x37850000, 0x37858000, 0x37860000, 0x37868000, 0x37870000, 0x37878000,
  0x37880000, 0x37888000, 0x37890000, 0x37898000, 0x378A0000, 0x378A8000, 0x378B0000, 0x378B8000, 0x378C0000, 0x378C8000, 0x378D0000, 0x378D8000, 0x378E0000, 0x378E8000, 0x378F0000, 0x378F8000,
  0x37900000, 0x37908000, 0x37910000, 0x37918000, 0x37920000, 0x37928000, 0x37930000, 0x37938000, 0x37940000, 0x37948000, 0x37950000, 0x37958000, 0x37960000, 0x37968000, 0x37970000, 0x37978000,
  0x37980000, 0x37988000, 0x37990000, 0x37998000, 0x379A0000, 0x379A8000, 0x379B0000, 0x379B8000, 0x379C0000, 0x379C8000, 0x379D0000, 0x379D8000, 0x379E0000, 0x379E8000, 0x379F0000, 0x379F8000,
  0x37A00000, 0x37A08000, 0x37A10000, 0x37A18000, 0x37A20000, 0x37A28000, 0x37A30000, 0x37A38000, 0x37A40000, 0x37A48000, 0x37A50000, 0x37A58000, 0x37A60000, 0x37A68000, 0x37A70000, 0x37A78000,
  0x37A80000, 0x37A88000, 0x37A90000, 0x37A98000, 0x37AA0000, 0x37AA8000, 0x37AB0000, 0x37AB8000, 0x37AC0000, 0x37AC8000, 0x37AD0000, 0x37AD8000, 0x37AE0000, 0x37AE8000, 0x37AF0000, 0x37AF8000,
  0x37B00000, 0x37B08000, 0x37B10000, 0x37B18000, 0x37B20000, 0x37B28000, 0x37B30000, 0x37B38000, 0x37B40000, 0x37B48000, 0x37B50000, 0x37B58000, 0x37B60000, 0x37B68000, 0x37B70000, 0x37B78000,
  0x37B80000, 0x37B88000, 0x37B90000, 0x37B98000, 0x37BA0000, 0x37BA8000, 0x37BB0000, 0x37BB8000, 0x37BC0000, 0x37BC8000, 0x37BD0000, 0x37BD8000, 0x37BE0000, 0x37BE8000, 0x37BF0000, 0x37BF8000,
  0x37C00000, 0x37C08000, 0x37C10000, 0x37C18000, 0x37C20000, 0x37C28000, 0x37C30000, 0x37C38000, 0x37C40000, 0x37C48000, 0x37C50000, 0x37C58000, 0x37C60000, 0x37C68000, 0x37C70000, 0x37C78000,
  0x37C80000, 0x37C88000, 0x37C90000, 0x37C98000, 0x37CA0000, 0x37CA8000, 0x37CB0000, 0x37CB8000, 0x37CC0000, 0x37CC8000, 0x37CD0000, 0x37CD8000, 0x37CE0000, 0x37CE8000, 0x37CF0000, 0x37CF8000,
  0x37D00000, 0x37D08000, 0x37D10000, 0x37D18000, 0x37D20000, 0x37D28000, 0x37D30000, 0x37D38000, 0x37D40000, 0x37D48000, 0x37D50000, 0x37D58000, 0x37D60000, 0x37D68000, 0x37D70000, 0x37D78000,
  0x37D80000, 0x37D88000, 0x37D90000, 0x37D98000, 0x37DA0000, 0x37DA8000, 0x37DB0000, 0x37DB8000, 0x37DC0000, 0x37DC8000, 0x37DD0000, 0x37DD8000, 0x37DE0000, 0x37DE8000, 0x37DF0000, 0x37DF8000,
  0x37E00000, 0x37E08000, 0x37E10000, 0x37E18000, 0x37E20000, 0x37E28000, 0x37E30000, 0x37E38000, 0x37E40000, 0x37E48000, 0x37E50000, 0x37E58000, 0x37E60000, 0x37E68000, 0x37E70000, 0x37E78000,
  0x37E80000, 0x37E88000, 0x37E90000, 0x37E98000, 0x37EA0000, 0x37EA8000, 0x37EB0000, 0x37EB8000, 0x37EC0000, 0x37EC8000, 0x37ED0000, 0x37ED8000, 0x37EE0000, 0x37EE8000, 0x37EF0000, 0x37EF8000,
  0x37F00000, 0x37F08000, 0x37F10000, 0x37F18000, 0x37F20000, 0x37F28000, 0x37F30000, 0x37F38000, 0x37F40000, 0x37F48000, 0x37F50000, 0x37F58000, 0x37F60000, 0x37F68000, 0x37F70000, 0x37F78000,
  0x37F80000, 0x37F88000, 0x37F90000, 0x37F98000, 0x37FA0000, 0x37FA8000, 0x37FB0000, 0x37FB8000, 0x37FC0000, 0x37FC8000, 0x37FD0000, 0x37FD8000, 0x37FE0000, 0x37FE8000, 0x37FF0000, 0x37FF8000,
  0x38000000, 0x38004000, 0x38008000, 0x3800C000, 0x38010000, 0x38014000, 0x38018000, 0x3801C000, 0x38020000, 0x38024000, 0x38028000, 0x3802C000, 0x38030000, 0x38034000, 0x38038000, 0x3803C000,
  0x38040000, 0x38044000, 0x38048000, 0x3804C000, 0x38050000, 0x38054000, 0x38058000, 0x3805C000, 0x38060000, 0x38064000, 0x38068000, 0x3806C000, 0x38070000, 0x38074000, 0x38078000, 0x3807C000,
  0x38080000, 0x38084000, 0x38088000, 0x3808C000, 0x38090000, 0x38094000, 0x38098000, 0x3809C000, 0x380A0000, 0x380A4000, 0x380A8000, 0x380AC000, 0x380B0000, 0x380B4000, 0x380B8000, 0x380BC000,
  0x380C0000, 0x380C4000, 0x380C8000, 0x380CC000, 0x380D0000, 0x380D4000, 0x380D8000, 0x380DC000, 0x380E0000, 0x380E4000, 0x380E8000, 0x380EC000, 0x380F0000, 0x380F4000, 0x380F8000, 0x380FC000,
  0x38100000, 0x38104000, 0x38108000, 0x3810C000, 0x38110000, 0x38114000, 0x38118000, 0x3811C000, 0x38120000, 0x38124000, 0x38128000, 0x3812C000, 0x38130000, 0x38134000, 0x38138000, 0x3813C000,
  0x38140000, 0x38144000, 0x38148000, 0x3814C000, 0x38150000, 0x38154000, 0x38158000, 0x3815C000, 0x38160000, 0x38164000, 0x38168000, 0x3816C000, 0x38170000, 0x38174000, 0x38178000, 0x3817C000,
  0x38180000, 0x38184000, 0x38188000, 0x3818C000, 0x38190000, 0x38194000, 0x38198000, 0x3819C000, 0x381A0000, 0x381A4000, 0x381A8000, 0x381AC000, 0x381B0000, 0x381B4000, 0x381B8000, 0x381BC000,
  0x381C0000, 0x381C4000, 0x381C8000, 0x381CC000, 0x381D0000, 0x381D4000, 0x381D8000, 0x381DC000, 0x381E0000, 0x381E4000, 0x381E8000, 0x381EC000, 0x381F0000, 0x381F4000, 0x381F8000, 0x381FC000,
  0x38200000, 0x38204000, 0x38208000, 0x3820C000, 0x38210000, 0x38214000, 0x38218000, 0x3821C000, 0x38220000, 0x38224000, 0x38228000, 0x3822C000, 0x38230000, 0x38234000, 0x38238000, 0x3823C000,
  0x38240000, 0x38244000, 0x38248000, 0x3824C000, 0x38250000, 0x38254000, 0x38258000, 0x3825C000, 0x38260000, 0x38264000, 0x38268000, 0x3826C000, 0x38270000, 0x38274000, 0x38278000, 0x3827C000,
  0x38280000, 0x38284000, 0x38288000, 0x3828C000, 0x38290000, 0x38294000, 0x38298000, 0x3829C000, 0x382A0000, 0x382A4000, 0x382A8000, 0x382AC000, 0x382B0000, 0x382B4000, 0x382B8000, 0x382BC000,
  0x382C0000, 0x382C4000, 0x382C8000, 0x382CC000, 0x382D0000, 0x382D4000, 0x382D8000, 0x382DC000, 0x382E0000, 0x382E4000, 0x382E8000, 0x382EC000, 0x382F0000, 0x382F4000, 0x382F8000, 0x382FC000,
  0x38300000, 0x38304000, 0x38308000, 0x3830C000, 0x38310000, 0x38314000, 0x38318000, 0x3831C000, 0x38320000, 0x38324000, 0x38328000, 0x3832C000, 0x38330000, 0x38334000, 0x38338000, 0x3833C000,
  0x38340000, 0x38344000, 0x38348000, 0x3834C000, 0x38350000, 0x38354000, 0x38358000, 0x3835C000, 0x38360000, 0x38364000, 0x38368000, 0x3836C000, 0x38370000, 0x38374000, 0x38378000, 0x3837C000,
  0x38380000, 0x38384000, 0x38388000, 0x3838C000, 0x38390000, 0x38394000, 0x38398000, 0x3839C000, 0x383A0000, 0x383A4000, 0x383A8000, 0x383AC000, 0x383B0000, 0x383B4000, 0x383B8000, 0x383BC000,
  0x383C0000, 0x383C4000, 0x383C8000, 0x383CC000, 0x383D0000, 0x383D4000, 0x383D8000, 0x383DC000, 0x383E0000, 0x383E4000, 0x383E8000, 0x383EC000, 0x383F0000, 0x383F4000, 0x383F8000, 0x383FC000,
  0x38400000, 0x38404000, 0x38408000, 0x3840C000, 0x38410000, 0x38414000, 0x38418000, 0x3841C000, 0x38420000, 0x38424000, 0x38428000, 0x3842C000, 0x38430000, 0x38434000, 0x38438000, 0x3843C000,
  0x38440000, 0x38444000, 0x38448000, 0x3844C000, 0x38450000, 0x38454000, 0x38458000, 0x3845C000, 0x38460000, 0x38464000, 0x38468000, 0x3846C000, 0x38470000, 0x38474000, 0x38478000, 0x3847C000,
  0x38480000, 0x38484000, 0x38488000, 0x3848C000, 0x38490000, 0x38494000, 0x38498000, 0x3849C000, 0x384A0000, 0x384A4000, 0x384A8000, 0x384AC000, 0x384B0000, 0x384B4000, 0x384B8000, 0x384BC000,
  0x384C0000, 0x384C4000, 0x384C8000, 0x384CC000, 0x384D0000, 0x384D4000, 0x384D8000, 0x384DC000, 0x384E0000, 0x384E4000, 0x384E8000, 0x384EC000, 0x384F0000, 0x384F4000, 0x384F8000, 0x384FC000,
  0x38500000, 0x38504000, 0x38508000, 0x3850C000, 0x38510000, 0x38514000, 0x38518000, 0x3851C000, 0x38520000, 0x38524000, 0x38528000, 0x3852C000, 0x38530000, 0x38534000, 0x38538000, 0x3853C000,
  0x38540000, 0x38544000, 0x38548000, 0x3854C000, 0x38550000, 0x38554000, 0x38558000, 0x3855C000, 0x38560000, 0x38564000, 0x38568000, 0x3856C000, 0x38570000, 0x38574000, 0x38578000, 0x3857C000,
  0x38580000, 0x38584000, 0x38588000, 0x3858C000, 0x38590000, 0x38594000, 0x38598000, 0x3859C000, 0x385A0000, 0x385A4000, 0x385A8000, 0x385AC000, 0x385B0000, 0x385B4000, 0x385B8000, 0x385BC000,
  0x385C0000, 0x385C4000, 0x385C8000, 0x385CC000, 0x385D0000, 0x385D4000, 0x385D8000, 0x385DC000, 0x385E0000, 0x385E4000, 0x385E8000, 0x385EC000, 0x385F0000, 0x385F4000, 0x385F8000, 0x385FC000,
  0x38600000, 0x38604000, 0x38608000, 0x3860C000, 0x38610000, 0x38614000, 0x38618000, 0x3861C000, 0x38620000, 0x38624000, 0x38628000, 0x3862C000, 0x38630000, 0x38634000, 0x38638000, 0x3863C000,
  0x38640000, 0x38644000, 0x38648000, 0x3864C000, 0x38650000, 0x38654000, 0x38658000, 0x3865C000, 0x38660000, 0x38664000, 0x38668000, 0x3866C000, 0x38670000, 0x38674000, 0x38678000, 0x3867C000,
  0x38680000, 0x38684000, 0x38688000, 0x3868C000, 0x38690000, 0x38694000, 0x38698000, 0x3869C000, 0x386A0000, 0x386A4000, 0x386A8000, 0x386AC000, 0x386B0000, 0x386B4000, 0x386B8000, 0x386BC000,
  0x386C0000, 0x386C4000, 0x386C8000, 0x386CC000, 0x386D0000, 0x386D4000, 0x386D8000, 0x386DC000, 0x386E0000, 0x386E4000, 0x386E8000, 0x386EC000, 0x386F0000, 0x386F4000, 0x386F8000, 0x386FC000,
  0x38700000, 0x38704000, 0x38708000, 0x3870C000, 0x38710000, 0x38714000, 0x38718000, 0x3871C000, 0x38720000, 0x38724000, 0x38728000, 0x3872C000, 0x38730000, 0x38734000, 0x38738000, 0x3873C000,
  0x38740000, 0x38744000, 0x38748000, 0x3874C000, 0x38750000, 0x38754000, 0x38758000, 0x3875C000, 0x38760000, 0x38764000, 0x38768000, 0x3876C000, 0x38770000, 0x38774000, 0x38778000, 0x3877C000,
  0x38780000, 0x38784000, 0x38788000, 0x3878C000, 0x38790000, 0x38794000, 0x38798000, 0x3879C000, 0x387A0000, 0x387A4000, 0x387A8000, 0x387AC000, 0x387B0000, 0x387B4000, 0x387B8000, 0x387BC000,
  0x387C0000, 0x387C4000, 0x387C8000, 0x387CC000, 0x387D0000, 0x387D4000, 0x387D8000, 0x387DC000, 0x387E0000, 0x387E4000, 0x387E8000, 0x387EC000, 0x387F0000, 0x387F4000, 0x387F8000, 0x387FC000,
  0x38000000, 0x38002000, 0x38004000, 0x38006000, 0x38008000, 0x3800A000, 0x3800C000, 0x3800E000, 0x38010000, 0x38012000, 0x38014000, 0x38016000, 0x38018000, 0x3801A000, 0x3801C000, 0x3801E000,
  0x38020000, 0x38022000, 0x38024000, 0x38026000, 0x38028000, 0x3802A000, 0x3802C000, 0x3802E000, 0x38030000, 0x38032000, 0x38034000, 0x38036000, 0x38038000, 0x3803A000, 0x3803C000, 0x3803E000,
  0x38040000, 0x38042000, 0x38044000, 0x38046000, 0x38048000, 0x3804A000, 0x3804C000, 0x3804E000, 0x38050000, 0x38052000, 0x38054000, 0x38056000, 0x38058000, 0x3805A000, 0x3805C000, 0x3805E000,
  0x38060000, 0x38062000, 0x38064000, 0x38066000, 0x38068000, 0x3806A000, 0x3806C000, 0x3806E000, 0x38070000, 0x38072000, 0x38074000, 0x38076000, 0x38078000, 0x3807A000, 0x3807C000, 0x3807E000,
  0x38080000, 0x38082000, 0x38084000, 0x38086000, 0x38088000, 0x3808A000, 0x3808C000, 0x3808E000, 0x38090000, 0x38092000, 0x38094000, 0x38096000, 0x38098000, 0x3809A000, 0x3809C000, 0x3809E000,
  0x380A0000, 0x380A2000, 0x380A4000, 0x380A6000, 0x380A8000, 0x380AA000, 0x380AC000, 0x380AE000, 0x380B0000, 0x380B2000, 0x380B4000, 0x380B6000, 0x380B8000, 0x380BA000, 0x380BC000, 0x380BE000,
  0x380C0000, 0x380C2000, 0x380C4000, 0x380C6000, 0x380C8000, 0x380CA000, 0x380CC000, 0x380CE000, 0x380D0000, 0x380D2000, 0x380D4000, 0x380D6000, 0x380D8000, 0x380DA000, 0x380DC000, 0x380DE000,
  0x380E0000, 0x380E2000, 0x380E4000, 0x380E6000, 0x380E8000, 0x380EA000, 0x380EC000, 0x380EE000, 0x380F0000, 0x380F2000, 0x380F4000, 0x380F6000, 0x380F8000, 0x380FA000, 0x380FC000, 0x380FE000,
  0x38100000, 0x38102000, 0x38104000, 0x38106000, 0x38108000, 0x3810A000, 0x3810C000, 0x3810E000, 0x38110000, 0x38112000, 0x38114000, 0x38116000, 0x38118000, 0x3811A000, 0x3811C000, 0x3811E000,
  0x38120000, 0x38122000, 0x38124000, 0x38126000, 0x38128000, 0x3812A000, 0x3812C000, 0x3812E000, 0x38130000, 0x38132000, 0x38134000, 0x38136000, 0x38138000, 0x3813A000, 0x3813C000, 0x3813E000,
  0x38140000, 0x38142000, 0x38144000, 0x38146000, 0x38148000, 0x3814A000, 0x3814C000, 0x3814E000, 0x38150000, 0x38152000, 0x38154000, 0x38156000, 0x38158000, 0x3815A000, 0x3815C000, 0x3815E000,
  0x38160000, 0x38162000, 0x38164000, 0x38166000, 0x38168000, 0x3816A000, 0x3816C000, 0x3816E000, 0x38170000, 0x38172000, 0x38174000, 0x38176000, 0x38178000, 0x3817A000, 0x3817C000, 0x3817E000,
  0x38180000, 0x38182000, 0x38184000, 0x38186000, 0x38188000, 0x3818A000, 0x3818C000, 0x3818E000, 0x38190000, 0x38192000, 0x38194000, 0x38196000, 0x38198000, 0x3819A000, 0x3819C000, 0x3819E000,
  0x381A0000, 0x381A2000, 0x381A4000, 0x381A6000, 0x381A8000, 0x381AA000, 0x381AC000, 0x381AE000, 0x381B0000, 0x381B2000, 0x381B4000, 0x381B6000, 0x381B8000, 0x381BA000, 0x381BC000, 0x381BE000,
  0x381C0000, 0x381C2000, 0x381C4000, 0x381C6000, 0x381C8000, 0x381CA000, 0x381CC000, 0x381CE000, 0x381D0000, 0x381D2000, 0x381D4000, 0x381D6000, 0x381D8000, 0x381DA000, 0x381DC000, 0x381DE000,
  0x381E0000, 0x381E2000, 0x381E4000, 0x381E6000, 0x381E8000, 0x381EA000, 0x381EC000, 0x381EE000, 0x381F0000, 0x381F2000, 0x381F4000, 0x381F6000, 0x381F8000, 0x381FA000, 0x381FC000, 0x381FE000,
  0x38200000, 0x38202000, 0x38204000, 0x38206000, 0x38208000, 0x3820A000, 0x3820C000, 0x3820E000, 0x38210000, 0x38212000, 0x38214000, 0x38216000, 0x38218000, 0x3821A000, 0x3821C000, 0x3821E000,
  0x38220000, 0x38222000, 0x38224000, 0x38226000, 0x38228000, 0x3822A000, 0x3822C000, 0x3822E000, 0x38230000, 0x38232000, 0x38234000, 0x38236000, 0x38238000, 0x3823A000, 0x3823C000, 0x3823E000,
  0x38240000, 0x38242000, 0x38244000, 0x38246000, 0x38248000, 0x3824A000, 0x3824C000, 0x3824E000, 0x38250000, 0x38252000, 0x38254000, 0x38256000, 0x38258000, 0x3825A000, 0x3825C000, 0x3825E000,
  0x38260000, 0x38262000, 0x38264000, 0x38266000, 0x38268000, 0x3826A000, 0x3826C000, 0x3826E000, 0x38270000, 0x38272000, 0x38274000, 0x38276000, 0x38278000, 0x3827A000, 0x3827C000, 0x3827E000,
  0x38280000, 0x38282000, 0x38284000, 0x38286000, 0x38288000, 0x3828A000, 0x3828C000, 0x3828E000, 0x38290000, 0x38292000, 0x38294000, 0x38296000, 0x38298000, 0x3829A000, 0x3829C000, 0x3829E000,
  0x382A0000, 0x382A2000, 0x382A4000, 0x382A6000, 0x382A8000, 0x382AA000, 0x382AC000, 0x382AE000, 0x382B0000, 0x382B2000, 0x382B4000, 0x382B6000, 0x382B8000, 0x382BA000, 0x382BC000, 0x382BE000,
  0x382C0000, 0x382C2000, 0x382C4000, 0x382C6000, 0x382C8000, 0x382CA000, 0x382CC000, 0x382CE000, 0x382D0000, 0x382D2000, 0x382D4000, 0x382D6000, 0x382D8000, 0x382DA000, 0x382DC000, 0x382DE000,
  0x382E0000, 0x382E2000, 0x382E4000, 0x382E6000, 0x382E8000, 0x382EA000, 0x382EC000, 0x382EE000, 0x382F0000, 0x382F2000, 0x382F4000, 0x382F6000, 0x382F8000, 0x382FA000, 0x382FC000, 0x382FE000,
  0x38300000, 0x38302000, 0x38304000, 0x38306000, 0x38308000, 0x3830A000, 0x3830C000, 0x3830E000, 0x38310000, 0x38312000, 0x38314000, 0x38316000, 0x38318000, 0x3831A000, 0x3831C000, 0x3831E000,
  0x38320000, 0x38322000, 0x38324000, 0x38326000, 0x38328000, 0x3832A000, 0x3832C000, 0x3832E000, 0x38330000, 0x38332000, 0x38334000, 0x38336000, 0x38338000, 0x3833A000, 0x3833C000, 0x3833E000,
  0x38340000, 0x38342000, 0x38344000, 0x38346000, 0x38348000, 0x3834A000, 0x3834C000, 0x3834E000, 0x38350000, 0x38352000, 0x38354000, 0x38356000, 0x38358000, 0x3835A000, 0x3835C000, 0x3835E000,
  0x38360000, 0x38362000, 0x38364000, 0x38366000, 0x38368000, 0x3836A000, 0x3836C000, 0x3836E000, 0x38370000, 0x38372000, 0x38374000, 0x38376000, 0x38378000, 0x3837A000, 0x3837C000, 0x3837E000,
  0x38380000, 0x38382000, 0x38384000, 0x38386000, 0x38388000, 0x3838A000, 0x3838C000, 0x3838E000, 0x38390000, 0x38392000, 0x38394000, 0x38396000, 0x38398000, 0x3839A000, 0x3839C000, 0x3839E000,
  0x383A0000, 0x383A2000, 0x383A4000, 0x383A6000, 0x383A8000, 0x383AA000, 0x383AC000, 0x383AE000, 0x383B0000, 0x383B2000, 0x383B4000, 0x383B6000, 0x383B8000, 0x383BA000, 0x383BC000, 0x383BE000,
  0x383C0000, 0x383C2000, 0x383C4000, 0x383C6000, 0x383C8000, 0x383CA000, 0x383CC000, 0x383CE000, 0x383D0000, 0x383D2000, 0x383D4000, 0x383D6000, 0x383D8000, 0x383DA000, 0x383DC000, 0x383DE000,
  0x383E0000, 0x383E2000, 0x383E4000, 0x383E6000, 0x383E8000, 0x383EA000, 0x383EC000, 0x383EE000, 0x383F0000, 0x383F2000, 0x383F4000, 0x383F6000, 0x383F8000, 0x383FA000, 0x383FC000, 0x383FE000,
  0x38400000, 0x38402000, 0x38404000, 0x38406000, 0x38408000, 0x3840A000, 0x3840C000, 0x3840E000, 0x38410000, 0x38412000, 0x38414000, 0x38416000, 0x38418000, 0x3841A000, 0x3841C000, 0x3841E000,
  0x38420000, 0x38422000, 0x38424000, 0x38426000, 0x38428000, 0x3842A000, 0x3842C000, 0x3842E000, 0x38430000, 0x38432000, 0x38434000, 0x38436000, 0x38438000, 0x3843A000, 0x3843C000, 0x3843E000,
  0x38440000, 0x38442000, 0x38444000, 0x38446000, 0x38448000, 0x3844A000, 0x3844C000, 0x3844E000, 0x38450000, 0x38452000, 0x38454000, 0x38456000, 0x38458000, 0x3845A000, 0x3845C000, 0x3845E000,
  0x38460000, 0x38462000, 0x38464000, 0x38466000, 0x38468000, 0x3846A000, 0x3846C000, 0x3846E000, 0x38470000, 0x38472000, 0x38474000, 0x38476000, 0x38478000, 0x3847A000, 0x3847C000, 0x3847E000,
  0x38480000, 0x38482000, 0x38484000, 0x38486000, 0x38488000, 0x3848A000, 0x3848C000, 0x3848E000, 0x38490000, 0x38492000, 0x38494000, 0x38496000, 0x38498000, 0x3849A000, 0x3849C000, 0x3849E000,
  0x384A0000, 0x384A2000, 0x384A4000, 0x384A6000, 0x384A8000, 0x384AA000, 0x384AC000, 0x384AE000, 0x384B0000, 0x384B2000, 0x384B4000, 0x384B6000, 0x384B8000, 0x384BA000, 0x384BC000, 0x384BE000,
  0x384C0000, 0x384C2000, 0x384C4000, 0x384C6000, 0x384C8000, 0x384CA000, 0x384CC000, 0x384CE000, 0x384D0000, 0x384D2000, 0x384D4000, 0x384D6000, 0x384D8000, 0x384DA000, 0x384DC000, 0x384DE000,
  0x384E0000, 0x384E2000, 0x384E4000, 0x384E6000, 0x384E8000, 0x384EA000, 0x384EC000, 0x384EE000, 0x384F0000, 0x384F2000, 0x384F4000, 0x384F6000, 0x384F8000, 0x384FA000, 0x384FC000, 0x384FE000,
  0x38500000, 0x38502000, 0x38504000, 0x38506000, 0x38508000, 0x3850A000, 0x3850C000, 0x3850E000, 0x38510000, 0x38512000, 0x38514000, 0x38516000, 0x38518000, 0x3851A000, 0x3851C000, 0x3851E000,
  0x38520000, 0x38522000, 0x38524000, 0x38526000, 0x38528000, 0x3852A000, 0x3852C000, 0x3852E000, 0x38530000, 0x38532000, 0x38534000, 0x38536000, 0x38538000, 0x3853A000, 0x3853C000, 0x3853E000,
  0x38540000, 0x38542000, 0x38544000, 0x38546000, 0x38548000, 0x3854A000, 0x3854C000, 0x3854E000, 0x38550000, 0x38552000, 0x38554000, 0x38556000, 0x38558000, 0x3855A000, 0x3855C000, 0x3855E000,
  0x38560000, 0x38562000, 0x38564000, 0x38566000, 0x38568000, 0x3856A000, 0x3856C000, 0x3856E000, 0x38570000, 0x38572000, 0x38574000, 0x38576000, 0x38578000, 0x3857A000, 0x3857C000, 0x3857E000,
  0x38580000, 0x38582000, 0x38584000, 0x38586000, 0x38588000, 0x3858A000, 0x3858C000, 0x3858E000, 0x38590000, 0x38592000, 0x38594000, 0x38596000, 0x38598000, 0x3859A000, 0x3859C000, 0x3859E000,
  0x385A0000, 0x385A2000, 0x385A4000, 0x385A6000, 0x385A8000, 0x385AA000, 0x385AC000, 0x385AE000, 0x385B0000, 0x385B2000, 0x385B4000, 0x385B6000, 0x385B8000, 0x385BA000, 0x385BC000, 0x385BE000,
  0x385C0000, 0x385C2000, 0x385C4000, 0x385C6000, 0x385C8000, 0x385CA000, 0x385CC000, 0x385CE000, 0x385D0000, 0x385D2000, 0x385D4000, 0x385D6000, 0x385D8000, 0x385DA000, 0x385DC000, 0x385DE000,
  0x385E0000, 0x385E2000, 0x385E4000, 0x385E6000, 0x385E8000, 0x385EA000, 0x385EC000, 0x385EE000, 0x385F0000, 0x385F2000, 0x385F4000, 0x385F6000, 0x385F8000, 0x385FA000, 0x385FC000, 0x385FE000,
  0x38600000, 0x38602000, 0x38604000, 0x38606000, 0x38608000, 0x3860A000, 0x3860C000, 0x3860E000, 0x38610000, 0x38612000, 0x38614000, 0x38616000, 0x38618000, 0x3861A000, 0x3861C000, 0x3861E000,
  0x38620000, 0x38622000, 0x38624000, 0x38626000, 0x38628000, 0x3862A000, 0x3862C000, 0x3862E000, 0x38630000, 0x38632000, 0x38634000, 0x38636000, 0x38638000, 0x3863A000, 0x3863C000, 0x3863E000,
  0x38640000, 0x38642000, 0x38644000, 0x38646000, 0x38648000, 0x3864A000, 0x3864C000, 0x3864E000, 0x38650000, 0x38652000, 0x38654000, 0x38656000, 0x38658000, 0x3865A000, 0x3865C000, 0x3865E000,
  0x38660000, 0x38662000, 0x38664000, 0x38666000, 0x38668000, 0x3866A000, 0x3866C000, 0x3866E000, 0x38670000, 0x38672000, 0x38674000, 0x38676000, 0x38678000, 0x3867A000, 0x3867C000, 0x3867E000,
  0x38680000, 0x38682000, 0x38684000, 0x38686000, 0x38688000, 0x3868A000, 0x3868C000, 0x3868E000, 0x38690000, 0x38692000, 0x38694000, 0x38696000, 0x38698000, 0x3869A000, 0x3869C000, 0x3869E000,
  0x386A0000, 0x386A2000, 0x386A4000, 0x386A6000, 0x386A8000, 0x386AA000, 0x386AC000, 0x386AE000, 0x386B0000, 0x386B2000, 0x386B4000, 0x386B6000, 0x386B8000, 0x386BA000, 0x386BC000, 0x386BE000,
  0x386C0000, 0x386C2000, 0x386C4000, 0x386C6000, 0x386C8000, 0x386CA000, 0x386CC000, 0x386CE000, 0x386D0000, 0x386D2000, 0x386D4000, 0x386D6000, 0x386D8000, 0x386DA000, 0x386DC000, 0x386DE000,
  0x386E0000, 0x386E2000, 0x386E4000, 0x386E6000, 0x386E8000, 0x386EA000, 0x386EC000, 0x386EE000, 0x386F0000, 0x386F2000, 0x386F4000, 0x386F6000, 0x386F8000, 0x386FA000, 0x386FC000, 0x386FE000,
  0x38700000, 0x38702000, 0x38704000, 0x38706000, 0x38708000, 0x3870A000, 0x3870C000, 0x3870E000, 0x38710000, 0x38712000, 0x38714000, 0x38716000, 0x38718000, 0x3871A000, 0x3871C000, 0x3871E000,
  0x38720000, 0x38722000, 0x38724000, 0x38726000, 0x38728000, 0x3872A000, 0x3872C000, 0x3872E000, 0x38730000, 0x38732000, 0x38734000, 0x38736000, 0x38738000, 0x3873A000, 0x3873C000, 0x3873E000,
  0x38740000, 0x38742000, 0x38744000, 0x38746000, 0x38748000, 0x3874A000, 0x3874C000, 0x3874E000, 0x38750000, 0x38752000, 0x38754000, 0x38756000, 0x38758000, 0x3875A000, 0x3875C000, 0x3875E000,
  0x38760000, 0x38762000, 0x38764000, 0x38766000, 0x38768000, 0x3876A000, 0x3876C000, 0x3876E000, 0x38770000, 0x38772000, 0x38774000, 0x38776000, 0x38778000, 0x3877A000, 0x3877C000, 0x3877E000,
  0x38780000, 0x38782000, 0x38784000, 0x38786000, 0x38788000, 0x3878A000, 0x3878C000, 0x3878E000, 0x38790000, 0x38792000, 0x38794000, 0x38796000, 0x38798000, 0x3879A000, 0x3879C000, 0x3879E000,
  0x387A0000, 0x387A2000, 0x387A4000, 0x387A6000, 0x387A8000, 0x387AA000, 0x387AC000, 0x387AE000, 0x387B0000, 0x387B2000, 0x387B4000, 0x387B6000, 0x387B8000, 0x387BA000, 0x387BC000, 0x387BE000,
  0x387C0000, 0x387C2000, 0x387C4000, 0x387C6000, 0x387C8000, 0x387CA000, 0x387CC000, 0x387CE000, 0x387D0000, 0x387D2000, 0x387D4000, 0x387D6000, 0x387D8000, 0x387DA000, 0x387DC000, 0x387DE000,
  0x387E0000, 0x387E2000, 0x387E4000, 0x387E6000, 0x387E8000, 0x387EA000, 0x387EC000, 0x387EE000, 0x387F0000, 0x387F2000, 0x387F4000, 0x387F6000, 0x387F8000, 0x387FA000, 0x387FC000, 0x387FE000 };
__constant static const uint32_t exponent_table[64] = {
  0x00000000, 0x00800000, 0x01000000, 0x01800000, 0x02000000, 0x02800000, 0x03000000, 0x03800000, 0x04000000, 0x04800000, 0x05000000, 0x05800000, 0x06000000, 0x06800000, 0x07000000, 0x07800000,
  0x08000000, 0x08800000, 0x09000000, 0x09800000, 0x0A000000, 0x0A800000, 0x0B000000, 0x0B800000, 0x0C000000, 0x0C800000, 0x0D000000, 0x0D800000, 0x0E000000, 0x0E800000, 0x0F000000, 0x47800000,
  0x80000000, 0x80800000, 0x81000000, 0x81800000, 0x82000000, 0x82800000, 0x83000000, 0x83800000, 0x84000000, 0x84800000, 0x85000000, 0x85800000, 0x86000000, 0x86800000, 0x87000000, 0x87800000,
  0x88000000, 0x88800000, 0x89000000, 0x89800000, 0x8A000000, 0x8A800000, 0x8B000000, 0x8B800000, 0x8C000000, 0x8C800000, 0x8D000000, 0x8D800000, 0x8E000000, 0x8E800000, 0x8F000000, 0xC7800000 };
__constant static const unsigned short offset_table[64] = {
  0, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,
  0, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024 };

static uint16_t float2halfbits(float value) {
  union { float x; uint32_t y; } u;
  u.x = value;
  uint32_t bits = u.y;

  uint16_t hbits = base_table[bits>>23] + (uint16_t)((bits&0x7FFFFF)>>shift_table[bits>>23]);;

  return hbits;
}

static float halfbits2float(uint16_t value) {
  uint32_t bits = mantissa_table[offset_table[value>>10]+(value&0x3FF)] + exponent_table[value>>10];

  union { uint32_t x; float y; } u;
  u.x = bits;
  return u.y;
}

// End of half.h.
// Start of timing.h.

// The function get_wall_time() returns the wall time in microseconds
// (with an unspecified offset).

#ifdef _WIN32

#include <windows.h>

static int64_t get_wall_time(void) {
  LARGE_INTEGER time,freq;
  assert(QueryPerformanceFrequency(&freq));
  assert(QueryPerformanceCounter(&time));
  return ((double)time.QuadPart / freq.QuadPart) * 1000000;
}

#else
// Assuming POSIX

#include <time.h>
#include <sys/time.h>

static int64_t get_wall_time(void) {
  struct timeval time;
  assert(gettimeofday(&time,NULL) == 0);
  return time.tv_sec * 1000000 + time.tv_usec;
}

static int64_t get_wall_time_ns(void) {
  struct timespec time;
  assert(clock_gettime(CLOCK_REALTIME, &time) == 0);
  return time.tv_sec * 1000000000 + time.tv_nsec;
}

#endif

// End of timing.h.

#ifdef _MSC_VER
#define inline __inline
#endif
#include <string.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <ctype.h>


#define CL_TARGET_OPENCL_VERSION 120
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
#ifdef __APPLE__
#define CL_SILENCE_DEPRECATION
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>
#endif


// Start of lock.h.

// A very simple cross-platform implementation of locks.  Uses
// pthreads on Unix and some Windows thing there.  Futhark's
// host-level code is not multithreaded, but user code may be, so we
// need some mechanism for ensuring atomic access to API functions.
// This is that mechanism.  It is not exposed to user code at all, so
// we do not have to worry about name collisions.

#ifdef _WIN32

typedef HANDLE lock_t;

static void create_lock(lock_t *lock) {
  *lock = CreateMutex(NULL,  // Default security attributes.
                      FALSE, // Initially unlocked.
                      NULL); // Unnamed.
}

static void lock_lock(lock_t *lock) {
  assert(WaitForSingleObject(*lock, INFINITE) == WAIT_OBJECT_0);
}

static void lock_unlock(lock_t *lock) {
  assert(ReleaseMutex(*lock));
}

static void free_lock(lock_t *lock) {
  CloseHandle(*lock);
}

#else
// Assuming POSIX

#include <pthread.h>

typedef pthread_mutex_t lock_t;

static void create_lock(lock_t *lock) {
  int r = pthread_mutex_init(lock, NULL);
  assert(r == 0);
}

static void lock_lock(lock_t *lock) {
  int r = pthread_mutex_lock(lock);
  assert(r == 0);
}

static void lock_unlock(lock_t *lock) {
  int r = pthread_mutex_unlock(lock);
  assert(r == 0);
}

static void free_lock(lock_t *lock) {
  // Nothing to do for pthreads.
  (void)lock;
}

#endif

// End of lock.h.

#define FUTHARK_F64_ENABLED

// Start of scalar.h.

// Implementation of the primitive scalar operations.  Very
// repetitive.  This code is inserted directly into both CUDA and
// OpenCL programs, as well as the CPU code, so it has some #ifdefs to
// work everywhere.  Some operations are defined as macros because
// this allows us to use them as constant expressions in things like
// array sizes and static initialisers.

// Some of the #ifdefs are because OpenCL uses type-generic functions
// for some operations (e.g. sqrt), while C and CUDA sensibly use
// distinct functions for different precisions (e.g. sqrtf() and
// sqrt()).  This is quite annoying.  Due to C's unfortunate casting
// rules, it is also really easy to accidentally implement
// floating-point functions in the wrong precision, so be careful.

// Double-precision definitions are only included if the preprocessor
// macro FUTHARK_F64_ENABLED is set.

static inline uint8_t add8(uint8_t x, uint8_t y) {
  return x + y;
}

static inline uint16_t add16(uint16_t x, uint16_t y) {
  return x + y;
}

static inline uint32_t add32(uint32_t x, uint32_t y) {
  return x + y;
}

static inline uint64_t add64(uint64_t x, uint64_t y) {
  return x + y;
}

static inline uint8_t sub8(uint8_t x, uint8_t y) {
  return x - y;
}

static inline uint16_t sub16(uint16_t x, uint16_t y) {
  return x - y;
}

static inline uint32_t sub32(uint32_t x, uint32_t y) {
  return x - y;
}

static inline uint64_t sub64(uint64_t x, uint64_t y) {
  return x - y;
}

static inline uint8_t mul8(uint8_t x, uint8_t y) {
  return x * y;
}

static inline uint16_t mul16(uint16_t x, uint16_t y) {
  return x * y;
}

static inline uint32_t mul32(uint32_t x, uint32_t y) {
  return x * y;
}

static inline uint64_t mul64(uint64_t x, uint64_t y) {
  return x * y;
}

static inline uint8_t udiv8(uint8_t x, uint8_t y) {
  return x / y;
}

static inline uint16_t udiv16(uint16_t x, uint16_t y) {
  return x / y;
}

static inline uint32_t udiv32(uint32_t x, uint32_t y) {
  return x / y;
}

static inline uint64_t udiv64(uint64_t x, uint64_t y) {
  return x / y;
}

static inline uint8_t udiv_up8(uint8_t x, uint8_t y) {
  return (x + y - 1) / y;
}

static inline uint16_t udiv_up16(uint16_t x, uint16_t y) {
  return (x + y - 1) / y;
}

static inline uint32_t udiv_up32(uint32_t x, uint32_t y) {
  return (x + y - 1) / y;
}

static inline uint64_t udiv_up64(uint64_t x, uint64_t y) {
  return (x + y - 1) / y;
}

static inline uint8_t umod8(uint8_t x, uint8_t y) {
  return x % y;
}

static inline uint16_t umod16(uint16_t x, uint16_t y) {
  return x % y;
}

static inline uint32_t umod32(uint32_t x, uint32_t y) {
  return x % y;
}

static inline uint64_t umod64(uint64_t x, uint64_t y) {
  return x % y;
}

static inline uint8_t udiv_safe8(uint8_t x, uint8_t y) {
  return y == 0 ? 0 : x / y;
}

static inline uint16_t udiv_safe16(uint16_t x, uint16_t y) {
  return y == 0 ? 0 : x / y;
}

static inline uint32_t udiv_safe32(uint32_t x, uint32_t y) {
  return y == 0 ? 0 : x / y;
}

static inline uint64_t udiv_safe64(uint64_t x, uint64_t y) {
  return y == 0 ? 0 : x / y;
}

static inline uint8_t udiv_up_safe8(uint8_t x, uint8_t y) {
  return y == 0 ? 0 : (x + y - 1) / y;
}

static inline uint16_t udiv_up_safe16(uint16_t x, uint16_t y) {
  return y == 0 ? 0 : (x + y - 1) / y;
}

static inline uint32_t udiv_up_safe32(uint32_t x, uint32_t y) {
  return y == 0 ? 0 : (x + y - 1) / y;
}

static inline uint64_t udiv_up_safe64(uint64_t x, uint64_t y) {
  return y == 0 ? 0 : (x + y - 1) / y;
}

static inline uint8_t umod_safe8(uint8_t x, uint8_t y) {
  return y == 0 ? 0 : x % y;
}

static inline uint16_t umod_safe16(uint16_t x, uint16_t y) {
  return y == 0 ? 0 : x % y;
}

static inline uint32_t umod_safe32(uint32_t x, uint32_t y) {
  return y == 0 ? 0 : x % y;
}

static inline uint64_t umod_safe64(uint64_t x, uint64_t y) {
  return y == 0 ? 0 : x % y;
}

static inline int8_t sdiv8(int8_t x, int8_t y) {
  int8_t q = x / y;
  int8_t r = x % y;

  return q - ((r != 0 && r < 0 != y < 0) ? 1 : 0);
}

static inline int16_t sdiv16(int16_t x, int16_t y) {
  int16_t q = x / y;
  int16_t r = x % y;

  return q - ((r != 0 && r < 0 != y < 0) ? 1 : 0);
}

static inline int32_t sdiv32(int32_t x, int32_t y) {
  int32_t q = x / y;
  int32_t r = x % y;

  return q - ((r != 0 && r < 0 != y < 0) ? 1 : 0);
}

static inline int64_t sdiv64(int64_t x, int64_t y) {
  int64_t q = x / y;
  int64_t r = x % y;

  return q - ((r != 0 && r < 0 != y < 0) ? 1 : 0);
}

static inline int8_t sdiv_up8(int8_t x, int8_t y) {
  return sdiv8(x + y - 1, y);
}

static inline int16_t sdiv_up16(int16_t x, int16_t y) {
  return sdiv16(x + y - 1, y);
}

static inline int32_t sdiv_up32(int32_t x, int32_t y) {
  return sdiv32(x + y - 1, y);
}

static inline int64_t sdiv_up64(int64_t x, int64_t y) {
  return sdiv64(x + y - 1, y);
}

static inline int8_t smod8(int8_t x, int8_t y) {
  int8_t r = x % y;

  return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);
}

static inline int16_t smod16(int16_t x, int16_t y) {
  int16_t r = x % y;

  return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);
}

static inline int32_t smod32(int32_t x, int32_t y) {
  int32_t r = x % y;

  return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);
}

static inline int64_t smod64(int64_t x, int64_t y) {
  int64_t r = x % y;

  return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);
}

static inline int8_t sdiv_safe8(int8_t x, int8_t y) {
  return y == 0 ? 0 : sdiv8(x, y);
}

static inline int16_t sdiv_safe16(int16_t x, int16_t y) {
  return y == 0 ? 0 : sdiv16(x, y);
}

static inline int32_t sdiv_safe32(int32_t x, int32_t y) {
  return y == 0 ? 0 : sdiv32(x, y);
}

static inline int64_t sdiv_safe64(int64_t x, int64_t y) {
  return y == 0 ? 0 : sdiv64(x, y);
}

static inline int8_t sdiv_up_safe8(int8_t x, int8_t y) {
  return sdiv_safe8(x + y - 1, y);
}

static inline int16_t sdiv_up_safe16(int16_t x, int16_t y) {
  return sdiv_safe16(x + y - 1, y);
}

static inline int32_t sdiv_up_safe32(int32_t x, int32_t y) {
  return sdiv_safe32(x + y - 1, y);
}

static inline int64_t sdiv_up_safe64(int64_t x, int64_t y) {
  return sdiv_safe64(x + y - 1, y);
}

static inline int8_t smod_safe8(int8_t x, int8_t y) {
  return y == 0 ? 0 : smod8(x, y);
}

static inline int16_t smod_safe16(int16_t x, int16_t y) {
  return y == 0 ? 0 : smod16(x, y);
}

static inline int32_t smod_safe32(int32_t x, int32_t y) {
  return y == 0 ? 0 : smod32(x, y);
}

static inline int64_t smod_safe64(int64_t x, int64_t y) {
  return y == 0 ? 0 : smod64(x, y);
}

static inline int8_t squot8(int8_t x, int8_t y) {
  return x / y;
}

static inline int16_t squot16(int16_t x, int16_t y) {
  return x / y;
}

static inline int32_t squot32(int32_t x, int32_t y) {
  return x / y;
}

static inline int64_t squot64(int64_t x, int64_t y) {
  return x / y;
}

static inline int8_t srem8(int8_t x, int8_t y) {
  return x % y;
}

static inline int16_t srem16(int16_t x, int16_t y) {
  return x % y;
}

static inline int32_t srem32(int32_t x, int32_t y) {
  return x % y;
}

static inline int64_t srem64(int64_t x, int64_t y) {
  return x % y;
}

static inline int8_t squot_safe8(int8_t x, int8_t y) {
  return y == 0 ? 0 : x / y;
}

static inline int16_t squot_safe16(int16_t x, int16_t y) {
  return y == 0 ? 0 : x / y;
}

static inline int32_t squot_safe32(int32_t x, int32_t y) {
  return y == 0 ? 0 : x / y;
}

static inline int64_t squot_safe64(int64_t x, int64_t y) {
  return y == 0 ? 0 : x / y;
}

static inline int8_t srem_safe8(int8_t x, int8_t y) {
  return y == 0 ? 0 : x % y;
}

static inline int16_t srem_safe16(int16_t x, int16_t y) {
  return y == 0 ? 0 : x % y;
}

static inline int32_t srem_safe32(int32_t x, int32_t y) {
  return y == 0 ? 0 : x % y;
}

static inline int64_t srem_safe64(int64_t x, int64_t y) {
  return y == 0 ? 0 : x % y;
}

static inline int8_t smin8(int8_t x, int8_t y) {
  return x < y ? x : y;
}

static inline int16_t smin16(int16_t x, int16_t y) {
  return x < y ? x : y;
}

static inline int32_t smin32(int32_t x, int32_t y) {
  return x < y ? x : y;
}

static inline int64_t smin64(int64_t x, int64_t y) {
  return x < y ? x : y;
}

static inline uint8_t umin8(uint8_t x, uint8_t y) {
  return x < y ? x : y;
}

static inline uint16_t umin16(uint16_t x, uint16_t y) {
  return x < y ? x : y;
}

static inline uint32_t umin32(uint32_t x, uint32_t y) {
  return x < y ? x : y;
}

static inline uint64_t umin64(uint64_t x, uint64_t y) {
  return x < y ? x : y;
}

static inline int8_t smax8(int8_t x, int8_t y) {
  return x < y ? y : x;
}

static inline int16_t smax16(int16_t x, int16_t y) {
  return x < y ? y : x;
}

static inline int32_t smax32(int32_t x, int32_t y) {
  return x < y ? y : x;
}

static inline int64_t smax64(int64_t x, int64_t y) {
  return x < y ? y : x;
}

static inline uint8_t umax8(uint8_t x, uint8_t y) {
  return x < y ? y : x;
}

static inline uint16_t umax16(uint16_t x, uint16_t y) {
  return x < y ? y : x;
}

static inline uint32_t umax32(uint32_t x, uint32_t y) {
  return x < y ? y : x;
}

static inline uint64_t umax64(uint64_t x, uint64_t y) {
  return x < y ? y : x;
}

static inline uint8_t shl8(uint8_t x, uint8_t y) {
  return (uint8_t)(x << y);
}

static inline uint16_t shl16(uint16_t x, uint16_t y) {
  return (uint16_t)(x << y);
}

static inline uint32_t shl32(uint32_t x, uint32_t y) {
  return x << y;
}

static inline uint64_t shl64(uint64_t x, uint64_t y) {
  return x << y;
}

static inline uint8_t lshr8(uint8_t x, uint8_t y) {
  return x >> y;
}

static inline uint16_t lshr16(uint16_t x, uint16_t y) {
  return x >> y;
}

static inline uint32_t lshr32(uint32_t x, uint32_t y) {
  return x >> y;
}

static inline uint64_t lshr64(uint64_t x, uint64_t y) {
  return x >> y;
}

static inline int8_t ashr8(int8_t x, int8_t y) {
  return x >> y;
}

static inline int16_t ashr16(int16_t x, int16_t y) {
  return x >> y;
}

static inline int32_t ashr32(int32_t x, int32_t y) {
  return x >> y;
}

static inline int64_t ashr64(int64_t x, int64_t y) {
  return x >> y;
}

static inline uint8_t and8(uint8_t x, uint8_t y) {
  return x & y;
}

static inline uint16_t and16(uint16_t x, uint16_t y) {
  return x & y;
}

static inline uint32_t and32(uint32_t x, uint32_t y) {
  return x & y;
}

static inline uint64_t and64(uint64_t x, uint64_t y) {
  return x & y;
}

static inline uint8_t or8(uint8_t x, uint8_t y) {
  return x | y;
}

static inline uint16_t or16(uint16_t x, uint16_t y) {
  return x | y;
}

static inline uint32_t or32(uint32_t x, uint32_t y) {
  return x | y;
}

static inline uint64_t or64(uint64_t x, uint64_t y) {
  return x | y;
}

static inline uint8_t xor8(uint8_t x, uint8_t y) {
  return x ^ y;
}

static inline uint16_t xor16(uint16_t x, uint16_t y) {
  return x ^ y;
}

static inline uint32_t xor32(uint32_t x, uint32_t y) {
  return x ^ y;
}

static inline uint64_t xor64(uint64_t x, uint64_t y) {
  return x ^ y;
}

static inline bool ult8(uint8_t x, uint8_t y) {
  return x < y;
}

static inline bool ult16(uint16_t x, uint16_t y) {
  return x < y;
}

static inline bool ult32(uint32_t x, uint32_t y) {
  return x < y;
}

static inline bool ult64(uint64_t x, uint64_t y) {
  return x < y;
}

static inline bool ule8(uint8_t x, uint8_t y) {
  return x <= y;
}

static inline bool ule16(uint16_t x, uint16_t y) {
  return x <= y;
}

static inline bool ule32(uint32_t x, uint32_t y) {
  return x <= y;
}

static inline bool ule64(uint64_t x, uint64_t y) {
  return x <= y;
}

static inline bool slt8(int8_t x, int8_t y) {
  return x < y;
}

static inline bool slt16(int16_t x, int16_t y) {
  return x < y;
}

static inline bool slt32(int32_t x, int32_t y) {
  return x < y;
}

static inline bool slt64(int64_t x, int64_t y) {
  return x < y;
}

static inline bool sle8(int8_t x, int8_t y) {
  return x <= y;
}

static inline bool sle16(int16_t x, int16_t y) {
  return x <= y;
}

static inline bool sle32(int32_t x, int32_t y) {
  return x <= y;
}

static inline bool sle64(int64_t x, int64_t y) {
  return x <= y;
}

static inline uint8_t pow8(uint8_t x, uint8_t y) {
  uint8_t res = 1, rem = y;

  while (rem != 0) {
    if (rem & 1)
      res *= x;
    rem >>= 1;
    x *= x;
  }
  return res;
}

static inline uint16_t pow16(uint16_t x, uint16_t y) {
  uint16_t res = 1, rem = y;

  while (rem != 0) {
    if (rem & 1)
      res *= x;
    rem >>= 1;
    x *= x;
  }
  return res;
}

static inline uint32_t pow32(uint32_t x, uint32_t y) {
  uint32_t res = 1, rem = y;

  while (rem != 0) {
    if (rem & 1)
      res *= x;
    rem >>= 1;
    x *= x;
  }
  return res;
}

static inline uint64_t pow64(uint64_t x, uint64_t y) {
  uint64_t res = 1, rem = y;

  while (rem != 0) {
    if (rem & 1)
      res *= x;
    rem >>= 1;
    x *= x;
  }
  return res;
}

static inline bool itob_i8_bool(int8_t x) {
  return x;
}

static inline bool itob_i16_bool(int16_t x) {
  return x;
}

static inline bool itob_i32_bool(int32_t x) {
  return x;
}

static inline bool itob_i64_bool(int64_t x) {
  return x;
}

static inline int8_t btoi_bool_i8(bool x) {
  return x;
}

static inline int16_t btoi_bool_i16(bool x) {
  return x;
}

static inline int32_t btoi_bool_i32(bool x) {
  return x;
}

static inline int64_t btoi_bool_i64(bool x) {
  return x;
}

#define sext_i8_i8(x) ((int8_t) (int8_t) (x))
#define sext_i8_i16(x) ((int16_t) (int8_t) (x))
#define sext_i8_i32(x) ((int32_t) (int8_t) (x))
#define sext_i8_i64(x) ((int64_t) (int8_t) (x))
#define sext_i16_i8(x) ((int8_t) (int16_t) (x))
#define sext_i16_i16(x) ((int16_t) (int16_t) (x))
#define sext_i16_i32(x) ((int32_t) (int16_t) (x))
#define sext_i16_i64(x) ((int64_t) (int16_t) (x))
#define sext_i32_i8(x) ((int8_t) (int32_t) (x))
#define sext_i32_i16(x) ((int16_t) (int32_t) (x))
#define sext_i32_i32(x) ((int32_t) (int32_t) (x))
#define sext_i32_i64(x) ((int64_t) (int32_t) (x))
#define sext_i64_i8(x) ((int8_t) (int64_t) (x))
#define sext_i64_i16(x) ((int16_t) (int64_t) (x))
#define sext_i64_i32(x) ((int32_t) (int64_t) (x))
#define sext_i64_i64(x) ((int64_t) (int64_t) (x))
#define zext_i8_i8(x) ((int8_t) (uint8_t) (x))
#define zext_i8_i16(x) ((int16_t) (uint8_t) (x))
#define zext_i8_i32(x) ((int32_t) (uint8_t) (x))
#define zext_i8_i64(x) ((int64_t) (uint8_t) (x))
#define zext_i16_i8(x) ((int8_t) (uint16_t) (x))
#define zext_i16_i16(x) ((int16_t) (uint16_t) (x))
#define zext_i16_i32(x) ((int32_t) (uint16_t) (x))
#define zext_i16_i64(x) ((int64_t) (uint16_t) (x))
#define zext_i32_i8(x) ((int8_t) (uint32_t) (x))
#define zext_i32_i16(x) ((int16_t) (uint32_t) (x))
#define zext_i32_i32(x) ((int32_t) (uint32_t) (x))
#define zext_i32_i64(x) ((int64_t) (uint32_t) (x))
#define zext_i64_i8(x) ((int8_t) (uint64_t) (x))
#define zext_i64_i16(x) ((int16_t) (uint64_t) (x))
#define zext_i64_i32(x) ((int32_t) (uint64_t) (x))
#define zext_i64_i64(x) ((int64_t) (uint64_t) (x))

static int8_t abs8(int8_t x) {
  return (int8_t)abs(x);
}

static int16_t abs16(int16_t x) {
  return (int16_t)abs(x);
}

static int32_t abs32(int32_t x) {
  return abs(x);
}

static int64_t abs64(int64_t x) {
#if defined(__OPENCL_VERSION__)
  return abs(x);
#else
  return llabs(x);
#endif
}

#if defined(__OPENCL_VERSION__)
static int32_t futrts_popc8(int8_t x) {
  return popcount(x);
}

static int32_t futrts_popc16(int16_t x) {
  return popcount(x);
}

static int32_t futrts_popc32(int32_t x) {
  return popcount(x);
}

static int32_t futrts_popc64(int64_t x) {
  return popcount(x);
}
#elif defined(__CUDA_ARCH__)

static int32_t futrts_popc8(int8_t x) {
  return __popc(zext_i8_i32(x));
}

static int32_t futrts_popc16(int16_t x) {
  return __popc(zext_i16_i32(x));
}

static int32_t futrts_popc32(int32_t x) {
  return __popc(x);
}

static int32_t futrts_popc64(int64_t x) {
  return __popcll(x);
}

#else // Not OpenCL or CUDA, but plain C.

static int32_t futrts_popc8(uint8_t x) {
  int c = 0;
  for (; x; ++c) { x &= x - 1; }
  return c;
}

static int32_t futrts_popc16(uint16_t x) {
  int c = 0;
  for (; x; ++c) { x &= x - 1; }
  return c;
}

static int32_t futrts_popc32(uint32_t x) {
  int c = 0;
  for (; x; ++c) { x &= x - 1; }
  return c;
}

static int32_t futrts_popc64(uint64_t x) {
  int c = 0;
  for (; x; ++c) { x &= x - 1; }
  return c;
}
#endif

#if defined(__OPENCL_VERSION__)
static uint8_t futrts_mul_hi8(uint8_t a, uint8_t b) {
  return mul_hi(a, b);
}

static uint16_t futrts_mul_hi16(uint16_t a, uint16_t b) {
  return mul_hi(a, b);
}

static uint32_t futrts_mul_hi32(uint32_t a, uint32_t b) {
  return mul_hi(a, b);
}

static uint64_t futrts_mul_hi64(uint64_t a, uint64_t b) {
  return mul_hi(a, b);
}

#elif defined(__CUDA_ARCH__)

static uint8_t futrts_mul_hi8(uint8_t a, uint8_t b) {
  uint16_t aa = a;
  uint16_t bb = b;

  return aa * bb >> 8;
}

static uint16_t futrts_mul_hi16(uint16_t a, uint16_t b) {
  uint32_t aa = a;
  uint32_t bb = b;

  return aa * bb >> 16;
}

static uint32_t futrts_mul_hi32(uint32_t a, uint32_t b) {
  return mulhi(a, b);
}

static uint64_t futrts_mul_hi64(uint64_t a, uint64_t b) {
  return mul64hi(a, b);
}

#else // Not OpenCL or CUDA, but plain C.

static uint8_t futrts_mul_hi8(uint8_t a, uint8_t b) {
  uint16_t aa = a;
  uint16_t bb = b;

  return aa * bb >> 8;
}

static uint16_t futrts_mul_hi16(uint16_t a, uint16_t b) {
  uint32_t aa = a;
  uint32_t bb = b;

  return aa * bb >> 16;
}

static uint32_t futrts_mul_hi32(uint32_t a, uint32_t b) {
  uint64_t aa = a;
  uint64_t bb = b;

  return aa * bb >> 32;
}

static uint64_t futrts_mul_hi64(uint64_t a, uint64_t b) {
  __uint128_t aa = a;
  __uint128_t bb = b;

  return aa * bb >> 64;
}
#endif

#if defined(__OPENCL_VERSION__)
static uint8_t futrts_mad_hi8(uint8_t a, uint8_t b, uint8_t c) {
  return mad_hi(a, b, c);
}

static uint16_t futrts_mad_hi16(uint16_t a, uint16_t b, uint16_t c) {
  return mad_hi(a, b, c);
}

static uint32_t futrts_mad_hi32(uint32_t a, uint32_t b, uint32_t c) {
  return mad_hi(a, b, c);
}

static uint64_t futrts_mad_hi64(uint64_t a, uint64_t b, uint64_t c) {
  return mad_hi(a, b, c);
}

#else // Not OpenCL

static uint8_t futrts_mad_hi8(uint8_t a, uint8_t b, uint8_t c) {
  return futrts_mul_hi8(a, b) + c;
}

static uint16_t futrts_mad_hi16(uint16_t a, uint16_t b, uint16_t c) {
  return futrts_mul_hi16(a, b) + c;
}

static uint32_t futrts_mad_hi32(uint32_t a, uint32_t b, uint32_t c) {
  return futrts_mul_hi32(a, b) + c;
}

static uint64_t futrts_mad_hi64(uint64_t a, uint64_t b, uint64_t c) {
  return futrts_mul_hi64(a, b) + c;
}
#endif

#if defined(__OPENCL_VERSION__)
static int32_t futrts_clzz8(int8_t x) {
  return clz(x);
}

static int32_t futrts_clzz16(int16_t x) {
  return clz(x);
}

static int32_t futrts_clzz32(int32_t x) {
  return clz(x);
}

static int32_t futrts_clzz64(int64_t x) {
  return clz(x);
}

#elif defined(__CUDA_ARCH__)

static int32_t futrts_clzz8(int8_t x) {
  return __clz(zext_i8_i32(x)) - 24;
}

static int32_t futrts_clzz16(int16_t x) {
  return __clz(zext_i16_i32(x)) - 16;
}

static int32_t futrts_clzz32(int32_t x) {
  return __clz(x);
}

static int32_t futrts_clzz64(int64_t x) {
  return __clzll(x);
}

#else // Not OpenCL or CUDA, but plain C.

static int32_t futrts_clzz8(int8_t x) {
  return x == 0 ? 8 : __builtin_clz((uint32_t)zext_i8_i32(x)) - 24;
}

static int32_t futrts_clzz16(int16_t x) {
  return x == 0 ? 16 : __builtin_clz((uint32_t)zext_i16_i32(x)) - 16;
}

static int32_t futrts_clzz32(int32_t x) {
  return x == 0 ? 32 : __builtin_clz((uint32_t)x);
}

static int32_t futrts_clzz64(int64_t x) {
  return x == 0 ? 64 : __builtin_clzll((uint64_t)x);
}
#endif

#if defined(__OPENCL_VERSION__)
static int32_t futrts_ctzz8(int8_t x) {
  int i = 0;
  for (; i < 8 && (x & 1) == 0; i++, x >>= 1)
    ;
  return i;
}

static int32_t futrts_ctzz16(int16_t x) {
  int i = 0;
  for (; i < 16 && (x & 1) == 0; i++, x >>= 1)
    ;
  return i;
}

static int32_t futrts_ctzz32(int32_t x) {
  int i = 0;
  for (; i < 32 && (x & 1) == 0; i++, x >>= 1)
    ;
  return i;
}

static int32_t futrts_ctzz64(int64_t x) {
  int i = 0;
  for (; i < 64 && (x & 1) == 0; i++, x >>= 1)
    ;
  return i;
}

#elif defined(__CUDA_ARCH__)

static int32_t futrts_ctzz8(int8_t x) {
  int y = __ffs(x);
  return y == 0 ? 8 : y - 1;
}

static int32_t futrts_ctzz16(int16_t x) {
  int y = __ffs(x);
  return y == 0 ? 16 : y - 1;
}

static int32_t futrts_ctzz32(int32_t x) {
  int y = __ffs(x);
  return y == 0 ? 32 : y - 1;
}

static int32_t futrts_ctzz64(int64_t x) {
  int y = __ffsll(x);
  return y == 0 ? 64 : y - 1;
}

#else // Not OpenCL or CUDA, but plain C.

static int32_t futrts_ctzz8(int8_t x) {
  return x == 0 ? 8 : __builtin_ctz((uint32_t)x);
}

static int32_t futrts_ctzz16(int16_t x) {
  return x == 0 ? 16 : __builtin_ctz((uint32_t)x);
}

static int32_t futrts_ctzz32(int32_t x) {
  return x == 0 ? 32 : __builtin_ctz((uint32_t)x);
}

static int32_t futrts_ctzz64(int64_t x) {
  return x == 0 ? 64 : __builtin_ctzll((uint64_t)x);
}
#endif

static inline float fdiv32(float x, float y) {
  return x / y;
}

static inline float fadd32(float x, float y) {
  return x + y;
}

static inline float fsub32(float x, float y) {
  return x - y;
}

static inline float fmul32(float x, float y) {
  return x * y;
}

static inline bool cmplt32(float x, float y) {
  return x < y;
}

static inline bool cmple32(float x, float y) {
  return x <= y;
}

static inline float sitofp_i8_f32(int8_t x) {
  return (float) x;
}

static inline float sitofp_i16_f32(int16_t x) {
  return (float) x;
}

static inline float sitofp_i32_f32(int32_t x) {
  return (float) x;
}

static inline float sitofp_i64_f32(int64_t x) {
  return (float) x;
}

static inline float uitofp_i8_f32(uint8_t x) {
  return (float) x;
}

static inline float uitofp_i16_f32(uint16_t x) {
  return (float) x;
}

static inline float uitofp_i32_f32(uint32_t x) {
  return (float) x;
}

static inline float uitofp_i64_f32(uint64_t x) {
  return (float) x;
}

static inline int8_t fptosi_f32_i8(float x) {
  return (int8_t) x;
}

static inline int16_t fptosi_f32_i16(float x) {
  return (int16_t) x;
}

static inline int32_t fptosi_f32_i32(float x) {
  return (int32_t) x;
}

static inline int64_t fptosi_f32_i64(float x) {
  return (int64_t) x;
}

static inline uint8_t fptoui_f32_i8(float x) {
  return (uint8_t) x;
}

static inline uint16_t fptoui_f32_i16(float x) {
  return (uint16_t) x;
}

static inline uint32_t fptoui_f32_i32(float x) {
  return (uint32_t) x;
}

static inline uint64_t fptoui_f32_i64(float x) {
  return (uint64_t) x;
}

#ifdef __OPENCL_VERSION__
static inline float fabs32(float x) {
  return fabs(x);
}

static inline float fmax32(float x, float y) {
  return fmax(x, y);
}

static inline float fmin32(float x, float y) {
  return fmin(x, y);
}

static inline float fpow32(float x, float y) {
  return pow(x, y);
}

#else // Not OpenCL, but CUDA or plain C.

static inline float fabs32(float x) {
  return fabsf(x);
}

static inline float fmax32(float x, float y) {
  return fmaxf(x, y);
}

static inline float fmin32(float x, float y) {
  return fminf(x, y);
}

static inline float fpow32(float x, float y) {
  return powf(x, y);
}
#endif

static inline bool futrts_isnan32(float x) {
  return isnan(x);
}

static inline bool futrts_isinf32(float x) {
  return isinf(x);
}

#ifdef __OPENCL_VERSION__
static inline float futrts_log32(float x) {
  return log(x);
}

static inline float futrts_log2_32(float x) {
  return log2(x);
}

static inline float futrts_log10_32(float x) {
  return log10(x);
}

static inline float futrts_sqrt32(float x) {
  return sqrt(x);
}

static inline float futrts_exp32(float x) {
  return exp(x);
}

static inline float futrts_cos32(float x) {
  return cos(x);
}

static inline float futrts_sin32(float x) {
  return sin(x);
}

static inline float futrts_tan32(float x) {
  return tan(x);
}

static inline float futrts_acos32(float x) {
  return acos(x);
}

static inline float futrts_asin32(float x) {
  return asin(x);
}

static inline float futrts_atan32(float x) {
  return atan(x);
}

static inline float futrts_cosh32(float x) {
  return cosh(x);
}

static inline float futrts_sinh32(float x) {
  return sinh(x);
}

static inline float futrts_tanh32(float x) {
  return tanh(x);
}

static inline float futrts_acosh32(float x) {
  return acosh(x);
}

static inline float futrts_asinh32(float x) {
  return asinh(x);
}

static inline float futrts_atanh32(float x) {
  return atanh(x);
}

static inline float futrts_atan2_32(float x, float y) {
  return atan2(x, y);
}

static inline float futrts_hypot32(float x, float y) {
  return hypot(x, y);
}

static inline float futrts_gamma32(float x) {
  return tgamma(x);
}

static inline float futrts_lgamma32(float x) {
  return lgamma(x);
}

static inline float fmod32(float x, float y) {
  return fmod(x, y);
}

static inline float futrts_round32(float x) {
  return rint(x);
}

static inline float futrts_floor32(float x) {
  return floor(x);
}

static inline float futrts_ceil32(float x) {
  return ceil(x);
}

static inline float futrts_lerp32(float v0, float v1, float t) {
  return mix(v0, v1, t);
}

static inline float futrts_mad32(float a, float b, float c) {
  return mad(a, b, c);
}

static inline float futrts_fma32(float a, float b, float c) {
  return fma(a, b, c);
}

#else // Not OpenCL, but CUDA or plain C.

static inline float futrts_log32(float x) {
  return logf(x);
}

static inline float futrts_log2_32(float x) {
  return log2f(x);
}

static inline float futrts_log10_32(float x) {
  return log10f(x);
}

static inline float futrts_sqrt32(float x) {
  return sqrtf(x);
}

static inline float futrts_exp32(float x) {
  return expf(x);
}

static inline float futrts_cos32(float x) {
  return cosf(x);
}

static inline float futrts_sin32(float x) {
  return sinf(x);
}

static inline float futrts_tan32(float x) {
  return tanf(x);
}

static inline float futrts_acos32(float x) {
  return acosf(x);
}

static inline float futrts_asin32(float x) {
  return asinf(x);
}

static inline float futrts_atan32(float x) {
  return atanf(x);
}

static inline float futrts_cosh32(float x) {
  return coshf(x);
}

static inline float futrts_sinh32(float x) {
  return sinhf(x);
}

static inline float futrts_tanh32(float x) {
  return tanhf(x);
}

static inline float futrts_acosh32(float x) {
  return acoshf(x);
}

static inline float futrts_asinh32(float x) {
  return asinhf(x);
}

static inline float futrts_atanh32(float x) {
  return atanhf(x);
}

static inline float futrts_atan2_32(float x, float y) {
  return atan2f(x, y);
}

static inline float futrts_hypot32(float x, float y) {
  return hypotf(x, y);
}

static inline float futrts_gamma32(float x) {
  return tgammaf(x);
}

static inline float futrts_lgamma32(float x) {
  return lgammaf(x);
}

static inline float fmod32(float x, float y) {
  return fmodf(x, y);
}

static inline float futrts_round32(float x) {
  return rintf(x);
}

static inline float futrts_floor32(float x) {
  return floorf(x);
}

static inline float futrts_ceil32(float x) {
  return ceilf(x);
}

static inline float futrts_lerp32(float v0, float v1, float t) {
  return v0 + (v1 - v0) * t;
}

static inline float futrts_mad32(float a, float b, float c) {
  return a * b + c;
}

static inline float futrts_fma32(float a, float b, float c) {
  return fmaf(a, b, c);
}
#endif

static inline int32_t futrts_to_bits32(float x) {
  union {
    float f;
    int32_t t;
  } p;

  p.f = x;
  return p.t;
}

static inline float futrts_from_bits32(int32_t x) {
  union {
    int32_t f;
    float t;
  } p;

  p.f = x;
  return p.t;
}

static inline float fsignum32(float x) {
  return futrts_isnan32(x) ? x : (x > 0) - (x < 0);
}

#ifdef FUTHARK_F64_ENABLED

static inline double fdiv64(double x, double y) {
  return x / y;
}

static inline double fadd64(double x, double y) {
  return x + y;
}

static inline double fsub64(double x, double y) {
  return x - y;
}

static inline double fmul64(double x, double y) {
  return x * y;
}

static inline bool cmplt64(double x, double y) {
  return x < y;
}

static inline bool cmple64(double x, double y) {
  return x <= y;
}

static inline double sitofp_i8_f64(int8_t x) {
  return (double) x;
}

static inline double sitofp_i16_f64(int16_t x) {
  return (double) x;
}

static inline double sitofp_i32_f64(int32_t x) {
  return (double) x;
}

static inline double sitofp_i64_f64(int64_t x) {
  return (double) x;
}

static inline double uitofp_i8_f64(uint8_t x) {
  return (double) x;
}

static inline double uitofp_i16_f64(uint16_t x) {
  return (double) x;
}

static inline double uitofp_i32_f64(uint32_t x) {
  return (double) x;
}

static inline double uitofp_i64_f64(uint64_t x) {
  return (double) x;
}

static inline int8_t fptosi_f64_i8(double x) {
  return (int8_t) x;
}

static inline int16_t fptosi_f64_i16(double x) {
  return (int16_t) x;
}

static inline int32_t fptosi_f64_i32(double x) {
  return (int32_t) x;
}

static inline int64_t fptosi_f64_i64(double x) {
  return (int64_t) x;
}

static inline uint8_t fptoui_f64_i8(double x) {
  return (uint8_t) x;
}

static inline uint16_t fptoui_f64_i16(double x) {
  return (uint16_t) x;
}

static inline uint32_t fptoui_f64_i32(double x) {
  return (uint32_t) x;
}

static inline uint64_t fptoui_f64_i64(double x) {
  return (uint64_t) x;
}

static inline double fabs64(double x) {
  return fabs(x);
}

static inline double fmax64(double x, double y) {
  return fmax(x, y);
}

static inline double fmin64(double x, double y) {
  return fmin(x, y);
}

static inline double fpow64(double x, double y) {
  return pow(x, y);
}

static inline double futrts_log64(double x) {
  return log(x);
}

static inline double futrts_log2_64(double x) {
  return log2(x);
}

static inline double futrts_log10_64(double x) {
  return log10(x);
}

static inline double futrts_sqrt64(double x) {
  return sqrt(x);
}

static inline double futrts_exp64(double x) {
  return exp(x);
}

static inline double futrts_cos64(double x) {
  return cos(x);
}

static inline double futrts_sin64(double x) {
  return sin(x);
}

static inline double futrts_tan64(double x) {
  return tan(x);
}

static inline double futrts_acos64(double x) {
  return acos(x);
}

static inline double futrts_asin64(double x) {
  return asin(x);
}

static inline double futrts_atan64(double x) {
  return atan(x);
}

static inline double futrts_cosh64(double x) {
  return cosh(x);
}

static inline double futrts_sinh64(double x) {
  return sinh(x);
}

static inline double futrts_tanh64(double x) {
  return tanh(x);
}

static inline double futrts_acosh64(double x) {
  return acosh(x);
}

static inline double futrts_asinh64(double x) {
  return asinh(x);
}

static inline double futrts_atanh64(double x) {
  return atanh(x);
}

static inline double futrts_atan2_64(double x, double y) {
  return atan2(x, y);
}

static inline double futrts_hypot64(double x, double y) {
  return hypot(x, y);
}

static inline double futrts_gamma64(double x) {
  return tgamma(x);
}

static inline double futrts_lgamma64(double x) {
  return lgamma(x);
}

static inline double futrts_fma64(double a, double b, double c) {
  return fma(a, b, c);
}

static inline double futrts_round64(double x) {
  return rint(x);
}

static inline double futrts_ceil64(double x) {
  return ceil(x);
}

static inline double futrts_floor64(double x) {
  return floor(x);
}

static inline bool futrts_isnan64(double x) {
  return isnan(x);
}

static inline bool futrts_isinf64(double x) {
  return isinf(x);
}

static inline int64_t futrts_to_bits64(double x) {
  union {
    double f;
    int64_t t;
  } p;

  p.f = x;
  return p.t;
}

static inline double futrts_from_bits64(int64_t x) {
  union {
    int64_t f;
    double t;
  } p;

  p.f = x;
  return p.t;
}

static inline double fmod64(double x, double y) {
  return fmod(x, y);
}

static inline double fsignum64(double x) {
  return futrts_isnan64(x) ? x : (x > 0) - (x < 0);
}

static inline double futrts_lerp64(double v0, double v1, double t) {
#ifdef __OPENCL_VERSION__
  return mix(v0, v1, t);
#else
  return v0 + (v1 - v0) * t;
#endif
}

static inline double futrts_mad64(double a, double b, double c) {
#ifdef __OPENCL_VERSION__
  return mad(a, b, c);
#else
  return a * b + c;
#endif
}

static inline float fpconv_f32_f32(float x) {
  return (float) x;
}

static inline double fpconv_f32_f64(float x) {
  return (double) x;
}

static inline float fpconv_f64_f32(double x) {
  return (float) x;
}

static inline double fpconv_f64_f64(double x) {
  return (double) x;
}

#endif

// End of scalar.h.
// Start of scalar_f16.h.

// Half-precision is emulated if needed (e.g. in straight C) with the
// native type used if possible.  The emulation works by typedef'ing
// 'float' to 'f16', and then implementing all operations on single
// precision.  To cut down on duplication, we use the same code for
// those Futhark functions that require just operators or casts.  The
// in-memory representation for arrays will still be 16 bits even
// under emulation, so the compiler will have to be careful when
// generating reads or writes.

#if !defined(cl_khr_fp16) && !(defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 600)
#define EMULATE_F16
#endif

#if !defined(EMULATE_F16) && defined(__OPENCL_VERSION__)
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
#endif

#ifdef EMULATE_F16

// Note that the half-precision storage format is still 16 bits - the
// compiler will have to be real careful!
typedef float f16;

#else

#ifdef __CUDA_ARCH__
#include <cuda_fp16.h>
#endif

typedef half f16;

#endif

// Some of these functions convert to single precision because half
// precision versions are not available.

static inline f16 fadd16(f16 x, f16 y) {
  return x + y;
}

static inline f16 fsub16(f16 x, f16 y) {
  return x - y;
}

static inline f16 fmul16(f16 x, f16 y) {
  return x * y;
}

static inline bool cmplt16(f16 x, f16 y) {
  return x < y;
}

static inline bool cmple16(f16 x, f16 y) {
  return x <= y;
}

static inline f16 sitofp_i8_f16(int8_t x) {
  return (f16) x;
}

static inline f16 sitofp_i16_f16(int16_t x) {
  return (f16) x;
}

static inline f16 sitofp_i32_f16(int32_t x) {
  return (f16) x;
}

static inline f16 sitofp_i64_f16(int64_t x) {
  return (f16) x;
}

static inline f16 uitofp_i8_f16(uint8_t x) {
  return (f16) x;
}

static inline f16 uitofp_i16_f16(uint16_t x) {
  return (f16) x;
}

static inline f16 uitofp_i32_f16(uint32_t x) {
  return (f16) x;
}

static inline f16 uitofp_i64_f16(uint64_t x) {
  return (f16) x;
}

static inline int8_t fptosi_f16_i8(f16 x) {
  return (int8_t) (float) x;
}

static inline int16_t fptosi_f16_i16(f16 x) {
  return (int16_t) x;
}

static inline int32_t fptosi_f16_i32(f16 x) {
  return (int32_t) x;
}

static inline int64_t fptosi_f16_i64(f16 x) {
  return (int64_t) x;
}

static inline uint8_t fptoui_f16_i8(f16 x) {
  return (uint8_t) (float) x;
}

static inline uint16_t fptoui_f16_i16(f16 x) {
  return (uint16_t) x;
}

static inline uint32_t fptoui_f16_i32(f16 x) {
  return (uint32_t) x;
}

static inline uint64_t fptoui_f16_i64(f16 x) {
  return (uint64_t) x;
}

#ifndef EMULATE_F16

#ifdef __OPENCL_VERSION__
static inline f16 fabs16(f16 x) {
  return fabs(x);
}

static inline f16 fmax16(f16 x, f16 y) {
  return fmax(x, y);
}

static inline f16 fmin16(f16 x, f16 y) {
  return fmin(x, y);
}

static inline f16 fpow16(f16 x, f16 y) {
  return pow(x, y);
}

#else // Assuming CUDA.

static inline f16 fabs16(f16 x) {
  return fabsf(x);
}

static inline f16 fmax16(f16 x, f16 y) {
  return fmaxf(x, y);
}

static inline f16 fmin16(f16 x, f16 y) {
  return fminf(x, y);
}

static inline f16 fpow16(f16 x, f16 y) {
  return powf(x, y);
}
#endif

static inline bool futrts_isnan16(f16 x) {
  return isnan((float)x);
}

static inline bool futrts_isinf16(f16 x) {
  return isinf((float)x);
}

#ifdef __OPENCL_VERSION__
static inline f16 futrts_log16(f16 x) {
  return log(x);
}

static inline f16 futrts_log2_16(f16 x) {
  return log2(x);
}

static inline f16 futrts_log10_16(f16 x) {
  return log10(x);
}

static inline f16 futrts_sqrt16(f16 x) {
  return sqrt(x);
}

static inline f16 futrts_exp16(f16 x) {
  return exp(x);
}

static inline f16 futrts_cos16(f16 x) {
  return cos(x);
}

static inline f16 futrts_sin16(f16 x) {
  return sin(x);
}

static inline f16 futrts_tan16(f16 x) {
  return tan(x);
}

static inline f16 futrts_acos16(f16 x) {
  return acos(x);
}

static inline f16 futrts_asin16(f16 x) {
  return asin(x);
}

static inline f16 futrts_atan16(f16 x) {
  return atan(x);
}

static inline f16 futrts_cosh16(f16 x) {
  return cosh(x);
}

static inline f16 futrts_sinh16(f16 x) {
  return sinh(x);
}

static inline f16 futrts_tanh16(f16 x) {
  return tanh(x);
}

static inline f16 futrts_acosh16(f16 x) {
  return acosh(x);
}

static inline f16 futrts_asinh16(f16 x) {
  return asinh(x);
}

static inline f16 futrts_atanh16(f16 x) {
  return atanh(x);
}

static inline f16 futrts_atan2_16(f16 x, f16 y) {
  return atan2(x, y);
}

static inline f16 futrts_hypot16(f16 x, f16 y) {
  return hypot(x, y);
}

static inline f16 futrts_gamma16(f16 x) {
  return tgamma(x);
}

static inline f16 futrts_lgamma16(f16 x) {
  return lgamma(x);
}

static inline f16 fmod16(f16 x, f16 y) {
  return fmod(x, y);
}

static inline f16 futrts_round16(f16 x) {
  return rint(x);
}

static inline f16 futrts_floor16(f16 x) {
  return floor(x);
}

static inline f16 futrts_ceil16(f16 x) {
  return ceil(x);
}

static inline f16 futrts_lerp16(f16 v0, f16 v1, f16 t) {
  return mix(v0, v1, t);
}

static inline f16 futrts_mad16(f16 a, f16 b, f16 c) {
  return mad(a, b, c);
}

static inline f16 futrts_fma16(f16 a, f16 b, f16 c) {
  return fma(a, b, c);
}

#else // Assume CUDA.

static inline f16 futrts_log16(f16 x) {
  return hlog(x);
}

static inline f16 futrts_log2_16(f16 x) {
  return hlog2(x);
}

static inline f16 futrts_log10_16(f16 x) {
  return hlog10(x);
}

static inline f16 futrts_sqrt16(f16 x) {
  return hsqrt(x);
}

static inline f16 futrts_exp16(f16 x) {
  return hexp(x);
}

static inline f16 futrts_cos16(f16 x) {
  return hcos(x);
}

static inline f16 futrts_sin16(f16 x) {
  return hsin(x);
}

static inline f16 futrts_tan16(f16 x) {
  return tanf(x);
}

static inline f16 futrts_acos16(f16 x) {
  return acosf(x);
}

static inline f16 futrts_asin16(f16 x) {
  return asinf(x);
}

static inline f16 futrts_atan16(f16 x) {
  return atanf(x);
}

static inline f16 futrts_cosh16(f16 x) {
  return coshf(x);
}

static inline f16 futrts_sinh16(f16 x) {
  return sinhf(x);
}

static inline f16 futrts_tanh16(f16 x) {
  return tanhf(x);
}

static inline f16 futrts_acosh16(f16 x) {
  return acoshf(x);
}

static inline f16 futrts_asinh16(f16 x) {
  return asinhf(x);
}

static inline f16 futrts_atanh16(f16 x) {
  return atanhf(x);
}

static inline f16 futrts_atan2_16(f16 x, f16 y) {
  return atan2f(x, y);
}

static inline f16 futrts_hypot16(f16 x, f16 y) {
  return hypotf(x, y);
}

static inline f16 futrts_gamma16(f16 x) {
  return tgammaf(x);
}

static inline f16 futrts_lgamma16(f16 x) {
  return lgammaf(x);
}

static inline f16 fmod16(f16 x, f16 y) {
  return fmodf(x, y);
}

static inline f16 futrts_round16(f16 x) {
  return rintf(x);
}

static inline f16 futrts_floor16(f16 x) {
  return hfloor(x);
}

static inline f16 futrts_ceil16(f16 x) {
  return hceil(x);
}

static inline f16 futrts_lerp16(f16 v0, f16 v1, f16 t) {
  return v0 + (v1 - v0) * t;
}

static inline f16 futrts_mad16(f16 a, f16 b, f16 c) {
  return a * b + c;
}

static inline f16 futrts_fma16(f16 a, f16 b, f16 c) {
  return fmaf(a, b, c);
}

#endif

// The CUDA __half type cannot be put in unions for some reason, so we
// use bespoke conversion functions instead.
#ifdef __CUDA_ARCH__
static inline int16_t futrts_to_bits16(f16 x) {
  return __half_as_ushort(x);
}
static inline f16 futrts_from_bits16(int16_t x) {
  return __ushort_as_half(x);
}
#else
static inline int16_t futrts_to_bits16(f16 x) {
  union {
    f16 f;
    int16_t t;
  } p;

  p.f = x;
  return p.t;
}

static inline f16 futrts_from_bits16(int16_t x) {
  union {
    int16_t f;
    f16 t;
  } p;

  p.f = x;
  return p.t;
}
#endif

#else // No native f16 - emulate.

static inline f16 fabs16(f16 x) {
  return fabs32(x);
}

static inline f16 fmax16(f16 x, f16 y) {
  return fmax32(x, y);
}

static inline f16 fmin16(f16 x, f16 y) {
  return fmin32(x, y);
}

static inline f16 fpow16(f16 x, f16 y) {
  return fpow32(x, y);
}

static inline bool futrts_isnan16(f16 x) {
  return futrts_isnan32(x);
}

static inline bool futrts_isinf16(f16 x) {
  return futrts_isinf32(x);
}

static inline f16 futrts_log16(f16 x) {
  return futrts_log32(x);
}

static inline f16 futrts_log2_16(f16 x) {
  return futrts_log2_32(x);
}

static inline f16 futrts_log10_16(f16 x) {
  return futrts_log10_32(x);
}

static inline f16 futrts_sqrt16(f16 x) {
  return futrts_sqrt32(x);
}

static inline f16 futrts_exp16(f16 x) {
  return futrts_exp32(x);
}

static inline f16 futrts_cos16(f16 x) {
  return futrts_cos32(x);
}

static inline f16 futrts_sin16(f16 x) {
  return futrts_sin32(x);
}

static inline f16 futrts_tan16(f16 x) {
  return futrts_tan32(x);
}

static inline f16 futrts_acos16(f16 x) {
  return futrts_acos32(x);
}

static inline f16 futrts_asin16(f16 x) {
  return futrts_asin32(x);
}

static inline f16 futrts_atan16(f16 x) {
  return futrts_atan32(x);
}

static inline f16 futrts_cosh16(f16 x) {
  return futrts_cosh32(x);
}

static inline f16 futrts_sinh16(f16 x) {
  return futrts_sinh32(x);
}

static inline f16 futrts_tanh16(f16 x) {
  return futrts_tanh32(x);
}

static inline f16 futrts_acosh16(f16 x) {
  return futrts_acosh32(x);
}

static inline f16 futrts_asinh16(f16 x) {
  return futrts_asinh32(x);
}

static inline f16 futrts_atanh16(f16 x) {
  return futrts_atanh32(x);
}

static inline f16 futrts_atan2_16(f16 x, f16 y) {
  return futrts_atan2_32(x, y);
}

static inline f16 futrts_hypot16(f16 x, f16 y) {
  return futrts_hypot32(x, y);
}

static inline f16 futrts_gamma16(f16 x) {
  return futrts_gamma32(x);
}

static inline f16 futrts_lgamma16(f16 x) {
  return futrts_lgamma32(x);
}

static inline f16 fmod16(f16 x, f16 y) {
  return fmod32(x, y);
}

static inline f16 futrts_round16(f16 x) {
  return futrts_round32(x);
}

static inline f16 futrts_floor16(f16 x) {
  return futrts_floor32(x);
}

static inline f16 futrts_ceil16(f16 x) {
  return futrts_ceil32(x);
}

static inline f16 futrts_lerp16(f16 v0, f16 v1, f16 t) {
  return futrts_lerp32(v0, v1, t);
}

static inline f16 futrts_mad16(f16 a, f16 b, f16 c) {
  return futrts_mad32(a, b, c);
}

static inline f16 futrts_fma16(f16 a, f16 b, f16 c) {
  return futrts_fma32(a, b, c);
}

// Even when we are using an OpenCL that does not support cl_khr_fp16,
// it must still support vload_half for actually creating a
// half-precision number, which can then be efficiently converted to a
// float.  Similarly for vstore_half.
#ifdef __OPENCL_VERSION__

static inline int16_t futrts_to_bits16(f16 x) {
  int16_t y;
  // Violating strict aliasing here.
  vstore_half((float)x, 0, (half*)&y);
  return y;
}

static inline f16 futrts_from_bits16(int16_t x) {
  return (f16)vload_half(0, (half*)&x);
}

#else

static inline int16_t futrts_to_bits16(f16 x) {
  return (int16_t)float2halfbits(x);
}

static inline f16 futrts_from_bits16(int16_t x) {
  return halfbits2float((uint16_t)x);
}

static inline f16 fsignum16(f16 x) {
  return futrts_isnan16(x) ? x : (x > 0) - (x < 0);
}

#endif

#endif

static inline float fpconv_f16_f16(f16 x) {
  return x;
}

static inline float fpconv_f16_f32(f16 x) {
  return x;
}

static inline f16 fpconv_f32_f16(float x) {
  return x;
}

#ifdef FUTHARK_F64_ENABLED

static inline double fpconv_f16_f64(f16 x) {
  return (double) x;
}

static inline f16 fpconv_f64_f16(double x) {
  return (f16) x;
}

#endif


// End of scalar_f16.h.

static int init_constants(struct futhark_context *);
static int free_constants(struct futhark_context *);
static int32_t mainzicounter_mem_realtype_80023[10240];
static int32_t mainzicounter_mem_realtype_80039[10240];
static int32_t mainzicounter_mem_realtype_80100[10240];
static int32_t mainzicounter_mem_realtype_80116[10240];
static int32_t mainzicounter_mem_realtype_80177[10240];
static int32_t mainzicounter_mem_realtype_80193[10240];
struct memblock_device {
    int *references;
    cl_mem mem;
    int64_t size;
    const char *desc;
};
struct memblock {
    int *references;
    unsigned char *mem;
    int64_t size;
    const char *desc;
};
typedef cl_mem fl_mem_t;
// Start of free_list.h.

// An entry in the free list.  May be invalid, to avoid having to
// deallocate entries as soon as they are removed.  There is also a
// tag, to help with memory reuse.
struct free_list_entry {
  size_t size;
  fl_mem_t mem;
  const char *tag;
  unsigned char valid;
};

struct free_list {
  struct free_list_entry *entries;        // Pointer to entries.
  int capacity;                           // Number of entries.
  int used;                               // Number of valid entries.
};

static void free_list_init(struct free_list *l) {
  l->capacity = 30; // Picked arbitrarily.
  l->used = 0;
  l->entries = (struct free_list_entry*) malloc(sizeof(struct free_list_entry) * l->capacity);
  for (int i = 0; i < l->capacity; i++) {
    l->entries[i].valid = 0;
  }
}

// Remove invalid entries from the free list.
static void free_list_pack(struct free_list *l) {
  int p = 0;
  for (int i = 0; i < l->capacity; i++) {
    if (l->entries[i].valid) {
      l->entries[p] = l->entries[i];
      if (i > p) {
        l->entries[i].valid = 0;
      }
      p++;
    }
  }

  // Now p is the number of used elements.  We don't want it to go
  // less than the default capacity (although in practice it's OK as
  // long as it doesn't become 1).
  if (p < 30) {
    p = 30;
  }
  l->entries = realloc(l->entries, p * sizeof(struct free_list_entry));
  l->capacity = p;
}

static void free_list_destroy(struct free_list *l) {
  assert(l->used == 0);
  free(l->entries);
}

static int free_list_find_invalid(struct free_list *l) {
  int i;
  for (i = 0; i < l->capacity; i++) {
    if (!l->entries[i].valid) {
      break;
    }
  }
  return i;
}

static void free_list_insert(struct free_list *l, size_t size, fl_mem_t mem, const char *tag) {
  int i = free_list_find_invalid(l);

  if (i == l->capacity) {
    // List is full; so we have to grow it.
    int new_capacity = l->capacity * 2 * sizeof(struct free_list_entry);
    l->entries = realloc(l->entries, new_capacity);
    for (int j = 0; j < l->capacity; j++) {
      l->entries[j+l->capacity].valid = 0;
    }
    l->capacity *= 2;
  }

  // Now 'i' points to the first invalid entry.
  l->entries[i].valid = 1;
  l->entries[i].size = size;
  l->entries[i].mem = mem;
  l->entries[i].tag = tag;

  l->used++;
}

// Find and remove a memory block of the indicated tag, or if that
// does not exist, another memory block with exactly the desired size.
// Returns 0 on success.
static int free_list_find(struct free_list *l, size_t size,
                          size_t *size_out, fl_mem_t *mem_out) {
  int size_match = -1;
  int i;
  for (i = 0; i < l->capacity; i++) {
    if (l->entries[i].valid &&
        size <= l->entries[i].size &&
        (size_match < 0 || l->entries[i].size < l->entries[size_match].size)) {
      // If this entry is valid, has sufficient size, and is smaller than the
      // best entry found so far, use this entry.
      size_match = i;
    }
  }

  if (size_match >= 0) {
    l->entries[size_match].valid = 0;
    *size_out = l->entries[size_match].size;
    *mem_out = l->entries[size_match].mem;
    l->used--;
    return 0;
  } else {
    return 1;
  }
}

// Remove the first block in the free list.  Returns 0 if a block was
// removed, and nonzero if the free list was already empty.
static int free_list_first(struct free_list *l, fl_mem_t *mem_out) {
  for (int i = 0; i < l->capacity; i++) {
    if (l->entries[i].valid) {
      l->entries[i].valid = 0;
      *mem_out = l->entries[i].mem;
      l->used--;
      return 0;
    }
  }

  return 1;
}

// End of free_list.h.

// Start of opencl.h.

#define OPENCL_SUCCEED_FATAL(e) opencl_succeed_fatal(e, #e, __FILE__, __LINE__)
#define OPENCL_SUCCEED_NONFATAL(e) opencl_succeed_nonfatal(e, #e, __FILE__, __LINE__)
// Take care not to override an existing error.
#define OPENCL_SUCCEED_OR_RETURN(e) {             \
    char *serror = OPENCL_SUCCEED_NONFATAL(e);    \
    if (serror) {                                 \
      if (!ctx->error) {                          \
        ctx->error = serror;                      \
        return bad;                               \
      } else {                                    \
        free(serror);                             \
      }                                           \
    }                                             \
  }

// OPENCL_SUCCEED_OR_RETURN returns the value of the variable 'bad' in
// scope.  By default, it will be this one.  Create a local variable
// of some other type if needed.  This is a bit of a hack, but it
// saves effort in the code generator.
static const int bad = 1;

struct opencl_config {
  int debugging;
  int profiling;
  int logging;
  int preferred_device_num;
  const char *preferred_platform;
  const char *preferred_device;
  int ignore_blacklist;

  const char* dump_program_to;
  const char* load_program_from;
  const char* dump_binary_to;
  const char* load_binary_from;

  size_t default_group_size;
  size_t default_num_groups;
  size_t default_tile_size;
  size_t default_reg_tile_size;
  size_t default_threshold;

  int default_group_size_changed;
  int default_tile_size_changed;

  int num_sizes;
  const char **size_names;
  const char **size_vars;
  int64_t *size_values;
  const char **size_classes;
};

static void opencl_config_init(struct opencl_config *cfg,
                               int num_sizes,
                               const char *size_names[],
                               const char *size_vars[],
                               int64_t *size_values,
                               const char *size_classes[]) {
  cfg->debugging = 0;
  cfg->logging = 0;
  cfg->profiling = 0;
  cfg->preferred_device_num = 0;
  cfg->preferred_platform = "";
  cfg->preferred_device = "";
  cfg->ignore_blacklist = 0;
  cfg->dump_program_to = NULL;
  cfg->load_program_from = NULL;
  cfg->dump_binary_to = NULL;
  cfg->load_binary_from = NULL;

  // The following are dummy sizes that mean the concrete defaults
  // will be set during initialisation via hardware-inspection-based
  // heuristics.
  cfg->default_group_size = 0;
  cfg->default_num_groups = 0;
  cfg->default_tile_size = 0;
  cfg->default_reg_tile_size = 0;
  cfg->default_threshold = 0;

  cfg->default_group_size_changed = 0;
  cfg->default_tile_size_changed = 0;

  cfg->num_sizes = num_sizes;
  cfg->size_names = size_names;
  cfg->size_vars = size_vars;
  cfg->size_values = size_values;
  cfg->size_classes = size_classes;
}

// A record of something that happened.
struct profiling_record {
  cl_event *event;
  int *runs;
  int64_t *runtime;
};

struct opencl_context {
  cl_device_id device;
  cl_context ctx;
  cl_command_queue queue;

  struct opencl_config cfg;

  struct free_list free_list;

  size_t max_group_size;
  size_t max_num_groups;
  size_t max_tile_size;
  size_t max_threshold;
  size_t max_local_memory;

  size_t lockstep_width;

  struct profiling_record *profiling_records;
  int profiling_records_capacity;
  int profiling_records_used;
};

struct opencl_device_option {
  cl_platform_id platform;
  cl_device_id device;
  cl_device_type device_type;
  char *platform_name;
  char *device_name;
};

// This function must be defined by the user.  It is invoked by
// setup_opencl() after the platform and device has been found, but
// before the program is loaded.  Its intended use is to tune
// constants based on the selected platform and device.
static void post_opencl_setup(struct opencl_context*, struct opencl_device_option*);

static char *strclone(const char *str) {
  size_t size = strlen(str) + 1;
  char *copy = (char*) malloc(size);
  if (copy == NULL) {
    return NULL;
  }

  memcpy(copy, str, size);
  return copy;
}

static const char* opencl_error_string(cl_int err)
{
    switch (err) {
        case CL_SUCCESS:                            return "Success!";
        case CL_DEVICE_NOT_FOUND:                   return "Device not found.";
        case CL_DEVICE_NOT_AVAILABLE:               return "Device not available";
        case CL_COMPILER_NOT_AVAILABLE:             return "Compiler not available";
        case CL_MEM_OBJECT_ALLOCATION_FAILURE:      return "Memory object allocation failure";
        case CL_OUT_OF_RESOURCES:                   return "Out of resources";
        case CL_OUT_OF_HOST_MEMORY:                 return "Out of host memory";
        case CL_PROFILING_INFO_NOT_AVAILABLE:       return "Profiling information not available";
        case CL_MEM_COPY_OVERLAP:                   return "Memory copy overlap";
        case CL_IMAGE_FORMAT_MISMATCH:              return "Image format mismatch";
        case CL_IMAGE_FORMAT_NOT_SUPPORTED:         return "Image format not supported";
        case CL_BUILD_PROGRAM_FAILURE:              return "Program build failure";
        case CL_MAP_FAILURE:                        return "Map failure";
        case CL_INVALID_VALUE:                      return "Invalid value";
        case CL_INVALID_DEVICE_TYPE:                return "Invalid device type";
        case CL_INVALID_PLATFORM:                   return "Invalid platform";
        case CL_INVALID_DEVICE:                     return "Invalid device";
        case CL_INVALID_CONTEXT:                    return "Invalid context";
        case CL_INVALID_QUEUE_PROPERTIES:           return "Invalid queue properties";
        case CL_INVALID_COMMAND_QUEUE:              return "Invalid command queue";
        case CL_INVALID_HOST_PTR:                   return "Invalid host pointer";
        case CL_INVALID_MEM_OBJECT:                 return "Invalid memory object";
        case CL_INVALID_IMAGE_FORMAT_DESCRIPTOR:    return "Invalid image format descriptor";
        case CL_INVALID_IMAGE_SIZE:                 return "Invalid image size";
        case CL_INVALID_SAMPLER:                    return "Invalid sampler";
        case CL_INVALID_BINARY:                     return "Invalid binary";
        case CL_INVALID_BUILD_OPTIONS:              return "Invalid build options";
        case CL_INVALID_PROGRAM:                    return "Invalid program";
        case CL_INVALID_PROGRAM_EXECUTABLE:         return "Invalid program executable";
        case CL_INVALID_KERNEL_NAME:                return "Invalid kernel name";
        case CL_INVALID_KERNEL_DEFINITION:          return "Invalid kernel definition";
        case CL_INVALID_KERNEL:                     return "Invalid kernel";
        case CL_INVALID_ARG_INDEX:                  return "Invalid argument index";
        case CL_INVALID_ARG_VALUE:                  return "Invalid argument value";
        case CL_INVALID_ARG_SIZE:                   return "Invalid argument size";
        case CL_INVALID_KERNEL_ARGS:                return "Invalid kernel arguments";
        case CL_INVALID_WORK_DIMENSION:             return "Invalid work dimension";
        case CL_INVALID_WORK_GROUP_SIZE:            return "Invalid work group size";
        case CL_INVALID_WORK_ITEM_SIZE:             return "Invalid work item size";
        case CL_INVALID_GLOBAL_OFFSET:              return "Invalid global offset";
        case CL_INVALID_EVENT_WAIT_LIST:            return "Invalid event wait list";
        case CL_INVALID_EVENT:                      return "Invalid event";
        case CL_INVALID_OPERATION:                  return "Invalid operation";
        case CL_INVALID_GL_OBJECT:                  return "Invalid OpenGL object";
        case CL_INVALID_BUFFER_SIZE:                return "Invalid buffer size";
        case CL_INVALID_MIP_LEVEL:                  return "Invalid mip-map level";
        default:                                    return "Unknown";
    }
}

static void opencl_succeed_fatal(cl_int ret,
                                 const char *call,
                                 const char *file,
                                 int line) {
  if (ret != CL_SUCCESS) {
    futhark_panic(-1, "%s:%d: OpenCL call\n  %s\nfailed with error code %d (%s)\n",
          file, line, call, ret, opencl_error_string(ret));
  }
}

static char* opencl_succeed_nonfatal(cl_int ret,
                                     const char *call,
                                     const char *file,
                                     int line) {
  if (ret != CL_SUCCESS) {
    return msgprintf("%s:%d: OpenCL call\n  %s\nfailed with error code %d (%s)\n",
                     file, line, call, ret, opencl_error_string(ret));
  } else {
    return NULL;
  }
}

static void set_preferred_platform(struct opencl_config *cfg, const char *s) {
  cfg->preferred_platform = s;
  cfg->ignore_blacklist = 1;
}

static void set_preferred_device(struct opencl_config *cfg, const char *s) {
  int x = 0;
  if (*s == '#') {
    s++;
    while (isdigit(*s)) {
      x = x * 10 + (*s++)-'0';
    }
    // Skip trailing spaces.
    while (isspace(*s)) {
      s++;
    }
  }
  cfg->preferred_device = s;
  cfg->preferred_device_num = x;
  cfg->ignore_blacklist = 1;
}

static char* opencl_platform_info(cl_platform_id platform,
                                  cl_platform_info param) {
  size_t req_bytes;
  char *info;

  OPENCL_SUCCEED_FATAL(clGetPlatformInfo(platform, param, 0, NULL, &req_bytes));

  info = (char*) malloc(req_bytes);

  OPENCL_SUCCEED_FATAL(clGetPlatformInfo(platform, param, req_bytes, info, NULL));

  return info;
}

static char* opencl_device_info(cl_device_id device,
                                cl_device_info param) {
  size_t req_bytes;
  char *info;

  OPENCL_SUCCEED_FATAL(clGetDeviceInfo(device, param, 0, NULL, &req_bytes));

  info = (char*) malloc(req_bytes);

  OPENCL_SUCCEED_FATAL(clGetDeviceInfo(device, param, req_bytes, info, NULL));

  return info;
}

static void opencl_all_device_options(struct opencl_device_option **devices_out,
                                      size_t *num_devices_out) {
  size_t num_devices = 0, num_devices_added = 0;

  cl_platform_id *all_platforms;
  cl_uint *platform_num_devices;

  cl_uint num_platforms;

  // Find the number of platforms.
  OPENCL_SUCCEED_FATAL(clGetPlatformIDs(0, NULL, &num_platforms));

  // Make room for them.
  all_platforms = calloc(num_platforms, sizeof(cl_platform_id));
  platform_num_devices = calloc(num_platforms, sizeof(cl_uint));

  // Fetch all the platforms.
  OPENCL_SUCCEED_FATAL(clGetPlatformIDs(num_platforms, all_platforms, NULL));

  // Count the number of devices for each platform, as well as the
  // total number of devices.
  for (cl_uint i = 0; i < num_platforms; i++) {
    if (clGetDeviceIDs(all_platforms[i], CL_DEVICE_TYPE_ALL,
                       0, NULL, &platform_num_devices[i]) == CL_SUCCESS) {
      num_devices += platform_num_devices[i];
    } else {
      platform_num_devices[i] = 0;
    }
  }

  // Make room for all the device options.
  struct opencl_device_option *devices =
    calloc(num_devices, sizeof(struct opencl_device_option));

  // Loop through the platforms, getting information about their devices.
  for (cl_uint i = 0; i < num_platforms; i++) {
    cl_platform_id platform = all_platforms[i];
    cl_uint num_platform_devices = platform_num_devices[i];

    if (num_platform_devices == 0) {
      continue;
    }

    char *platform_name = opencl_platform_info(platform, CL_PLATFORM_NAME);
    cl_device_id *platform_devices =
      calloc(num_platform_devices, sizeof(cl_device_id));

    // Fetch all the devices.
    OPENCL_SUCCEED_FATAL(clGetDeviceIDs(platform, CL_DEVICE_TYPE_ALL,
                                  num_platform_devices, platform_devices, NULL));

    // Loop through the devices, adding them to the devices array.
    for (cl_uint i = 0; i < num_platform_devices; i++) {
      char *device_name = opencl_device_info(platform_devices[i], CL_DEVICE_NAME);
      devices[num_devices_added].platform = platform;
      devices[num_devices_added].device = platform_devices[i];
      OPENCL_SUCCEED_FATAL(clGetDeviceInfo(platform_devices[i], CL_DEVICE_TYPE,
                                     sizeof(cl_device_type),
                                     &devices[num_devices_added].device_type,
                                     NULL));
      // We don't want the structs to share memory, so copy the platform name.
      // Each device name is already unique.
      devices[num_devices_added].platform_name = strclone(platform_name);
      devices[num_devices_added].device_name = device_name;
      num_devices_added++;
    }
    free(platform_devices);
    free(platform_name);
  }
  free(all_platforms);
  free(platform_num_devices);

  *devices_out = devices;
  *num_devices_out = num_devices;
}

// Returns 0 on success.
static int list_devices(void) {
  struct opencl_device_option *devices;
  size_t num_devices;

  opencl_all_device_options(&devices, &num_devices);

  const char *cur_platform = "";
  for (size_t i = 0; i < num_devices; i++) {
    struct opencl_device_option device = devices[i];
    if (strcmp(cur_platform, device.platform_name) != 0) {
      printf("Platform: %s\n", device.platform_name);
      cur_platform = device.platform_name;
    }
    printf("[%d]: %s\n", (int)i, device.device_name);
  }

  // Free all the platform and device names.
  for (size_t j = 0; j < num_devices; j++) {
    free(devices[j].platform_name);
    free(devices[j].device_name);
  }
  free(devices);

  return 0;
}

// Returns 0 on success.
static int select_device_interactively(struct opencl_config *cfg) {
  struct opencl_device_option *devices;
  size_t num_devices;
  int ret = 1;

  opencl_all_device_options(&devices, &num_devices);

  printf("Choose OpenCL device:\n");
  const char *cur_platform = "";
  for (size_t i = 0; i < num_devices; i++) {
    struct opencl_device_option device = devices[i];
    if (strcmp(cur_platform, device.platform_name) != 0) {
      printf("Platform: %s\n", device.platform_name);
      cur_platform = device.platform_name;
    }
    printf("[%d] %s\n", (int)i, device.device_name);
  }

  int selection;
  printf("Choice: ");
  if (scanf("%d", &selection) == 1) {
    ret = 0;
    cfg->preferred_platform = "";
    cfg->preferred_device = "";
    cfg->preferred_device_num = selection;
    cfg->ignore_blacklist = 1;
  }

  // Free all the platform and device names.
  for (size_t j = 0; j < num_devices; j++) {
    free(devices[j].platform_name);
    free(devices[j].device_name);
  }
  free(devices);

  return ret;
}

static int is_blacklisted(const char *platform_name, const char *device_name,
                          const struct opencl_config *cfg) {
  if (strcmp(cfg->preferred_platform, "") != 0 ||
      strcmp(cfg->preferred_device, "") != 0) {
    return 0;
  } else if (strstr(platform_name, "Apple") != NULL &&
             strstr(device_name, "Intel(R) Core(TM)") != NULL) {
    return 1;
  } else {
    return 0;
  }
}

static struct opencl_device_option get_preferred_device(const struct opencl_config *cfg) {
  struct opencl_device_option *devices;
  size_t num_devices;

  opencl_all_device_options(&devices, &num_devices);

  int num_device_matches = 0;

  for (size_t i = 0; i < num_devices; i++) {
    struct opencl_device_option device = devices[i];
    if (strstr(device.platform_name, cfg->preferred_platform) != NULL &&
        strstr(device.device_name, cfg->preferred_device) != NULL &&
        (cfg->ignore_blacklist ||
         !is_blacklisted(device.platform_name, device.device_name, cfg)) &&
        num_device_matches++ == cfg->preferred_device_num) {
      // Free all the platform and device names, except the ones we have chosen.
      for (size_t j = 0; j < num_devices; j++) {
        if (j != i) {
          free(devices[j].platform_name);
          free(devices[j].device_name);
        }
      }
      free(devices);
      return device;
    }
  }

  futhark_panic(1, "Could not find acceptable OpenCL device.\n");
  exit(1); // Never reached
}

static void describe_device_option(struct opencl_device_option device) {
  fprintf(stderr, "Using platform: %s\n", device.platform_name);
  fprintf(stderr, "Using device: %s\n", device.device_name);
}

static cl_build_status build_opencl_program(cl_program program, cl_device_id device, const char* options) {
  cl_int clBuildProgram_error = clBuildProgram(program, 1, &device, options, NULL, NULL);

  // Avoid termination due to CL_BUILD_PROGRAM_FAILURE
  if (clBuildProgram_error != CL_SUCCESS &&
      clBuildProgram_error != CL_BUILD_PROGRAM_FAILURE) {
    OPENCL_SUCCEED_FATAL(clBuildProgram_error);
  }

  cl_build_status build_status;
  OPENCL_SUCCEED_FATAL(clGetProgramBuildInfo(program,
                                             device,
                                             CL_PROGRAM_BUILD_STATUS,
                                             sizeof(cl_build_status),
                                             &build_status,
                                             NULL));

  if (build_status != CL_SUCCESS) {
    char *build_log;
    size_t ret_val_size;
    OPENCL_SUCCEED_FATAL(clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG, 0, NULL, &ret_val_size));

    build_log = (char*) malloc(ret_val_size+1);
    OPENCL_SUCCEED_FATAL(clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG, ret_val_size, build_log, NULL));

    // The spec technically does not say whether the build log is zero-terminated, so let's be careful.
    build_log[ret_val_size] = '\0';

    fprintf(stderr, "Build log:\n%s\n", build_log);

    free(build_log);
  }

  return build_status;
}

// Fields in a bitmask indicating which types we must be sure are
// available.
enum opencl_required_type { OPENCL_F64 = 1 };

// We take as input several strings representing the program, because
// C does not guarantee that the compiler supports particularly large
// literals.  Notably, Visual C has a limit of 2048 characters.  The
// array must be NULL-terminated.
static cl_program setup_opencl_with_command_queue(struct opencl_context *ctx,
                                                  cl_command_queue queue,
                                                  const char *srcs[],
                                                  int required_types,
                                                  const char *extra_build_opts[]) {
  int error;

  free_list_init(&ctx->free_list);
  ctx->queue = queue;

  OPENCL_SUCCEED_FATAL(clGetCommandQueueInfo(ctx->queue, CL_QUEUE_CONTEXT, sizeof(cl_context), &ctx->ctx, NULL));

  // Fill out the device info.  This is redundant work if we are
  // called from setup_opencl() (which is the common case), but I
  // doubt it matters much.
  struct opencl_device_option device_option;
  OPENCL_SUCCEED_FATAL(clGetCommandQueueInfo(ctx->queue, CL_QUEUE_DEVICE,
                                       sizeof(cl_device_id),
                                       &device_option.device,
                                       NULL));
  OPENCL_SUCCEED_FATAL(clGetDeviceInfo(device_option.device, CL_DEVICE_PLATFORM,
                                 sizeof(cl_platform_id),
                                 &device_option.platform,
                                 NULL));
  OPENCL_SUCCEED_FATAL(clGetDeviceInfo(device_option.device, CL_DEVICE_TYPE,
                                 sizeof(cl_device_type),
                                 &device_option.device_type,
                                 NULL));
  device_option.platform_name = opencl_platform_info(device_option.platform, CL_PLATFORM_NAME);
  device_option.device_name = opencl_device_info(device_option.device, CL_DEVICE_NAME);

  ctx->device = device_option.device;

  if (required_types & OPENCL_F64) {
    cl_uint supported;
    OPENCL_SUCCEED_FATAL(clGetDeviceInfo(device_option.device, CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE,
                                   sizeof(cl_uint), &supported, NULL));
    if (!supported) {
      futhark_panic(1, "Program uses double-precision floats, but this is not supported on the chosen device: %s\n",
            device_option.device_name);
    }
  }

  size_t max_group_size;
  OPENCL_SUCCEED_FATAL(clGetDeviceInfo(device_option.device, CL_DEVICE_MAX_WORK_GROUP_SIZE,
                                 sizeof(size_t), &max_group_size, NULL));

  size_t max_tile_size = sqrt(max_group_size);

  cl_ulong max_local_memory;
  OPENCL_SUCCEED_FATAL(clGetDeviceInfo(device_option.device, CL_DEVICE_LOCAL_MEM_SIZE,
                                       sizeof(size_t), &max_local_memory, NULL));

  // Futhark reserves 4 bytes for bookkeeping information.
  max_local_memory -= 4;

  // The OpenCL implementation may reserve some local memory bytes for
  // various purposes.  In principle, we should use
  // clGetKernelWorkGroupInfo() to figure out for each kernel how much
  // is actually available, but our current code generator design
  // makes this infeasible.  Instead, we have this nasty hack where we
  // arbitrarily subtract some bytes, based on empirical measurements
  // (but which might be arbitrarily wrong).  Fortunately, we rarely
  // try to really push the local memory usage.
  if (strstr(device_option.platform_name, "NVIDIA CUDA") != NULL) {
    max_local_memory -= 12;
  } else if (strstr(device_option.platform_name, "AMD") != NULL) {
    max_local_memory -= 16;
  }

  // Make sure this function is defined.
  post_opencl_setup(ctx, &device_option);

  if (max_group_size < ctx->cfg.default_group_size) {
    if (ctx->cfg.default_group_size_changed) {
      fprintf(stderr, "Note: Device limits default group size to %zu (down from %zu).\n",
              max_group_size, ctx->cfg.default_group_size);
    }
    ctx->cfg.default_group_size = max_group_size;
  }

  if (max_tile_size < ctx->cfg.default_tile_size) {
    if (ctx->cfg.default_tile_size_changed) {
      fprintf(stderr, "Note: Device limits default tile size to %zu (down from %zu).\n",
              max_tile_size, ctx->cfg.default_tile_size);
    }
    ctx->cfg.default_tile_size = max_tile_size;
  }

  ctx->max_group_size = max_group_size;
  ctx->max_tile_size = max_tile_size; // No limit.
  ctx->max_threshold = ctx->max_num_groups = 0; // No limit.
  ctx->max_local_memory = max_local_memory;

  // Now we go through all the sizes, clamp them to the valid range,
  // or set them to the default.
  for (int i = 0; i < ctx->cfg.num_sizes; i++) {
    const char *size_class = ctx->cfg.size_classes[i];
    int64_t *size_value = &ctx->cfg.size_values[i];
    const char* size_name = ctx->cfg.size_names[i];
    int64_t max_value = 0, default_value = 0;

    if (strstr(size_class, "group_size") == size_class) {
      max_value = max_group_size;
      default_value = ctx->cfg.default_group_size;
    } else if (strstr(size_class, "num_groups") == size_class) {
      max_value = max_group_size; // Futhark assumes this constraint.
      default_value = ctx->cfg.default_num_groups;
      // XXX: as a quick and dirty hack, use twice as many threads for
      // histograms by default.  We really should just be smarter
      // about sizes somehow.
      if (strstr(size_name, ".seghist_") != NULL) {
        default_value *= 2;
      }
    } else if (strstr(size_class, "tile_size") == size_class) {
      max_value = sqrt(max_group_size);
      default_value = ctx->cfg.default_tile_size;
    } else if (strstr(size_class, "reg_tile_size") == size_class) {
      max_value = 0; // No limit.
      default_value = ctx->cfg.default_reg_tile_size;
    } else if (strstr(size_class, "threshold") == size_class) {
      // Threshold can be as large as it takes.
      default_value = ctx->cfg.default_threshold;
    } else {
      // Bespoke sizes have no limit or default.
    }
    if (*size_value == 0) {
      *size_value = default_value;
    } else if (max_value > 0 && *size_value > max_value) {
      fprintf(stderr, "Note: Device limits %s to %d (down from %d)\n",
              size_name, (int)max_value, (int)*size_value);
      *size_value = max_value;
    }
  }

  if (ctx->lockstep_width == 0) {
    ctx->lockstep_width = 1;
  }

  if (ctx->cfg.logging) {
    fprintf(stderr, "Lockstep width: %d\n", (int)ctx->lockstep_width);
    fprintf(stderr, "Default group size: %d\n", (int)ctx->cfg.default_group_size);
    fprintf(stderr, "Default number of groups: %d\n", (int)ctx->cfg.default_num_groups);
  }

  char *fut_opencl_src = NULL;
  cl_program prog;
  error = CL_SUCCESS;

  if (ctx->cfg.load_binary_from == NULL) {
    size_t src_size = 0;

    // Maybe we have to read OpenCL source from somewhere else (used for debugging).
    if (ctx->cfg.load_program_from != NULL) {
      fut_opencl_src = slurp_file(ctx->cfg.load_program_from, NULL);
      assert(fut_opencl_src != NULL);
    } else {
      // Construct the OpenCL source concatenating all the fragments.
      for (const char **src = srcs; src && *src; src++) {
        src_size += strlen(*src);
      }

      fut_opencl_src = (char*) malloc(src_size + 1);

      size_t n, i;
      for (i = 0, n = 0; srcs && srcs[i]; i++) {
        strncpy(fut_opencl_src+n, srcs[i], src_size-n);
        n += strlen(srcs[i]);
      }
      fut_opencl_src[src_size] = 0;
    }

    if (ctx->cfg.dump_program_to != NULL) {
      if (ctx->cfg.debugging) {
        fprintf(stderr, "Dumping OpenCL source to %s...\n", ctx->cfg.dump_program_to);
      }

      dump_file(ctx->cfg.dump_program_to, fut_opencl_src, strlen(fut_opencl_src));
    }

    if (ctx->cfg.debugging) {
      fprintf(stderr, "Creating OpenCL program...\n");
    }

    const char* src_ptr[] = {fut_opencl_src};
    prog = clCreateProgramWithSource(ctx->ctx, 1, src_ptr, &src_size, &error);
    OPENCL_SUCCEED_FATAL(error);
  } else {
    if (ctx->cfg.debugging) {
      fprintf(stderr, "Loading OpenCL binary from %s...\n", ctx->cfg.load_binary_from);
    }
    size_t binary_size;
    unsigned char *fut_opencl_bin =
      (unsigned char*) slurp_file(ctx->cfg.load_binary_from, &binary_size);
    assert(fut_opencl_bin != NULL);
    const unsigned char *binaries[1] = { fut_opencl_bin };
    cl_int status = 0;

    prog = clCreateProgramWithBinary(ctx->ctx, 1, &device_option.device,
                                     &binary_size, binaries,
                                     &status, &error);

    OPENCL_SUCCEED_FATAL(status);
    OPENCL_SUCCEED_FATAL(error);
  }

  int compile_opts_size = 1024;

  for (int i = 0; i < ctx->cfg.num_sizes; i++) {
    compile_opts_size += strlen(ctx->cfg.size_names[i]) + 20;
  }

  for (int i = 0; extra_build_opts[i] != NULL; i++) {
    compile_opts_size += strlen(extra_build_opts[i] + 1);
  }

  char *compile_opts = (char*) malloc(compile_opts_size);

  int w = snprintf(compile_opts, compile_opts_size,
                   "-DLOCKSTEP_WIDTH=%d ",
                   (int)ctx->lockstep_width);

  for (int i = 0; i < ctx->cfg.num_sizes; i++) {
    w += snprintf(compile_opts+w, compile_opts_size-w,
                  "-D%s=%d ",
                  ctx->cfg.size_vars[i],
                  (int)ctx->cfg.size_values[i]);
  }

  for (int i = 0; extra_build_opts[i] != NULL; i++) {
    w += snprintf(compile_opts+w, compile_opts_size-w,
                  "%s ", extra_build_opts[i]);
  }

  // Oclgrind claims to support cl_khr_fp16, but this is not actually
  // the case.
  if (strcmp(device_option.platform_name, "Oclgrind") == 0) {
    w += snprintf(compile_opts+w, compile_opts_size-w, "-DEMULATE_F16 ");
  }

  if (ctx->cfg.debugging) {
    fprintf(stderr, "OpenCL compiler options: %s\n", compile_opts);
    fprintf(stderr, "Building OpenCL program...\n");
  }
  OPENCL_SUCCEED_FATAL(build_opencl_program(prog, device_option.device, compile_opts));

  free(compile_opts);
  free(fut_opencl_src);

  if (ctx->cfg.dump_binary_to != NULL) {
    if (ctx->cfg.debugging) {
      fprintf(stderr, "Dumping OpenCL binary to %s...\n", ctx->cfg.dump_binary_to);
    }

    size_t binary_size;
    OPENCL_SUCCEED_FATAL(clGetProgramInfo(prog, CL_PROGRAM_BINARY_SIZES,
                                          sizeof(size_t), &binary_size, NULL));
    unsigned char *binary = (unsigned char*) malloc(binary_size);
    unsigned char *binaries[1] = { binary };
    OPENCL_SUCCEED_FATAL(clGetProgramInfo(prog, CL_PROGRAM_BINARIES,
                                          sizeof(unsigned char*), binaries, NULL));

    dump_file(ctx->cfg.dump_binary_to, binary, binary_size);
  }

  return prog;
}

static cl_program setup_opencl(struct opencl_context *ctx,
                               const char *srcs[],
                               int required_types,
                               const char *extra_build_opts[]) {

  ctx->lockstep_width = 0; // Real value set later.

  struct opencl_device_option device_option = get_preferred_device(&ctx->cfg);

  if (ctx->cfg.logging) {
    describe_device_option(device_option);
  }

  // Note that NVIDIA's OpenCL requires the platform property
  cl_context_properties properties[] = {
    CL_CONTEXT_PLATFORM,
    (cl_context_properties)device_option.platform,
    0
  };

  cl_int clCreateContext_error;
  ctx->ctx = clCreateContext(properties, 1, &device_option.device, NULL, NULL, &clCreateContext_error);
  OPENCL_SUCCEED_FATAL(clCreateContext_error);

  cl_int clCreateCommandQueue_error;
  cl_command_queue queue =
    clCreateCommandQueue(ctx->ctx,
                         device_option.device,
                         ctx->cfg.profiling ? CL_QUEUE_PROFILING_ENABLE : 0,
                         &clCreateCommandQueue_error);
  OPENCL_SUCCEED_FATAL(clCreateCommandQueue_error);

  return setup_opencl_with_command_queue(ctx, queue, srcs, required_types, extra_build_opts);
}

// Count up the runtime all the profiling_records that occured during execution.
// Also clears the buffer of profiling_records.
static cl_int opencl_tally_profiling_records(struct opencl_context *ctx) {
  cl_int err;
  for (int i = 0; i < ctx->profiling_records_used; i++) {
    struct profiling_record record = ctx->profiling_records[i];

    cl_ulong start_t, end_t;

    if ((err = clGetEventProfilingInfo(*record.event,
                                       CL_PROFILING_COMMAND_START,
                                       sizeof(start_t),
                                       &start_t,
                                       NULL)) != CL_SUCCESS) {
      return err;
    }

    if ((err = clGetEventProfilingInfo(*record.event,
                                       CL_PROFILING_COMMAND_END,
                                       sizeof(end_t),
                                       &end_t,
                                       NULL)) != CL_SUCCESS) {
      return err;
    }

    // OpenCL provides nanosecond resolution, but we want
    // microseconds.
    *record.runs += 1;
    *record.runtime += (end_t - start_t)/1000;

    if ((err = clReleaseEvent(*record.event)) != CL_SUCCESS) {
      return err;
    }
    free(record.event);
  }

  ctx->profiling_records_used = 0;

  return CL_SUCCESS;
}

// If profiling, produce an event associated with a profiling record.
static cl_event* opencl_get_event(struct opencl_context *ctx, int *runs, int64_t *runtime) {
    if (ctx->profiling_records_used == ctx->profiling_records_capacity) {
      ctx->profiling_records_capacity *= 2;
      ctx->profiling_records =
        realloc(ctx->profiling_records,
                ctx->profiling_records_capacity *
                sizeof(struct profiling_record));
    }
    cl_event *event = malloc(sizeof(cl_event));
    ctx->profiling_records[ctx->profiling_records_used].event = event;
    ctx->profiling_records[ctx->profiling_records_used].runs = runs;
    ctx->profiling_records[ctx->profiling_records_used].runtime = runtime;
    ctx->profiling_records_used++;
    return event;
}

// Allocate memory from driver. The problem is that OpenCL may perform
// lazy allocation, so we cannot know whether an allocation succeeded
// until the first time we try to use it.  Hence we immediately
// perform a write to see if the allocation succeeded.  This is slow,
// but the assumption is that this operation will be rare (most things
// will go through the free list).
static int opencl_alloc_actual(struct opencl_context *ctx, size_t size, cl_mem *mem_out) {
  int error;
  *mem_out = clCreateBuffer(ctx->ctx, CL_MEM_READ_WRITE, size, NULL, &error);

  if (error != CL_SUCCESS) {
    return error;
  }

  int x = 2;
  error = clEnqueueWriteBuffer(ctx->queue, *mem_out,
                               CL_TRUE,
                               0, sizeof(x), &x,
                               0, NULL, NULL);

  // No need to wait for completion here. clWaitForEvents() cannot
  // return mem object allocation failures. This implies that the
  // buffer is faulted onto the device on enqueue. (Observation by
  // Andreas Kloeckner.)

  return error;
}

static int opencl_alloc(struct opencl_context *ctx, size_t min_size, const char *tag, cl_mem *mem_out) {
  (void)tag;
  if (min_size < sizeof(int)) {
    min_size = sizeof(int);
  }

  size_t size;

  if (free_list_find(&ctx->free_list, min_size, &size, mem_out) == 0) {
    // Successfully found a free block.  Is it big enough?
    //
    // FIXME: we might also want to check whether the block is *too
    // big*, to avoid internal fragmentation.  However, this can
    // sharply impact performance on programs where arrays change size
    // frequently.  Fortunately, such allocations are usually fairly
    // short-lived, as they are necessarily within a loop, so the risk
    // of internal fragmentation resulting in an OOM situation is
    // limited.  However, it would be preferable if we could go back
    // and *shrink* oversize allocations when we encounter an OOM
    // condition.  That is technically feasible, since we do not
    // expose OpenCL pointer values directly to the application, but
    // instead rely on a level of indirection.
    if (size >= min_size) {
      if (ctx->cfg.debugging) {
        fprintf(stderr, "No need to allocate: Found a block in the free list.\n");
      }

      return CL_SUCCESS;
    } else {
      if (ctx->cfg.debugging) {
        fprintf(stderr, "Found a free block, but it was too small.\n");
      }

      // Not just right - free it.
      int error = clReleaseMemObject(*mem_out);
      if (error != CL_SUCCESS) {
        return error;
      }
    }
  }

  // We have to allocate a new block from the driver.  If the
  // allocation does not succeed, then we might be in an out-of-memory
  // situation.  We now start freeing things from the free list until
  // we think we have freed enough that the allocation will succeed.
  // Since we don't know how far the allocation is from fitting, we
  // have to check after every deallocation.  This might be pretty
  // expensive.  Let's hope that this case is hit rarely.

  if (ctx->cfg.debugging) {
    fprintf(stderr, "Actually allocating the desired block.\n");
  }

  int error = opencl_alloc_actual(ctx, min_size, mem_out);

  while (error == CL_MEM_OBJECT_ALLOCATION_FAILURE) {
    if (ctx->cfg.debugging) {
      fprintf(stderr, "Out of OpenCL memory: releasing entry from the free list...\n");
    }
    cl_mem mem;
    if (free_list_first(&ctx->free_list, &mem) == 0) {
      error = clReleaseMemObject(mem);
      if (error != CL_SUCCESS) {
        return error;
      }
    } else {
      break;
    }
    error = opencl_alloc_actual(ctx, min_size, mem_out);
  }

  return error;
}

static int opencl_free(struct opencl_context *ctx, cl_mem mem, const char *tag) {
  size_t size;
  cl_mem existing_mem;

  // If there is already a block with this tag, then remove it.
  if (free_list_find(&ctx->free_list, -1, &size, &existing_mem) == 0) {
    int error = clReleaseMemObject(existing_mem);
    if (error != CL_SUCCESS) {
      return error;
    }
  }

  int error = clGetMemObjectInfo(mem, CL_MEM_SIZE, sizeof(size_t), &size, NULL);

  if (error == CL_SUCCESS) {
    free_list_insert(&ctx->free_list, size, mem, tag);
  }

  return error;
}

static int opencl_free_all(struct opencl_context *ctx) {
  cl_mem mem;
  free_list_pack(&ctx->free_list);
  while (free_list_first(&ctx->free_list, &mem) == 0) {
    int error = clReleaseMemObject(mem);
    if (error != CL_SUCCESS) {
      return error;
    }
  }

  return CL_SUCCESS;
}

// Free everything that belongs to 'ctx', but do not free 'ctx'
// itself.
static void teardown_opencl(struct opencl_context *ctx) {
  (void)opencl_tally_profiling_records(ctx);
  free(ctx->profiling_records);
  (void)opencl_free_all(ctx);
  (void)clReleaseCommandQueue(ctx->queue);
  (void)clReleaseContext(ctx->ctx);
}

// End of opencl.h.

static const char *opencl_program[] =
                  {"\n// Clang-based OpenCL implementations need this for 'static' to work.\n#ifdef cl_clang_storage_class_specifiers\n#pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable\n#endif\n#pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable\n\n// Some OpenCL programs dislike empty progams, or programs with no kernels.\n// Declare a dummy kernel to ensure they remain our friends.\n__kernel void dummy_kernel(__global unsigned char *dummy, int n)\n{\n    const int thread_gid = get_global_id(0);\n    if (thread_gid >= n) return;\n}\n\n#pragma OPENCL EXTENSION cl_khr_int64_base_atomics : enable\n#pragma OPENCL EXTENSION cl_khr_int64_extended_atomics : enable\n\ntypedef char int8_t;\ntypedef short int16_t;\ntypedef int int32_t;\ntypedef long int64_t;\n\ntypedef uchar uint8_t;\ntypedef ushort uint16_t;\ntypedef uint uint32_t;\ntypedef ulong uint64_t;\n\n// NVIDIAs OpenCL does not create device-wide memory fences (see #734), so we\n// use inline assembly if we detect we are on an NVIDIA GPU.\n#ifdef cl_nv_pragma_unroll\nstatic inline void mem_fence_global() {\n  asm(\"membar.gl;\");\n}\n#else\nstatic inline void mem_fence_global() {\n  mem_fence(CLK_LOCAL_MEM_FENCE | CLK_GLOBAL_MEM_FENCE);\n}\n#endif\nstatic inline void mem_fence_local() {\n  mem_fence(CLK_LOCAL_MEM_FENCE);\n}\n// Start of half.h.\n\n// Conversion functions are from http://half.sourceforge.net/, but\n// translated to C.\n//\n// Copyright (c) 2012-2021 Christian Rau\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Softwa",
                   "re.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#ifndef __OPENCL_VERSION__\n#define __constant\n#endif\n\n__constant static const uint16_t base_table[512] = {\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,\n  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100,\n  0x0200, 0x0400, 0x0800, 0x0C00, 0x1000, 0x1400, 0x1800, 0x1C00, 0x2000, 0x2400, 0x2800, 0x2C00, 0x3000, 0x3400, 0x3800, 0x3C00,\n  0x4000, 0x4400, 0x4800, 0x4C00, 0x5000, 0x5400, 0x5800, 0x5C00, 0x6000, 0x6400, 0x6800, 0x6C00, 0x7000, 0x7400, 0x7800, 0x7C00,\n  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,\n  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C0",
                   "0, 0x7C00, 0x7C00, 0x7C00,\n  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,\n  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,\n  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,\n  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,\n  0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00, 0x7C00,\n  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\n  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\n  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\n  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\n  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\n  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000,\n  0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8000, 0x8001, 0x8002, 0x8004, 0x8008, 0x8010, 0x8020, 0x8040, 0x8080, 0x8100,\n  0x8200, 0x8400, 0x8800, 0x8C00, 0x9000, 0x9400, 0x9800, 0x9C00, 0xA000, 0xA400, 0xA800, 0xAC00, 0xB000, 0xB400, 0xB800, 0xBC00,\n  0xC000, 0xC400, 0xC800, 0xCC00, 0xD000, 0xD400, 0xD800, 0xDC00, 0xE000, 0xE400, 0xE800, 0xEC00, 0xF000, 0xF400, 0xF800, 0xFC00,\n  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,\n  0xFC00, 0xFC00, 0xFC0",
                   "0, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,\n  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,\n  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,\n  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,\n  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00,\n  0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00, 0xFC00 };\n\n__constant static const unsigned char shift_table[512] = {\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 13,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 2",
                   "4, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,\n  13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n  24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 13 };\n\n__constant static const uint32_t mantissa_table[2048] = {\n  0x00000000, 0x33800000, 0x34000000, 0x34400000, 0x34800000, 0x34A00000, 0x34C00000, 0x34E00000, 0x35000000, 0x35100000, 0x35200000, 0x35300000, 0x35400000, 0x35500000, 0x35600000, 0x35700000,\n  0x35800000, 0x35880000, 0x35900000, 0x35980000, 0x35A00000, 0x35A80000, 0x35B00000, 0x35B80000, 0x35C00000, 0x35C80000, 0x35D00000, 0x35D80000, 0x35E00000, 0x35E80000, 0x35F00000, 0x35F80000,\n  0x36000000, 0x36040000, 0x36080000, 0x360C0000, 0x36100000, 0x36140000, 0x36180000, 0x361C0000, 0x36200000, 0x36240000, 0x36280000, 0x362C0000, 0x36300000, 0x36340000, 0x36380000, 0x363C0000,\n  0x36400000, 0x36440000, 0x36480000, 0x364C0000, 0x36500000, 0x36540000, 0x36580000, 0x365C0000, 0x36600000, 0x36640000, 0x36680000, 0x366C0000, 0x36700000, 0x36740000, 0x36780000, 0x367C0000,\n  0x36800000, 0x36820000, 0x36840000, 0x36860000, 0x36880000, 0x368A0000, 0x368C0000, 0x368E0000, 0x36900000, 0x36920000, 0x36940000, 0x36960000, 0x36980000, 0x369A0000, 0x369C0000, 0x369E0000,\n  0x36A00000, 0x36A20000, 0x36A40000, 0x36A60000, 0x36A80000, 0x36AA00",
                   "00, 0x36AC0000, 0x36AE0000, 0x36B00000, 0x36B20000, 0x36B40000, 0x36B60000, 0x36B80000, 0x36BA0000, 0x36BC0000, 0x36BE0000,\n  0x36C00000, 0x36C20000, 0x36C40000, 0x36C60000, 0x36C80000, 0x36CA0000, 0x36CC0000, 0x36CE0000, 0x36D00000, 0x36D20000, 0x36D40000, 0x36D60000, 0x36D80000, 0x36DA0000, 0x36DC0000, 0x36DE0000,\n  0x36E00000, 0x36E20000, 0x36E40000, 0x36E60000, 0x36E80000, 0x36EA0000, 0x36EC0000, 0x36EE0000, 0x36F00000, 0x36F20000, 0x36F40000, 0x36F60000, 0x36F80000, 0x36FA0000, 0x36FC0000, 0x36FE0000,\n  0x37000000, 0x37010000, 0x37020000, 0x37030000, 0x37040000, 0x37050000, 0x37060000, 0x37070000, 0x37080000, 0x37090000, 0x370A0000, 0x370B0000, 0x370C0000, 0x370D0000, 0x370E0000, 0x370F0000,\n  0x37100000, 0x37110000, 0x37120000, 0x37130000, 0x37140000, 0x37150000, 0x37160000, 0x37170000, 0x37180000, 0x37190000, 0x371A0000, 0x371B0000, 0x371C0000, 0x371D0000, 0x371E0000, 0x371F0000,\n  0x37200000, 0x37210000, 0x37220000, 0x37230000, 0x37240000, 0x37250000, 0x37260000, 0x37270000, 0x37280000, 0x37290000, 0x372A0000, 0x372B0000, 0x372C0000, 0x372D0000, 0x372E0000, 0x372F0000,\n  0x37300000, 0x37310000, 0x37320000, 0x37330000, 0x37340000, 0x37350000, 0x37360000, 0x37370000, 0x37380000, 0x37390000, 0x373A0000, 0x373B0000, 0x373C0000, 0x373D0000, 0x373E0000, 0x373F0000,\n  0x37400000, 0x37410000, 0x37420000, 0x37430000, 0x37440000, 0x37450000, 0x37460000, 0x37470000, 0x37480000, 0x37490000, 0x374A0000, 0x374B0000, 0x374C0000, 0x374D0000, 0x374E0000, 0x374F0000,\n  0x37500000, 0x37510000, 0x37520000, 0x37530000, 0x37540000, 0x37550000, 0x37560000, 0x37570000, 0x37580000, 0x37590000, 0x375A0000, 0x375B0000, 0x375C0000, 0x375D0000, 0x375E0000, 0x375F0000,\n  0x37600000, 0x37610000, 0x37620000, 0x37630000, 0x37640000, 0x37650000, 0x37660000, 0x37670000, 0x37680000, 0x37690000, 0x376A0000, 0x376B0000, 0x376C0000, 0x376D0000, 0x376E0000, 0x376F0000,\n  0x37700000, 0x37710000, 0x37720000, 0x37730000, 0x37740000, 0x37750000, 0x37760000, 0x37770000, 0x37780000, 0x37790000, 0x377A00",
                   "00, 0x377B0000, 0x377C0000, 0x377D0000, 0x377E0000, 0x377F0000,\n  0x37800000, 0x37808000, 0x37810000, 0x37818000, 0x37820000, 0x37828000, 0x37830000, 0x37838000, 0x37840000, 0x37848000, 0x37850000, 0x37858000, 0x37860000, 0x37868000, 0x37870000, 0x37878000,\n  0x37880000, 0x37888000, 0x37890000, 0x37898000, 0x378A0000, 0x378A8000, 0x378B0000, 0x378B8000, 0x378C0000, 0x378C8000, 0x378D0000, 0x378D8000, 0x378E0000, 0x378E8000, 0x378F0000, 0x378F8000,\n  0x37900000, 0x37908000, 0x37910000, 0x37918000, 0x37920000, 0x37928000, 0x37930000, 0x37938000, 0x37940000, 0x37948000, 0x37950000, 0x37958000, 0x37960000, 0x37968000, 0x37970000, 0x37978000,\n  0x37980000, 0x37988000, 0x37990000, 0x37998000, 0x379A0000, 0x379A8000, 0x379B0000, 0x379B8000, 0x379C0000, 0x379C8000, 0x379D0000, 0x379D8000, 0x379E0000, 0x379E8000, 0x379F0000, 0x379F8000,\n  0x37A00000, 0x37A08000, 0x37A10000, 0x37A18000, 0x37A20000, 0x37A28000, 0x37A30000, 0x37A38000, 0x37A40000, 0x37A48000, 0x37A50000, 0x37A58000, 0x37A60000, 0x37A68000, 0x37A70000, 0x37A78000,\n  0x37A80000, 0x37A88000, 0x37A90000, 0x37A98000, 0x37AA0000, 0x37AA8000, 0x37AB0000, 0x37AB8000, 0x37AC0000, 0x37AC8000, 0x37AD0000, 0x37AD8000, 0x37AE0000, 0x37AE8000, 0x37AF0000, 0x37AF8000,\n  0x37B00000, 0x37B08000, 0x37B10000, 0x37B18000, 0x37B20000, 0x37B28000, 0x37B30000, 0x37B38000, 0x37B40000, 0x37B48000, 0x37B50000, 0x37B58000, 0x37B60000, 0x37B68000, 0x37B70000, 0x37B78000,\n  0x37B80000, 0x37B88000, 0x37B90000, 0x37B98000, 0x37BA0000, 0x37BA8000, 0x37BB0000, 0x37BB8000, 0x37BC0000, 0x37BC8000, 0x37BD0000, 0x37BD8000, 0x37BE0000, 0x37BE8000, 0x37BF0000, 0x37BF8000,\n  0x37C00000, 0x37C08000, 0x37C10000, 0x37C18000, 0x37C20000, 0x37C28000, 0x37C30000, 0x37C38000, 0x37C40000, 0x37C48000, 0x37C50000, 0x37C58000, 0x37C60000, 0x37C68000, 0x37C70000, 0x37C78000,\n  0x37C80000, 0x37C88000, 0x37C90000, 0x37C98000, 0x37CA0000, 0x37CA8000, 0x37CB0000, 0x37CB8000, 0x37CC0000, 0x37CC8000, 0x37CD0000, 0x37CD8000, 0x37CE0000, 0x37CE8000, 0x37CF0000, 0x37CF80",
                   "00,\n  0x37D00000, 0x37D08000, 0x37D10000, 0x37D18000, 0x37D20000, 0x37D28000, 0x37D30000, 0x37D38000, 0x37D40000, 0x37D48000, 0x37D50000, 0x37D58000, 0x37D60000, 0x37D68000, 0x37D70000, 0x37D78000,\n  0x37D80000, 0x37D88000, 0x37D90000, 0x37D98000, 0x37DA0000, 0x37DA8000, 0x37DB0000, 0x37DB8000, 0x37DC0000, 0x37DC8000, 0x37DD0000, 0x37DD8000, 0x37DE0000, 0x37DE8000, 0x37DF0000, 0x37DF8000,\n  0x37E00000, 0x37E08000, 0x37E10000, 0x37E18000, 0x37E20000, 0x37E28000, 0x37E30000, 0x37E38000, 0x37E40000, 0x37E48000, 0x37E50000, 0x37E58000, 0x37E60000, 0x37E68000, 0x37E70000, 0x37E78000,\n  0x37E80000, 0x37E88000, 0x37E90000, 0x37E98000, 0x37EA0000, 0x37EA8000, 0x37EB0000, 0x37EB8000, 0x37EC0000, 0x37EC8000, 0x37ED0000, 0x37ED8000, 0x37EE0000, 0x37EE8000, 0x37EF0000, 0x37EF8000,\n  0x37F00000, 0x37F08000, 0x37F10000, 0x37F18000, 0x37F20000, 0x37F28000, 0x37F30000, 0x37F38000, 0x37F40000, 0x37F48000, 0x37F50000, 0x37F58000, 0x37F60000, 0x37F68000, 0x37F70000, 0x37F78000,\n  0x37F80000, 0x37F88000, 0x37F90000, 0x37F98000, 0x37FA0000, 0x37FA8000, 0x37FB0000, 0x37FB8000, 0x37FC0000, 0x37FC8000, 0x37FD0000, 0x37FD8000, 0x37FE0000, 0x37FE8000, 0x37FF0000, 0x37FF8000,\n  0x38000000, 0x38004000, 0x38008000, 0x3800C000, 0x38010000, 0x38014000, 0x38018000, 0x3801C000, 0x38020000, 0x38024000, 0x38028000, 0x3802C000, 0x38030000, 0x38034000, 0x38038000, 0x3803C000,\n  0x38040000, 0x38044000, 0x38048000, 0x3804C000, 0x38050000, 0x38054000, 0x38058000, 0x3805C000, 0x38060000, 0x38064000, 0x38068000, 0x3806C000, 0x38070000, 0x38074000, 0x38078000, 0x3807C000,\n  0x38080000, 0x38084000, 0x38088000, 0x3808C000, 0x38090000, 0x38094000, 0x38098000, 0x3809C000, 0x380A0000, 0x380A4000, 0x380A8000, 0x380AC000, 0x380B0000, 0x380B4000, 0x380B8000, 0x380BC000,\n  0x380C0000, 0x380C4000, 0x380C8000, 0x380CC000, 0x380D0000, 0x380D4000, 0x380D8000, 0x380DC000, 0x380E0000, 0x380E4000, 0x380E8000, 0x380EC000, 0x380F0000, 0x380F4000, 0x380F8000, 0x380FC000,\n  0x38100000, 0x38104000, 0x38108000, 0x3810C000, 0x3811",
                   "0000, 0x38114000, 0x38118000, 0x3811C000, 0x38120000, 0x38124000, 0x38128000, 0x3812C000, 0x38130000, 0x38134000, 0x38138000, 0x3813C000,\n  0x38140000, 0x38144000, 0x38148000, 0x3814C000, 0x38150000, 0x38154000, 0x38158000, 0x3815C000, 0x38160000, 0x38164000, 0x38168000, 0x3816C000, 0x38170000, 0x38174000, 0x38178000, 0x3817C000,\n  0x38180000, 0x38184000, 0x38188000, 0x3818C000, 0x38190000, 0x38194000, 0x38198000, 0x3819C000, 0x381A0000, 0x381A4000, 0x381A8000, 0x381AC000, 0x381B0000, 0x381B4000, 0x381B8000, 0x381BC000,\n  0x381C0000, 0x381C4000, 0x381C8000, 0x381CC000, 0x381D0000, 0x381D4000, 0x381D8000, 0x381DC000, 0x381E0000, 0x381E4000, 0x381E8000, 0x381EC000, 0x381F0000, 0x381F4000, 0x381F8000, 0x381FC000,\n  0x38200000, 0x38204000, 0x38208000, 0x3820C000, 0x38210000, 0x38214000, 0x38218000, 0x3821C000, 0x38220000, 0x38224000, 0x38228000, 0x3822C000, 0x38230000, 0x38234000, 0x38238000, 0x3823C000,\n  0x38240000, 0x38244000, 0x38248000, 0x3824C000, 0x38250000, 0x38254000, 0x38258000, 0x3825C000, 0x38260000, 0x38264000, 0x38268000, 0x3826C000, 0x38270000, 0x38274000, 0x38278000, 0x3827C000,\n  0x38280000, 0x38284000, 0x38288000, 0x3828C000, 0x38290000, 0x38294000, 0x38298000, 0x3829C000, 0x382A0000, 0x382A4000, 0x382A8000, 0x382AC000, 0x382B0000, 0x382B4000, 0x382B8000, 0x382BC000,\n  0x382C0000, 0x382C4000, 0x382C8000, 0x382CC000, 0x382D0000, 0x382D4000, 0x382D8000, 0x382DC000, 0x382E0000, 0x382E4000, 0x382E8000, 0x382EC000, 0x382F0000, 0x382F4000, 0x382F8000, 0x382FC000,\n  0x38300000, 0x38304000, 0x38308000, 0x3830C000, 0x38310000, 0x38314000, 0x38318000, 0x3831C000, 0x38320000, 0x38324000, 0x38328000, 0x3832C000, 0x38330000, 0x38334000, 0x38338000, 0x3833C000,\n  0x38340000, 0x38344000, 0x38348000, 0x3834C000, 0x38350000, 0x38354000, 0x38358000, 0x3835C000, 0x38360000, 0x38364000, 0x38368000, 0x3836C000, 0x38370000, 0x38374000, 0x38378000, 0x3837C000,\n  0x38380000, 0x38384000, 0x38388000, 0x3838C000, 0x38390000, 0x38394000, 0x38398000, 0x3839C000, 0x383A0000, 0x383A",
                   "4000, 0x383A8000, 0x383AC000, 0x383B0000, 0x383B4000, 0x383B8000, 0x383BC000,\n  0x383C0000, 0x383C4000, 0x383C8000, 0x383CC000, 0x383D0000, 0x383D4000, 0x383D8000, 0x383DC000, 0x383E0000, 0x383E4000, 0x383E8000, 0x383EC000, 0x383F0000, 0x383F4000, 0x383F8000, 0x383FC000,\n  0x38400000, 0x38404000, 0x38408000, 0x3840C000, 0x38410000, 0x38414000, 0x38418000, 0x3841C000, 0x38420000, 0x38424000, 0x38428000, 0x3842C000, 0x38430000, 0x38434000, 0x38438000, 0x3843C000,\n  0x38440000, 0x38444000, 0x38448000, 0x3844C000, 0x38450000, 0x38454000, 0x38458000, 0x3845C000, 0x38460000, 0x38464000, 0x38468000, 0x3846C000, 0x38470000, 0x38474000, 0x38478000, 0x3847C000,\n  0x38480000, 0x38484000, 0x38488000, 0x3848C000, 0x38490000, 0x38494000, 0x38498000, 0x3849C000, 0x384A0000, 0x384A4000, 0x384A8000, 0x384AC000, 0x384B0000, 0x384B4000, 0x384B8000, 0x384BC000,\n  0x384C0000, 0x384C4000, 0x384C8000, 0x384CC000, 0x384D0000, 0x384D4000, 0x384D8000, 0x384DC000, 0x384E0000, 0x384E4000, 0x384E8000, 0x384EC000, 0x384F0000, 0x384F4000, 0x384F8000, 0x384FC000,\n  0x38500000, 0x38504000, 0x38508000, 0x3850C000, 0x38510000, 0x38514000, 0x38518000, 0x3851C000, 0x38520000, 0x38524000, 0x38528000, 0x3852C000, 0x38530000, 0x38534000, 0x38538000, 0x3853C000,\n  0x38540000, 0x38544000, 0x38548000, 0x3854C000, 0x38550000, 0x38554000, 0x38558000, 0x3855C000, 0x38560000, 0x38564000, 0x38568000, 0x3856C000, 0x38570000, 0x38574000, 0x38578000, 0x3857C000,\n  0x38580000, 0x38584000, 0x38588000, 0x3858C000, 0x38590000, 0x38594000, 0x38598000, 0x3859C000, 0x385A0000, 0x385A4000, 0x385A8000, 0x385AC000, 0x385B0000, 0x385B4000, 0x385B8000, 0x385BC000,\n  0x385C0000, 0x385C4000, 0x385C8000, 0x385CC000, 0x385D0000, 0x385D4000, 0x385D8000, 0x385DC000, 0x385E0000, 0x385E4000, 0x385E8000, 0x385EC000, 0x385F0000, 0x385F4000, 0x385F8000, 0x385FC000,\n  0x38600000, 0x38604000, 0x38608000, 0x3860C000, 0x38610000, 0x38614000, 0x38618000, 0x3861C000, 0x38620000, 0x38624000, 0x38628000, 0x3862C000, 0x38630000, 0x38634000, 0x3863",
                   "8000, 0x3863C000,\n  0x38640000, 0x38644000, 0x38648000, 0x3864C000, 0x38650000, 0x38654000, 0x38658000, 0x3865C000, 0x38660000, 0x38664000, 0x38668000, 0x3866C000, 0x38670000, 0x38674000, 0x38678000, 0x3867C000,\n  0x38680000, 0x38684000, 0x38688000, 0x3868C000, 0x38690000, 0x38694000, 0x38698000, 0x3869C000, 0x386A0000, 0x386A4000, 0x386A8000, 0x386AC000, 0x386B0000, 0x386B4000, 0x386B8000, 0x386BC000,\n  0x386C0000, 0x386C4000, 0x386C8000, 0x386CC000, 0x386D0000, 0x386D4000, 0x386D8000, 0x386DC000, 0x386E0000, 0x386E4000, 0x386E8000, 0x386EC000, 0x386F0000, 0x386F4000, 0x386F8000, 0x386FC000,\n  0x38700000, 0x38704000, 0x38708000, 0x3870C000, 0x38710000, 0x38714000, 0x38718000, 0x3871C000, 0x38720000, 0x38724000, 0x38728000, 0x3872C000, 0x38730000, 0x38734000, 0x38738000, 0x3873C000,\n  0x38740000, 0x38744000, 0x38748000, 0x3874C000, 0x38750000, 0x38754000, 0x38758000, 0x3875C000, 0x38760000, 0x38764000, 0x38768000, 0x3876C000, 0x38770000, 0x38774000, 0x38778000, 0x3877C000,\n  0x38780000, 0x38784000, 0x38788000, 0x3878C000, 0x38790000, 0x38794000, 0x38798000, 0x3879C000, 0x387A0000, 0x387A4000, 0x387A8000, 0x387AC000, 0x387B0000, 0x387B4000, 0x387B8000, 0x387BC000,\n  0x387C0000, 0x387C4000, 0x387C8000, 0x387CC000, 0x387D0000, 0x387D4000, 0x387D8000, 0x387DC000, 0x387E0000, 0x387E4000, 0x387E8000, 0x387EC000, 0x387F0000, 0x387F4000, 0x387F8000, 0x387FC000,\n  0x38000000, 0x38002000, 0x38004000, 0x38006000, 0x38008000, 0x3800A000, 0x3800C000, 0x3800E000, 0x38010000, 0x38012000, 0x38014000, 0x38016000, 0x38018000, 0x3801A000, 0x3801C000, 0x3801E000,\n  0x38020000, 0x38022000, 0x38024000, 0x38026000, 0x38028000, 0x3802A000, 0x3802C000, 0x3802E000, 0x38030000, 0x38032000, 0x38034000, 0x38036000, 0x38038000, 0x3803A000, 0x3803C000, 0x3803E000,\n  0x38040000, 0x38042000, 0x38044000, 0x38046000, 0x38048000, 0x3804A000, 0x3804C000, 0x3804E000, 0x38050000, 0x38052000, 0x38054000, 0x38056000, 0x38058000, 0x3805A000, 0x3805C000, 0x3805E000,\n  0x38060000, 0x38062000, 0x38064000, 0x38",
                   "066000, 0x38068000, 0x3806A000, 0x3806C000, 0x3806E000, 0x38070000, 0x38072000, 0x38074000, 0x38076000, 0x38078000, 0x3807A000, 0x3807C000, 0x3807E000,\n  0x38080000, 0x38082000, 0x38084000, 0x38086000, 0x38088000, 0x3808A000, 0x3808C000, 0x3808E000, 0x38090000, 0x38092000, 0x38094000, 0x38096000, 0x38098000, 0x3809A000, 0x3809C000, 0x3809E000,\n  0x380A0000, 0x380A2000, 0x380A4000, 0x380A6000, 0x380A8000, 0x380AA000, 0x380AC000, 0x380AE000, 0x380B0000, 0x380B2000, 0x380B4000, 0x380B6000, 0x380B8000, 0x380BA000, 0x380BC000, 0x380BE000,\n  0x380C0000, 0x380C2000, 0x380C4000, 0x380C6000, 0x380C8000, 0x380CA000, 0x380CC000, 0x380CE000, 0x380D0000, 0x380D2000, 0x380D4000, 0x380D6000, 0x380D8000, 0x380DA000, 0x380DC000, 0x380DE000,\n  0x380E0000, 0x380E2000, 0x380E4000, 0x380E6000, 0x380E8000, 0x380EA000, 0x380EC000, 0x380EE000, 0x380F0000, 0x380F2000, 0x380F4000, 0x380F6000, 0x380F8000, 0x380FA000, 0x380FC000, 0x380FE000,\n  0x38100000, 0x38102000, 0x38104000, 0x38106000, 0x38108000, 0x3810A000, 0x3810C000, 0x3810E000, 0x38110000, 0x38112000, 0x38114000, 0x38116000, 0x38118000, 0x3811A000, 0x3811C000, 0x3811E000,\n  0x38120000, 0x38122000, 0x38124000, 0x38126000, 0x38128000, 0x3812A000, 0x3812C000, 0x3812E000, 0x38130000, 0x38132000, 0x38134000, 0x38136000, 0x38138000, 0x3813A000, 0x3813C000, 0x3813E000,\n  0x38140000, 0x38142000, 0x38144000, 0x38146000, 0x38148000, 0x3814A000, 0x3814C000, 0x3814E000, 0x38150000, 0x38152000, 0x38154000, 0x38156000, 0x38158000, 0x3815A000, 0x3815C000, 0x3815E000,\n  0x38160000, 0x38162000, 0x38164000, 0x38166000, 0x38168000, 0x3816A000, 0x3816C000, 0x3816E000, 0x38170000, 0x38172000, 0x38174000, 0x38176000, 0x38178000, 0x3817A000, 0x3817C000, 0x3817E000,\n  0x38180000, 0x38182000, 0x38184000, 0x38186000, 0x38188000, 0x3818A000, 0x3818C000, 0x3818E000, 0x38190000, 0x38192000, 0x38194000, 0x38196000, 0x38198000, 0x3819A000, 0x3819C000, 0x3819E000,\n  0x381A0000, 0x381A2000, 0x381A4000, 0x381A6000, 0x381A8000, 0x381AA000, 0x381AC000, 0x381AE000, 0x38",
                   "1B0000, 0x381B2000, 0x381B4000, 0x381B6000, 0x381B8000, 0x381BA000, 0x381BC000, 0x381BE000,\n  0x381C0000, 0x381C2000, 0x381C4000, 0x381C6000, 0x381C8000, 0x381CA000, 0x381CC000, 0x381CE000, 0x381D0000, 0x381D2000, 0x381D4000, 0x381D6000, 0x381D8000, 0x381DA000, 0x381DC000, 0x381DE000,\n  0x381E0000, 0x381E2000, 0x381E4000, 0x381E6000, 0x381E8000, 0x381EA000, 0x381EC000, 0x381EE000, 0x381F0000, 0x381F2000, 0x381F4000, 0x381F6000, 0x381F8000, 0x381FA000, 0x381FC000, 0x381FE000,\n  0x38200000, 0x38202000, 0x38204000, 0x38206000, 0x38208000, 0x3820A000, 0x3820C000, 0x3820E000, 0x38210000, 0x38212000, 0x38214000, 0x38216000, 0x38218000, 0x3821A000, 0x3821C000, 0x3821E000,\n  0x38220000, 0x38222000, 0x38224000, 0x38226000, 0x38228000, 0x3822A000, 0x3822C000, 0x3822E000, 0x38230000, 0x38232000, 0x38234000, 0x38236000, 0x38238000, 0x3823A000, 0x3823C000, 0x3823E000,\n  0x38240000, 0x38242000, 0x38244000, 0x38246000, 0x38248000, 0x3824A000, 0x3824C000, 0x3824E000, 0x38250000, 0x38252000, 0x38254000, 0x38256000, 0x38258000, 0x3825A000, 0x3825C000, 0x3825E000,\n  0x38260000, 0x38262000, 0x38264000, 0x38266000, 0x38268000, 0x3826A000, 0x3826C000, 0x3826E000, 0x38270000, 0x38272000, 0x38274000, 0x38276000, 0x38278000, 0x3827A000, 0x3827C000, 0x3827E000,\n  0x38280000, 0x38282000, 0x38284000, 0x38286000, 0x38288000, 0x3828A000, 0x3828C000, 0x3828E000, 0x38290000, 0x38292000, 0x38294000, 0x38296000, 0x38298000, 0x3829A000, 0x3829C000, 0x3829E000,\n  0x382A0000, 0x382A2000, 0x382A4000, 0x382A6000, 0x382A8000, 0x382AA000, 0x382AC000, 0x382AE000, 0x382B0000, 0x382B2000, 0x382B4000, 0x382B6000, 0x382B8000, 0x382BA000, 0x382BC000, 0x382BE000,\n  0x382C0000, 0x382C2000, 0x382C4000, 0x382C6000, 0x382C8000, 0x382CA000, 0x382CC000, 0x382CE000, 0x382D0000, 0x382D2000, 0x382D4000, 0x382D6000, 0x382D8000, 0x382DA000, 0x382DC000, 0x382DE000,\n  0x382E0000, 0x382E2000, 0x382E4000, 0x382E6000, 0x382E8000, 0x382EA000, 0x382EC000, 0x382EE000, 0x382F0000, 0x382F2000, 0x382F4000, 0x382F6000, 0x382F8000, 0x38",
                   "2FA000, 0x382FC000, 0x382FE000,\n  0x38300000, 0x38302000, 0x38304000, 0x38306000, 0x38308000, 0x3830A000, 0x3830C000, 0x3830E000, 0x38310000, 0x38312000, 0x38314000, 0x38316000, 0x38318000, 0x3831A000, 0x3831C000, 0x3831E000,\n  0x38320000, 0x38322000, 0x38324000, 0x38326000, 0x38328000, 0x3832A000, 0x3832C000, 0x3832E000, 0x38330000, 0x38332000, 0x38334000, 0x38336000, 0x38338000, 0x3833A000, 0x3833C000, 0x3833E000,\n  0x38340000, 0x38342000, 0x38344000, 0x38346000, 0x38348000, 0x3834A000, 0x3834C000, 0x3834E000, 0x38350000, 0x38352000, 0x38354000, 0x38356000, 0x38358000, 0x3835A000, 0x3835C000, 0x3835E000,\n  0x38360000, 0x38362000, 0x38364000, 0x38366000, 0x38368000, 0x3836A000, 0x3836C000, 0x3836E000, 0x38370000, 0x38372000, 0x38374000, 0x38376000, 0x38378000, 0x3837A000, 0x3837C000, 0x3837E000,\n  0x38380000, 0x38382000, 0x38384000, 0x38386000, 0x38388000, 0x3838A000, 0x3838C000, 0x3838E000, 0x38390000, 0x38392000, 0x38394000, 0x38396000, 0x38398000, 0x3839A000, 0x3839C000, 0x3839E000,\n  0x383A0000, 0x383A2000, 0x383A4000, 0x383A6000, 0x383A8000, 0x383AA000, 0x383AC000, 0x383AE000, 0x383B0000, 0x383B2000, 0x383B4000, 0x383B6000, 0x383B8000, 0x383BA000, 0x383BC000, 0x383BE000,\n  0x383C0000, 0x383C2000, 0x383C4000, 0x383C6000, 0x383C8000, 0x383CA000, 0x383CC000, 0x383CE000, 0x383D0000, 0x383D2000, 0x383D4000, 0x383D6000, 0x383D8000, 0x383DA000, 0x383DC000, 0x383DE000,\n  0x383E0000, 0x383E2000, 0x383E4000, 0x383E6000, 0x383E8000, 0x383EA000, 0x383EC000, 0x383EE000, 0x383F0000, 0x383F2000, 0x383F4000, 0x383F6000, 0x383F8000, 0x383FA000, 0x383FC000, 0x383FE000,\n  0x38400000, 0x38402000, 0x38404000, 0x38406000, 0x38408000, 0x3840A000, 0x3840C000, 0x3840E000, 0x38410000, 0x38412000, 0x38414000, 0x38416000, 0x38418000, 0x3841A000, 0x3841C000, 0x3841E000,\n  0x38420000, 0x38422000, 0x38424000, 0x38426000, 0x38428000, 0x3842A000, 0x3842C000, 0x3842E000, 0x38430000, 0x38432000, 0x38434000, 0x38436000, 0x38438000, 0x3843A000, 0x3843C000, 0x3843E000,\n  0x38440000, 0x38442000, 0x",
                   "38444000, 0x38446000, 0x38448000, 0x3844A000, 0x3844C000, 0x3844E000, 0x38450000, 0x38452000, 0x38454000, 0x38456000, 0x38458000, 0x3845A000, 0x3845C000, 0x3845E000,\n  0x38460000, 0x38462000, 0x38464000, 0x38466000, 0x38468000, 0x3846A000, 0x3846C000, 0x3846E000, 0x38470000, 0x38472000, 0x38474000, 0x38476000, 0x38478000, 0x3847A000, 0x3847C000, 0x3847E000,\n  0x38480000, 0x38482000, 0x38484000, 0x38486000, 0x38488000, 0x3848A000, 0x3848C000, 0x3848E000, 0x38490000, 0x38492000, 0x38494000, 0x38496000, 0x38498000, 0x3849A000, 0x3849C000, 0x3849E000,\n  0x384A0000, 0x384A2000, 0x384A4000, 0x384A6000, 0x384A8000, 0x384AA000, 0x384AC000, 0x384AE000, 0x384B0000, 0x384B2000, 0x384B4000, 0x384B6000, 0x384B8000, 0x384BA000, 0x384BC000, 0x384BE000,\n  0x384C0000, 0x384C2000, 0x384C4000, 0x384C6000, 0x384C8000, 0x384CA000, 0x384CC000, 0x384CE000, 0x384D0000, 0x384D2000, 0x384D4000, 0x384D6000, 0x384D8000, 0x384DA000, 0x384DC000, 0x384DE000,\n  0x384E0000, 0x384E2000, 0x384E4000, 0x384E6000, 0x384E8000, 0x384EA000, 0x384EC000, 0x384EE000, 0x384F0000, 0x384F2000, 0x384F4000, 0x384F6000, 0x384F8000, 0x384FA000, 0x384FC000, 0x384FE000,\n  0x38500000, 0x38502000, 0x38504000, 0x38506000, 0x38508000, 0x3850A000, 0x3850C000, 0x3850E000, 0x38510000, 0x38512000, 0x38514000, 0x38516000, 0x38518000, 0x3851A000, 0x3851C000, 0x3851E000,\n  0x38520000, 0x38522000, 0x38524000, 0x38526000, 0x38528000, 0x3852A000, 0x3852C000, 0x3852E000, 0x38530000, 0x38532000, 0x38534000, 0x38536000, 0x38538000, 0x3853A000, 0x3853C000, 0x3853E000,\n  0x38540000, 0x38542000, 0x38544000, 0x38546000, 0x38548000, 0x3854A000, 0x3854C000, 0x3854E000, 0x38550000, 0x38552000, 0x38554000, 0x38556000, 0x38558000, 0x3855A000, 0x3855C000, 0x3855E000,\n  0x38560000, 0x38562000, 0x38564000, 0x38566000, 0x38568000, 0x3856A000, 0x3856C000, 0x3856E000, 0x38570000, 0x38572000, 0x38574000, 0x38576000, 0x38578000, 0x3857A000, 0x3857C000, 0x3857E000,\n  0x38580000, 0x38582000, 0x38584000, 0x38586000, 0x38588000, 0x3858A000, 0x3858C000, 0x",
                   "3858E000, 0x38590000, 0x38592000, 0x38594000, 0x38596000, 0x38598000, 0x3859A000, 0x3859C000, 0x3859E000,\n  0x385A0000, 0x385A2000, 0x385A4000, 0x385A6000, 0x385A8000, 0x385AA000, 0x385AC000, 0x385AE000, 0x385B0000, 0x385B2000, 0x385B4000, 0x385B6000, 0x385B8000, 0x385BA000, 0x385BC000, 0x385BE000,\n  0x385C0000, 0x385C2000, 0x385C4000, 0x385C6000, 0x385C8000, 0x385CA000, 0x385CC000, 0x385CE000, 0x385D0000, 0x385D2000, 0x385D4000, 0x385D6000, 0x385D8000, 0x385DA000, 0x385DC000, 0x385DE000,\n  0x385E0000, 0x385E2000, 0x385E4000, 0x385E6000, 0x385E8000, 0x385EA000, 0x385EC000, 0x385EE000, 0x385F0000, 0x385F2000, 0x385F4000, 0x385F6000, 0x385F8000, 0x385FA000, 0x385FC000, 0x385FE000,\n  0x38600000, 0x38602000, 0x38604000, 0x38606000, 0x38608000, 0x3860A000, 0x3860C000, 0x3860E000, 0x38610000, 0x38612000, 0x38614000, 0x38616000, 0x38618000, 0x3861A000, 0x3861C000, 0x3861E000,\n  0x38620000, 0x38622000, 0x38624000, 0x38626000, 0x38628000, 0x3862A000, 0x3862C000, 0x3862E000, 0x38630000, 0x38632000, 0x38634000, 0x38636000, 0x38638000, 0x3863A000, 0x3863C000, 0x3863E000,\n  0x38640000, 0x38642000, 0x38644000, 0x38646000, 0x38648000, 0x3864A000, 0x3864C000, 0x3864E000, 0x38650000, 0x38652000, 0x38654000, 0x38656000, 0x38658000, 0x3865A000, 0x3865C000, 0x3865E000,\n  0x38660000, 0x38662000, 0x38664000, 0x38666000, 0x38668000, 0x3866A000, 0x3866C000, 0x3866E000, 0x38670000, 0x38672000, 0x38674000, 0x38676000, 0x38678000, 0x3867A000, 0x3867C000, 0x3867E000,\n  0x38680000, 0x38682000, 0x38684000, 0x38686000, 0x38688000, 0x3868A000, 0x3868C000, 0x3868E000, 0x38690000, 0x38692000, 0x38694000, 0x38696000, 0x38698000, 0x3869A000, 0x3869C000, 0x3869E000,\n  0x386A0000, 0x386A2000, 0x386A4000, 0x386A6000, 0x386A8000, 0x386AA000, 0x386AC000, 0x386AE000, 0x386B0000, 0x386B2000, 0x386B4000, 0x386B6000, 0x386B8000, 0x386BA000, 0x386BC000, 0x386BE000,\n  0x386C0000, 0x386C2000, 0x386C4000, 0x386C6000, 0x386C8000, 0x386CA000, 0x386CC000, 0x386CE000, 0x386D0000, 0x386D2000, 0x386D4000, 0x386D6000, 0x",
                   "386D8000, 0x386DA000, 0x386DC000, 0x386DE000,\n  0x386E0000, 0x386E2000, 0x386E4000, 0x386E6000, 0x386E8000, 0x386EA000, 0x386EC000, 0x386EE000, 0x386F0000, 0x386F2000, 0x386F4000, 0x386F6000, 0x386F8000, 0x386FA000, 0x386FC000, 0x386FE000,\n  0x38700000, 0x38702000, 0x38704000, 0x38706000, 0x38708000, 0x3870A000, 0x3870C000, 0x3870E000, 0x38710000, 0x38712000, 0x38714000, 0x38716000, 0x38718000, 0x3871A000, 0x3871C000, 0x3871E000,\n  0x38720000, 0x38722000, 0x38724000, 0x38726000, 0x38728000, 0x3872A000, 0x3872C000, 0x3872E000, 0x38730000, 0x38732000, 0x38734000, 0x38736000, 0x38738000, 0x3873A000, 0x3873C000, 0x3873E000,\n  0x38740000, 0x38742000, 0x38744000, 0x38746000, 0x38748000, 0x3874A000, 0x3874C000, 0x3874E000, 0x38750000, 0x38752000, 0x38754000, 0x38756000, 0x38758000, 0x3875A000, 0x3875C000, 0x3875E000,\n  0x38760000, 0x38762000, 0x38764000, 0x38766000, 0x38768000, 0x3876A000, 0x3876C000, 0x3876E000, 0x38770000, 0x38772000, 0x38774000, 0x38776000, 0x38778000, 0x3877A000, 0x3877C000, 0x3877E000,\n  0x38780000, 0x38782000, 0x38784000, 0x38786000, 0x38788000, 0x3878A000, 0x3878C000, 0x3878E000, 0x38790000, 0x38792000, 0x38794000, 0x38796000, 0x38798000, 0x3879A000, 0x3879C000, 0x3879E000,\n  0x387A0000, 0x387A2000, 0x387A4000, 0x387A6000, 0x387A8000, 0x387AA000, 0x387AC000, 0x387AE000, 0x387B0000, 0x387B2000, 0x387B4000, 0x387B6000, 0x387B8000, 0x387BA000, 0x387BC000, 0x387BE000,\n  0x387C0000, 0x387C2000, 0x387C4000, 0x387C6000, 0x387C8000, 0x387CA000, 0x387CC000, 0x387CE000, 0x387D0000, 0x387D2000, 0x387D4000, 0x387D6000, 0x387D8000, 0x387DA000, 0x387DC000, 0x387DE000,\n  0x387E0000, 0x387E2000, 0x387E4000, 0x387E6000, 0x387E8000, 0x387EA000, 0x387EC000, 0x387EE000, 0x387F0000, 0x387F2000, 0x387F4000, 0x387F6000, 0x387F8000, 0x387FA000, 0x387FC000, 0x387FE000 };\n__constant static const uint32_t exponent_table[64] = {\n  0x00000000, 0x00800000, 0x01000000, 0x01800000, 0x02000000, 0x02800000, 0x03000000, 0x03800000, 0x04000000, 0x04800000, 0x05000000, 0x05800000, 0x06",
                   "000000, 0x06800000, 0x07000000, 0x07800000,\n  0x08000000, 0x08800000, 0x09000000, 0x09800000, 0x0A000000, 0x0A800000, 0x0B000000, 0x0B800000, 0x0C000000, 0x0C800000, 0x0D000000, 0x0D800000, 0x0E000000, 0x0E800000, 0x0F000000, 0x47800000,\n  0x80000000, 0x80800000, 0x81000000, 0x81800000, 0x82000000, 0x82800000, 0x83000000, 0x83800000, 0x84000000, 0x84800000, 0x85000000, 0x85800000, 0x86000000, 0x86800000, 0x87000000, 0x87800000,\n  0x88000000, 0x88800000, 0x89000000, 0x89800000, 0x8A000000, 0x8A800000, 0x8B000000, 0x8B800000, 0x8C000000, 0x8C800000, 0x8D000000, 0x8D800000, 0x8E000000, 0x8E800000, 0x8F000000, 0xC7800000 };\n__constant static const unsigned short offset_table[64] = {\n  0, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024,\n  0, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024 };\n\nstatic uint16_t float2halfbits(float value) {\n  union { float x; uint32_t y; } u;\n  u.x = value;\n  uint32_t bits = u.y;\n\n  uint16_t hbits = base_table[bits>>23] + (uint16_t)((bits&0x7FFFFF)>>shift_table[bits>>23]);;\n\n  return hbits;\n}\n\nstatic float halfbits2float(uint16_t value) {\n  uint32_t bits = mantissa_table[offset_table[value>>10]+(value&0x3FF)] + exponent_table[value>>10];\n\n  union { uint32_t x; float y; } u;\n  u.x = bits;\n  return u.y;\n}\n\n// End of half.h.\n// Start of scalar.h.\n\n// Implementation of the primitive scalar operations.  Very\n// repetitive.  This code is inserted directly into both CUDA and\n// OpenCL programs, as well as the CPU code, so it has some #ifdefs to\n// work everywhere.  Some operations are defined as macros because\n// this allows us to use them as constant expressions in things like\n// array sizes and static initialisers.\n\n// Some of the #ifdefs are because OpenCL uses type-generic f",
                   "unctions\n// for some operations (e.g. sqrt), while C and CUDA sensibly use\n// distinct functions for different precisions (e.g. sqrtf() and\n// sqrt()).  This is quite annoying.  Due to C's unfortunate casting\n// rules, it is also really easy to accidentally implement\n// floating-point functions in the wrong precision, so be careful.\n\n// Double-precision definitions are only included if the preprocessor\n// macro FUTHARK_F64_ENABLED is set.\n\nstatic inline uint8_t add8(uint8_t x, uint8_t y) {\n  return x + y;\n}\n\nstatic inline uint16_t add16(uint16_t x, uint16_t y) {\n  return x + y;\n}\n\nstatic inline uint32_t add32(uint32_t x, uint32_t y) {\n  return x + y;\n}\n\nstatic inline uint64_t add64(uint64_t x, uint64_t y) {\n  return x + y;\n}\n\nstatic inline uint8_t sub8(uint8_t x, uint8_t y) {\n  return x - y;\n}\n\nstatic inline uint16_t sub16(uint16_t x, uint16_t y) {\n  return x - y;\n}\n\nstatic inline uint32_t sub32(uint32_t x, uint32_t y) {\n  return x - y;\n}\n\nstatic inline uint64_t sub64(uint64_t x, uint64_t y) {\n  return x - y;\n}\n\nstatic inline uint8_t mul8(uint8_t x, uint8_t y) {\n  return x * y;\n}\n\nstatic inline uint16_t mul16(uint16_t x, uint16_t y) {\n  return x * y;\n}\n\nstatic inline uint32_t mul32(uint32_t x, uint32_t y) {\n  return x * y;\n}\n\nstatic inline uint64_t mul64(uint64_t x, uint64_t y) {\n  return x * y;\n}\n\nstatic inline uint8_t udiv8(uint8_t x, uint8_t y) {\n  return x / y;\n}\n\nstatic inline uint16_t udiv16(uint16_t x, uint16_t y) {\n  return x / y;\n}\n\nstatic inline uint32_t udiv32(uint32_t x, uint32_t y) {\n  return x / y;\n}\n\nstatic inline uint64_t udiv64(uint64_t x, uint64_t y) {\n  return x / y;\n}\n\nstatic inline uint8_t udiv_up8(uint8_t x, uint8_t y) {\n  return (x + y - 1) / y;\n}\n\nstatic inline uint16_t udiv_up16(uint16_t x, uint16_t y) {\n  return (x + y - 1) / y;\n}\n\nstatic inline uint32_t udiv_up32(uint32_t x, uint32_t y) {\n  return (x + y - 1) / y;\n}\n\nstatic inline uint64_t udiv_up64(uint64_t x, uint64_t y) {\n  return (x + y - 1) / y;\n}\n\nstatic inline uint8_t umod8(uint8_t ",
                   "x, uint8_t y) {\n  return x % y;\n}\n\nstatic inline uint16_t umod16(uint16_t x, uint16_t y) {\n  return x % y;\n}\n\nstatic inline uint32_t umod32(uint32_t x, uint32_t y) {\n  return x % y;\n}\n\nstatic inline uint64_t umod64(uint64_t x, uint64_t y) {\n  return x % y;\n}\n\nstatic inline uint8_t udiv_safe8(uint8_t x, uint8_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline uint16_t udiv_safe16(uint16_t x, uint16_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline uint32_t udiv_safe32(uint32_t x, uint32_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline uint64_t udiv_safe64(uint64_t x, uint64_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline uint8_t udiv_up_safe8(uint8_t x, uint8_t y) {\n  return y == 0 ? 0 : (x + y - 1) / y;\n}\n\nstatic inline uint16_t udiv_up_safe16(uint16_t x, uint16_t y) {\n  return y == 0 ? 0 : (x + y - 1) / y;\n}\n\nstatic inline uint32_t udiv_up_safe32(uint32_t x, uint32_t y) {\n  return y == 0 ? 0 : (x + y - 1) / y;\n}\n\nstatic inline uint64_t udiv_up_safe64(uint64_t x, uint64_t y) {\n  return y == 0 ? 0 : (x + y - 1) / y;\n}\n\nstatic inline uint8_t umod_safe8(uint8_t x, uint8_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline uint16_t umod_safe16(uint16_t x, uint16_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline uint32_t umod_safe32(uint32_t x, uint32_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline uint64_t umod_safe64(uint64_t x, uint64_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline int8_t sdiv8(int8_t x, int8_t y) {\n  int8_t q = x / y;\n  int8_t r = x % y;\n\n  return q - ((r != 0 && r < 0 != y < 0) ? 1 : 0);\n}\n\nstatic inline int16_t sdiv16(int16_t x, int16_t y) {\n  int16_t q = x / y;\n  int16_t r = x % y;\n\n  return q - ((r != 0 && r < 0 != y < 0) ? 1 : 0);\n}\n\nstatic inline int32_t sdiv32(int32_t x, int32_t y) {\n  int32_t q = x / y;\n  int32_t r = x % y;\n\n  return q - ((r != 0 && r < 0 != y < 0) ? 1 : 0);\n}\n\nstatic inline int64_t sdiv64(int64_t x, int64_t y) {\n  int64_t q = x / y;\n  int64_t r = x % y;\n\n  return q - ((r != 0 && r < 0 != y < 0) ? 1",
                   " : 0);\n}\n\nstatic inline int8_t sdiv_up8(int8_t x, int8_t y) {\n  return sdiv8(x + y - 1, y);\n}\n\nstatic inline int16_t sdiv_up16(int16_t x, int16_t y) {\n  return sdiv16(x + y - 1, y);\n}\n\nstatic inline int32_t sdiv_up32(int32_t x, int32_t y) {\n  return sdiv32(x + y - 1, y);\n}\n\nstatic inline int64_t sdiv_up64(int64_t x, int64_t y) {\n  return sdiv64(x + y - 1, y);\n}\n\nstatic inline int8_t smod8(int8_t x, int8_t y) {\n  int8_t r = x % y;\n\n  return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);\n}\n\nstatic inline int16_t smod16(int16_t x, int16_t y) {\n  int16_t r = x % y;\n\n  return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);\n}\n\nstatic inline int32_t smod32(int32_t x, int32_t y) {\n  int32_t r = x % y;\n\n  return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);\n}\n\nstatic inline int64_t smod64(int64_t x, int64_t y) {\n  int64_t r = x % y;\n\n  return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);\n}\n\nstatic inline int8_t sdiv_safe8(int8_t x, int8_t y) {\n  return y == 0 ? 0 : sdiv8(x, y);\n}\n\nstatic inline int16_t sdiv_safe16(int16_t x, int16_t y) {\n  return y == 0 ? 0 : sdiv16(x, y);\n}\n\nstatic inline int32_t sdiv_safe32(int32_t x, int32_t y) {\n  return y == 0 ? 0 : sdiv32(x, y);\n}\n\nstatic inline int64_t sdiv_safe64(int64_t x, int64_t y) {\n  return y == 0 ? 0 : sdiv64(x, y);\n}\n\nstatic inline int8_t sdiv_up_safe8(int8_t x, int8_t y) {\n  return sdiv_safe8(x + y - 1, y);\n}\n\nstatic inline int16_t sdiv_up_safe16(int16_t x, int16_t y) {\n  return sdiv_safe16(x + y - 1, y);\n}\n\nstatic inline int32_t sdiv_up_safe32(int32_t x, int32_t y) {\n  return sdiv_safe32(x + y - 1, y);\n}\n\nstatic inline int64_t sdiv_up_safe64(int64_t x, int64_t y) {\n  return sdiv_safe64(x + y - 1, y);\n}\n\nstatic inline int8_t smod_safe8(int8_t x, int8_t y) {\n  return y == 0 ? 0 : smod8(x, y);\n}\n\nstatic inline int16_t smod_safe16(int16_t x, int16_t y) {\n  return y == 0 ? 0 : smod16(x, y);\n}\n\nstatic inline int32_t smod_safe32(int32_t x, int32_t y) {\n  return y == 0 ? 0",
                   " : smod32(x, y);\n}\n\nstatic inline int64_t smod_safe64(int64_t x, int64_t y) {\n  return y == 0 ? 0 : smod64(x, y);\n}\n\nstatic inline int8_t squot8(int8_t x, int8_t y) {\n  return x / y;\n}\n\nstatic inline int16_t squot16(int16_t x, int16_t y) {\n  return x / y;\n}\n\nstatic inline int32_t squot32(int32_t x, int32_t y) {\n  return x / y;\n}\n\nstatic inline int64_t squot64(int64_t x, int64_t y) {\n  return x / y;\n}\n\nstatic inline int8_t srem8(int8_t x, int8_t y) {\n  return x % y;\n}\n\nstatic inline int16_t srem16(int16_t x, int16_t y) {\n  return x % y;\n}\n\nstatic inline int32_t srem32(int32_t x, int32_t y) {\n  return x % y;\n}\n\nstatic inline int64_t srem64(int64_t x, int64_t y) {\n  return x % y;\n}\n\nstatic inline int8_t squot_safe8(int8_t x, int8_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline int16_t squot_safe16(int16_t x, int16_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline int32_t squot_safe32(int32_t x, int32_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline int64_t squot_safe64(int64_t x, int64_t y) {\n  return y == 0 ? 0 : x / y;\n}\n\nstatic inline int8_t srem_safe8(int8_t x, int8_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline int16_t srem_safe16(int16_t x, int16_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline int32_t srem_safe32(int32_t x, int32_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline int64_t srem_safe64(int64_t x, int64_t y) {\n  return y == 0 ? 0 : x % y;\n}\n\nstatic inline int8_t smin8(int8_t x, int8_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline int16_t smin16(int16_t x, int16_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline int32_t smin32(int32_t x, int32_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline int64_t smin64(int64_t x, int64_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline uint8_t umin8(uint8_t x, uint8_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline uint16_t umin16(uint16_t x, uint16_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline uint32_t umin32(uint32_t x, uint32_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline uint64_t umin64(uint",
                   "64_t x, uint64_t y) {\n  return x < y ? x : y;\n}\n\nstatic inline int8_t smax8(int8_t x, int8_t y) {\n  return x < y ? y : x;\n}\n\nstatic inline int16_t smax16(int16_t x, int16_t y) {\n  return x < y ? y : x;\n}\n\nstatic inline int32_t smax32(int32_t x, int32_t y) {\n  return x < y ? y : x;\n}\n\nstatic inline int64_t smax64(int64_t x, int64_t y) {\n  return x < y ? y : x;\n}\n\nstatic inline uint8_t umax8(uint8_t x, uint8_t y) {\n  return x < y ? y : x;\n}\n\nstatic inline uint16_t umax16(uint16_t x, uint16_t y) {\n  return x < y ? y : x;\n}\n\nstatic inline uint32_t umax32(uint32_t x, uint32_t y) {\n  return x < y ? y : x;\n}\n\nstatic inline uint64_t umax64(uint64_t x, uint64_t y) {\n  return x < y ? y : x;\n}\n\nstatic inline uint8_t shl8(uint8_t x, uint8_t y) {\n  return (uint8_t)(x << y);\n}\n\nstatic inline uint16_t shl16(uint16_t x, uint16_t y) {\n  return (uint16_t)(x << y);\n}\n\nstatic inline uint32_t shl32(uint32_t x, uint32_t y) {\n  return x << y;\n}\n\nstatic inline uint64_t shl64(uint64_t x, uint64_t y) {\n  return x << y;\n}\n\nstatic inline uint8_t lshr8(uint8_t x, uint8_t y) {\n  return x >> y;\n}\n\nstatic inline uint16_t lshr16(uint16_t x, uint16_t y) {\n  return x >> y;\n}\n\nstatic inline uint32_t lshr32(uint32_t x, uint32_t y) {\n  return x >> y;\n}\n\nstatic inline uint64_t lshr64(uint64_t x, uint64_t y) {\n  return x >> y;\n}\n\nstatic inline int8_t ashr8(int8_t x, int8_t y) {\n  return x >> y;\n}\n\nstatic inline int16_t ashr16(int16_t x, int16_t y) {\n  return x >> y;\n}\n\nstatic inline int32_t ashr32(int32_t x, int32_t y) {\n  return x >> y;\n}\n\nstatic inline int64_t ashr64(int64_t x, int64_t y) {\n  return x >> y;\n}\n\nstatic inline uint8_t and8(uint8_t x, uint8_t y) {\n  return x & y;\n}\n\nstatic inline uint16_t and16(uint16_t x, uint16_t y) {\n  return x & y;\n}\n\nstatic inline uint32_t and32(uint32_t x, uint32_t y) {\n  return x & y;\n}\n\nstatic inline uint64_t and64(uint64_t x, uint64_t y) {\n  return x & y;\n}\n\nstatic inline uint8_t or8(uint8_t x, uint8_t y) {\n  return x | y;\n}\n\nstatic inline uint16_t or16(uint16_t x,",
                   " uint16_t y) {\n  return x | y;\n}\n\nstatic inline uint32_t or32(uint32_t x, uint32_t y) {\n  return x | y;\n}\n\nstatic inline uint64_t or64(uint64_t x, uint64_t y) {\n  return x | y;\n}\n\nstatic inline uint8_t xor8(uint8_t x, uint8_t y) {\n  return x ^ y;\n}\n\nstatic inline uint16_t xor16(uint16_t x, uint16_t y) {\n  return x ^ y;\n}\n\nstatic inline uint32_t xor32(uint32_t x, uint32_t y) {\n  return x ^ y;\n}\n\nstatic inline uint64_t xor64(uint64_t x, uint64_t y) {\n  return x ^ y;\n}\n\nstatic inline bool ult8(uint8_t x, uint8_t y) {\n  return x < y;\n}\n\nstatic inline bool ult16(uint16_t x, uint16_t y) {\n  return x < y;\n}\n\nstatic inline bool ult32(uint32_t x, uint32_t y) {\n  return x < y;\n}\n\nstatic inline bool ult64(uint64_t x, uint64_t y) {\n  return x < y;\n}\n\nstatic inline bool ule8(uint8_t x, uint8_t y) {\n  return x <= y;\n}\n\nstatic inline bool ule16(uint16_t x, uint16_t y) {\n  return x <= y;\n}\n\nstatic inline bool ule32(uint32_t x, uint32_t y) {\n  return x <= y;\n}\n\nstatic inline bool ule64(uint64_t x, uint64_t y) {\n  return x <= y;\n}\n\nstatic inline bool slt8(int8_t x, int8_t y) {\n  return x < y;\n}\n\nstatic inline bool slt16(int16_t x, int16_t y) {\n  return x < y;\n}\n\nstatic inline bool slt32(int32_t x, int32_t y) {\n  return x < y;\n}\n\nstatic inline bool slt64(int64_t x, int64_t y) {\n  return x < y;\n}\n\nstatic inline bool sle8(int8_t x, int8_t y) {\n  return x <= y;\n}\n\nstatic inline bool sle16(int16_t x, int16_t y) {\n  return x <= y;\n}\n\nstatic inline bool sle32(int32_t x, int32_t y) {\n  return x <= y;\n}\n\nstatic inline bool sle64(int64_t x, int64_t y) {\n  return x <= y;\n}\n\nstatic inline uint8_t pow8(uint8_t x, uint8_t y) {\n  uint8_t res = 1, rem = y;\n\n  while (rem != 0) {\n    if (rem & 1)\n      res *= x;\n    rem >>= 1;\n    x *= x;\n  }\n  return res;\n}\n\nstatic inline uint16_t pow16(uint16_t x, uint16_t y) {\n  uint16_t res = 1, rem = y;\n\n  while (rem != 0) {\n    if (rem & 1)\n      res *= x;\n    rem >>= 1;\n    x *= x;\n  }\n  return res;\n}\n\nstatic inline uint32_t pow32(uint32_t x, uint32_t y) {\n  ui",
                   "nt32_t res = 1, rem = y;\n\n  while (rem != 0) {\n    if (rem & 1)\n      res *= x;\n    rem >>= 1;\n    x *= x;\n  }\n  return res;\n}\n\nstatic inline uint64_t pow64(uint64_t x, uint64_t y) {\n  uint64_t res = 1, rem = y;\n\n  while (rem != 0) {\n    if (rem & 1)\n      res *= x;\n    rem >>= 1;\n    x *= x;\n  }\n  return res;\n}\n\nstatic inline bool itob_i8_bool(int8_t x) {\n  return x;\n}\n\nstatic inline bool itob_i16_bool(int16_t x) {\n  return x;\n}\n\nstatic inline bool itob_i32_bool(int32_t x) {\n  return x;\n}\n\nstatic inline bool itob_i64_bool(int64_t x) {\n  return x;\n}\n\nstatic inline int8_t btoi_bool_i8(bool x) {\n  return x;\n}\n\nstatic inline int16_t btoi_bool_i16(bool x) {\n  return x;\n}\n\nstatic inline int32_t btoi_bool_i32(bool x) {\n  return x;\n}\n\nstatic inline int64_t btoi_bool_i64(bool x) {\n  return x;\n}\n\n#define sext_i8_i8(x) ((int8_t) (int8_t) (x))\n#define sext_i8_i16(x) ((int16_t) (int8_t) (x))\n#define sext_i8_i32(x) ((int32_t) (int8_t) (x))\n#define sext_i8_i64(x) ((int64_t) (int8_t) (x))\n#define sext_i16_i8(x) ((int8_t) (int16_t) (x))\n#define sext_i16_i16(x) ((int16_t) (int16_t) (x))\n#define sext_i16_i32(x) ((int32_t) (int16_t) (x))\n#define sext_i16_i64(x) ((int64_t) (int16_t) (x))\n#define sext_i32_i8(x) ((int8_t) (int32_t) (x))\n#define sext_i32_i16(x) ((int16_t) (int32_t) (x))\n#define sext_i32_i32(x) ((int32_t) (int32_t) (x))\n#define sext_i32_i64(x) ((int64_t) (int32_t) (x))\n#define sext_i64_i8(x) ((int8_t) (int64_t) (x))\n#define sext_i64_i16(x) ((int16_t) (int64_t) (x))\n#define sext_i64_i32(x) ((int32_t) (int64_t) (x))\n#define sext_i64_i64(x) ((int64_t) (int64_t) (x))\n#define zext_i8_i8(x) ((int8_t) (uint8_t) (x))\n#define zext_i8_i16(x) ((int16_t) (uint8_t) (x))\n#define zext_i8_i32(x) ((int32_t) (uint8_t) (x))\n#define zext_i8_i64(x) ((int64_t) (uint8_t) (x))\n#define zext_i16_i8(x) ((int8_t) (uint16_t) (x))\n#define zext_i16_i16(x) ((int16_t) (uint16_t) (x))\n#define zext_i16_i32(x) ((int32_t) (uint16_t) (x))\n#define zext_i16_i64(x) ((int64_t) (uint16_t) (x))\n#define zext_i32_i8(x",
                   ") ((int8_t) (uint32_t) (x))\n#define zext_i32_i16(x) ((int16_t) (uint32_t) (x))\n#define zext_i32_i32(x) ((int32_t) (uint32_t) (x))\n#define zext_i32_i64(x) ((int64_t) (uint32_t) (x))\n#define zext_i64_i8(x) ((int8_t) (uint64_t) (x))\n#define zext_i64_i16(x) ((int16_t) (uint64_t) (x))\n#define zext_i64_i32(x) ((int32_t) (uint64_t) (x))\n#define zext_i64_i64(x) ((int64_t) (uint64_t) (x))\n\nstatic int8_t abs8(int8_t x) {\n  return (int8_t)abs(x);\n}\n\nstatic int16_t abs16(int16_t x) {\n  return (int16_t)abs(x);\n}\n\nstatic int32_t abs32(int32_t x) {\n  return abs(x);\n}\n\nstatic int64_t abs64(int64_t x) {\n#if defined(__OPENCL_VERSION__)\n  return abs(x);\n#else\n  return llabs(x);\n#endif\n}\n\n#if defined(__OPENCL_VERSION__)\nstatic int32_t futrts_popc8(int8_t x) {\n  return popcount(x);\n}\n\nstatic int32_t futrts_popc16(int16_t x) {\n  return popcount(x);\n}\n\nstatic int32_t futrts_popc32(int32_t x) {\n  return popcount(x);\n}\n\nstatic int32_t futrts_popc64(int64_t x) {\n  return popcount(x);\n}\n#elif defined(__CUDA_ARCH__)\n\nstatic int32_t futrts_popc8(int8_t x) {\n  return __popc(zext_i8_i32(x));\n}\n\nstatic int32_t futrts_popc16(int16_t x) {\n  return __popc(zext_i16_i32(x));\n}\n\nstatic int32_t futrts_popc32(int32_t x) {\n  return __popc(x);\n}\n\nstatic int32_t futrts_popc64(int64_t x) {\n  return __popcll(x);\n}\n\n#else // Not OpenCL or CUDA, but plain C.\n\nstatic int32_t futrts_popc8(uint8_t x) {\n  int c = 0;\n  for (; x; ++c) { x &= x - 1; }\n  return c;\n}\n\nstatic int32_t futrts_popc16(uint16_t x) {\n  int c = 0;\n  for (; x; ++c) { x &= x - 1; }\n  return c;\n}\n\nstatic int32_t futrts_popc32(uint32_t x) {\n  int c = 0;\n  for (; x; ++c) { x &= x - 1; }\n  return c;\n}\n\nstatic int32_t futrts_popc64(uint64_t x) {\n  int c = 0;\n  for (; x; ++c) { x &= x - 1; }\n  return c;\n}\n#endif\n\n#if defined(__OPENCL_VERSION__)\nstatic uint8_t futrts_mul_hi8(uint8_t a, uint8_t b) {\n  return mul_hi(a, b);\n}\n\nstatic uint16_t futrts_mul_hi16(uint16_t a, uint16_t b) {\n  return mul_hi(a, b);\n}\n\nstatic uint32_t futrts_mul_hi32(uint32_t a, uint",
                   "32_t b) {\n  return mul_hi(a, b);\n}\n\nstatic uint64_t futrts_mul_hi64(uint64_t a, uint64_t b) {\n  return mul_hi(a, b);\n}\n\n#elif defined(__CUDA_ARCH__)\n\nstatic uint8_t futrts_mul_hi8(uint8_t a, uint8_t b) {\n  uint16_t aa = a;\n  uint16_t bb = b;\n\n  return aa * bb >> 8;\n}\n\nstatic uint16_t futrts_mul_hi16(uint16_t a, uint16_t b) {\n  uint32_t aa = a;\n  uint32_t bb = b;\n\n  return aa * bb >> 16;\n}\n\nstatic uint32_t futrts_mul_hi32(uint32_t a, uint32_t b) {\n  return mulhi(a, b);\n}\n\nstatic uint64_t futrts_mul_hi64(uint64_t a, uint64_t b) {\n  return mul64hi(a, b);\n}\n\n#else // Not OpenCL or CUDA, but plain C.\n\nstatic uint8_t futrts_mul_hi8(uint8_t a, uint8_t b) {\n  uint16_t aa = a;\n  uint16_t bb = b;\n\n  return aa * bb >> 8;\n}\n\nstatic uint16_t futrts_mul_hi16(uint16_t a, uint16_t b) {\n  uint32_t aa = a;\n  uint32_t bb = b;\n\n  return aa * bb >> 16;\n}\n\nstatic uint32_t futrts_mul_hi32(uint32_t a, uint32_t b) {\n  uint64_t aa = a;\n  uint64_t bb = b;\n\n  return aa * bb >> 32;\n}\n\nstatic uint64_t futrts_mul_hi64(uint64_t a, uint64_t b) {\n  __uint128_t aa = a;\n  __uint128_t bb = b;\n\n  return aa * bb >> 64;\n}\n#endif\n\n#if defined(__OPENCL_VERSION__)\nstatic uint8_t futrts_mad_hi8(uint8_t a, uint8_t b, uint8_t c) {\n  return mad_hi(a, b, c);\n}\n\nstatic uint16_t futrts_mad_hi16(uint16_t a, uint16_t b, uint16_t c) {\n  return mad_hi(a, b, c);\n}\n\nstatic uint32_t futrts_mad_hi32(uint32_t a, uint32_t b, uint32_t c) {\n  return mad_hi(a, b, c);\n}\n\nstatic uint64_t futrts_mad_hi64(uint64_t a, uint64_t b, uint64_t c) {\n  return mad_hi(a, b, c);\n}\n\n#else // Not OpenCL\n\nstatic uint8_t futrts_mad_hi8(uint8_t a, uint8_t b, uint8_t c) {\n  return futrts_mul_hi8(a, b) + c;\n}\n\nstatic uint16_t futrts_mad_hi16(uint16_t a, uint16_t b, uint16_t c) {\n  return futrts_mul_hi16(a, b) + c;\n}\n\nstatic uint32_t futrts_mad_hi32(uint32_t a, uint32_t b, uint32_t c) {\n  return futrts_mul_hi32(a, b) + c;\n}\n\nstatic uint64_t futrts_mad_hi64(uint64_t a, uint64_t b, uint64_t c) {\n  return futrts_mul_hi64(a, b) + c;\n}\n#endif\n\n#if defined",
                   "(__OPENCL_VERSION__)\nstatic int32_t futrts_clzz8(int8_t x) {\n  return clz(x);\n}\n\nstatic int32_t futrts_clzz16(int16_t x) {\n  return clz(x);\n}\n\nstatic int32_t futrts_clzz32(int32_t x) {\n  return clz(x);\n}\n\nstatic int32_t futrts_clzz64(int64_t x) {\n  return clz(x);\n}\n\n#elif defined(__CUDA_ARCH__)\n\nstatic int32_t futrts_clzz8(int8_t x) {\n  return __clz(zext_i8_i32(x)) - 24;\n}\n\nstatic int32_t futrts_clzz16(int16_t x) {\n  return __clz(zext_i16_i32(x)) - 16;\n}\n\nstatic int32_t futrts_clzz32(int32_t x) {\n  return __clz(x);\n}\n\nstatic int32_t futrts_clzz64(int64_t x) {\n  return __clzll(x);\n}\n\n#else // Not OpenCL or CUDA, but plain C.\n\nstatic int32_t futrts_clzz8(int8_t x) {\n  return x == 0 ? 8 : __builtin_clz((uint32_t)zext_i8_i32(x)) - 24;\n}\n\nstatic int32_t futrts_clzz16(int16_t x) {\n  return x == 0 ? 16 : __builtin_clz((uint32_t)zext_i16_i32(x)) - 16;\n}\n\nstatic int32_t futrts_clzz32(int32_t x) {\n  return x == 0 ? 32 : __builtin_clz((uint32_t)x);\n}\n\nstatic int32_t futrts_clzz64(int64_t x) {\n  return x == 0 ? 64 : __builtin_clzll((uint64_t)x);\n}\n#endif\n\n#if defined(__OPENCL_VERSION__)\nstatic int32_t futrts_ctzz8(int8_t x) {\n  int i = 0;\n  for (; i < 8 && (x & 1) == 0; i++, x >>= 1)\n    ;\n  return i;\n}\n\nstatic int32_t futrts_ctzz16(int16_t x) {\n  int i = 0;\n  for (; i < 16 && (x & 1) == 0; i++, x >>= 1)\n    ;\n  return i;\n}\n\nstatic int32_t futrts_ctzz32(int32_t x) {\n  int i = 0;\n  for (; i < 32 && (x & 1) == 0; i++, x >>= 1)\n    ;\n  return i;\n}\n\nstatic int32_t futrts_ctzz64(int64_t x) {\n  int i = 0;\n  for (; i < 64 && (x & 1) == 0; i++, x >>= 1)\n    ;\n  return i;\n}\n\n#elif defined(__CUDA_ARCH__)\n\nstatic int32_t futrts_ctzz8(int8_t x) {\n  int y = __ffs(x);\n  return y == 0 ? 8 : y - 1;\n}\n\nstatic int32_t futrts_ctzz16(int16_t x) {\n  int y = __ffs(x);\n  return y == 0 ? 16 : y - 1;\n}\n\nstatic int32_t futrts_ctzz32(int32_t x) {\n  int y = __ffs(x);\n  return y == 0 ? 32 : y - 1;\n}\n\nstatic int32_t futrts_ctzz64(int64_t x) {\n  int y = __ffsll(x);\n  return y == 0 ? 64 : y - 1;\n}\n\n#else // N",
                   "ot OpenCL or CUDA, but plain C.\n\nstatic int32_t futrts_ctzz8(int8_t x) {\n  return x == 0 ? 8 : __builtin_ctz((uint32_t)x);\n}\n\nstatic int32_t futrts_ctzz16(int16_t x) {\n  return x == 0 ? 16 : __builtin_ctz((uint32_t)x);\n}\n\nstatic int32_t futrts_ctzz32(int32_t x) {\n  return x == 0 ? 32 : __builtin_ctz((uint32_t)x);\n}\n\nstatic int32_t futrts_ctzz64(int64_t x) {\n  return x == 0 ? 64 : __builtin_ctzll((uint64_t)x);\n}\n#endif\n\nstatic inline float fdiv32(float x, float y) {\n  return x / y;\n}\n\nstatic inline float fadd32(float x, float y) {\n  return x + y;\n}\n\nstatic inline float fsub32(float x, float y) {\n  return x - y;\n}\n\nstatic inline float fmul32(float x, float y) {\n  return x * y;\n}\n\nstatic inline bool cmplt32(float x, float y) {\n  return x < y;\n}\n\nstatic inline bool cmple32(float x, float y) {\n  return x <= y;\n}\n\nstatic inline float sitofp_i8_f32(int8_t x) {\n  return (float) x;\n}\n\nstatic inline float sitofp_i16_f32(int16_t x) {\n  return (float) x;\n}\n\nstatic inline float sitofp_i32_f32(int32_t x) {\n  return (float) x;\n}\n\nstatic inline float sitofp_i64_f32(int64_t x) {\n  return (float) x;\n}\n\nstatic inline float uitofp_i8_f32(uint8_t x) {\n  return (float) x;\n}\n\nstatic inline float uitofp_i16_f32(uint16_t x) {\n  return (float) x;\n}\n\nstatic inline float uitofp_i32_f32(uint32_t x) {\n  return (float) x;\n}\n\nstatic inline float uitofp_i64_f32(uint64_t x) {\n  return (float) x;\n}\n\nstatic inline int8_t fptosi_f32_i8(float x) {\n  return (int8_t) x;\n}\n\nstatic inline int16_t fptosi_f32_i16(float x) {\n  return (int16_t) x;\n}\n\nstatic inline int32_t fptosi_f32_i32(float x) {\n  return (int32_t) x;\n}\n\nstatic inline int64_t fptosi_f32_i64(float x) {\n  return (int64_t) x;\n}\n\nstatic inline uint8_t fptoui_f32_i8(float x) {\n  return (uint8_t) x;\n}\n\nstatic inline uint16_t fptoui_f32_i16(float x) {\n  return (uint16_t) x;\n}\n\nstatic inline uint32_t fptoui_f32_i32(float x) {\n  return (uint32_t) x;\n}\n\nstatic inline uint64_t fptoui_f32_i64(float x) {\n  return (uint64_t) x;\n}\n\n#ifdef __OPENCL_VERSION__\n",
                   "static inline float fabs32(float x) {\n  return fabs(x);\n}\n\nstatic inline float fmax32(float x, float y) {\n  return fmax(x, y);\n}\n\nstatic inline float fmin32(float x, float y) {\n  return fmin(x, y);\n}\n\nstatic inline float fpow32(float x, float y) {\n  return pow(x, y);\n}\n\n#else // Not OpenCL, but CUDA or plain C.\n\nstatic inline float fabs32(float x) {\n  return fabsf(x);\n}\n\nstatic inline float fmax32(float x, float y) {\n  return fmaxf(x, y);\n}\n\nstatic inline float fmin32(float x, float y) {\n  return fminf(x, y);\n}\n\nstatic inline float fpow32(float x, float y) {\n  return powf(x, y);\n}\n#endif\n\nstatic inline bool futrts_isnan32(float x) {\n  return isnan(x);\n}\n\nstatic inline bool futrts_isinf32(float x) {\n  return isinf(x);\n}\n\n#ifdef __OPENCL_VERSION__\nstatic inline float futrts_log32(float x) {\n  return log(x);\n}\n\nstatic inline float futrts_log2_32(float x) {\n  return log2(x);\n}\n\nstatic inline float futrts_log10_32(float x) {\n  return log10(x);\n}\n\nstatic inline float futrts_sqrt32(float x) {\n  return sqrt(x);\n}\n\nstatic inline float futrts_exp32(float x) {\n  return exp(x);\n}\n\nstatic inline float futrts_cos32(float x) {\n  return cos(x);\n}\n\nstatic inline float futrts_sin32(float x) {\n  return sin(x);\n}\n\nstatic inline float futrts_tan32(float x) {\n  return tan(x);\n}\n\nstatic inline float futrts_acos32(float x) {\n  return acos(x);\n}\n\nstatic inline float futrts_asin32(float x) {\n  return asin(x);\n}\n\nstatic inline float futrts_atan32(float x) {\n  return atan(x);\n}\n\nstatic inline float futrts_cosh32(float x) {\n  return cosh(x);\n}\n\nstatic inline float futrts_sinh32(float x) {\n  return sinh(x);\n}\n\nstatic inline float futrts_tanh32(float x) {\n  return tanh(x);\n}\n\nstatic inline float futrts_acosh32(float x) {\n  return acosh(x);\n}\n\nstatic inline float futrts_asinh32(float x) {\n  return asinh(x);\n}\n\nstatic inline float futrts_atanh32(float x) {\n  return atanh(x);\n}\n\nstatic inline float futrts_atan2_32(float x, float y) {\n  return atan2(x, y);\n}\n\nstatic inline float futrts_hypot32(float ",
                   "x, float y) {\n  return hypot(x, y);\n}\n\nstatic inline float futrts_gamma32(float x) {\n  return tgamma(x);\n}\n\nstatic inline float futrts_lgamma32(float x) {\n  return lgamma(x);\n}\n\nstatic inline float fmod32(float x, float y) {\n  return fmod(x, y);\n}\n\nstatic inline float futrts_round32(float x) {\n  return rint(x);\n}\n\nstatic inline float futrts_floor32(float x) {\n  return floor(x);\n}\n\nstatic inline float futrts_ceil32(float x) {\n  return ceil(x);\n}\n\nstatic inline float futrts_lerp32(float v0, float v1, float t) {\n  return mix(v0, v1, t);\n}\n\nstatic inline float futrts_mad32(float a, float b, float c) {\n  return mad(a, b, c);\n}\n\nstatic inline float futrts_fma32(float a, float b, float c) {\n  return fma(a, b, c);\n}\n\n#else // Not OpenCL, but CUDA or plain C.\n\nstatic inline float futrts_log32(float x) {\n  return logf(x);\n}\n\nstatic inline float futrts_log2_32(float x) {\n  return log2f(x);\n}\n\nstatic inline float futrts_log10_32(float x) {\n  return log10f(x);\n}\n\nstatic inline float futrts_sqrt32(float x) {\n  return sqrtf(x);\n}\n\nstatic inline float futrts_exp32(float x) {\n  return expf(x);\n}\n\nstatic inline float futrts_cos32(float x) {\n  return cosf(x);\n}\n\nstatic inline float futrts_sin32(float x) {\n  return sinf(x);\n}\n\nstatic inline float futrts_tan32(float x) {\n  return tanf(x);\n}\n\nstatic inline float futrts_acos32(float x) {\n  return acosf(x);\n}\n\nstatic inline float futrts_asin32(float x) {\n  return asinf(x);\n}\n\nstatic inline float futrts_atan32(float x) {\n  return atanf(x);\n}\n\nstatic inline float futrts_cosh32(float x) {\n  return coshf(x);\n}\n\nstatic inline float futrts_sinh32(float x) {\n  return sinhf(x);\n}\n\nstatic inline float futrts_tanh32(float x) {\n  return tanhf(x);\n}\n\nstatic inline float futrts_acosh32(float x) {\n  return acoshf(x);\n}\n\nstatic inline float futrts_asinh32(float x) {\n  return asinhf(x);\n}\n\nstatic inline float futrts_atanh32(float x) {\n  return atanhf(x);\n}\n\nstatic inline float futrts_atan2_32(float x, float y) {\n  return atan2f(x, y);\n}\n\nstatic inline flo",
                   "at futrts_hypot32(float x, float y) {\n  return hypotf(x, y);\n}\n\nstatic inline float futrts_gamma32(float x) {\n  return tgammaf(x);\n}\n\nstatic inline float futrts_lgamma32(float x) {\n  return lgammaf(x);\n}\n\nstatic inline float fmod32(float x, float y) {\n  return fmodf(x, y);\n}\n\nstatic inline float futrts_round32(float x) {\n  return rintf(x);\n}\n\nstatic inline float futrts_floor32(float x) {\n  return floorf(x);\n}\n\nstatic inline float futrts_ceil32(float x) {\n  return ceilf(x);\n}\n\nstatic inline float futrts_lerp32(float v0, float v1, float t) {\n  return v0 + (v1 - v0) * t;\n}\n\nstatic inline float futrts_mad32(float a, float b, float c) {\n  return a * b + c;\n}\n\nstatic inline float futrts_fma32(float a, float b, float c) {\n  return fmaf(a, b, c);\n}\n#endif\n\nstatic inline int32_t futrts_to_bits32(float x) {\n  union {\n    float f;\n    int32_t t;\n  } p;\n\n  p.f = x;\n  return p.t;\n}\n\nstatic inline float futrts_from_bits32(int32_t x) {\n  union {\n    int32_t f;\n    float t;\n  } p;\n\n  p.f = x;\n  return p.t;\n}\n\nstatic inline float fsignum32(float x) {\n  return futrts_isnan32(x) ? x : (x > 0) - (x < 0);\n}\n\n#ifdef FUTHARK_F64_ENABLED\n\nstatic inline double fdiv64(double x, double y) {\n  return x / y;\n}\n\nstatic inline double fadd64(double x, double y) {\n  return x + y;\n}\n\nstatic inline double fsub64(double x, double y) {\n  return x - y;\n}\n\nstatic inline double fmul64(double x, double y) {\n  return x * y;\n}\n\nstatic inline bool cmplt64(double x, double y) {\n  return x < y;\n}\n\nstatic inline bool cmple64(double x, double y) {\n  return x <= y;\n}\n\nstatic inline double sitofp_i8_f64(int8_t x) {\n  return (double) x;\n}\n\nstatic inline double sitofp_i16_f64(int16_t x) {\n  return (double) x;\n}\n\nstatic inline double sitofp_i32_f64(int32_t x) {\n  return (double) x;\n}\n\nstatic inline double sitofp_i64_f64(int64_t x) {\n  return (double) x;\n}\n\nstatic inline double uitofp_i8_f64(uint8_t x) {\n  return (double) x;\n}\n\nstatic inline double uitofp_i16_f64(uint16_t x) {\n  return (double) x;\n}\n\nstatic inline doub",
                   "le uitofp_i32_f64(uint32_t x) {\n  return (double) x;\n}\n\nstatic inline double uitofp_i64_f64(uint64_t x) {\n  return (double) x;\n}\n\nstatic inline int8_t fptosi_f64_i8(double x) {\n  return (int8_t) x;\n}\n\nstatic inline int16_t fptosi_f64_i16(double x) {\n  return (int16_t) x;\n}\n\nstatic inline int32_t fptosi_f64_i32(double x) {\n  return (int32_t) x;\n}\n\nstatic inline int64_t fptosi_f64_i64(double x) {\n  return (int64_t) x;\n}\n\nstatic inline uint8_t fptoui_f64_i8(double x) {\n  return (uint8_t) x;\n}\n\nstatic inline uint16_t fptoui_f64_i16(double x) {\n  return (uint16_t) x;\n}\n\nstatic inline uint32_t fptoui_f64_i32(double x) {\n  return (uint32_t) x;\n}\n\nstatic inline uint64_t fptoui_f64_i64(double x) {\n  return (uint64_t) x;\n}\n\nstatic inline double fabs64(double x) {\n  return fabs(x);\n}\n\nstatic inline double fmax64(double x, double y) {\n  return fmax(x, y);\n}\n\nstatic inline double fmin64(double x, double y) {\n  return fmin(x, y);\n}\n\nstatic inline double fpow64(double x, double y) {\n  return pow(x, y);\n}\n\nstatic inline double futrts_log64(double x) {\n  return log(x);\n}\n\nstatic inline double futrts_log2_64(double x) {\n  return log2(x);\n}\n\nstatic inline double futrts_log10_64(double x) {\n  return log10(x);\n}\n\nstatic inline double futrts_sqrt64(double x) {\n  return sqrt(x);\n}\n\nstatic inline double futrts_exp64(double x) {\n  return exp(x);\n}\n\nstatic inline double futrts_cos64(double x) {\n  return cos(x);\n}\n\nstatic inline double futrts_sin64(double x) {\n  return sin(x);\n}\n\nstatic inline double futrts_tan64(double x) {\n  return tan(x);\n}\n\nstatic inline double futrts_acos64(double x) {\n  return acos(x);\n}\n\nstatic inline double futrts_asin64(double x) {\n  return asin(x);\n}\n\nstatic inline double futrts_atan64(double x) {\n  return atan(x);\n}\n\nstatic inline double futrts_cosh64(double x) {\n  return cosh(x);\n}\n\nstatic inline double futrts_sinh64(double x) {\n  return sinh(x);\n}\n\nstatic inline double futrts_tanh64(double x) {\n  return tanh(x);\n}\n\nstatic inline double futrts_acosh64(double x) {\n",
                   "  return acosh(x);\n}\n\nstatic inline double futrts_asinh64(double x) {\n  return asinh(x);\n}\n\nstatic inline double futrts_atanh64(double x) {\n  return atanh(x);\n}\n\nstatic inline double futrts_atan2_64(double x, double y) {\n  return atan2(x, y);\n}\n\nstatic inline double futrts_hypot64(double x, double y) {\n  return hypot(x, y);\n}\n\nstatic inline double futrts_gamma64(double x) {\n  return tgamma(x);\n}\n\nstatic inline double futrts_lgamma64(double x) {\n  return lgamma(x);\n}\n\nstatic inline double futrts_fma64(double a, double b, double c) {\n  return fma(a, b, c);\n}\n\nstatic inline double futrts_round64(double x) {\n  return rint(x);\n}\n\nstatic inline double futrts_ceil64(double x) {\n  return ceil(x);\n}\n\nstatic inline double futrts_floor64(double x) {\n  return floor(x);\n}\n\nstatic inline bool futrts_isnan64(double x) {\n  return isnan(x);\n}\n\nstatic inline bool futrts_isinf64(double x) {\n  return isinf(x);\n}\n\nstatic inline int64_t futrts_to_bits64(double x) {\n  union {\n    double f;\n    int64_t t;\n  } p;\n\n  p.f = x;\n  return p.t;\n}\n\nstatic inline double futrts_from_bits64(int64_t x) {\n  union {\n    int64_t f;\n    double t;\n  } p;\n\n  p.f = x;\n  return p.t;\n}\n\nstatic inline double fmod64(double x, double y) {\n  return fmod(x, y);\n}\n\nstatic inline double fsignum64(double x) {\n  return futrts_isnan64(x) ? x : (x > 0) - (x < 0);\n}\n\nstatic inline double futrts_lerp64(double v0, double v1, double t) {\n#ifdef __OPENCL_VERSION__\n  return mix(v0, v1, t);\n#else\n  return v0 + (v1 - v0) * t;\n#endif\n}\n\nstatic inline double futrts_mad64(double a, double b, double c) {\n#ifdef __OPENCL_VERSION__\n  return mad(a, b, c);\n#else\n  return a * b + c;\n#endif\n}\n\nstatic inline float fpconv_f32_f32(float x) {\n  return (float) x;\n}\n\nstatic inline double fpconv_f32_f64(float x) {\n  return (double) x;\n}\n\nstatic inline float fpconv_f64_f32(double x) {\n  return (float) x;\n}\n\nstatic inline double fpconv_f64_f64(double x) {\n  return (double) x;\n}\n\n#endif\n\n// End of scalar.h.\n// Start of scalar_f16.h.\n\n// Half-precis",
                   "ion is emulated if needed (e.g. in straight C) with the\n// native type used if possible.  The emulation works by typedef'ing\n// 'float' to 'f16', and then implementing all operations on single\n// precision.  To cut down on duplication, we use the same code for\n// those Futhark functions that require just operators or casts.  The\n// in-memory representation for arrays will still be 16 bits even\n// under emulation, so the compiler will have to be careful when\n// generating reads or writes.\n\n#if !defined(cl_khr_fp16) && !(defined(__CUDA_ARCH__) && __CUDA_ARCH__ >= 600)\n#define EMULATE_F16\n#endif\n\n#if !defined(EMULATE_F16) && defined(__OPENCL_VERSION__)\n#pragma OPENCL EXTENSION cl_khr_fp16 : enable\n#endif\n\n#ifdef EMULATE_F16\n\n// Note that the half-precision storage format is still 16 bits - the\n// compiler will have to be real careful!\ntypedef float f16;\n\n#else\n\n#ifdef __CUDA_ARCH__\n#include <cuda_fp16.h>\n#endif\n\ntypedef half f16;\n\n#endif\n\n// Some of these functions convert to single precision because half\n// precision versions are not available.\n\nstatic inline f16 fadd16(f16 x, f16 y) {\n  return x + y;\n}\n\nstatic inline f16 fsub16(f16 x, f16 y) {\n  return x - y;\n}\n\nstatic inline f16 fmul16(f16 x, f16 y) {\n  return x * y;\n}\n\nstatic inline bool cmplt16(f16 x, f16 y) {\n  return x < y;\n}\n\nstatic inline bool cmple16(f16 x, f16 y) {\n  return x <= y;\n}\n\nstatic inline f16 sitofp_i8_f16(int8_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 sitofp_i16_f16(int16_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 sitofp_i32_f16(int32_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 sitofp_i64_f16(int64_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 uitofp_i8_f16(uint8_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 uitofp_i16_f16(uint16_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 uitofp_i32_f16(uint32_t x) {\n  return (f16) x;\n}\n\nstatic inline f16 uitofp_i64_f16(uint64_t x) {\n  return (f16) x;\n}\n\nstatic inline int8_t fptosi_f16_i8(f16 x) {\n  return (int8_t) (float) x;\n}\n\nstatic inline int16_t f",
                   "ptosi_f16_i16(f16 x) {\n  return (int16_t) x;\n}\n\nstatic inline int32_t fptosi_f16_i32(f16 x) {\n  return (int32_t) x;\n}\n\nstatic inline int64_t fptosi_f16_i64(f16 x) {\n  return (int64_t) x;\n}\n\nstatic inline uint8_t fptoui_f16_i8(f16 x) {\n  return (uint8_t) (float) x;\n}\n\nstatic inline uint16_t fptoui_f16_i16(f16 x) {\n  return (uint16_t) x;\n}\n\nstatic inline uint32_t fptoui_f16_i32(f16 x) {\n  return (uint32_t) x;\n}\n\nstatic inline uint64_t fptoui_f16_i64(f16 x) {\n  return (uint64_t) x;\n}\n\n#ifndef EMULATE_F16\n\n#ifdef __OPENCL_VERSION__\nstatic inline f16 fabs16(f16 x) {\n  return fabs(x);\n}\n\nstatic inline f16 fmax16(f16 x, f16 y) {\n  return fmax(x, y);\n}\n\nstatic inline f16 fmin16(f16 x, f16 y) {\n  return fmin(x, y);\n}\n\nstatic inline f16 fpow16(f16 x, f16 y) {\n  return pow(x, y);\n}\n\n#else // Assuming CUDA.\n\nstatic inline f16 fabs16(f16 x) {\n  return fabsf(x);\n}\n\nstatic inline f16 fmax16(f16 x, f16 y) {\n  return fmaxf(x, y);\n}\n\nstatic inline f16 fmin16(f16 x, f16 y) {\n  return fminf(x, y);\n}\n\nstatic inline f16 fpow16(f16 x, f16 y) {\n  return powf(x, y);\n}\n#endif\n\nstatic inline bool futrts_isnan16(f16 x) {\n  return isnan((float)x);\n}\n\nstatic inline bool futrts_isinf16(f16 x) {\n  return isinf((float)x);\n}\n\n#ifdef __OPENCL_VERSION__\nstatic inline f16 futrts_log16(f16 x) {\n  return log(x);\n}\n\nstatic inline f16 futrts_log2_16(f16 x) {\n  return log2(x);\n}\n\nstatic inline f16 futrts_log10_16(f16 x) {\n  return log10(x);\n}\n\nstatic inline f16 futrts_sqrt16(f16 x) {\n  return sqrt(x);\n}\n\nstatic inline f16 futrts_exp16(f16 x) {\n  return exp(x);\n}\n\nstatic inline f16 futrts_cos16(f16 x) {\n  return cos(x);\n}\n\nstatic inline f16 futrts_sin16(f16 x) {\n  return sin(x);\n}\n\nstatic inline f16 futrts_tan16(f16 x) {\n  return tan(x);\n}\n\nstatic inline f16 futrts_acos16(f16 x) {\n  return acos(x);\n}\n\nstatic inline f16 futrts_asin16(f16 x) {\n  return asin(x);\n}\n\nstatic inline f16 futrts_atan16(f16 x) {\n  return atan(x);\n}\n\nstatic inline f16 futrts_cosh16(f16 x) {\n  return cosh(x);\n}\n\nstatic inline f16 futrts",
                   "_sinh16(f16 x) {\n  return sinh(x);\n}\n\nstatic inline f16 futrts_tanh16(f16 x) {\n  return tanh(x);\n}\n\nstatic inline f16 futrts_acosh16(f16 x) {\n  return acosh(x);\n}\n\nstatic inline f16 futrts_asinh16(f16 x) {\n  return asinh(x);\n}\n\nstatic inline f16 futrts_atanh16(f16 x) {\n  return atanh(x);\n}\n\nstatic inline f16 futrts_atan2_16(f16 x, f16 y) {\n  return atan2(x, y);\n}\n\nstatic inline f16 futrts_hypot16(f16 x, f16 y) {\n  return hypot(x, y);\n}\n\nstatic inline f16 futrts_gamma16(f16 x) {\n  return tgamma(x);\n}\n\nstatic inline f16 futrts_lgamma16(f16 x) {\n  return lgamma(x);\n}\n\nstatic inline f16 fmod16(f16 x, f16 y) {\n  return fmod(x, y);\n}\n\nstatic inline f16 futrts_round16(f16 x) {\n  return rint(x);\n}\n\nstatic inline f16 futrts_floor16(f16 x) {\n  return floor(x);\n}\n\nstatic inline f16 futrts_ceil16(f16 x) {\n  return ceil(x);\n}\n\nstatic inline f16 futrts_lerp16(f16 v0, f16 v1, f16 t) {\n  return mix(v0, v1, t);\n}\n\nstatic inline f16 futrts_mad16(f16 a, f16 b, f16 c) {\n  return mad(a, b, c);\n}\n\nstatic inline f16 futrts_fma16(f16 a, f16 b, f16 c) {\n  return fma(a, b, c);\n}\n\n#else // Assume CUDA.\n\nstatic inline f16 futrts_log16(f16 x) {\n  return hlog(x);\n}\n\nstatic inline f16 futrts_log2_16(f16 x) {\n  return hlog2(x);\n}\n\nstatic inline f16 futrts_log10_16(f16 x) {\n  return hlog10(x);\n}\n\nstatic inline f16 futrts_sqrt16(f16 x) {\n  return hsqrt(x);\n}\n\nstatic inline f16 futrts_exp16(f16 x) {\n  return hexp(x);\n}\n\nstatic inline f16 futrts_cos16(f16 x) {\n  return hcos(x);\n}\n\nstatic inline f16 futrts_sin16(f16 x) {\n  return hsin(x);\n}\n\nstatic inline f16 futrts_tan16(f16 x) {\n  return tanf(x);\n}\n\nstatic inline f16 futrts_acos16(f16 x) {\n  return acosf(x);\n}\n\nstatic inline f16 futrts_asin16(f16 x) {\n  return asinf(x);\n}\n\nstatic inline f16 futrts_atan16(f16 x) {\n  return atanf(x);\n}\n\nstatic inline f16 futrts_cosh16(f16 x) {\n  return coshf(x);\n}\n\nstatic inline f16 futrts_sinh16(f16 x) {\n  return sinhf(x);\n}\n\nstatic inline f16 futrts_tanh16(f16 x) {\n  return tanhf(x);\n}\n\nstatic inline f16 futrts_acosh",
                   "16(f16 x) {\n  return acoshf(x);\n}\n\nstatic inline f16 futrts_asinh16(f16 x) {\n  return asinhf(x);\n}\n\nstatic inline f16 futrts_atanh16(f16 x) {\n  return atanhf(x);\n}\n\nstatic inline f16 futrts_atan2_16(f16 x, f16 y) {\n  return atan2f(x, y);\n}\n\nstatic inline f16 futrts_hypot16(f16 x, f16 y) {\n  return hypotf(x, y);\n}\n\nstatic inline f16 futrts_gamma16(f16 x) {\n  return tgammaf(x);\n}\n\nstatic inline f16 futrts_lgamma16(f16 x) {\n  return lgammaf(x);\n}\n\nstatic inline f16 fmod16(f16 x, f16 y) {\n  return fmodf(x, y);\n}\n\nstatic inline f16 futrts_round16(f16 x) {\n  return rintf(x);\n}\n\nstatic inline f16 futrts_floor16(f16 x) {\n  return hfloor(x);\n}\n\nstatic inline f16 futrts_ceil16(f16 x) {\n  return hceil(x);\n}\n\nstatic inline f16 futrts_lerp16(f16 v0, f16 v1, f16 t) {\n  return v0 + (v1 - v0) * t;\n}\n\nstatic inline f16 futrts_mad16(f16 a, f16 b, f16 c) {\n  return a * b + c;\n}\n\nstatic inline f16 futrts_fma16(f16 a, f16 b, f16 c) {\n  return fmaf(a, b, c);\n}\n\n#endif\n\n// The CUDA __half type cannot be put in unions for some reason, so we\n// use bespoke conversion functions instead.\n#ifdef __CUDA_ARCH__\nstatic inline int16_t futrts_to_bits16(f16 x) {\n  return __half_as_ushort(x);\n}\nstatic inline f16 futrts_from_bits16(int16_t x) {\n  return __ushort_as_half(x);\n}\n#else\nstatic inline int16_t futrts_to_bits16(f16 x) {\n  union {\n    f16 f;\n    int16_t t;\n  } p;\n\n  p.f = x;\n  return p.t;\n}\n\nstatic inline f16 futrts_from_bits16(int16_t x) {\n  union {\n    int16_t f;\n    f16 t;\n  } p;\n\n  p.f = x;\n  return p.t;\n}\n#endif\n\n#else // No native f16 - emulate.\n\nstatic inline f16 fabs16(f16 x) {\n  return fabs32(x);\n}\n\nstatic inline f16 fmax16(f16 x, f16 y) {\n  return fmax32(x, y);\n}\n\nstatic inline f16 fmin16(f16 x, f16 y) {\n  return fmin32(x, y);\n}\n\nstatic inline f16 fpow16(f16 x, f16 y) {\n  return fpow32(x, y);\n}\n\nstatic inline bool futrts_isnan16(f16 x) {\n  return futrts_isnan32(x);\n}\n\nstatic inline bool futrts_isinf16(f16 x) {\n  return futrts_isinf32(x);\n}\n\nstatic inline f16 futrts_log16(f16 x) {\n  r",
                   "eturn futrts_log32(x);\n}\n\nstatic inline f16 futrts_log2_16(f16 x) {\n  return futrts_log2_32(x);\n}\n\nstatic inline f16 futrts_log10_16(f16 x) {\n  return futrts_log10_32(x);\n}\n\nstatic inline f16 futrts_sqrt16(f16 x) {\n  return futrts_sqrt32(x);\n}\n\nstatic inline f16 futrts_exp16(f16 x) {\n  return futrts_exp32(x);\n}\n\nstatic inline f16 futrts_cos16(f16 x) {\n  return futrts_cos32(x);\n}\n\nstatic inline f16 futrts_sin16(f16 x) {\n  return futrts_sin32(x);\n}\n\nstatic inline f16 futrts_tan16(f16 x) {\n  return futrts_tan32(x);\n}\n\nstatic inline f16 futrts_acos16(f16 x) {\n  return futrts_acos32(x);\n}\n\nstatic inline f16 futrts_asin16(f16 x) {\n  return futrts_asin32(x);\n}\n\nstatic inline f16 futrts_atan16(f16 x) {\n  return futrts_atan32(x);\n}\n\nstatic inline f16 futrts_cosh16(f16 x) {\n  return futrts_cosh32(x);\n}\n\nstatic inline f16 futrts_sinh16(f16 x) {\n  return futrts_sinh32(x);\n}\n\nstatic inline f16 futrts_tanh16(f16 x) {\n  return futrts_tanh32(x);\n}\n\nstatic inline f16 futrts_acosh16(f16 x) {\n  return futrts_acosh32(x);\n}\n\nstatic inline f16 futrts_asinh16(f16 x) {\n  return futrts_asinh32(x);\n}\n\nstatic inline f16 futrts_atanh16(f16 x) {\n  return futrts_atanh32(x);\n}\n\nstatic inline f16 futrts_atan2_16(f16 x, f16 y) {\n  return futrts_atan2_32(x, y);\n}\n\nstatic inline f16 futrts_hypot16(f16 x, f16 y) {\n  return futrts_hypot32(x, y);\n}\n\nstatic inline f16 futrts_gamma16(f16 x) {\n  return futrts_gamma32(x);\n}\n\nstatic inline f16 futrts_lgamma16(f16 x) {\n  return futrts_lgamma32(x);\n}\n\nstatic inline f16 fmod16(f16 x, f16 y) {\n  return fmod32(x, y);\n}\n\nstatic inline f16 futrts_round16(f16 x) {\n  return futrts_round32(x);\n}\n\nstatic inline f16 futrts_floor16(f16 x) {\n  return futrts_floor32(x);\n}\n\nstatic inline f16 futrts_ceil16(f16 x) {\n  return futrts_ceil32(x);\n}\n\nstatic inline f16 futrts_lerp16(f16 v0, f16 v1, f16 t) {\n  return futrts_lerp32(v0, v1, t);\n}\n\nstatic inline f16 futrts_mad16(f16 a, f16 b, f16 c) {\n  return futrts_mad32(a, b, c);\n}\n\nstatic inline f16 futrts_fma16(f16 a, f16 b, f16 c",
                   ") {\n  return futrts_fma32(a, b, c);\n}\n\n// Even when we are using an OpenCL that does not support cl_khr_fp16,\n// it must still support vload_half for actually creating a\n// half-precision number, which can then be efficiently converted to a\n// float.  Similarly for vstore_half.\n#ifdef __OPENCL_VERSION__\n\nstatic inline int16_t futrts_to_bits16(f16 x) {\n  int16_t y;\n  // Violating strict aliasing here.\n  vstore_half((float)x, 0, (half*)&y);\n  return y;\n}\n\nstatic inline f16 futrts_from_bits16(int16_t x) {\n  return (f16)vload_half(0, (half*)&x);\n}\n\n#else\n\nstatic inline int16_t futrts_to_bits16(f16 x) {\n  return (int16_t)float2halfbits(x);\n}\n\nstatic inline f16 futrts_from_bits16(int16_t x) {\n  return halfbits2float((uint16_t)x);\n}\n\nstatic inline f16 fsignum16(f16 x) {\n  return futrts_isnan16(x) ? x : (x > 0) - (x < 0);\n}\n\n#endif\n\n#endif\n\nstatic inline float fpconv_f16_f16(f16 x) {\n  return x;\n}\n\nstatic inline float fpconv_f16_f32(f16 x) {\n  return x;\n}\n\nstatic inline f16 fpconv_f32_f16(float x) {\n  return x;\n}\n\n#ifdef FUTHARK_F64_ENABLED\n\nstatic inline double fpconv_f16_f64(f16 x) {\n  return (double) x;\n}\n\nstatic inline f16 fpconv_f64_f16(double x) {\n  return (f16) x;\n}\n\n#endif\n\n\n// End of scalar_f16.h.\n// Start of atomics.h\n\ninline int32_t atomic_xchg_i32_global(volatile __global int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicExch((int32_t*)p, x);\n#else\n  return atomic_xor(p, x);\n#endif\n}\n\ninline int32_t atomic_xchg_i32_local(volatile __local int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicExch((int32_t*)p, x);\n#else\n  return atomic_xor(p, x);\n#endif\n}\n\ninline int32_t atomic_cmpxchg_i32_global(volatile __global int32_t *p,\n                                         int32_t cmp, int32_t val) {\n#ifdef FUTHARK_CUDA\n  return atomicCAS((int32_t*)p, cmp, val);\n#else\n  return atomic_cmpxchg(p, cmp, val);\n#endif\n}\n\ninline int32_t atomic_cmpxchg_i32_local(volatile __local int32_t *p,\n                                        int32_t cmp, int32_t val) {\n#ifde",
                   "f FUTHARK_CUDA\n  return atomicCAS((int32_t*)p, cmp, val);\n#else\n  return atomic_cmpxchg(p, cmp, val);\n#endif\n}\n\ninline int32_t atomic_add_i32_global(volatile __global int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicAdd((int32_t*)p, x);\n#else\n  return atomic_add(p, x);\n#endif\n}\n\ninline int32_t atomic_add_i32_local(volatile __local int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicAdd((int32_t*)p, x);\n#else\n  return atomic_add(p, x);\n#endif\n}\n\ninline float atomic_fadd_f32_global(volatile __global float *p, float x) {\n#ifdef FUTHARK_CUDA\n  return atomicAdd((float*)p, x);\n#else\n  union { int32_t i; float f; } old;\n  union { int32_t i; float f; } assumed;\n  old.f = *p;\n  do {\n    assumed.f = old.f;\n    old.f = old.f + x;\n    old.i = atomic_cmpxchg_i32_global((volatile __global int32_t*)p, assumed.i, old.i);\n  } while (assumed.i != old.i);\n  return old.f;\n#endif\n}\n\ninline float atomic_fadd_f32_local(volatile __local float *p, float x) {\n#ifdef FUTHARK_CUDA\n  return atomicAdd((float*)p, x);\n#else\n  union { int32_t i; float f; } old;\n  union { int32_t i; float f; } assumed;\n  old.f = *p;\n  do {\n    assumed.f = old.f;\n    old.f = old.f + x;\n    old.i = atomic_cmpxchg_i32_local((volatile __local int32_t*)p, assumed.i, old.i);\n  } while (assumed.i != old.i);\n  return old.f;\n#endif\n}\n\ninline int32_t atomic_smax_i32_global(volatile __global int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMax((int32_t*)p, x);\n#else\n  return atomic_max(p, x);\n#endif\n}\n\ninline int32_t atomic_smax_i32_local(volatile __local int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMax((int32_t*)p, x);\n#else\n  return atomic_max(p, x);\n#endif\n}\n\ninline int32_t atomic_smin_i32_global(volatile __global int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMin((int32_t*)p, x);\n#else\n  return atomic_min(p, x);\n#endif\n}\n\ninline int32_t atomic_smin_i32_local(volatile __local int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMin((int32_t*)p, x);\n#else\n  ret",
                   "urn atomic_min(p, x);\n#endif\n}\n\ninline uint32_t atomic_umax_i32_global(volatile __global uint32_t *p, uint32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMax((uint32_t*)p, x);\n#else\n  return atomic_max(p, x);\n#endif\n}\n\ninline uint32_t atomic_umax_i32_local(volatile __local uint32_t *p, uint32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMax((uint32_t*)p, x);\n#else\n  return atomic_max(p, x);\n#endif\n}\n\ninline uint32_t atomic_umin_i32_global(volatile __global uint32_t *p, uint32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMin((uint32_t*)p, x);\n#else\n  return atomic_min(p, x);\n#endif\n}\n\ninline uint32_t atomic_umin_i32_local(volatile __local uint32_t *p, uint32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMin((uint32_t*)p, x);\n#else\n  return atomic_min(p, x);\n#endif\n}\n\ninline int32_t atomic_and_i32_global(volatile __global int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicAnd((int32_t*)p, x);\n#else\n  return atomic_and(p, x);\n#endif\n}\n\ninline int32_t atomic_and_i32_local(volatile __local int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicAnd((int32_t*)p, x);\n#else\n  return atomic_and(p, x);\n#endif\n}\n\ninline int32_t atomic_or_i32_global(volatile __global int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicOr((int32_t*)p, x);\n#else\n  return atomic_or(p, x);\n#endif\n}\n\ninline int32_t atomic_or_i32_local(volatile __local int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicOr((int32_t*)p, x);\n#else\n  return atomic_or(p, x);\n#endif\n}\n\ninline int32_t atomic_xor_i32_global(volatile __global int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicXor((int32_t*)p, x);\n#else\n  return atomic_xor(p, x);\n#endif\n}\n\ninline int32_t atomic_xor_i32_local(volatile __local int32_t *p, int32_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicXor((int32_t*)p, x);\n#else\n  return atomic_xor(p, x);\n#endif\n}\n\n// Start of 64 bit atomics\n\ninline int64_t atomic_xchg_i64_global(volatile __global int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicExch((uint64_t*)p, x);\n#else\n ",
                   " return atom_xor(p, x);\n#endif\n}\n\ninline int64_t atomic_xchg_i64_local(volatile __local int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicExch((uint64_t*)p, x);\n#else\n  return atom_xor(p, x);\n#endif\n}\n\ninline int64_t atomic_cmpxchg_i64_global(volatile __global int64_t *p,\n                                         int64_t cmp, int64_t val) {\n#ifdef FUTHARK_CUDA\n  return atomicCAS((uint64_t*)p, cmp, val);\n#else\n  return atom_cmpxchg(p, cmp, val);\n#endif\n}\n\ninline int64_t atomic_cmpxchg_i64_local(volatile __local int64_t *p,\n                                        int64_t cmp, int64_t val) {\n#ifdef FUTHARK_CUDA\n  return atomicCAS((uint64_t*)p, cmp, val);\n#else\n  return atom_cmpxchg(p, cmp, val);\n#endif\n}\n\ninline int64_t atomic_add_i64_global(volatile __global int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicAdd((uint64_t*)p, x);\n#else\n  return atom_add(p, x);\n#endif\n}\n\ninline int64_t atomic_add_i64_local(volatile __local int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicAdd((uint64_t*)p, x);\n#else\n  return atom_add(p, x);\n#endif\n}\n\n#ifdef FUTHARK_F64_ENABLED\n\ninline double atomic_fadd_f64_global(volatile __global double *p, double x) {\n#if defined(FUTHARK_CUDA) && __CUDA_ARCH__ >= 600\n  return atomicAdd((double*)p, x);\n#else\n  union { int64_t i; double f; } old;\n  union { int64_t i; double f; } assumed;\n  old.f = *p;\n  do {\n    assumed.f = old.f;\n    old.f = old.f + x;\n    old.i = atomic_cmpxchg_i64_global((volatile __global int64_t*)p, assumed.i, old.i);\n  } while (assumed.i != old.i);\n  return old.f;\n#endif\n}\n\ninline double atomic_fadd_f64_local(volatile __local double *p, double x) {\n#if defined(FUTHARK_CUDA) && __CUDA_ARCH__ >= 600\n  return atomicAdd((double*)p, x);\n#else\n  union { int64_t i; double f; } old;\n  union { int64_t i; double f; } assumed;\n  old.f = *p;\n  do {\n    assumed.f = old.f;\n    old.f = old.f + x;\n    old.i = atomic_cmpxchg_i64_local((volatile __local int64_t*)p, assumed.i, old.i);\n  } while (assumed.i != old.i);\n  r",
                   "eturn old.f;\n#endif\n}\n\n#endif\n\ninline int64_t atomic_smax_i64_global(volatile __global int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMax((int64_t*)p, x);\n#else\n  return atom_max(p, x);\n#endif\n}\n\ninline int64_t atomic_smax_i64_local(volatile __local int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMax((int64_t*)p, x);\n#else\n  return atom_max(p, x);\n#endif\n}\n\ninline int64_t atomic_smin_i64_global(volatile __global int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMin((int64_t*)p, x);\n#else\n  return atom_min(p, x);\n#endif\n}\n\ninline int64_t atomic_smin_i64_local(volatile __local int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMin((int64_t*)p, x);\n#else\n  return atom_min(p, x);\n#endif\n}\n\ninline uint64_t atomic_umax_i64_global(volatile __global uint64_t *p, uint64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMax((uint64_t*)p, x);\n#else\n  return atom_max(p, x);\n#endif\n}\n\ninline uint64_t atomic_umax_i64_local(volatile __local uint64_t *p, uint64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMax((uint64_t*)p, x);\n#else\n  return atom_max(p, x);\n#endif\n}\n\ninline uint64_t atomic_umin_i64_global(volatile __global uint64_t *p, uint64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMin((uint64_t*)p, x);\n#else\n  return atom_min(p, x);\n#endif\n}\n\ninline uint64_t atomic_umin_i64_local(volatile __local uint64_t *p, uint64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicMin((uint64_t*)p, x);\n#else\n  return atom_min(p, x);\n#endif\n}\n\ninline int64_t atomic_and_i64_global(volatile __global int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicAnd((int64_t*)p, x);\n#else\n  return atom_and(p, x);\n#endif\n}\n\ninline int64_t atomic_and_i64_local(volatile __local int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicAnd((int64_t*)p, x);\n#else\n  return atom_and(p, x);\n#endif\n}\n\ninline int64_t atomic_or_i64_global(volatile __global int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicOr((int64_t*)p, x);\n#else\n  return atom_or(p, x);\n#endif\n}\n\ninline int6",
                   "4_t atomic_or_i64_local(volatile __local int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicOr((int64_t*)p, x);\n#else\n  return atom_or(p, x);\n#endif\n}\n\ninline int64_t atomic_xor_i64_global(volatile __global int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicXor((int64_t*)p, x);\n#else\n  return atom_xor(p, x);\n#endif\n}\n\ninline int64_t atomic_xor_i64_local(volatile __local int64_t *p, int64_t x) {\n#ifdef FUTHARK_CUDA\n  return atomicXor((int64_t*)p, x);\n#else\n  return atom_xor(p, x);\n#endif\n}\n\n// End of atomics.h\n\n\n\n__kernel void builtinzhreplicate_f32zireplicate_78275(int32_t num_elems_78272,\n                                                      float val_78273, __global\n                                                      unsigned char *mem_78271)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t replicate_gtid_78275;\n    int32_t replicate_ltid_78276;\n    int32_t replicate_gid_78277;\n    \n    replicate_gtid_78275 = get_global_id(0);\n    replicate_ltid_78276 = get_local_id(0);\n    replicate_gid_78277 = get_group_id(0);\n    \n    int64_t slice_78281 = num_elems_78272;\n    int64_t rep_i_78280 = sext_i32_i64(replicate_gtid_78275);\n    int64_t remnant_78282 = sext_i32_i64(replicate_gtid_78275) - rep_i_78280;\n    \n    if (slt64(replicate_gtid_78275, num_elems_78272)) {\n        ((__global float *) mem_78271)[rep_i_78280] = val_78273;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void builtinzhreplicate_i64zireplicate_78389(int32_t num_elems_78386,\n                                                      int64_t val_78387,\n                                                      __global\n                                                      unsigned char *mem_78385)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t replicate_gtid_78389;\n    int32_t replicate_ltid_78390;\n    int32_t replicate_gid_78391;\n    \n    replicate_gtid_78389 = get_global_id(0);\n    rep",
                   "licate_ltid_78390 = get_local_id(0);\n    replicate_gid_78391 = get_group_id(0);\n    \n    int64_t slice_78395 = num_elems_78386;\n    int64_t rep_i_78394 = sext_i32_i64(replicate_gtid_78389);\n    int64_t remnant_78396 = sext_i32_i64(replicate_gtid_78389) - rep_i_78394;\n    \n    if (slt64(replicate_gtid_78389, num_elems_78386)) {\n        ((__global int64_t *) mem_78385)[rep_i_78394] = val_78387;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void gpu_map_transpose_f32(__local volatile\n                                    int64_t *block_9_backing_aligned_0,\n                                    int32_t destoffset_1, int32_t srcoffset_3,\n                                    int32_t num_arrays_4, int32_t x_elems_5,\n                                    int32_t y_elems_6, int32_t mulx_7,\n                                    int32_t muly_8, __global\n                                    unsigned char *destmem_0, __global\n                                    unsigned char *srcmem_2)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict block_9_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) block_9_backing_aligned_0;\n    __local unsigned char *block_9;\n    \n    block_9 = (__local unsigned char *) block_9_backing_0;\n    \n    int32_t get_global_id_0_37;\n    \n    get_global_id_0_37 = get_global_id(0);\n    \n    int32_t get_local_id_0_38;\n    \n    get_local_id_0_38 = get_local_id(0);\n    \n    int32_t get_local_id_1_39;\n    \n    get_local_id_1_39 = get_local_id(1);\n    \n    int32_t get_group_id_0_40;\n    \n    get_group_id_0_40 = get_group_id(0);\n    \n    int32_t get_group_id_1_41;\n    \n    get_group_id_1_41 = get_group_id(1);\n    \n    int32_t get_group_id_2_42;\n    \n    get_group_id_2_42 = get_group_id(2);\n    \n    int32_t our_array_offset_30 = get_group_id_2_42 * x_elems_5 * y_elems_6;\n    int32_t odata_offset_33 = squot32(destoffset_1, 4) +",
                   " our_array_offset_30;\n    int32_t idata_offset_34 = squot32(srcoffset_3, 4) + our_array_offset_30;\n    int32_t x_index_31 = get_global_id_0_37;\n    int32_t y_index_32 = get_group_id_1_41 * 32 + get_local_id_1_39;\n    float val_44;\n    \n    if (slt32(x_index_31, x_elems_5)) {\n        for (int32_t j_43 = 0; j_43 < 4; j_43++) {\n            int32_t index_in_35 = (y_index_32 + j_43 * 8) * x_elems_5 +\n                    x_index_31;\n            \n            if (slt32(y_index_32 + j_43 * 8, y_elems_6)) {\n                val_44 = ((__global\n                           float *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                              index_in_35)];\n                ((__local float *) block_9)[sext_i32_i64((get_local_id_1_39 +\n                                                          j_43 * 8) * 33 +\n                                            get_local_id_0_38)] = val_44;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    x_index_31 = get_group_id_1_41 * 32 + get_local_id_0_38;\n    y_index_32 = get_group_id_0_40 * 32 + get_local_id_1_39;\n    if (slt32(x_index_31, y_elems_6)) {\n        for (int32_t j_43 = 0; j_43 < 4; j_43++) {\n            int32_t index_out_36 = (y_index_32 + j_43 * 8) * y_elems_6 +\n                    x_index_31;\n            \n            if (slt32(y_index_32 + j_43 * 8, x_elems_5)) {\n                val_44 = ((__local\n                           float *) block_9)[sext_i32_i64(get_local_id_0_38 *\n                                             33 + get_local_id_1_39 + j_43 *\n                                             8)];\n                ((__global float *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                               index_out_36)] = val_44;\n            }\n        }\n    }\n    \n  error_0:\n    return;\n}\n__kernel void gpu_map_transpose_f32_low_height(__local volatile\n                                               int64_t *block_9_backing_aligned_0,\n                                             ",
                   "  int32_t destoffset_1,\n                                               int32_t srcoffset_3,\n                                               int32_t num_arrays_4,\n                                               int32_t x_elems_5,\n                                               int32_t y_elems_6,\n                                               int32_t mulx_7, int32_t muly_8,\n                                               __global\n                                               unsigned char *destmem_0,\n                                               __global unsigned char *srcmem_2)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict block_9_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) block_9_backing_aligned_0;\n    __local unsigned char *block_9;\n    \n    block_9 = (__local unsigned char *) block_9_backing_0;\n    \n    int32_t get_global_id_0_37;\n    \n    get_global_id_0_37 = get_global_id(0);\n    \n    int32_t get_local_id_0_38;\n    \n    get_local_id_0_38 = get_local_id(0);\n    \n    int32_t get_local_id_1_39;\n    \n    get_local_id_1_39 = get_local_id(1);\n    \n    int32_t get_group_id_0_40;\n    \n    get_group_id_0_40 = get_group_id(0);\n    \n    int32_t get_group_id_1_41;\n    \n    get_group_id_1_41 = get_group_id(1);\n    \n    int32_t get_group_id_2_42;\n    \n    get_group_id_2_42 = get_group_id(2);\n    \n    int32_t our_array_offset_30 = get_group_id_2_42 * x_elems_5 * y_elems_6;\n    int32_t odata_offset_33 = squot32(destoffset_1, 4) + our_array_offset_30;\n    int32_t idata_offset_34 = squot32(srcoffset_3, 4) + our_array_offset_30;\n    int32_t x_index_31 = get_group_id_0_40 * 16 * mulx_7 + get_local_id_0_38 +\n            srem32(get_local_id_1_39, mulx_7) * 16;\n    int32_t y_index_32 = get_group_id_1_41 * 16 + squot32(get_local_id_1_39,\n                                                          mulx_7);\n    float val_44;\n   ",
                   " int32_t index_in_35 = y_index_32 * x_elems_5 + x_index_31;\n    \n    if (slt32(x_index_31, x_elems_5) && slt32(y_index_32, y_elems_6)) {\n        val_44 = ((__global float *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                               index_in_35)];\n        ((__local float *) block_9)[sext_i32_i64(get_local_id_1_39 * 17 +\n                                    get_local_id_0_38)] = val_44;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    x_index_31 = get_group_id_1_41 * 16 + squot32(get_local_id_0_38, mulx_7);\n    y_index_32 = get_group_id_0_40 * 16 * mulx_7 + get_local_id_1_39 +\n        srem32(get_local_id_0_38, mulx_7) * 16;\n    \n    int32_t index_out_36 = y_index_32 * y_elems_6 + x_index_31;\n    \n    if (slt32(x_index_31, y_elems_6) && slt32(y_index_32, x_elems_5)) {\n        val_44 = ((__local float *) block_9)[sext_i32_i64(get_local_id_0_38 *\n                                             17 + get_local_id_1_39)];\n        ((__global float *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                       index_out_36)] = val_44;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void gpu_map_transpose_f32_low_width(__local volatile\n                                              int64_t *block_9_backing_aligned_0,\n                                              int32_t destoffset_1,\n                                              int32_t srcoffset_3,\n                                              int32_t num_arrays_4,\n                                              int32_t x_elems_5,\n                                              int32_t y_elems_6, int32_t mulx_7,\n                                              int32_t muly_8, __global\n                                              unsigned char *destmem_0, __global\n                                              unsigned char *srcmem_2)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict block_9_backing_0 =\n       ",
                   "                            (__local volatile\n                                    unsigned char *) block_9_backing_aligned_0;\n    __local unsigned char *block_9;\n    \n    block_9 = (__local unsigned char *) block_9_backing_0;\n    \n    int32_t get_global_id_0_37;\n    \n    get_global_id_0_37 = get_global_id(0);\n    \n    int32_t get_local_id_0_38;\n    \n    get_local_id_0_38 = get_local_id(0);\n    \n    int32_t get_local_id_1_39;\n    \n    get_local_id_1_39 = get_local_id(1);\n    \n    int32_t get_group_id_0_40;\n    \n    get_group_id_0_40 = get_group_id(0);\n    \n    int32_t get_group_id_1_41;\n    \n    get_group_id_1_41 = get_group_id(1);\n    \n    int32_t get_group_id_2_42;\n    \n    get_group_id_2_42 = get_group_id(2);\n    \n    int32_t our_array_offset_30 = get_group_id_2_42 * x_elems_5 * y_elems_6;\n    int32_t odata_offset_33 = squot32(destoffset_1, 4) + our_array_offset_30;\n    int32_t idata_offset_34 = squot32(srcoffset_3, 4) + our_array_offset_30;\n    int32_t x_index_31 = get_group_id_0_40 * 16 + squot32(get_local_id_0_38,\n                                                          muly_8);\n    int32_t y_index_32 = get_group_id_1_41 * 16 * muly_8 + get_local_id_1_39 +\n            srem32(get_local_id_0_38, muly_8) * 16;\n    float val_44;\n    int32_t index_in_35 = y_index_32 * x_elems_5 + x_index_31;\n    \n    if (slt32(x_index_31, x_elems_5) && slt32(y_index_32, y_elems_6)) {\n        val_44 = ((__global float *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                               index_in_35)];\n        ((__local float *) block_9)[sext_i32_i64(get_local_id_1_39 * 17 +\n                                    get_local_id_0_38)] = val_44;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    x_index_31 = get_group_id_1_41 * 16 * muly_8 + get_local_id_0_38 +\n        srem32(get_local_id_1_39, muly_8) * 16;\n    y_index_32 = get_group_id_0_40 * 16 + squot32(get_local_id_1_39, muly_8);\n    \n    int32_t index_out_36 = y_index_32 * y_elems_6 + x_index_31;\n    \n    if (slt32(x_in",
                   "dex_31, y_elems_6) && slt32(y_index_32, x_elems_5)) {\n        val_44 = ((__local float *) block_9)[sext_i32_i64(get_local_id_0_38 *\n                                             17 + get_local_id_1_39)];\n        ((__global float *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                       index_out_36)] = val_44;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void gpu_map_transpose_f32_small(__local volatile\n                                          int64_t *block_9_backing_aligned_0,\n                                          int32_t destoffset_1,\n                                          int32_t srcoffset_3,\n                                          int32_t num_arrays_4,\n                                          int32_t x_elems_5, int32_t y_elems_6,\n                                          int32_t mulx_7, int32_t muly_8,\n                                          __global unsigned char *destmem_0,\n                                          __global unsigned char *srcmem_2)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict block_9_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) block_9_backing_aligned_0;\n    __local unsigned char *block_9;\n    \n    block_9 = (__local unsigned char *) block_9_backing_0;\n    \n    int32_t get_global_id_0_37;\n    \n    get_global_id_0_37 = get_global_id(0);\n    \n    int32_t get_local_id_0_38;\n    \n    get_local_id_0_38 = get_local_id(0);\n    \n    int32_t get_local_id_1_39;\n    \n    get_local_id_1_39 = get_local_id(1);\n    \n    int32_t get_group_id_0_40;\n    \n    get_group_id_0_40 = get_group_id(0);\n    \n    int32_t get_group_id_1_41;\n    \n    get_group_id_1_41 = get_group_id(1);\n    \n    int32_t get_group_id_2_42;\n    \n    get_group_id_2_42 = get_group_id(2);\n    \n    int32_t our_array_offset_30 = squot32(get_global_id_0_37, y_elems_6 *\n                            ",
                   "              x_elems_5) * (y_elems_6 * x_elems_5);\n    int32_t x_index_31 = squot32(srem32(get_global_id_0_37, y_elems_6 *\n                                        x_elems_5), y_elems_6);\n    int32_t y_index_32 = srem32(get_global_id_0_37, y_elems_6);\n    float val_44;\n    int32_t odata_offset_33 = squot32(destoffset_1, 4) + our_array_offset_30;\n    int32_t idata_offset_34 = squot32(srcoffset_3, 4) + our_array_offset_30;\n    int32_t index_in_35 = y_index_32 * x_elems_5 + x_index_31;\n    int32_t index_out_36 = x_index_31 * y_elems_6 + y_index_32;\n    \n    if (slt32(get_global_id_0_37, x_elems_5 * y_elems_6 * num_arrays_4)) {\n        val_44 = ((__global float *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                               index_in_35)];\n        ((__global float *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                       index_out_36)] = val_44;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainziscan_stage1_67850(__global int *global_failure,\n                                      __local volatile\n                                      int64_t *scan_arr_mem_78328_backing_aligned_0,\n                                      int64_t m_65343, int64_t n_65344,\n                                      int32_t num_threads_78322, __global\n                                      unsigned char *Y_mem_76976, __global\n                                      unsigned char *mem_77082)\n{\n    #define segscan_group_sizze_67844 (mainzisegscan_group_sizze_67824)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_78328_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_78328_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78323;\n    int32_t local_tid_78324;\n    int64_t group_sizze_78327;\n    int32_t wave_sizze_78326;\n",
                   "    int32_t group_tid_78325;\n    \n    global_tid_78323 = get_global_id(0);\n    local_tid_78324 = get_local_id(0);\n    group_sizze_78327 = get_local_size(0);\n    wave_sizze_78326 = LOCKSTEP_WIDTH;\n    group_tid_78325 = get_group_id(0);\n    \n    int32_t phys_tid_67850 = global_tid_78323;\n    __local unsigned char *scan_arr_mem_78328;\n    \n    scan_arr_mem_78328 = (__local unsigned char *) scan_arr_mem_78328_backing_0;\n    \n    int64_t x_67851;\n    int64_t x_67852;\n    \n    x_67851 = (int64_t) 0;\n    for (int64_t j_78330 = 0; j_78330 < sdiv_up64(m_65343 * n_65344,\n                                                  sext_i32_i64(num_threads_78322));\n         j_78330++) {\n        int64_t chunk_offset_78331 = segscan_group_sizze_67844 * j_78330 +\n                sext_i32_i64(group_tid_78325) * (segscan_group_sizze_67844 *\n                                                 sdiv_up64(m_65343 * n_65344,\n                                                           sext_i32_i64(num_threads_78322)));\n        int64_t flat_idx_78332 = chunk_offset_78331 +\n                sext_i32_i64(local_tid_78324);\n        int64_t gtid_67848 = squot64(flat_idx_78332, n_65344);\n        int64_t gtid_67849 = flat_idx_78332 - squot64(flat_idx_78332, n_65344) *\n                n_65344;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_67848, m_65343) && slt64(gtid_67849, n_65344)) {\n                float x_67855;\n                \n                x_67855 = ((__global float *) Y_mem_76976)[gtid_67848 *\n                                                           n_65344 +\n                                                           gtid_67849];\n                \n                bool isnan_res_67856;\n                \n                isnan_res_67856 = futrts_isnan32(x_67855);\n                \n                bool defunc_0_p_res_67857 = !isnan_res_67856;\n                int64_t defunc_0_f_res_67858 =\n                        btoi_bool_i64(defunc_0_p_res_67857);\n                \n ",
                   "               // write to-scan values to parameters\n                {\n                    x_67852 = defunc_0_f_res_67858;\n                }\n                // write mapped values results to global memory\n                { }\n            }\n        }\n        // do one intra-group scan operation\n        {\n            // maybe restore some to-scan values to parameters, or read neutral\n            {\n                if (!(slt64(gtid_67848, m_65343) && slt64(gtid_67849,\n                                                          n_65344))) {\n                    x_67852 = (int64_t) 0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                int64_t defunc_1_op_res_67853 = add64(x_67851, x_67852);\n                \n                ((__local\n                  int64_t *) scan_arr_mem_78328)[sext_i32_i64(local_tid_78324)] =\n                    defunc_1_op_res_67853;\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            int64_t x_78333;\n            int64_t x_78334;\n            int64_t x_78336;\n            int64_t x_78337;\n            bool ltid_in_bounds_78339 = slt64(sext_i32_i64(local_tid_78324),\n                                              segscan_group_sizze_67844);\n            int32_t skip_threads_78340;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_78339) {\n                    x_78334 = ((volatile __local\n                                int64_t *) scan_arr_mem_78328)[sext_i32_i64(local_tid_78324)];\n                    if ((local_tid_78324 - squot32(local_tid_78324, 32) * 32) ==\n                        0) {\n                        x_78333 = x_78334;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_78340 = 1;\n                while (slt32(skip_threads_78340, 32)) {\n                    bool thread_active_78341 = sle32(skip_t",
                   "hreads_78340,\n                                                     local_tid_78324 -\n                                                     squot32(local_tid_78324,\n                                                             32) * 32) &&\n                         ltid_in_bounds_78339;\n                    \n                    if (thread_active_78341) {\n                        // read operands\n                        {\n                            x_78333 = ((volatile __local\n                                        int64_t *) scan_arr_mem_78328)[sext_i32_i64(local_tid_78324) -\n                                                                       sext_i32_i64(skip_threads_78340)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_78342 =\n                             slt64(srem64(sext_i32_i64(local_tid_78324) +\n                                          chunk_offset_78331, n_65344),\n                                   sext_i32_i64(local_tid_78324) +\n                                   chunk_offset_78331 -\n                                   (sext_i32_i64(local_tid_78324 -\n                                    skip_threads_78340) + chunk_offset_78331));\n                        \n                        if (thread_active_78341 && inactive_78342) {\n                            x_78333 = x_78334;\n                        }\n                        if (thread_active_78341) {\n                            if (!inactive_78342) {\n                                int64_t defunc_1_op_res_78335 = add64(x_78333,\n                                                                      x_78334);\n                                \n                                x_78333 = defunc_1_op_res_78335;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_78326, skip_threads_78340)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n             ",
                   "       }\n                    if (thread_active_78341) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_78328)[sext_i32_i64(local_tid_78324)] =\n                                x_78333;\n                            x_78334 = x_78333;\n                        }\n                    }\n                    if (sle32(wave_sizze_78326, skip_threads_78340)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_78340 *= 2;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // last thread of block 'i' writes its result to offset 'i'\n            {\n                if ((local_tid_78324 - squot32(local_tid_78324, 32) * 32) ==\n                    31 && ltid_in_bounds_78339) {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_78328)[sext_i32_i64(squot32(local_tid_78324,\n                                                                          32))] =\n                        x_78333;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n            {\n                int32_t skip_threads_78343;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_78324, 32) == 0 &&\n                        ltid_in_bounds_78339) {\n                        x_78337 = ((volatile __local\n                                    int64_t *) scan_arr_mem_78328)[sext_i32_i64(local_tid_78324)];\n                        if ((local_tid_78324 - squot32(local_tid_78324, 32) *\n                             32) == 0) {\n                            x_78336 = x_78337;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n           ",
                   "     {\n                    skip_threads_78343 = 1;\n                    while (slt32(skip_threads_78343, 32)) {\n                        bool thread_active_78344 = sle32(skip_threads_78343,\n                                                         local_tid_78324 -\n                                                         squot32(local_tid_78324,\n                                                                 32) * 32) &&\n                             (squot32(local_tid_78324, 32) == 0 &&\n                              ltid_in_bounds_78339);\n                        \n                        if (thread_active_78344) {\n                            // read operands\n                            {\n                                x_78336 = ((volatile __local\n                                            int64_t *) scan_arr_mem_78328)[sext_i32_i64(local_tid_78324) -\n                                                                           sext_i32_i64(skip_threads_78343)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_78345 =\n                                 slt64(srem64(sext_i32_i64(local_tid_78324 *\n                                              32 + 32 - 1) + chunk_offset_78331,\n                                              n_65344),\n                                       sext_i32_i64(local_tid_78324 * 32 + 32 -\n                                       1) + chunk_offset_78331 -\n                                       (sext_i32_i64((local_tid_78324 -\n                                                      skip_threads_78343) * 32 +\n                                        32 - 1) + chunk_offset_78331));\n                            \n                            if (thread_active_78344 && inactive_78345) {\n                                x_78336 = x_78337;\n                            }\n                            if (thread_active_78344) {\n                             ",
                   "   if (!inactive_78345) {\n                                    int64_t defunc_1_op_res_78338 =\n                                            add64(x_78336, x_78337);\n                                    \n                                    x_78336 = defunc_1_op_res_78338;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_78326, skip_threads_78343)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_78344) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_78328)[sext_i32_i64(local_tid_78324)] =\n                                    x_78336;\n                                x_78337 = x_78336;\n                            }\n                        }\n                        if (sle32(wave_sizze_78326, skip_threads_78343)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_78343 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            bool no_carry_in_78346 = squot32(local_tid_78324, 32) == 0 ||\n                 !ltid_in_bounds_78339;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_78346) {\n                        x_78334 = x_78333;\n                        x_78333 = ((__local\n                                    int64_t *) scan_arr_mem_78328)[sext_i32_i64(squot32(local_tid_78324,\n                                                                                        32)) -\n                                                                   (int64_t) 1];\n                    }\n                }\n                // perform operation",
                   "\n                {\n                    bool inactive_78347 =\n                         slt64(srem64(sext_i32_i64(local_tid_78324) +\n                                      chunk_offset_78331, n_65344),\n                               sext_i32_i64(local_tid_78324) +\n                               chunk_offset_78331 -\n                               (sext_i32_i64(squot32(local_tid_78324, 32) * 32 -\n                                1) + chunk_offset_78331));\n                    \n                    if (!no_carry_in_78346) {\n                        if (inactive_78347) {\n                            x_78333 = x_78334;\n                        }\n                    }\n                    if (!no_carry_in_78346) {\n                        if (!inactive_78347) {\n                            int64_t defunc_1_op_res_78335 = add64(x_78333,\n                                                                  x_78334);\n                            \n                            x_78333 = defunc_1_op_res_78335;\n                        }\n                    }\n                }\n                // write final result\n                {\n                    if (!no_carry_in_78346) {\n                        ((__local\n                          int64_t *) scan_arr_mem_78328)[sext_i32_i64(local_tid_78324)] =\n                            x_78333;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_78324, 32) == 0 && ltid_in_bounds_78339) {\n                    ((__local\n                      int64_t *) scan_arr_mem_78328)[sext_i32_i64(local_tid_78324)] =\n                        x_78334;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_67848, m_65343) && slt64(gtid_67849, n_65344)) {\n                    int64_t tmp_78348;\n               ",
                   "     \n                    tmp_78348 = ((__local\n                                  int64_t *) scan_arr_mem_78328)[sext_i32_i64(local_tid_78324)];\n                    ((__global int64_t *) mem_77082)[gtid_67848 * n_65344 +\n                                                     gtid_67849] = tmp_78348;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // first thread reads last element as carry-in for next iteration\n            {\n                bool crosses_segment_78349 = slt64(srem64(chunk_offset_78331 +\n                                                          segscan_group_sizze_67844,\n                                                          n_65344),\n                                                   chunk_offset_78331 +\n                                                   segscan_group_sizze_67844 -\n                                                   (chunk_offset_78331 +\n                                                    segscan_group_sizze_67844 -\n                                                    (int64_t) 1));\n                bool should_load_carry_78350 = local_tid_78324 == 0 &&\n                     !crosses_segment_78349;\n                \n                if (should_load_carry_78350) {\n                    x_67851 = ((__local\n                                int64_t *) scan_arr_mem_78328)[segscan_group_sizze_67844 -\n                                                               (int64_t) 1];\n                }\n                if (!should_load_carry_78350) {\n                    x_67851 = (int64_t) 0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_67844\n}\n__kernel void mainziscan_stage1_69641(__global int *global_failure,\n                                      __local volatile\n                                      int64_t *scan_arr_mem_78693_backing_aligned_0,\n                                      int64_t m_65343, int64_t n_65344",
                   ",\n                                      int32_t num_threads_78687, __global\n                                      unsigned char *Y_mem_76976, __global\n                                      unsigned char *mem_77316)\n{\n    #define segscan_group_sizze_69635 (mainzisegscan_group_sizze_69615)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_78693_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_78693_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78688;\n    int32_t local_tid_78689;\n    int64_t group_sizze_78692;\n    int32_t wave_sizze_78691;\n    int32_t group_tid_78690;\n    \n    global_tid_78688 = get_global_id(0);\n    local_tid_78689 = get_local_id(0);\n    group_sizze_78692 = get_local_size(0);\n    wave_sizze_78691 = LOCKSTEP_WIDTH;\n    group_tid_78690 = get_group_id(0);\n    \n    int32_t phys_tid_69641 = global_tid_78688;\n    __local unsigned char *scan_arr_mem_78693;\n    \n    scan_arr_mem_78693 = (__local unsigned char *) scan_arr_mem_78693_backing_0;\n    \n    int64_t x_69642;\n    int64_t x_69643;\n    \n    x_69642 = (int64_t) 0;\n    for (int64_t j_78695 = 0; j_78695 < sdiv_up64(m_65343 * n_65344,\n                                                  sext_i32_i64(num_threads_78687));\n         j_78695++) {\n        int64_t chunk_offset_78696 = segscan_group_sizze_69635 * j_78695 +\n                sext_i32_i64(group_tid_78690) * (segscan_group_sizze_69635 *\n                                                 sdiv_up64(m_65343 * n_65344,\n                                                           sext_i32_i64(num_threads_78687)));\n        int64_t flat_idx_78697 = chunk_offset_78696 +\n                sext_i32_i64(local_tid_78689);\n        int64_t gtid_69639 = squot64(flat_idx_78697, n_65344);\n        int64_t gtid_69640 = flat_idx_78697 - squot64(flat",
                   "_idx_78697, n_65344) *\n                n_65344;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_69639, m_65343) && slt64(gtid_69640, n_65344)) {\n                float x_69646;\n                \n                x_69646 = ((__global float *) Y_mem_76976)[gtid_69639 *\n                                                           n_65344 +\n                                                           gtid_69640];\n                \n                bool isnan_res_69647;\n                \n                isnan_res_69647 = futrts_isnan32(x_69646);\n                \n                bool defunc_0_p_res_69648 = !isnan_res_69647;\n                int64_t defunc_0_f_res_69649 =\n                        btoi_bool_i64(defunc_0_p_res_69648);\n                \n                // write to-scan values to parameters\n                {\n                    x_69643 = defunc_0_f_res_69649;\n                }\n                // write mapped values results to global memory\n                { }\n            }\n        }\n        // do one intra-group scan operation\n        {\n            // maybe restore some to-scan values to parameters, or read neutral\n            {\n                if (!(slt64(gtid_69639, m_65343) && slt64(gtid_69640,\n                                                          n_65344))) {\n                    x_69643 = (int64_t) 0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                int64_t defunc_1_op_res_69644 = add64(x_69642, x_69643);\n                \n                ((__local\n                  int64_t *) scan_arr_mem_78693)[sext_i32_i64(local_tid_78689)] =\n                    defunc_1_op_res_69644;\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            int64_t x_78698;\n            int64_t x_78699;\n            int64_t x_78701;\n            int64_t x_78702;\n            bool ltid_in_bounds_78704 = slt64(sext_i32_i64(local_tid_78689),\n                             ",
                   "                 segscan_group_sizze_69635);\n            int32_t skip_threads_78705;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_78704) {\n                    x_78699 = ((volatile __local\n                                int64_t *) scan_arr_mem_78693)[sext_i32_i64(local_tid_78689)];\n                    if ((local_tid_78689 - squot32(local_tid_78689, 32) * 32) ==\n                        0) {\n                        x_78698 = x_78699;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_78705 = 1;\n                while (slt32(skip_threads_78705, 32)) {\n                    bool thread_active_78706 = sle32(skip_threads_78705,\n                                                     local_tid_78689 -\n                                                     squot32(local_tid_78689,\n                                                             32) * 32) &&\n                         ltid_in_bounds_78704;\n                    \n                    if (thread_active_78706) {\n                        // read operands\n                        {\n                            x_78698 = ((volatile __local\n                                        int64_t *) scan_arr_mem_78693)[sext_i32_i64(local_tid_78689) -\n                                                                       sext_i32_i64(skip_threads_78705)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_78707 =\n                             slt64(srem64(sext_i32_i64(local_tid_78689) +\n                                          chunk_offset_78696, n_65344),\n                                   sext_i32_i64(local_tid_78689) +\n                                   chunk_offset_78696 -\n                                   (sext_i32_i64(local_tid_78689 -\n                                    skip_t",
                   "hreads_78705) + chunk_offset_78696));\n                        \n                        if (thread_active_78706 && inactive_78707) {\n                            x_78698 = x_78699;\n                        }\n                        if (thread_active_78706) {\n                            if (!inactive_78707) {\n                                int64_t defunc_1_op_res_78700 = add64(x_78698,\n                                                                      x_78699);\n                                \n                                x_78698 = defunc_1_op_res_78700;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_78691, skip_threads_78705)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_78706) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_78693)[sext_i32_i64(local_tid_78689)] =\n                                x_78698;\n                            x_78699 = x_78698;\n                        }\n                    }\n                    if (sle32(wave_sizze_78691, skip_threads_78705)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_78705 *= 2;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // last thread of block 'i' writes its result to offset 'i'\n            {\n                if ((local_tid_78689 - squot32(local_tid_78689, 32) * 32) ==\n                    31 && ltid_in_bounds_78704) {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_78693)[sext_i32_i64(squot32(local_tid_78689,\n                                                                          32))] =\n                        x_78698;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // scan the",
                   " first block, after which offset 'i' contains carry-in for block 'i+1'\n            {\n                int32_t skip_threads_78708;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_78689, 32) == 0 &&\n                        ltid_in_bounds_78704) {\n                        x_78702 = ((volatile __local\n                                    int64_t *) scan_arr_mem_78693)[sext_i32_i64(local_tid_78689)];\n                        if ((local_tid_78689 - squot32(local_tid_78689, 32) *\n                             32) == 0) {\n                            x_78701 = x_78702;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_78708 = 1;\n                    while (slt32(skip_threads_78708, 32)) {\n                        bool thread_active_78709 = sle32(skip_threads_78708,\n                                                         local_tid_78689 -\n                                                         squot32(local_tid_78689,\n                                                                 32) * 32) &&\n                             (squot32(local_tid_78689, 32) == 0 &&\n                              ltid_in_bounds_78704);\n                        \n                        if (thread_active_78709) {\n                            // read operands\n                            {\n                                x_78701 = ((volatile __local\n                                            int64_t *) scan_arr_mem_78693)[sext_i32_i64(local_tid_78689) -\n                                                                           sext_i32_i64(skip_threads_78708)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_78710 =\n                                 slt64(srem64(sext_i32_i64(local_tid_78",
                   "689 *\n                                              32 + 32 - 1) + chunk_offset_78696,\n                                              n_65344),\n                                       sext_i32_i64(local_tid_78689 * 32 + 32 -\n                                       1) + chunk_offset_78696 -\n                                       (sext_i32_i64((local_tid_78689 -\n                                                      skip_threads_78708) * 32 +\n                                        32 - 1) + chunk_offset_78696));\n                            \n                            if (thread_active_78709 && inactive_78710) {\n                                x_78701 = x_78702;\n                            }\n                            if (thread_active_78709) {\n                                if (!inactive_78710) {\n                                    int64_t defunc_1_op_res_78703 =\n                                            add64(x_78701, x_78702);\n                                    \n                                    x_78701 = defunc_1_op_res_78703;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_78691, skip_threads_78708)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_78709) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_78693)[sext_i32_i64(local_tid_78689)] =\n                                    x_78701;\n                                x_78702 = x_78701;\n                            }\n                        }\n                        if (sle32(wave_sizze_78691, skip_threads_78708)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_78708 *= 2;\n                    }\n                }\n            }\n            ba",
                   "rrier(CLK_LOCAL_MEM_FENCE);\n            \n            bool no_carry_in_78711 = squot32(local_tid_78689, 32) == 0 ||\n                 !ltid_in_bounds_78704;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_78711) {\n                        x_78699 = x_78698;\n                        x_78698 = ((__local\n                                    int64_t *) scan_arr_mem_78693)[sext_i32_i64(squot32(local_tid_78689,\n                                                                                        32)) -\n                                                                   (int64_t) 1];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_78712 =\n                         slt64(srem64(sext_i32_i64(local_tid_78689) +\n                                      chunk_offset_78696, n_65344),\n                               sext_i32_i64(local_tid_78689) +\n                               chunk_offset_78696 -\n                               (sext_i32_i64(squot32(local_tid_78689, 32) * 32 -\n                                1) + chunk_offset_78696));\n                    \n                    if (!no_carry_in_78711) {\n                        if (inactive_78712) {\n                            x_78698 = x_78699;\n                        }\n                    }\n                    if (!no_carry_in_78711) {\n                        if (!inactive_78712) {\n                            int64_t defunc_1_op_res_78700 = add64(x_78698,\n                                                                  x_78699);\n                            \n                            x_78698 = defunc_1_op_res_78700;\n                        }\n                    }\n                }\n                // write final result\n                {\n                    if (!no_carry_in_78711) {\n                        ((__local\n                      ",
                   "    int64_t *) scan_arr_mem_78693)[sext_i32_i64(local_tid_78689)] =\n                            x_78698;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_78689, 32) == 0 && ltid_in_bounds_78704) {\n                    ((__local\n                      int64_t *) scan_arr_mem_78693)[sext_i32_i64(local_tid_78689)] =\n                        x_78699;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_69639, m_65343) && slt64(gtid_69640, n_65344)) {\n                    int64_t tmp_78713;\n                    \n                    tmp_78713 = ((__local\n                                  int64_t *) scan_arr_mem_78693)[sext_i32_i64(local_tid_78689)];\n                    ((__global int64_t *) mem_77316)[gtid_69639 * n_65344 +\n                                                     gtid_69640] = tmp_78713;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // first thread reads last element as carry-in for next iteration\n            {\n                bool crosses_segment_78714 = slt64(srem64(chunk_offset_78696 +\n                                                          segscan_group_sizze_69635,\n                                                          n_65344),\n                                                   chunk_offset_78696 +\n                                                   segscan_group_sizze_69635 -\n                                                   (chunk_offset_78696 +\n                                                    segscan_group_sizze_69635 -\n                                                    (int64_t) 1));\n                bool should_load_carry_78715 = local_tid_78689 == 0 &&\n                     !crosses_segment_78714;\n                \n                if ",
                   "(should_load_carry_78715) {\n                    x_69642 = ((__local\n                                int64_t *) scan_arr_mem_78693)[segscan_group_sizze_69635 -\n                                                               (int64_t) 1];\n                }\n                if (!should_load_carry_78715) {\n                    x_69642 = (int64_t) 0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_69635\n}\n__kernel void mainziscan_stage1_71680(__global int *global_failure,\n                                      __local volatile\n                                      int64_t *scan_arr_mem_79110_backing_aligned_0,\n                                      int64_t m_65343, int64_t n_65344,\n                                      int32_t num_threads_79104, __global\n                                      unsigned char *Y_mem_76976, __global\n                                      unsigned char *mem_77608)\n{\n    #define segscan_group_sizze_71674 (mainzisegscan_group_sizze_71654)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_79110_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_79110_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79105;\n    int32_t local_tid_79106;\n    int64_t group_sizze_79109;\n    int32_t wave_sizze_79108;\n    int32_t group_tid_79107;\n    \n    global_tid_79105 = get_global_id(0);\n    local_tid_79106 = get_local_id(0);\n    group_sizze_79109 = get_local_size(0);\n    wave_sizze_79108 = LOCKSTEP_WIDTH;\n    group_tid_79107 = get_group_id(0);\n    \n    int32_t phys_tid_71680 = global_tid_79105;\n    __local unsigned char *scan_arr_mem_79110;\n    \n    scan_arr_mem_79110 = (__local unsigned char *) scan_arr_mem_79110_backing_0;\n    \n    int64_t x_7",
                   "1681;\n    int64_t x_71682;\n    \n    x_71681 = (int64_t) 0;\n    for (int64_t j_79112 = 0; j_79112 < sdiv_up64(m_65343 * n_65344,\n                                                  sext_i32_i64(num_threads_79104));\n         j_79112++) {\n        int64_t chunk_offset_79113 = segscan_group_sizze_71674 * j_79112 +\n                sext_i32_i64(group_tid_79107) * (segscan_group_sizze_71674 *\n                                                 sdiv_up64(m_65343 * n_65344,\n                                                           sext_i32_i64(num_threads_79104)));\n        int64_t flat_idx_79114 = chunk_offset_79113 +\n                sext_i32_i64(local_tid_79106);\n        int64_t gtid_71678 = squot64(flat_idx_79114, n_65344);\n        int64_t gtid_71679 = flat_idx_79114 - squot64(flat_idx_79114, n_65344) *\n                n_65344;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_71678, m_65343) && slt64(gtid_71679, n_65344)) {\n                float x_71685;\n                \n                x_71685 = ((__global float *) Y_mem_76976)[gtid_71678 *\n                                                           n_65344 +\n                                                           gtid_71679];\n                \n                bool isnan_res_71686;\n                \n                isnan_res_71686 = futrts_isnan32(x_71685);\n                \n                bool defunc_0_p_res_71687 = !isnan_res_71686;\n                int64_t defunc_0_f_res_71688 =\n                        btoi_bool_i64(defunc_0_p_res_71687);\n                \n                // write to-scan values to parameters\n                {\n                    x_71682 = defunc_0_f_res_71688;\n                }\n                // write mapped values results to global memory\n                { }\n            }\n        }\n        // do one intra-group scan operation\n        {\n            // maybe restore some to-scan values to parameters, or read neutral\n            {\n                if (!(slt64(gtid_71678, m_",
                   "65343) && slt64(gtid_71679,\n                                                          n_65344))) {\n                    x_71682 = (int64_t) 0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                int64_t defunc_1_op_res_71683 = add64(x_71681, x_71682);\n                \n                ((__local\n                  int64_t *) scan_arr_mem_79110)[sext_i32_i64(local_tid_79106)] =\n                    defunc_1_op_res_71683;\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            int64_t x_79115;\n            int64_t x_79116;\n            int64_t x_79118;\n            int64_t x_79119;\n            bool ltid_in_bounds_79121 = slt64(sext_i32_i64(local_tid_79106),\n                                              segscan_group_sizze_71674);\n            int32_t skip_threads_79122;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_79121) {\n                    x_79116 = ((volatile __local\n                                int64_t *) scan_arr_mem_79110)[sext_i32_i64(local_tid_79106)];\n                    if ((local_tid_79106 - squot32(local_tid_79106, 32) * 32) ==\n                        0) {\n                        x_79115 = x_79116;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_79122 = 1;\n                while (slt32(skip_threads_79122, 32)) {\n                    bool thread_active_79123 = sle32(skip_threads_79122,\n                                                     local_tid_79106 -\n                                                     squot32(local_tid_79106,\n                                                             32) * 32) &&\n                         ltid_in_bounds_79121;\n                    \n                    if (thread_active_79123) {\n                        // read operands\n                        {\n                     ",
                   "       x_79115 = ((volatile __local\n                                        int64_t *) scan_arr_mem_79110)[sext_i32_i64(local_tid_79106) -\n                                                                       sext_i32_i64(skip_threads_79122)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_79124 =\n                             slt64(srem64(sext_i32_i64(local_tid_79106) +\n                                          chunk_offset_79113, n_65344),\n                                   sext_i32_i64(local_tid_79106) +\n                                   chunk_offset_79113 -\n                                   (sext_i32_i64(local_tid_79106 -\n                                    skip_threads_79122) + chunk_offset_79113));\n                        \n                        if (thread_active_79123 && inactive_79124) {\n                            x_79115 = x_79116;\n                        }\n                        if (thread_active_79123) {\n                            if (!inactive_79124) {\n                                int64_t defunc_1_op_res_79117 = add64(x_79115,\n                                                                      x_79116);\n                                \n                                x_79115 = defunc_1_op_res_79117;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_79108, skip_threads_79122)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_79123) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_79110)[sext_i32_i64(local_tid_79106)] =\n                                x_79115;\n                            x_79116 = x_79115;\n                        }\n                    }\n                    if (sle32(wave_sizze_",
                   "79108, skip_threads_79122)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_79122 *= 2;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // last thread of block 'i' writes its result to offset 'i'\n            {\n                if ((local_tid_79106 - squot32(local_tid_79106, 32) * 32) ==\n                    31 && ltid_in_bounds_79121) {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_79110)[sext_i32_i64(squot32(local_tid_79106,\n                                                                          32))] =\n                        x_79115;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n            {\n                int32_t skip_threads_79125;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_79106, 32) == 0 &&\n                        ltid_in_bounds_79121) {\n                        x_79119 = ((volatile __local\n                                    int64_t *) scan_arr_mem_79110)[sext_i32_i64(local_tid_79106)];\n                        if ((local_tid_79106 - squot32(local_tid_79106, 32) *\n                             32) == 0) {\n                            x_79118 = x_79119;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_79125 = 1;\n                    while (slt32(skip_threads_79125, 32)) {\n                        bool thread_active_79126 = sle32(skip_threads_79125,\n                                                         local_tid_79106 -\n                                                         squot32(local_tid_79106,\n                                                                 32) * 32) &&\n                 ",
                   "            (squot32(local_tid_79106, 32) == 0 &&\n                              ltid_in_bounds_79121);\n                        \n                        if (thread_active_79126) {\n                            // read operands\n                            {\n                                x_79118 = ((volatile __local\n                                            int64_t *) scan_arr_mem_79110)[sext_i32_i64(local_tid_79106) -\n                                                                           sext_i32_i64(skip_threads_79125)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_79127 =\n                                 slt64(srem64(sext_i32_i64(local_tid_79106 *\n                                              32 + 32 - 1) + chunk_offset_79113,\n                                              n_65344),\n                                       sext_i32_i64(local_tid_79106 * 32 + 32 -\n                                       1) + chunk_offset_79113 -\n                                       (sext_i32_i64((local_tid_79106 -\n                                                      skip_threads_79125) * 32 +\n                                        32 - 1) + chunk_offset_79113));\n                            \n                            if (thread_active_79126 && inactive_79127) {\n                                x_79118 = x_79119;\n                            }\n                            if (thread_active_79126) {\n                                if (!inactive_79127) {\n                                    int64_t defunc_1_op_res_79120 =\n                                            add64(x_79118, x_79119);\n                                    \n                                    x_79118 = defunc_1_op_res_79120;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_79108, skip_threads_79125)) {\n      ",
                   "                      barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_79126) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_79110)[sext_i32_i64(local_tid_79106)] =\n                                    x_79118;\n                                x_79119 = x_79118;\n                            }\n                        }\n                        if (sle32(wave_sizze_79108, skip_threads_79125)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_79125 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            bool no_carry_in_79128 = squot32(local_tid_79106, 32) == 0 ||\n                 !ltid_in_bounds_79121;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_79128) {\n                        x_79116 = x_79115;\n                        x_79115 = ((__local\n                                    int64_t *) scan_arr_mem_79110)[sext_i32_i64(squot32(local_tid_79106,\n                                                                                        32)) -\n                                                                   (int64_t) 1];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_79129 =\n                         slt64(srem64(sext_i32_i64(local_tid_79106) +\n                                      chunk_offset_79113, n_65344),\n                               sext_i32_i64(local_tid_79106) +\n                               chunk_offset_79113 -\n                               (sext_i32_i64(squot32(local_tid_79106, 32) * 32 -\n                                1) + chunk_of",
                   "fset_79113));\n                    \n                    if (!no_carry_in_79128) {\n                        if (inactive_79129) {\n                            x_79115 = x_79116;\n                        }\n                    }\n                    if (!no_carry_in_79128) {\n                        if (!inactive_79129) {\n                            int64_t defunc_1_op_res_79117 = add64(x_79115,\n                                                                  x_79116);\n                            \n                            x_79115 = defunc_1_op_res_79117;\n                        }\n                    }\n                }\n                // write final result\n                {\n                    if (!no_carry_in_79128) {\n                        ((__local\n                          int64_t *) scan_arr_mem_79110)[sext_i32_i64(local_tid_79106)] =\n                            x_79115;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_79106, 32) == 0 && ltid_in_bounds_79121) {\n                    ((__local\n                      int64_t *) scan_arr_mem_79110)[sext_i32_i64(local_tid_79106)] =\n                        x_79116;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_71678, m_65343) && slt64(gtid_71679, n_65344)) {\n                    int64_t tmp_79130;\n                    \n                    tmp_79130 = ((__local\n                                  int64_t *) scan_arr_mem_79110)[sext_i32_i64(local_tid_79106)];\n                    ((__global int64_t *) mem_77608)[gtid_71678 * n_65344 +\n                                                     gtid_71679] = tmp_79130;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // first thread reads last element as carry-in for next",
                   " iteration\n            {\n                bool crosses_segment_79131 = slt64(srem64(chunk_offset_79113 +\n                                                          segscan_group_sizze_71674,\n                                                          n_65344),\n                                                   chunk_offset_79113 +\n                                                   segscan_group_sizze_71674 -\n                                                   (chunk_offset_79113 +\n                                                    segscan_group_sizze_71674 -\n                                                    (int64_t) 1));\n                bool should_load_carry_79132 = local_tid_79106 == 0 &&\n                     !crosses_segment_79131;\n                \n                if (should_load_carry_79132) {\n                    x_71681 = ((__local\n                                int64_t *) scan_arr_mem_79110)[segscan_group_sizze_71674 -\n                                                               (int64_t) 1];\n                }\n                if (!should_load_carry_79132) {\n                    x_71681 = (int64_t) 0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_71674\n}\n__kernel void mainziscan_stage1_72665(__global int *global_failure,\n                                      __local volatile\n                                      int64_t *scan_arr_mem_79527_backing_aligned_0,\n                                      int64_t m_65343, int64_t n_65344,\n                                      int32_t num_threads_79521, __global\n                                      unsigned char *Y_mem_76976, __global\n                                      unsigned char *mem_77833)\n{\n    #define segscan_group_sizze_72659 (mainzisegscan_group_sizze_72639)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_me",
                   "m_79527_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_79527_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79522;\n    int32_t local_tid_79523;\n    int64_t group_sizze_79526;\n    int32_t wave_sizze_79525;\n    int32_t group_tid_79524;\n    \n    global_tid_79522 = get_global_id(0);\n    local_tid_79523 = get_local_id(0);\n    group_sizze_79526 = get_local_size(0);\n    wave_sizze_79525 = LOCKSTEP_WIDTH;\n    group_tid_79524 = get_group_id(0);\n    \n    int32_t phys_tid_72665 = global_tid_79522;\n    __local unsigned char *scan_arr_mem_79527;\n    \n    scan_arr_mem_79527 = (__local unsigned char *) scan_arr_mem_79527_backing_0;\n    \n    int64_t x_72666;\n    int64_t x_72667;\n    \n    x_72666 = (int64_t) 0;\n    for (int64_t j_79529 = 0; j_79529 < sdiv_up64(m_65343 * n_65344,\n                                                  sext_i32_i64(num_threads_79521));\n         j_79529++) {\n        int64_t chunk_offset_79530 = segscan_group_sizze_72659 * j_79529 +\n                sext_i32_i64(group_tid_79524) * (segscan_group_sizze_72659 *\n                                                 sdiv_up64(m_65343 * n_65344,\n                                                           sext_i32_i64(num_threads_79521)));\n        int64_t flat_idx_79531 = chunk_offset_79530 +\n                sext_i32_i64(local_tid_79523);\n        int64_t gtid_72663 = squot64(flat_idx_79531, n_65344);\n        int64_t gtid_72664 = flat_idx_79531 - squot64(flat_idx_79531, n_65344) *\n                n_65344;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_72663, m_65343) && slt64(gtid_72664, n_65344)) {\n                float x_72670;\n                \n                x_72670 = ((__global float *) Y_mem_76976)[gtid_72663 *\n                                                           n_65344 +\n                                                           gtid_7266",
                   "4];\n                \n                bool isnan_res_72671;\n                \n                isnan_res_72671 = futrts_isnan32(x_72670);\n                \n                bool defunc_0_p_res_72672 = !isnan_res_72671;\n                int64_t defunc_0_f_res_72673 =\n                        btoi_bool_i64(defunc_0_p_res_72672);\n                \n                // write to-scan values to parameters\n                {\n                    x_72667 = defunc_0_f_res_72673;\n                }\n                // write mapped values results to global memory\n                { }\n            }\n        }\n        // do one intra-group scan operation\n        {\n            // maybe restore some to-scan values to parameters, or read neutral\n            {\n                if (!(slt64(gtid_72663, m_65343) && slt64(gtid_72664,\n                                                          n_65344))) {\n                    x_72667 = (int64_t) 0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                int64_t defunc_1_op_res_72668 = add64(x_72666, x_72667);\n                \n                ((__local\n                  int64_t *) scan_arr_mem_79527)[sext_i32_i64(local_tid_79523)] =\n                    defunc_1_op_res_72668;\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            int64_t x_79532;\n            int64_t x_79533;\n            int64_t x_79535;\n            int64_t x_79536;\n            bool ltid_in_bounds_79538 = slt64(sext_i32_i64(local_tid_79523),\n                                              segscan_group_sizze_72659);\n            int32_t skip_threads_79539;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_79538) {\n                    x_79533 = ((volatile __local\n                                int64_t *) scan_arr_mem_79527)[sext_i32_i64(local_tid_79523)];\n                    if ((local_tid_79523 - squot32(local_tid_79523, 32) * 32) ==\n               ",
                   "         0) {\n                        x_79532 = x_79533;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_79539 = 1;\n                while (slt32(skip_threads_79539, 32)) {\n                    bool thread_active_79540 = sle32(skip_threads_79539,\n                                                     local_tid_79523 -\n                                                     squot32(local_tid_79523,\n                                                             32) * 32) &&\n                         ltid_in_bounds_79538;\n                    \n                    if (thread_active_79540) {\n                        // read operands\n                        {\n                            x_79532 = ((volatile __local\n                                        int64_t *) scan_arr_mem_79527)[sext_i32_i64(local_tid_79523) -\n                                                                       sext_i32_i64(skip_threads_79539)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_79541 =\n                             slt64(srem64(sext_i32_i64(local_tid_79523) +\n                                          chunk_offset_79530, n_65344),\n                                   sext_i32_i64(local_tid_79523) +\n                                   chunk_offset_79530 -\n                                   (sext_i32_i64(local_tid_79523 -\n                                    skip_threads_79539) + chunk_offset_79530));\n                        \n                        if (thread_active_79540 && inactive_79541) {\n                            x_79532 = x_79533;\n                        }\n                        if (thread_active_79540) {\n                            if (!inactive_79541) {\n                                int64_t defunc_1_op_res_79534 = add64(x_79532,\n                                                      ",
                   "                x_79533);\n                                \n                                x_79532 = defunc_1_op_res_79534;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_79525, skip_threads_79539)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_79540) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_79527)[sext_i32_i64(local_tid_79523)] =\n                                x_79532;\n                            x_79533 = x_79532;\n                        }\n                    }\n                    if (sle32(wave_sizze_79525, skip_threads_79539)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_79539 *= 2;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // last thread of block 'i' writes its result to offset 'i'\n            {\n                if ((local_tid_79523 - squot32(local_tid_79523, 32) * 32) ==\n                    31 && ltid_in_bounds_79538) {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_79527)[sext_i32_i64(squot32(local_tid_79523,\n                                                                          32))] =\n                        x_79532;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n            {\n                int32_t skip_threads_79542;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_79523, 32) == 0 &&\n                        ltid_in_bounds_79538) {\n                        x_79536 = ((volatile __local\n                                    int64_t *) scan_arr_mem_79527)",
                   "[sext_i32_i64(local_tid_79523)];\n                        if ((local_tid_79523 - squot32(local_tid_79523, 32) *\n                             32) == 0) {\n                            x_79535 = x_79536;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_79542 = 1;\n                    while (slt32(skip_threads_79542, 32)) {\n                        bool thread_active_79543 = sle32(skip_threads_79542,\n                                                         local_tid_79523 -\n                                                         squot32(local_tid_79523,\n                                                                 32) * 32) &&\n                             (squot32(local_tid_79523, 32) == 0 &&\n                              ltid_in_bounds_79538);\n                        \n                        if (thread_active_79543) {\n                            // read operands\n                            {\n                                x_79535 = ((volatile __local\n                                            int64_t *) scan_arr_mem_79527)[sext_i32_i64(local_tid_79523) -\n                                                                           sext_i32_i64(skip_threads_79542)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_79544 =\n                                 slt64(srem64(sext_i32_i64(local_tid_79523 *\n                                              32 + 32 - 1) + chunk_offset_79530,\n                                              n_65344),\n                                       sext_i32_i64(local_tid_79523 * 32 + 32 -\n                                       1) + chunk_offset_79530 -\n                                       (sext_i32_i64((local_tid_79523 -\n                                                      skip_threads_79542) * 32 +",
                   "\n                                        32 - 1) + chunk_offset_79530));\n                            \n                            if (thread_active_79543 && inactive_79544) {\n                                x_79535 = x_79536;\n                            }\n                            if (thread_active_79543) {\n                                if (!inactive_79544) {\n                                    int64_t defunc_1_op_res_79537 =\n                                            add64(x_79535, x_79536);\n                                    \n                                    x_79535 = defunc_1_op_res_79537;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_79525, skip_threads_79542)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_79543) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_79527)[sext_i32_i64(local_tid_79523)] =\n                                    x_79535;\n                                x_79536 = x_79535;\n                            }\n                        }\n                        if (sle32(wave_sizze_79525, skip_threads_79542)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_79542 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            bool no_carry_in_79545 = squot32(local_tid_79523, 32) == 0 ||\n                 !ltid_in_bounds_79538;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_79545) {\n                        x_79533 = x_79532;\n                        x_79532 = ((__local\n                 ",
                   "                   int64_t *) scan_arr_mem_79527)[sext_i32_i64(squot32(local_tid_79523,\n                                                                                        32)) -\n                                                                   (int64_t) 1];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_79546 =\n                         slt64(srem64(sext_i32_i64(local_tid_79523) +\n                                      chunk_offset_79530, n_65344),\n                               sext_i32_i64(local_tid_79523) +\n                               chunk_offset_79530 -\n                               (sext_i32_i64(squot32(local_tid_79523, 32) * 32 -\n                                1) + chunk_offset_79530));\n                    \n                    if (!no_carry_in_79545) {\n                        if (inactive_79546) {\n                            x_79532 = x_79533;\n                        }\n                    }\n                    if (!no_carry_in_79545) {\n                        if (!inactive_79546) {\n                            int64_t defunc_1_op_res_79534 = add64(x_79532,\n                                                                  x_79533);\n                            \n                            x_79532 = defunc_1_op_res_79534;\n                        }\n                    }\n                }\n                // write final result\n                {\n                    if (!no_carry_in_79545) {\n                        ((__local\n                          int64_t *) scan_arr_mem_79527)[sext_i32_i64(local_tid_79523)] =\n                            x_79532;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_79523, 32) == 0 && ltid_in_bounds_79538) {\n                    ((__local\n                      int64_t *) scan_arr_mem_79527)[sext_i3",
                   "2_i64(local_tid_79523)] =\n                        x_79533;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_72663, m_65343) && slt64(gtid_72664, n_65344)) {\n                    int64_t tmp_79547;\n                    \n                    tmp_79547 = ((__local\n                                  int64_t *) scan_arr_mem_79527)[sext_i32_i64(local_tid_79523)];\n                    ((__global int64_t *) mem_77833)[gtid_72663 * n_65344 +\n                                                     gtid_72664] = tmp_79547;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // first thread reads last element as carry-in for next iteration\n            {\n                bool crosses_segment_79548 = slt64(srem64(chunk_offset_79530 +\n                                                          segscan_group_sizze_72659,\n                                                          n_65344),\n                                                   chunk_offset_79530 +\n                                                   segscan_group_sizze_72659 -\n                                                   (chunk_offset_79530 +\n                                                    segscan_group_sizze_72659 -\n                                                    (int64_t) 1));\n                bool should_load_carry_79549 = local_tid_79523 == 0 &&\n                     !crosses_segment_79548;\n                \n                if (should_load_carry_79549) {\n                    x_72666 = ((__local\n                                int64_t *) scan_arr_mem_79527)[segscan_group_sizze_72659 -\n                                                               (int64_t) 1];\n                }\n                if (!should_load_carry_79549) {\n                    x_72666 = (int64_t) 0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n",
                   "  error_1:\n    return;\n    #undef segscan_group_sizze_72659\n}\n__kernel void mainziscan_stage1_73332(__global int *global_failure,\n                                      __local volatile\n                                      int64_t *scan_arr_mem_79658_backing_aligned_0,\n                                      int64_t m_65343, int64_t n_65344,\n                                      int32_t num_threads_79652, __global\n                                      unsigned char *Y_mem_76976, __global\n                                      unsigned char *mem_77880)\n{\n    #define segscan_group_sizze_73326 (mainzisegscan_group_sizze_73306)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_79658_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_79658_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79653;\n    int32_t local_tid_79654;\n    int64_t group_sizze_79657;\n    int32_t wave_sizze_79656;\n    int32_t group_tid_79655;\n    \n    global_tid_79653 = get_global_id(0);\n    local_tid_79654 = get_local_id(0);\n    group_sizze_79657 = get_local_size(0);\n    wave_sizze_79656 = LOCKSTEP_WIDTH;\n    group_tid_79655 = get_group_id(0);\n    \n    int32_t phys_tid_73332 = global_tid_79653;\n    __local unsigned char *scan_arr_mem_79658;\n    \n    scan_arr_mem_79658 = (__local unsigned char *) scan_arr_mem_79658_backing_0;\n    \n    int64_t x_73333;\n    int64_t x_73334;\n    \n    x_73333 = (int64_t) 0;\n    for (int64_t j_79660 = 0; j_79660 < sdiv_up64(m_65343 * n_65344,\n                                                  sext_i32_i64(num_threads_79652));\n         j_79660++) {\n        int64_t chunk_offset_79661 = segscan_group_sizze_73326 * j_79660 +\n                sext_i32_i64(group_tid_79655) * (segscan_group_sizze_73326 *\n                                                 sdiv_",
                   "up64(m_65343 * n_65344,\n                                                           sext_i32_i64(num_threads_79652)));\n        int64_t flat_idx_79662 = chunk_offset_79661 +\n                sext_i32_i64(local_tid_79654);\n        int64_t gtid_73330 = squot64(flat_idx_79662, n_65344);\n        int64_t gtid_73331 = flat_idx_79662 - squot64(flat_idx_79662, n_65344) *\n                n_65344;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_73330, m_65343) && slt64(gtid_73331, n_65344)) {\n                float x_73337;\n                \n                x_73337 = ((__global float *) Y_mem_76976)[gtid_73330 *\n                                                           n_65344 +\n                                                           gtid_73331];\n                \n                bool isnan_res_73338;\n                \n                isnan_res_73338 = futrts_isnan32(x_73337);\n                \n                bool defunc_0_p_res_73339 = !isnan_res_73338;\n                int64_t defunc_0_f_res_73340 =\n                        btoi_bool_i64(defunc_0_p_res_73339);\n                \n                // write to-scan values to parameters\n                {\n                    x_73334 = defunc_0_f_res_73340;\n                }\n                // write mapped values results to global memory\n                { }\n            }\n        }\n        // do one intra-group scan operation\n        {\n            // maybe restore some to-scan values to parameters, or read neutral\n            {\n                if (!(slt64(gtid_73330, m_65343) && slt64(gtid_73331,\n                                                          n_65344))) {\n                    x_73334 = (int64_t) 0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                int64_t defunc_1_op_res_73335 = add64(x_73333, x_73334);\n                \n                ((__local\n                  int64_t *) scan_arr_mem_79658)[sext_i32_i64(local_tid_7965",
                   "4)] =\n                    defunc_1_op_res_73335;\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            int64_t x_79663;\n            int64_t x_79664;\n            int64_t x_79666;\n            int64_t x_79667;\n            bool ltid_in_bounds_79669 = slt64(sext_i32_i64(local_tid_79654),\n                                              segscan_group_sizze_73326);\n            int32_t skip_threads_79670;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_79669) {\n                    x_79664 = ((volatile __local\n                                int64_t *) scan_arr_mem_79658)[sext_i32_i64(local_tid_79654)];\n                    if ((local_tid_79654 - squot32(local_tid_79654, 32) * 32) ==\n                        0) {\n                        x_79663 = x_79664;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_79670 = 1;\n                while (slt32(skip_threads_79670, 32)) {\n                    bool thread_active_79671 = sle32(skip_threads_79670,\n                                                     local_tid_79654 -\n                                                     squot32(local_tid_79654,\n                                                             32) * 32) &&\n                         ltid_in_bounds_79669;\n                    \n                    if (thread_active_79671) {\n                        // read operands\n                        {\n                            x_79663 = ((volatile __local\n                                        int64_t *) scan_arr_mem_79658)[sext_i32_i64(local_tid_79654) -\n                                                                       sext_i32_i64(skip_threads_79670)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_79672 =\n                             slt64(sre",
                   "m64(sext_i32_i64(local_tid_79654) +\n                                          chunk_offset_79661, n_65344),\n                                   sext_i32_i64(local_tid_79654) +\n                                   chunk_offset_79661 -\n                                   (sext_i32_i64(local_tid_79654 -\n                                    skip_threads_79670) + chunk_offset_79661));\n                        \n                        if (thread_active_79671 && inactive_79672) {\n                            x_79663 = x_79664;\n                        }\n                        if (thread_active_79671) {\n                            if (!inactive_79672) {\n                                int64_t defunc_1_op_res_79665 = add64(x_79663,\n                                                                      x_79664);\n                                \n                                x_79663 = defunc_1_op_res_79665;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_79656, skip_threads_79670)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_79671) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_79658)[sext_i32_i64(local_tid_79654)] =\n                                x_79663;\n                            x_79664 = x_79663;\n                        }\n                    }\n                    if (sle32(wave_sizze_79656, skip_threads_79670)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_79670 *= 2;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // last thread of block 'i' writes its result to offset 'i'\n            {\n                if ((local_tid_79654 - squot32(local_tid_79654, 32) * 32) ==\n                    31 && ltid_in_bounds_79669) {\n  ",
                   "                  ((volatile __local\n                      int64_t *) scan_arr_mem_79658)[sext_i32_i64(squot32(local_tid_79654,\n                                                                          32))] =\n                        x_79663;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n            {\n                int32_t skip_threads_79673;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_79654, 32) == 0 &&\n                        ltid_in_bounds_79669) {\n                        x_79667 = ((volatile __local\n                                    int64_t *) scan_arr_mem_79658)[sext_i32_i64(local_tid_79654)];\n                        if ((local_tid_79654 - squot32(local_tid_79654, 32) *\n                             32) == 0) {\n                            x_79666 = x_79667;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_79673 = 1;\n                    while (slt32(skip_threads_79673, 32)) {\n                        bool thread_active_79674 = sle32(skip_threads_79673,\n                                                         local_tid_79654 -\n                                                         squot32(local_tid_79654,\n                                                                 32) * 32) &&\n                             (squot32(local_tid_79654, 32) == 0 &&\n                              ltid_in_bounds_79669);\n                        \n                        if (thread_active_79674) {\n                            // read operands\n                            {\n                                x_79666 = ((volatile __local\n                                            int64_t *) scan_arr_mem_79658)[sext_i32_i64(local_tid_79654) -\n                  ",
                   "                                                         sext_i32_i64(skip_threads_79673)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_79675 =\n                                 slt64(srem64(sext_i32_i64(local_tid_79654 *\n                                              32 + 32 - 1) + chunk_offset_79661,\n                                              n_65344),\n                                       sext_i32_i64(local_tid_79654 * 32 + 32 -\n                                       1) + chunk_offset_79661 -\n                                       (sext_i32_i64((local_tid_79654 -\n                                                      skip_threads_79673) * 32 +\n                                        32 - 1) + chunk_offset_79661));\n                            \n                            if (thread_active_79674 && inactive_79675) {\n                                x_79666 = x_79667;\n                            }\n                            if (thread_active_79674) {\n                                if (!inactive_79675) {\n                                    int64_t defunc_1_op_res_79668 =\n                                            add64(x_79666, x_79667);\n                                    \n                                    x_79666 = defunc_1_op_res_79668;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_79656, skip_threads_79673)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_79674) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_79658)[sext_i32_i64(local_tid_79654)] =\n                                    x_79666;\n                                x_79667 = x",
                   "_79666;\n                            }\n                        }\n                        if (sle32(wave_sizze_79656, skip_threads_79673)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_79673 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            bool no_carry_in_79676 = squot32(local_tid_79654, 32) == 0 ||\n                 !ltid_in_bounds_79669;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_79676) {\n                        x_79664 = x_79663;\n                        x_79663 = ((__local\n                                    int64_t *) scan_arr_mem_79658)[sext_i32_i64(squot32(local_tid_79654,\n                                                                                        32)) -\n                                                                   (int64_t) 1];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_79677 =\n                         slt64(srem64(sext_i32_i64(local_tid_79654) +\n                                      chunk_offset_79661, n_65344),\n                               sext_i32_i64(local_tid_79654) +\n                               chunk_offset_79661 -\n                               (sext_i32_i64(squot32(local_tid_79654, 32) * 32 -\n                                1) + chunk_offset_79661));\n                    \n                    if (!no_carry_in_79676) {\n                        if (inactive_79677) {\n                            x_79663 = x_79664;\n                        }\n                    }\n                    if (!no_carry_in_79676) {\n                        if (!inactive_79677) {\n                            int64_t defunc_1_op_res_79665 = add64(x_79663,\n                                                  ",
                   "                x_79664);\n                            \n                            x_79663 = defunc_1_op_res_79665;\n                        }\n                    }\n                }\n                // write final result\n                {\n                    if (!no_carry_in_79676) {\n                        ((__local\n                          int64_t *) scan_arr_mem_79658)[sext_i32_i64(local_tid_79654)] =\n                            x_79663;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_79654, 32) == 0 && ltid_in_bounds_79669) {\n                    ((__local\n                      int64_t *) scan_arr_mem_79658)[sext_i32_i64(local_tid_79654)] =\n                        x_79664;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_73330, m_65343) && slt64(gtid_73331, n_65344)) {\n                    int64_t tmp_79678;\n                    \n                    tmp_79678 = ((__local\n                                  int64_t *) scan_arr_mem_79658)[sext_i32_i64(local_tid_79654)];\n                    ((__global int64_t *) mem_77880)[gtid_73330 * n_65344 +\n                                                     gtid_73331] = tmp_79678;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // first thread reads last element as carry-in for next iteration\n            {\n                bool crosses_segment_79679 = slt64(srem64(chunk_offset_79661 +\n                                                          segscan_group_sizze_73326,\n                                                          n_65344),\n                                                   chunk_offset_79661 +\n                                                   segscan_group_sizze_73326 -\n                                ",
                   "                   (chunk_offset_79661 +\n                                                    segscan_group_sizze_73326 -\n                                                    (int64_t) 1));\n                bool should_load_carry_79680 = local_tid_79654 == 0 &&\n                     !crosses_segment_79679;\n                \n                if (should_load_carry_79680) {\n                    x_73333 = ((__local\n                                int64_t *) scan_arr_mem_79658)[segscan_group_sizze_73326 -\n                                                               (int64_t) 1];\n                }\n                if (!should_load_carry_79680) {\n                    x_73333 = (int64_t) 0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_73326\n}\n__kernel void mainziscan_stage1_74089(__global int *global_failure,\n                                      __local volatile\n                                      int64_t *scan_arr_mem_79795_backing_aligned_0,\n                                      int64_t m_65343, int64_t n_65344,\n                                      int32_t num_threads_79789, __global\n                                      unsigned char *Y_mem_76976, __global\n                                      unsigned char *mem_77934)\n{\n    #define segscan_group_sizze_74083 (mainzisegscan_group_sizze_74063)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_79795_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_79795_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79790;\n    int32_t local_tid_79791;\n    int64_t group_sizze_79794;\n    int32_t wave_sizze_79793;\n    int32_t group_tid_79792;\n    \n    global_tid_79790 = get_global_id(0);\n    local_tid_79791 = get",
                   "_local_id(0);\n    group_sizze_79794 = get_local_size(0);\n    wave_sizze_79793 = LOCKSTEP_WIDTH;\n    group_tid_79792 = get_group_id(0);\n    \n    int32_t phys_tid_74089 = global_tid_79790;\n    __local unsigned char *scan_arr_mem_79795;\n    \n    scan_arr_mem_79795 = (__local unsigned char *) scan_arr_mem_79795_backing_0;\n    \n    int64_t x_74090;\n    int64_t x_74091;\n    \n    x_74090 = (int64_t) 0;\n    for (int64_t j_79797 = 0; j_79797 < sdiv_up64(m_65343 * n_65344,\n                                                  sext_i32_i64(num_threads_79789));\n         j_79797++) {\n        int64_t chunk_offset_79798 = segscan_group_sizze_74083 * j_79797 +\n                sext_i32_i64(group_tid_79792) * (segscan_group_sizze_74083 *\n                                                 sdiv_up64(m_65343 * n_65344,\n                                                           sext_i32_i64(num_threads_79789)));\n        int64_t flat_idx_79799 = chunk_offset_79798 +\n                sext_i32_i64(local_tid_79791);\n        int64_t gtid_74087 = squot64(flat_idx_79799, n_65344);\n        int64_t gtid_74088 = flat_idx_79799 - squot64(flat_idx_79799, n_65344) *\n                n_65344;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_74087, m_65343) && slt64(gtid_74088, n_65344)) {\n                float x_74094;\n                \n                x_74094 = ((__global float *) Y_mem_76976)[gtid_74087 *\n                                                           n_65344 +\n                                                           gtid_74088];\n                \n                bool isnan_res_74095;\n                \n                isnan_res_74095 = futrts_isnan32(x_74094);\n                \n                bool defunc_0_p_res_74096 = !isnan_res_74095;\n                int64_t defunc_0_f_res_74097 =\n                        btoi_bool_i64(defunc_0_p_res_74096);\n                \n                // write to-scan values to parameters\n                {\n                    x_74091 =",
                   " defunc_0_f_res_74097;\n                }\n                // write mapped values results to global memory\n                { }\n            }\n        }\n        // do one intra-group scan operation\n        {\n            // maybe restore some to-scan values to parameters, or read neutral\n            {\n                if (!(slt64(gtid_74087, m_65343) && slt64(gtid_74088,\n                                                          n_65344))) {\n                    x_74091 = (int64_t) 0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                int64_t defunc_1_op_res_74092 = add64(x_74090, x_74091);\n                \n                ((__local\n                  int64_t *) scan_arr_mem_79795)[sext_i32_i64(local_tid_79791)] =\n                    defunc_1_op_res_74092;\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            int64_t x_79800;\n            int64_t x_79801;\n            int64_t x_79803;\n            int64_t x_79804;\n            bool ltid_in_bounds_79806 = slt64(sext_i32_i64(local_tid_79791),\n                                              segscan_group_sizze_74083);\n            int32_t skip_threads_79807;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_79806) {\n                    x_79801 = ((volatile __local\n                                int64_t *) scan_arr_mem_79795)[sext_i32_i64(local_tid_79791)];\n                    if ((local_tid_79791 - squot32(local_tid_79791, 32) * 32) ==\n                        0) {\n                        x_79800 = x_79801;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_79807 = 1;\n                while (slt32(skip_threads_79807, 32)) {\n                    bool thread_active_79808 = sle32(skip_threads_79807,\n                                                     local_tid_79791 -\n               ",
                   "                                      squot32(local_tid_79791,\n                                                             32) * 32) &&\n                         ltid_in_bounds_79806;\n                    \n                    if (thread_active_79808) {\n                        // read operands\n                        {\n                            x_79800 = ((volatile __local\n                                        int64_t *) scan_arr_mem_79795)[sext_i32_i64(local_tid_79791) -\n                                                                       sext_i32_i64(skip_threads_79807)];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_79809 =\n                             slt64(srem64(sext_i32_i64(local_tid_79791) +\n                                          chunk_offset_79798, n_65344),\n                                   sext_i32_i64(local_tid_79791) +\n                                   chunk_offset_79798 -\n                                   (sext_i32_i64(local_tid_79791 -\n                                    skip_threads_79807) + chunk_offset_79798));\n                        \n                        if (thread_active_79808 && inactive_79809) {\n                            x_79800 = x_79801;\n                        }\n                        if (thread_active_79808) {\n                            if (!inactive_79809) {\n                                int64_t defunc_1_op_res_79802 = add64(x_79800,\n                                                                      x_79801);\n                                \n                                x_79800 = defunc_1_op_res_79802;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_79793, skip_threads_79807)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (thread_active_79808) {\n                        // write result\n    ",
                   "                    {\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_79795)[sext_i32_i64(local_tid_79791)] =\n                                x_79800;\n                            x_79801 = x_79800;\n                        }\n                    }\n                    if (sle32(wave_sizze_79793, skip_threads_79807)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_79807 *= 2;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // last thread of block 'i' writes its result to offset 'i'\n            {\n                if ((local_tid_79791 - squot32(local_tid_79791, 32) * 32) ==\n                    31 && ltid_in_bounds_79806) {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_79795)[sext_i32_i64(squot32(local_tid_79791,\n                                                                          32))] =\n                        x_79800;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n            {\n                int32_t skip_threads_79810;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_79791, 32) == 0 &&\n                        ltid_in_bounds_79806) {\n                        x_79804 = ((volatile __local\n                                    int64_t *) scan_arr_mem_79795)[sext_i32_i64(local_tid_79791)];\n                        if ((local_tid_79791 - squot32(local_tid_79791, 32) *\n                             32) == 0) {\n                            x_79803 = x_79804;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_79810 = 1;\n                    while (slt32(skip_threads_798",
                   "10, 32)) {\n                        bool thread_active_79811 = sle32(skip_threads_79810,\n                                                         local_tid_79791 -\n                                                         squot32(local_tid_79791,\n                                                                 32) * 32) &&\n                             (squot32(local_tid_79791, 32) == 0 &&\n                              ltid_in_bounds_79806);\n                        \n                        if (thread_active_79811) {\n                            // read operands\n                            {\n                                x_79803 = ((volatile __local\n                                            int64_t *) scan_arr_mem_79795)[sext_i32_i64(local_tid_79791) -\n                                                                           sext_i32_i64(skip_threads_79810)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_79812 =\n                                 slt64(srem64(sext_i32_i64(local_tid_79791 *\n                                              32 + 32 - 1) + chunk_offset_79798,\n                                              n_65344),\n                                       sext_i32_i64(local_tid_79791 * 32 + 32 -\n                                       1) + chunk_offset_79798 -\n                                       (sext_i32_i64((local_tid_79791 -\n                                                      skip_threads_79810) * 32 +\n                                        32 - 1) + chunk_offset_79798));\n                            \n                            if (thread_active_79811 && inactive_79812) {\n                                x_79803 = x_79804;\n                            }\n                            if (thread_active_79811) {\n                                if (!inactive_79812) {\n                                    int64_t defunc_1_op_res_79805 =\n      ",
                   "                                      add64(x_79803, x_79804);\n                                    \n                                    x_79803 = defunc_1_op_res_79805;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_79793, skip_threads_79810)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_79811) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_79795)[sext_i32_i64(local_tid_79791)] =\n                                    x_79803;\n                                x_79804 = x_79803;\n                            }\n                        }\n                        if (sle32(wave_sizze_79793, skip_threads_79810)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_79810 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            bool no_carry_in_79813 = squot32(local_tid_79791, 32) == 0 ||\n                 !ltid_in_bounds_79806;\n            \n            // carry-in for every block except the first\n            {\n                // read operands\n                {\n                    if (!no_carry_in_79813) {\n                        x_79801 = x_79800;\n                        x_79800 = ((__local\n                                    int64_t *) scan_arr_mem_79795)[sext_i32_i64(squot32(local_tid_79791,\n                                                                                        32)) -\n                                                                   (int64_t) 1];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_79814 =\n                         slt64(srem64(s",
                   "ext_i32_i64(local_tid_79791) +\n                                      chunk_offset_79798, n_65344),\n                               sext_i32_i64(local_tid_79791) +\n                               chunk_offset_79798 -\n                               (sext_i32_i64(squot32(local_tid_79791, 32) * 32 -\n                                1) + chunk_offset_79798));\n                    \n                    if (!no_carry_in_79813) {\n                        if (inactive_79814) {\n                            x_79800 = x_79801;\n                        }\n                    }\n                    if (!no_carry_in_79813) {\n                        if (!inactive_79814) {\n                            int64_t defunc_1_op_res_79802 = add64(x_79800,\n                                                                  x_79801);\n                            \n                            x_79800 = defunc_1_op_res_79802;\n                        }\n                    }\n                }\n                // write final result\n                {\n                    if (!no_carry_in_79813) {\n                        ((__local\n                          int64_t *) scan_arr_mem_79795)[sext_i32_i64(local_tid_79791)] =\n                            x_79800;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_79791, 32) == 0 && ltid_in_bounds_79806) {\n                    ((__local\n                      int64_t *) scan_arr_mem_79795)[sext_i32_i64(local_tid_79791)] =\n                        x_79801;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_74087, m_65343) && slt64(gtid_74088, n_65344)) {\n                    int64_t tmp_79815;\n                    \n                    tmp_79815 = ((__local\n                                  int64_t *) scan_ar",
                   "r_mem_79795)[sext_i32_i64(local_tid_79791)];\n                    ((__global int64_t *) mem_77934)[gtid_74087 * n_65344 +\n                                                     gtid_74088] = tmp_79815;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // first thread reads last element as carry-in for next iteration\n            {\n                bool crosses_segment_79816 = slt64(srem64(chunk_offset_79798 +\n                                                          segscan_group_sizze_74083,\n                                                          n_65344),\n                                                   chunk_offset_79798 +\n                                                   segscan_group_sizze_74083 -\n                                                   (chunk_offset_79798 +\n                                                    segscan_group_sizze_74083 -\n                                                    (int64_t) 1));\n                bool should_load_carry_79817 = local_tid_79791 == 0 &&\n                     !crosses_segment_79816;\n                \n                if (should_load_carry_79817) {\n                    x_74090 = ((__local\n                                int64_t *) scan_arr_mem_79795)[segscan_group_sizze_74083 -\n                                                               (int64_t) 1];\n                }\n                if (!should_load_carry_79817) {\n                    x_74090 = (int64_t) 0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_74083\n}\n__kernel void mainziscan_stage2_67850(__global int *global_failure,\n                                      __local volatile\n                                      int64_t *scan_arr_mem_78356_backing_aligned_0,\n                                      int64_t m_65343, int64_t n_65344,\n                                      int64_t stage1_num_groups_78321,\n                           ",
                   "           int32_t num_threads_78322, __global\n                                      unsigned char *mem_77082)\n{\n    #define segscan_group_sizze_67844 (mainzisegscan_group_sizze_67824)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_78356_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_78356_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78351;\n    int32_t local_tid_78352;\n    int64_t group_sizze_78355;\n    int32_t wave_sizze_78354;\n    int32_t group_tid_78353;\n    \n    global_tid_78351 = get_global_id(0);\n    local_tid_78352 = get_local_id(0);\n    group_sizze_78355 = get_local_size(0);\n    wave_sizze_78354 = LOCKSTEP_WIDTH;\n    group_tid_78353 = get_group_id(0);\n    \n    int32_t phys_tid_67850 = global_tid_78351;\n    __local unsigned char *scan_arr_mem_78356;\n    \n    scan_arr_mem_78356 = (__local unsigned char *) scan_arr_mem_78356_backing_0;\n    \n    int64_t flat_idx_78358 = (sext_i32_i64(local_tid_78352) + (int64_t) 1) *\n            (segscan_group_sizze_67844 * sdiv_up64(m_65343 * n_65344,\n                                                   sext_i32_i64(num_threads_78322))) -\n            (int64_t) 1;\n    int64_t gtid_67848 = squot64(flat_idx_78358, n_65344);\n    int64_t gtid_67849 = flat_idx_78358 - squot64(flat_idx_78358, n_65344) *\n            n_65344;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_67848, m_65343) && slt64(gtid_67849, n_65344)) {\n            int64_t tmp_78359;\n            \n            tmp_78359 = ((__global int64_t *) mem_77082)[gtid_67848 * n_65344 +\n                                                         gtid_67849];\n            ((__local\n              int64_t *) scan_arr_mem_78356)[sext_i32_i64(local_tid_78352)] =\n                tmp_78359;\n        } else",
                   " {\n            ((__local\n              int64_t *) scan_arr_mem_78356)[sext_i32_i64(local_tid_78352)] =\n                (int64_t) 0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t x_67851;\n    int64_t x_67852;\n    int64_t x_78360;\n    int64_t x_78361;\n    bool ltid_in_bounds_78363 = slt64(sext_i32_i64(local_tid_78352),\n                                      stage1_num_groups_78321);\n    int32_t skip_threads_78364;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_78363) {\n            x_67852 = ((volatile __local\n                        int64_t *) scan_arr_mem_78356)[sext_i32_i64(local_tid_78352)];\n            if ((local_tid_78352 - squot32(local_tid_78352, 32) * 32) == 0) {\n                x_67851 = x_67852;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_78364 = 1;\n        while (slt32(skip_threads_78364, 32)) {\n            bool thread_active_78365 = sle32(skip_threads_78364,\n                                             local_tid_78352 -\n                                             squot32(local_tid_78352, 32) *\n                                             32) && ltid_in_bounds_78363;\n            \n            if (thread_active_78365) {\n                // read operands\n                {\n                    x_67851 = ((volatile __local\n                                int64_t *) scan_arr_mem_78356)[sext_i32_i64(local_tid_78352) -\n                                                               sext_i32_i64(skip_threads_78364)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_78366 =\n                     slt64(srem64((sext_i32_i64(local_tid_78352) +\n                                   (int64_t) 1) * (segscan_group_sizze_67844 *\n                                                   sdiv_up64(m_65343 * n_65344,\n                                                             sext_i32_i64(num_threads_78322))) -\n         ",
                   "                         (int64_t) 1, n_65344),\n                           (sext_i32_i64(local_tid_78352) + (int64_t) 1) *\n                           (segscan_group_sizze_67844 * sdiv_up64(m_65343 *\n                                                                  n_65344,\n                                                                  sext_i32_i64(num_threads_78322))) -\n                           (int64_t) 1 - ((sext_i32_i64(local_tid_78352 -\n                                           skip_threads_78364) + (int64_t) 1) *\n                                          (segscan_group_sizze_67844 *\n                                           sdiv_up64(m_65343 * n_65344,\n                                                     sext_i32_i64(num_threads_78322))) -\n                                          (int64_t) 1));\n                \n                if (thread_active_78365 && inactive_78366) {\n                    x_67851 = x_67852;\n                }\n                if (thread_active_78365) {\n                    if (!inactive_78366) {\n                        int64_t defunc_1_op_res_67853 = add64(x_67851, x_67852);\n                        \n                        x_67851 = defunc_1_op_res_67853;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_78354, skip_threads_78364)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_78365) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_78356)[sext_i32_i64(local_tid_78352)] =\n                        x_67851;\n                    x_67852 = x_67851;\n                }\n            }\n            if (sle32(wave_sizze_78354, skip_threads_78364)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_78364 *= 2;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // last thread of block 'i' writes its result to offset 'i'\n    {\n        if ((local_tid",
                   "_78352 - squot32(local_tid_78352, 32) * 32) == 31 &&\n            ltid_in_bounds_78363) {\n            ((volatile __local\n              int64_t *) scan_arr_mem_78356)[sext_i32_i64(squot32(local_tid_78352,\n                                                                  32))] =\n                x_67851;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_78367;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_78352, 32) == 0 && ltid_in_bounds_78363) {\n                x_78361 = ((volatile __local\n                            int64_t *) scan_arr_mem_78356)[sext_i32_i64(local_tid_78352)];\n                if ((local_tid_78352 - squot32(local_tid_78352, 32) * 32) ==\n                    0) {\n                    x_78360 = x_78361;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_78367 = 1;\n            while (slt32(skip_threads_78367, 32)) {\n                bool thread_active_78368 = sle32(skip_threads_78367,\n                                                 local_tid_78352 -\n                                                 squot32(local_tid_78352, 32) *\n                                                 32) &&\n                     (squot32(local_tid_78352, 32) == 0 &&\n                      ltid_in_bounds_78363);\n                \n                if (thread_active_78368) {\n                    // read operands\n                    {\n                        x_78360 = ((volatile __local\n                                    int64_t *) scan_arr_mem_78356)[sext_i32_i64(local_tid_78352) -\n                                                                   sext_i32_i64(skip_threads_78367)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_78369 =\n                         ",
                   "slt64(srem64((sext_i32_i64(local_tid_78352 * 32 + 32 -\n                                       1) + (int64_t) 1) *\n                                      (segscan_group_sizze_67844 *\n                                       sdiv_up64(m_65343 * n_65344,\n                                                 sext_i32_i64(num_threads_78322))) -\n                                      (int64_t) 1, n_65344),\n                               (sext_i32_i64(local_tid_78352 * 32 + 32 - 1) +\n                                (int64_t) 1) * (segscan_group_sizze_67844 *\n                                                sdiv_up64(m_65343 * n_65344,\n                                                          sext_i32_i64(num_threads_78322))) -\n                               (int64_t) 1 - ((sext_i32_i64((local_tid_78352 -\n                                                             skip_threads_78367) *\n                                               32 + 32 - 1) + (int64_t) 1) *\n                                              (segscan_group_sizze_67844 *\n                                               sdiv_up64(m_65343 * n_65344,\n                                                         sext_i32_i64(num_threads_78322))) -\n                                              (int64_t) 1));\n                    \n                    if (thread_active_78368 && inactive_78369) {\n                        x_78360 = x_78361;\n                    }\n                    if (thread_active_78368) {\n                        if (!inactive_78369) {\n                            int64_t defunc_1_op_res_78362 = add64(x_78360,\n                                                                  x_78361);\n                            \n                            x_78360 = defunc_1_op_res_78362;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_78354, skip_threads_78367)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_78368) {\n      ",
                   "              // write result\n                    {\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_78356)[sext_i32_i64(local_tid_78352)] =\n                            x_78360;\n                        x_78361 = x_78360;\n                    }\n                }\n                if (sle32(wave_sizze_78354, skip_threads_78367)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_78367 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_78370 = squot32(local_tid_78352, 32) == 0 ||\n         !ltid_in_bounds_78363;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_78370) {\n                x_67852 = x_67851;\n                x_67851 = ((__local\n                            int64_t *) scan_arr_mem_78356)[sext_i32_i64(squot32(local_tid_78352,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_78371 = slt64(srem64((sext_i32_i64(local_tid_78352) +\n                                                (int64_t) 1) *\n                                               (segscan_group_sizze_67844 *\n                                                sdiv_up64(m_65343 * n_65344,\n                                                          sext_i32_i64(num_threads_78322))) -\n                                               (int64_t) 1, n_65344),\n                                        (sext_i32_i64(local_tid_78352) +\n                                         (int64_t) 1) *\n                                        (segscan_group_sizze_67844 *\n                                         sdiv_up64(m_65343 * n_65344,\n                                                   sext_i32_i64(num_threads_78322))) -\n             ",
                   "                           (int64_t) 1 -\n                                        ((sext_i32_i64(squot32(local_tid_78352,\n                                                               32) * 32 - 1) +\n                                          (int64_t) 1) *\n                                         (segscan_group_sizze_67844 *\n                                          sdiv_up64(m_65343 * n_65344,\n                                                    sext_i32_i64(num_threads_78322))) -\n                                         (int64_t) 1));\n            \n            if (!no_carry_in_78370) {\n                if (inactive_78371) {\n                    x_67851 = x_67852;\n                }\n            }\n            if (!no_carry_in_78370) {\n                if (!inactive_78371) {\n                    int64_t defunc_1_op_res_67853 = add64(x_67851, x_67852);\n                    \n                    x_67851 = defunc_1_op_res_67853;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_78370) {\n                ((__local\n                  int64_t *) scan_arr_mem_78356)[sext_i32_i64(local_tid_78352)] =\n                    x_67851;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_78352, 32) == 0 && ltid_in_bounds_78363) {\n            ((__local\n              int64_t *) scan_arr_mem_78356)[sext_i32_i64(local_tid_78352)] =\n                x_67852;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_67848, m_65343) && slt64(gtid_67849, n_65344)) {\n            int64_t tmp_78372;\n            \n            tmp_78372 = ((__local\n                          int64_t *) scan_arr_mem_78356)[sext_i32_i64(local_tid_78352)];\n            ((__global int64_t *) mem_77082)[gtid_67848 * n_65344 +\n                                             gtid_67849] = tmp_78372;\n        }\n    }\n   ",
                   " \n  error_0:\n    return;\n    #undef segscan_group_sizze_67844\n}\n__kernel void mainziscan_stage2_69641(__global int *global_failure,\n                                      __local volatile\n                                      int64_t *scan_arr_mem_78721_backing_aligned_0,\n                                      int64_t m_65343, int64_t n_65344,\n                                      int64_t stage1_num_groups_78686,\n                                      int32_t num_threads_78687, __global\n                                      unsigned char *mem_77316)\n{\n    #define segscan_group_sizze_69635 (mainzisegscan_group_sizze_69615)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_78721_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_78721_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78716;\n    int32_t local_tid_78717;\n    int64_t group_sizze_78720;\n    int32_t wave_sizze_78719;\n    int32_t group_tid_78718;\n    \n    global_tid_78716 = get_global_id(0);\n    local_tid_78717 = get_local_id(0);\n    group_sizze_78720 = get_local_size(0);\n    wave_sizze_78719 = LOCKSTEP_WIDTH;\n    group_tid_78718 = get_group_id(0);\n    \n    int32_t phys_tid_69641 = global_tid_78716;\n    __local unsigned char *scan_arr_mem_78721;\n    \n    scan_arr_mem_78721 = (__local unsigned char *) scan_arr_mem_78721_backing_0;\n    \n    int64_t flat_idx_78723 = (sext_i32_i64(local_tid_78717) + (int64_t) 1) *\n            (segscan_group_sizze_69635 * sdiv_up64(m_65343 * n_65344,\n                                                   sext_i32_i64(num_threads_78687))) -\n            (int64_t) 1;\n    int64_t gtid_69639 = squot64(flat_idx_78723, n_65344);\n    int64_t gtid_69640 = flat_idx_78723 - squot64(flat_idx_78723, n_65344) *\n            n_65344;\n    \n    // threads in bound read carries",
                   "; others get neutral element\n    {\n        if (slt64(gtid_69639, m_65343) && slt64(gtid_69640, n_65344)) {\n            int64_t tmp_78724;\n            \n            tmp_78724 = ((__global int64_t *) mem_77316)[gtid_69639 * n_65344 +\n                                                         gtid_69640];\n            ((__local\n              int64_t *) scan_arr_mem_78721)[sext_i32_i64(local_tid_78717)] =\n                tmp_78724;\n        } else {\n            ((__local\n              int64_t *) scan_arr_mem_78721)[sext_i32_i64(local_tid_78717)] =\n                (int64_t) 0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t x_69642;\n    int64_t x_69643;\n    int64_t x_78725;\n    int64_t x_78726;\n    bool ltid_in_bounds_78728 = slt64(sext_i32_i64(local_tid_78717),\n                                      stage1_num_groups_78686);\n    int32_t skip_threads_78729;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_78728) {\n            x_69643 = ((volatile __local\n                        int64_t *) scan_arr_mem_78721)[sext_i32_i64(local_tid_78717)];\n            if ((local_tid_78717 - squot32(local_tid_78717, 32) * 32) == 0) {\n                x_69642 = x_69643;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_78729 = 1;\n        while (slt32(skip_threads_78729, 32)) {\n            bool thread_active_78730 = sle32(skip_threads_78729,\n                                             local_tid_78717 -\n                                             squot32(local_tid_78717, 32) *\n                                             32) && ltid_in_bounds_78728;\n            \n            if (thread_active_78730) {\n                // read operands\n                {\n                    x_69642 = ((volatile __local\n                                int64_t *) scan_arr_mem_78721)[sext_i32_i64(local_tid_78717) -\n                                                               sext_i32_i64(skip_threads_78729)];\n       ",
                   "         }\n            }\n            // perform operation\n            {\n                bool inactive_78731 =\n                     slt64(srem64((sext_i32_i64(local_tid_78717) +\n                                   (int64_t) 1) * (segscan_group_sizze_69635 *\n                                                   sdiv_up64(m_65343 * n_65344,\n                                                             sext_i32_i64(num_threads_78687))) -\n                                  (int64_t) 1, n_65344),\n                           (sext_i32_i64(local_tid_78717) + (int64_t) 1) *\n                           (segscan_group_sizze_69635 * sdiv_up64(m_65343 *\n                                                                  n_65344,\n                                                                  sext_i32_i64(num_threads_78687))) -\n                           (int64_t) 1 - ((sext_i32_i64(local_tid_78717 -\n                                           skip_threads_78729) + (int64_t) 1) *\n                                          (segscan_group_sizze_69635 *\n                                           sdiv_up64(m_65343 * n_65344,\n                                                     sext_i32_i64(num_threads_78687))) -\n                                          (int64_t) 1));\n                \n                if (thread_active_78730 && inactive_78731) {\n                    x_69642 = x_69643;\n                }\n                if (thread_active_78730) {\n                    if (!inactive_78731) {\n                        int64_t defunc_1_op_res_69644 = add64(x_69642, x_69643);\n                        \n                        x_69642 = defunc_1_op_res_69644;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_78719, skip_threads_78729)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_78730) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_7872",
                   "1)[sext_i32_i64(local_tid_78717)] =\n                        x_69642;\n                    x_69643 = x_69642;\n                }\n            }\n            if (sle32(wave_sizze_78719, skip_threads_78729)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_78729 *= 2;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // last thread of block 'i' writes its result to offset 'i'\n    {\n        if ((local_tid_78717 - squot32(local_tid_78717, 32) * 32) == 31 &&\n            ltid_in_bounds_78728) {\n            ((volatile __local\n              int64_t *) scan_arr_mem_78721)[sext_i32_i64(squot32(local_tid_78717,\n                                                                  32))] =\n                x_69642;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_78732;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_78717, 32) == 0 && ltid_in_bounds_78728) {\n                x_78726 = ((volatile __local\n                            int64_t *) scan_arr_mem_78721)[sext_i32_i64(local_tid_78717)];\n                if ((local_tid_78717 - squot32(local_tid_78717, 32) * 32) ==\n                    0) {\n                    x_78725 = x_78726;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_78732 = 1;\n            while (slt32(skip_threads_78732, 32)) {\n                bool thread_active_78733 = sle32(skip_threads_78732,\n                                                 local_tid_78717 -\n                                                 squot32(local_tid_78717, 32) *\n                                                 32) &&\n                     (squot32(local_tid_78717, 32) == 0 &&\n                      ltid_in_bounds_78728);\n                \n                if (thread_active_78733) {\n                    // read opera",
                   "nds\n                    {\n                        x_78725 = ((volatile __local\n                                    int64_t *) scan_arr_mem_78721)[sext_i32_i64(local_tid_78717) -\n                                                                   sext_i32_i64(skip_threads_78732)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_78734 =\n                         slt64(srem64((sext_i32_i64(local_tid_78717 * 32 + 32 -\n                                       1) + (int64_t) 1) *\n                                      (segscan_group_sizze_69635 *\n                                       sdiv_up64(m_65343 * n_65344,\n                                                 sext_i32_i64(num_threads_78687))) -\n                                      (int64_t) 1, n_65344),\n                               (sext_i32_i64(local_tid_78717 * 32 + 32 - 1) +\n                                (int64_t) 1) * (segscan_group_sizze_69635 *\n                                                sdiv_up64(m_65343 * n_65344,\n                                                          sext_i32_i64(num_threads_78687))) -\n                               (int64_t) 1 - ((sext_i32_i64((local_tid_78717 -\n                                                             skip_threads_78732) *\n                                               32 + 32 - 1) + (int64_t) 1) *\n                                              (segscan_group_sizze_69635 *\n                                               sdiv_up64(m_65343 * n_65344,\n                                                         sext_i32_i64(num_threads_78687))) -\n                                              (int64_t) 1));\n                    \n                    if (thread_active_78733 && inactive_78734) {\n                        x_78725 = x_78726;\n                    }\n                    if (thread_active_78733) {\n                        if (!inactive_78734) {\n                            int64_t defunc_1_op_r",
                   "es_78727 = add64(x_78725,\n                                                                  x_78726);\n                            \n                            x_78725 = defunc_1_op_res_78727;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_78719, skip_threads_78732)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_78733) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_78721)[sext_i32_i64(local_tid_78717)] =\n                            x_78725;\n                        x_78726 = x_78725;\n                    }\n                }\n                if (sle32(wave_sizze_78719, skip_threads_78732)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_78732 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_78735 = squot32(local_tid_78717, 32) == 0 ||\n         !ltid_in_bounds_78728;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_78735) {\n                x_69643 = x_69642;\n                x_69642 = ((__local\n                            int64_t *) scan_arr_mem_78721)[sext_i32_i64(squot32(local_tid_78717,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_78736 = slt64(srem64((sext_i32_i64(local_tid_78717) +\n                                                (int64_t) 1) *\n                                               (segscan_group_sizze_69635 *\n                                                sdiv_up64(m_65343 * n_65344,\n                                                          sext_i32_i64(num_threads_78687))",
                   ") -\n                                               (int64_t) 1, n_65344),\n                                        (sext_i32_i64(local_tid_78717) +\n                                         (int64_t) 1) *\n                                        (segscan_group_sizze_69635 *\n                                         sdiv_up64(m_65343 * n_65344,\n                                                   sext_i32_i64(num_threads_78687))) -\n                                        (int64_t) 1 -\n                                        ((sext_i32_i64(squot32(local_tid_78717,\n                                                               32) * 32 - 1) +\n                                          (int64_t) 1) *\n                                         (segscan_group_sizze_69635 *\n                                          sdiv_up64(m_65343 * n_65344,\n                                                    sext_i32_i64(num_threads_78687))) -\n                                         (int64_t) 1));\n            \n            if (!no_carry_in_78735) {\n                if (inactive_78736) {\n                    x_69642 = x_69643;\n                }\n            }\n            if (!no_carry_in_78735) {\n                if (!inactive_78736) {\n                    int64_t defunc_1_op_res_69644 = add64(x_69642, x_69643);\n                    \n                    x_69642 = defunc_1_op_res_69644;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_78735) {\n                ((__local\n                  int64_t *) scan_arr_mem_78721)[sext_i32_i64(local_tid_78717)] =\n                    x_69642;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_78717, 32) == 0 && ltid_in_bounds_78728) {\n            ((__local\n              int64_t *) scan_arr_mem_78721)[sext_i32_i64(local_tid_78717)] =\n                x_69643;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // ",
                   "threads in bounds write scanned carries\n    {\n        if (slt64(gtid_69639, m_65343) && slt64(gtid_69640, n_65344)) {\n            int64_t tmp_78737;\n            \n            tmp_78737 = ((__local\n                          int64_t *) scan_arr_mem_78721)[sext_i32_i64(local_tid_78717)];\n            ((__global int64_t *) mem_77316)[gtid_69639 * n_65344 +\n                                             gtid_69640] = tmp_78737;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_69635\n}\n__kernel void mainziscan_stage2_71680(__global int *global_failure,\n                                      __local volatile\n                                      int64_t *scan_arr_mem_79138_backing_aligned_0,\n                                      int64_t m_65343, int64_t n_65344,\n                                      int64_t stage1_num_groups_79103,\n                                      int32_t num_threads_79104, __global\n                                      unsigned char *mem_77608)\n{\n    #define segscan_group_sizze_71674 (mainzisegscan_group_sizze_71654)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_79138_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_79138_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79133;\n    int32_t local_tid_79134;\n    int64_t group_sizze_79137;\n    int32_t wave_sizze_79136;\n    int32_t group_tid_79135;\n    \n    global_tid_79133 = get_global_id(0);\n    local_tid_79134 = get_local_id(0);\n    group_sizze_79137 = get_local_size(0);\n    wave_sizze_79136 = LOCKSTEP_WIDTH;\n    group_tid_79135 = get_group_id(0);\n    \n    int32_t phys_tid_71680 = global_tid_79133;\n    __local unsigned char *scan_arr_mem_79138;\n    \n    scan_arr_mem_79138 = (__local unsigned char *) scan_arr_mem_79138_backing_0;\n    \n    int64_t fla",
                   "t_idx_79140 = (sext_i32_i64(local_tid_79134) + (int64_t) 1) *\n            (segscan_group_sizze_71674 * sdiv_up64(m_65343 * n_65344,\n                                                   sext_i32_i64(num_threads_79104))) -\n            (int64_t) 1;\n    int64_t gtid_71678 = squot64(flat_idx_79140, n_65344);\n    int64_t gtid_71679 = flat_idx_79140 - squot64(flat_idx_79140, n_65344) *\n            n_65344;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_71678, m_65343) && slt64(gtid_71679, n_65344)) {\n            int64_t tmp_79141;\n            \n            tmp_79141 = ((__global int64_t *) mem_77608)[gtid_71678 * n_65344 +\n                                                         gtid_71679];\n            ((__local\n              int64_t *) scan_arr_mem_79138)[sext_i32_i64(local_tid_79134)] =\n                tmp_79141;\n        } else {\n            ((__local\n              int64_t *) scan_arr_mem_79138)[sext_i32_i64(local_tid_79134)] =\n                (int64_t) 0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t x_71681;\n    int64_t x_71682;\n    int64_t x_79142;\n    int64_t x_79143;\n    bool ltid_in_bounds_79145 = slt64(sext_i32_i64(local_tid_79134),\n                                      stage1_num_groups_79103);\n    int32_t skip_threads_79146;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_79145) {\n            x_71682 = ((volatile __local\n                        int64_t *) scan_arr_mem_79138)[sext_i32_i64(local_tid_79134)];\n            if ((local_tid_79134 - squot32(local_tid_79134, 32) * 32) == 0) {\n                x_71681 = x_71682;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_79146 = 1;\n        while (slt32(skip_threads_79146, 32)) {\n            bool thread_active_79147 = sle32(skip_threads_79146,\n                                             local_tid_79134 -\n                                             squot32(local_t",
                   "id_79134, 32) *\n                                             32) && ltid_in_bounds_79145;\n            \n            if (thread_active_79147) {\n                // read operands\n                {\n                    x_71681 = ((volatile __local\n                                int64_t *) scan_arr_mem_79138)[sext_i32_i64(local_tid_79134) -\n                                                               sext_i32_i64(skip_threads_79146)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_79148 =\n                     slt64(srem64((sext_i32_i64(local_tid_79134) +\n                                   (int64_t) 1) * (segscan_group_sizze_71674 *\n                                                   sdiv_up64(m_65343 * n_65344,\n                                                             sext_i32_i64(num_threads_79104))) -\n                                  (int64_t) 1, n_65344),\n                           (sext_i32_i64(local_tid_79134) + (int64_t) 1) *\n                           (segscan_group_sizze_71674 * sdiv_up64(m_65343 *\n                                                                  n_65344,\n                                                                  sext_i32_i64(num_threads_79104))) -\n                           (int64_t) 1 - ((sext_i32_i64(local_tid_79134 -\n                                           skip_threads_79146) + (int64_t) 1) *\n                                          (segscan_group_sizze_71674 *\n                                           sdiv_up64(m_65343 * n_65344,\n                                                     sext_i32_i64(num_threads_79104))) -\n                                          (int64_t) 1));\n                \n                if (thread_active_79147 && inactive_79148) {\n                    x_71681 = x_71682;\n                }\n                if (thread_active_79147) {\n                    if (!inactive_79148) {\n                        int64_t defunc_1_op_res_71683 = add64(x_71681, x_716",
                   "82);\n                        \n                        x_71681 = defunc_1_op_res_71683;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_79136, skip_threads_79146)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_79147) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_79138)[sext_i32_i64(local_tid_79134)] =\n                        x_71681;\n                    x_71682 = x_71681;\n                }\n            }\n            if (sle32(wave_sizze_79136, skip_threads_79146)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_79146 *= 2;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // last thread of block 'i' writes its result to offset 'i'\n    {\n        if ((local_tid_79134 - squot32(local_tid_79134, 32) * 32) == 31 &&\n            ltid_in_bounds_79145) {\n            ((volatile __local\n              int64_t *) scan_arr_mem_79138)[sext_i32_i64(squot32(local_tid_79134,\n                                                                  32))] =\n                x_71681;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_79149;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_79134, 32) == 0 && ltid_in_bounds_79145) {\n                x_79143 = ((volatile __local\n                            int64_t *) scan_arr_mem_79138)[sext_i32_i64(local_tid_79134)];\n                if ((local_tid_79134 - squot32(local_tid_79134, 32) * 32) ==\n                    0) {\n                    x_79142 = x_79143;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_79149 = 1;\n            while (slt32(skip_threads_79149, 32)) {\n                bool thread",
                   "_active_79150 = sle32(skip_threads_79149,\n                                                 local_tid_79134 -\n                                                 squot32(local_tid_79134, 32) *\n                                                 32) &&\n                     (squot32(local_tid_79134, 32) == 0 &&\n                      ltid_in_bounds_79145);\n                \n                if (thread_active_79150) {\n                    // read operands\n                    {\n                        x_79142 = ((volatile __local\n                                    int64_t *) scan_arr_mem_79138)[sext_i32_i64(local_tid_79134) -\n                                                                   sext_i32_i64(skip_threads_79149)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_79151 =\n                         slt64(srem64((sext_i32_i64(local_tid_79134 * 32 + 32 -\n                                       1) + (int64_t) 1) *\n                                      (segscan_group_sizze_71674 *\n                                       sdiv_up64(m_65343 * n_65344,\n                                                 sext_i32_i64(num_threads_79104))) -\n                                      (int64_t) 1, n_65344),\n                               (sext_i32_i64(local_tid_79134 * 32 + 32 - 1) +\n                                (int64_t) 1) * (segscan_group_sizze_71674 *\n                                                sdiv_up64(m_65343 * n_65344,\n                                                          sext_i32_i64(num_threads_79104))) -\n                               (int64_t) 1 - ((sext_i32_i64((local_tid_79134 -\n                                                             skip_threads_79149) *\n                                               32 + 32 - 1) + (int64_t) 1) *\n                                              (segscan_group_sizze_71674 *\n                                               sdiv_up64(m_65343 * n_65344,\n      ",
                   "                                                   sext_i32_i64(num_threads_79104))) -\n                                              (int64_t) 1));\n                    \n                    if (thread_active_79150 && inactive_79151) {\n                        x_79142 = x_79143;\n                    }\n                    if (thread_active_79150) {\n                        if (!inactive_79151) {\n                            int64_t defunc_1_op_res_79144 = add64(x_79142,\n                                                                  x_79143);\n                            \n                            x_79142 = defunc_1_op_res_79144;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_79136, skip_threads_79149)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_79150) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_79138)[sext_i32_i64(local_tid_79134)] =\n                            x_79142;\n                        x_79143 = x_79142;\n                    }\n                }\n                if (sle32(wave_sizze_79136, skip_threads_79149)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_79149 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_79152 = squot32(local_tid_79134, 32) == 0 ||\n         !ltid_in_bounds_79145;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_79152) {\n                x_71682 = x_71681;\n                x_71681 = ((__local\n                            int64_t *) scan_arr_mem_79138)[sext_i32_i64(squot32(local_tid_79134,\n                                                                                32)) -\n                                                           (int64_t) 1];\n       ",
                   "     }\n        }\n        // perform operation\n        {\n            bool inactive_79153 = slt64(srem64((sext_i32_i64(local_tid_79134) +\n                                                (int64_t) 1) *\n                                               (segscan_group_sizze_71674 *\n                                                sdiv_up64(m_65343 * n_65344,\n                                                          sext_i32_i64(num_threads_79104))) -\n                                               (int64_t) 1, n_65344),\n                                        (sext_i32_i64(local_tid_79134) +\n                                         (int64_t) 1) *\n                                        (segscan_group_sizze_71674 *\n                                         sdiv_up64(m_65343 * n_65344,\n                                                   sext_i32_i64(num_threads_79104))) -\n                                        (int64_t) 1 -\n                                        ((sext_i32_i64(squot32(local_tid_79134,\n                                                               32) * 32 - 1) +\n                                          (int64_t) 1) *\n                                         (segscan_group_sizze_71674 *\n                                          sdiv_up64(m_65343 * n_65344,\n                                                    sext_i32_i64(num_threads_79104))) -\n                                         (int64_t) 1));\n            \n            if (!no_carry_in_79152) {\n                if (inactive_79153) {\n                    x_71681 = x_71682;\n                }\n            }\n            if (!no_carry_in_79152) {\n                if (!inactive_79153) {\n                    int64_t defunc_1_op_res_71683 = add64(x_71681, x_71682);\n                    \n                    x_71681 = defunc_1_op_res_71683;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_79152) {\n                ((__local\n                  int64_t *) scan_arr_me",
                   "m_79138)[sext_i32_i64(local_tid_79134)] =\n                    x_71681;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_79134, 32) == 0 && ltid_in_bounds_79145) {\n            ((__local\n              int64_t *) scan_arr_mem_79138)[sext_i32_i64(local_tid_79134)] =\n                x_71682;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_71678, m_65343) && slt64(gtid_71679, n_65344)) {\n            int64_t tmp_79154;\n            \n            tmp_79154 = ((__local\n                          int64_t *) scan_arr_mem_79138)[sext_i32_i64(local_tid_79134)];\n            ((__global int64_t *) mem_77608)[gtid_71678 * n_65344 +\n                                             gtid_71679] = tmp_79154;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_71674\n}\n__kernel void mainziscan_stage2_72665(__global int *global_failure,\n                                      __local volatile\n                                      int64_t *scan_arr_mem_79555_backing_aligned_0,\n                                      int64_t m_65343, int64_t n_65344,\n                                      int64_t stage1_num_groups_79520,\n                                      int32_t num_threads_79521, __global\n                                      unsigned char *mem_77833)\n{\n    #define segscan_group_sizze_72659 (mainzisegscan_group_sizze_72639)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_79555_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_79555_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79550;\n    int32_t local_tid_79551;\n    int64_t group_sizze_79554;\n    int32_t wave_sizze_79553",
                   ";\n    int32_t group_tid_79552;\n    \n    global_tid_79550 = get_global_id(0);\n    local_tid_79551 = get_local_id(0);\n    group_sizze_79554 = get_local_size(0);\n    wave_sizze_79553 = LOCKSTEP_WIDTH;\n    group_tid_79552 = get_group_id(0);\n    \n    int32_t phys_tid_72665 = global_tid_79550;\n    __local unsigned char *scan_arr_mem_79555;\n    \n    scan_arr_mem_79555 = (__local unsigned char *) scan_arr_mem_79555_backing_0;\n    \n    int64_t flat_idx_79557 = (sext_i32_i64(local_tid_79551) + (int64_t) 1) *\n            (segscan_group_sizze_72659 * sdiv_up64(m_65343 * n_65344,\n                                                   sext_i32_i64(num_threads_79521))) -\n            (int64_t) 1;\n    int64_t gtid_72663 = squot64(flat_idx_79557, n_65344);\n    int64_t gtid_72664 = flat_idx_79557 - squot64(flat_idx_79557, n_65344) *\n            n_65344;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_72663, m_65343) && slt64(gtid_72664, n_65344)) {\n            int64_t tmp_79558;\n            \n            tmp_79558 = ((__global int64_t *) mem_77833)[gtid_72663 * n_65344 +\n                                                         gtid_72664];\n            ((__local\n              int64_t *) scan_arr_mem_79555)[sext_i32_i64(local_tid_79551)] =\n                tmp_79558;\n        } else {\n            ((__local\n              int64_t *) scan_arr_mem_79555)[sext_i32_i64(local_tid_79551)] =\n                (int64_t) 0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t x_72666;\n    int64_t x_72667;\n    int64_t x_79559;\n    int64_t x_79560;\n    bool ltid_in_bounds_79562 = slt64(sext_i32_i64(local_tid_79551),\n                                      stage1_num_groups_79520);\n    int32_t skip_threads_79563;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_79562) {\n            x_72667 = ((volatile __local\n                        int64_t *) scan_arr_mem_79555)[sext_i32_i64(local_tid_79551)];\n            if ((local_tid_",
                   "79551 - squot32(local_tid_79551, 32) * 32) == 0) {\n                x_72666 = x_72667;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_79563 = 1;\n        while (slt32(skip_threads_79563, 32)) {\n            bool thread_active_79564 = sle32(skip_threads_79563,\n                                             local_tid_79551 -\n                                             squot32(local_tid_79551, 32) *\n                                             32) && ltid_in_bounds_79562;\n            \n            if (thread_active_79564) {\n                // read operands\n                {\n                    x_72666 = ((volatile __local\n                                int64_t *) scan_arr_mem_79555)[sext_i32_i64(local_tid_79551) -\n                                                               sext_i32_i64(skip_threads_79563)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_79565 =\n                     slt64(srem64((sext_i32_i64(local_tid_79551) +\n                                   (int64_t) 1) * (segscan_group_sizze_72659 *\n                                                   sdiv_up64(m_65343 * n_65344,\n                                                             sext_i32_i64(num_threads_79521))) -\n                                  (int64_t) 1, n_65344),\n                           (sext_i32_i64(local_tid_79551) + (int64_t) 1) *\n                           (segscan_group_sizze_72659 * sdiv_up64(m_65343 *\n                                                                  n_65344,\n                                                                  sext_i32_i64(num_threads_79521))) -\n                           (int64_t) 1 - ((sext_i32_i64(local_tid_79551 -\n                                           skip_threads_79563) + (int64_t) 1) *\n                                          (segscan_group_sizze_72659 *\n                                           sdiv_up64(m_65343 * n_65344,\n ",
                   "                                                    sext_i32_i64(num_threads_79521))) -\n                                          (int64_t) 1));\n                \n                if (thread_active_79564 && inactive_79565) {\n                    x_72666 = x_72667;\n                }\n                if (thread_active_79564) {\n                    if (!inactive_79565) {\n                        int64_t defunc_1_op_res_72668 = add64(x_72666, x_72667);\n                        \n                        x_72666 = defunc_1_op_res_72668;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_79553, skip_threads_79563)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_79564) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_79555)[sext_i32_i64(local_tid_79551)] =\n                        x_72666;\n                    x_72667 = x_72666;\n                }\n            }\n            if (sle32(wave_sizze_79553, skip_threads_79563)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_79563 *= 2;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // last thread of block 'i' writes its result to offset 'i'\n    {\n        if ((local_tid_79551 - squot32(local_tid_79551, 32) * 32) == 31 &&\n            ltid_in_bounds_79562) {\n            ((volatile __local\n              int64_t *) scan_arr_mem_79555)[sext_i32_i64(squot32(local_tid_79551,\n                                                                  32))] =\n                x_72666;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_79566;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_79551, 32) == 0 && ltid_in_bounds_79562) {\n                x_79560 = ((volatile __local\n             ",
                   "               int64_t *) scan_arr_mem_79555)[sext_i32_i64(local_tid_79551)];\n                if ((local_tid_79551 - squot32(local_tid_79551, 32) * 32) ==\n                    0) {\n                    x_79559 = x_79560;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_79566 = 1;\n            while (slt32(skip_threads_79566, 32)) {\n                bool thread_active_79567 = sle32(skip_threads_79566,\n                                                 local_tid_79551 -\n                                                 squot32(local_tid_79551, 32) *\n                                                 32) &&\n                     (squot32(local_tid_79551, 32) == 0 &&\n                      ltid_in_bounds_79562);\n                \n                if (thread_active_79567) {\n                    // read operands\n                    {\n                        x_79559 = ((volatile __local\n                                    int64_t *) scan_arr_mem_79555)[sext_i32_i64(local_tid_79551) -\n                                                                   sext_i32_i64(skip_threads_79566)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_79568 =\n                         slt64(srem64((sext_i32_i64(local_tid_79551 * 32 + 32 -\n                                       1) + (int64_t) 1) *\n                                      (segscan_group_sizze_72659 *\n                                       sdiv_up64(m_65343 * n_65344,\n                                                 sext_i32_i64(num_threads_79521))) -\n                                      (int64_t) 1, n_65344),\n                               (sext_i32_i64(local_tid_79551 * 32 + 32 - 1) +\n                                (int64_t) 1) * (segscan_group_sizze_72659 *\n                                                sdiv_up64(m_65343 * n_65344,\n                                                ",
                   "          sext_i32_i64(num_threads_79521))) -\n                               (int64_t) 1 - ((sext_i32_i64((local_tid_79551 -\n                                                             skip_threads_79566) *\n                                               32 + 32 - 1) + (int64_t) 1) *\n                                              (segscan_group_sizze_72659 *\n                                               sdiv_up64(m_65343 * n_65344,\n                                                         sext_i32_i64(num_threads_79521))) -\n                                              (int64_t) 1));\n                    \n                    if (thread_active_79567 && inactive_79568) {\n                        x_79559 = x_79560;\n                    }\n                    if (thread_active_79567) {\n                        if (!inactive_79568) {\n                            int64_t defunc_1_op_res_79561 = add64(x_79559,\n                                                                  x_79560);\n                            \n                            x_79559 = defunc_1_op_res_79561;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_79553, skip_threads_79566)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_79567) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_79555)[sext_i32_i64(local_tid_79551)] =\n                            x_79559;\n                        x_79560 = x_79559;\n                    }\n                }\n                if (sle32(wave_sizze_79553, skip_threads_79566)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_79566 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_79569 = squot32(local_tid_79551, 32) == 0 ||\n         !ltid_in_bounds_79562;\n    \n    // carry-in for e",
                   "very block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_79569) {\n                x_72667 = x_72666;\n                x_72666 = ((__local\n                            int64_t *) scan_arr_mem_79555)[sext_i32_i64(squot32(local_tid_79551,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_79570 = slt64(srem64((sext_i32_i64(local_tid_79551) +\n                                                (int64_t) 1) *\n                                               (segscan_group_sizze_72659 *\n                                                sdiv_up64(m_65343 * n_65344,\n                                                          sext_i32_i64(num_threads_79521))) -\n                                               (int64_t) 1, n_65344),\n                                        (sext_i32_i64(local_tid_79551) +\n                                         (int64_t) 1) *\n                                        (segscan_group_sizze_72659 *\n                                         sdiv_up64(m_65343 * n_65344,\n                                                   sext_i32_i64(num_threads_79521))) -\n                                        (int64_t) 1 -\n                                        ((sext_i32_i64(squot32(local_tid_79551,\n                                                               32) * 32 - 1) +\n                                          (int64_t) 1) *\n                                         (segscan_group_sizze_72659 *\n                                          sdiv_up64(m_65343 * n_65344,\n                                                    sext_i32_i64(num_threads_79521))) -\n                                         (int64_t) 1));\n            \n            if (!no_carry_in_79569) {\n                if (inactive_79570) {\n                    x_72666 = x_72667;\n    ",
                   "            }\n            }\n            if (!no_carry_in_79569) {\n                if (!inactive_79570) {\n                    int64_t defunc_1_op_res_72668 = add64(x_72666, x_72667);\n                    \n                    x_72666 = defunc_1_op_res_72668;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_79569) {\n                ((__local\n                  int64_t *) scan_arr_mem_79555)[sext_i32_i64(local_tid_79551)] =\n                    x_72666;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_79551, 32) == 0 && ltid_in_bounds_79562) {\n            ((__local\n              int64_t *) scan_arr_mem_79555)[sext_i32_i64(local_tid_79551)] =\n                x_72667;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_72663, m_65343) && slt64(gtid_72664, n_65344)) {\n            int64_t tmp_79571;\n            \n            tmp_79571 = ((__local\n                          int64_t *) scan_arr_mem_79555)[sext_i32_i64(local_tid_79551)];\n            ((__global int64_t *) mem_77833)[gtid_72663 * n_65344 +\n                                             gtid_72664] = tmp_79571;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_72659\n}\n__kernel void mainziscan_stage2_73332(__global int *global_failure,\n                                      __local volatile\n                                      int64_t *scan_arr_mem_79686_backing_aligned_0,\n                                      int64_t m_65343, int64_t n_65344,\n                                      int64_t stage1_num_groups_79651,\n                                      int32_t num_threads_79652, __global\n                                      unsigned char *mem_77880)\n{\n    #define segscan_group_sizze_73326 (mainzisegscan_group_sizze_73306)\n    \n    const int block_dim0 = 0;\n    const in",
                   "t block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_79686_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_79686_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79681;\n    int32_t local_tid_79682;\n    int64_t group_sizze_79685;\n    int32_t wave_sizze_79684;\n    int32_t group_tid_79683;\n    \n    global_tid_79681 = get_global_id(0);\n    local_tid_79682 = get_local_id(0);\n    group_sizze_79685 = get_local_size(0);\n    wave_sizze_79684 = LOCKSTEP_WIDTH;\n    group_tid_79683 = get_group_id(0);\n    \n    int32_t phys_tid_73332 = global_tid_79681;\n    __local unsigned char *scan_arr_mem_79686;\n    \n    scan_arr_mem_79686 = (__local unsigned char *) scan_arr_mem_79686_backing_0;\n    \n    int64_t flat_idx_79688 = (sext_i32_i64(local_tid_79682) + (int64_t) 1) *\n            (segscan_group_sizze_73326 * sdiv_up64(m_65343 * n_65344,\n                                                   sext_i32_i64(num_threads_79652))) -\n            (int64_t) 1;\n    int64_t gtid_73330 = squot64(flat_idx_79688, n_65344);\n    int64_t gtid_73331 = flat_idx_79688 - squot64(flat_idx_79688, n_65344) *\n            n_65344;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_73330, m_65343) && slt64(gtid_73331, n_65344)) {\n            int64_t tmp_79689;\n            \n            tmp_79689 = ((__global int64_t *) mem_77880)[gtid_73330 * n_65344 +\n                                                         gtid_73331];\n            ((__local\n              int64_t *) scan_arr_mem_79686)[sext_i32_i64(local_tid_79682)] =\n                tmp_79689;\n        } else {\n            ((__local\n              int64_t *) scan_arr_mem_79686)[sext_i32_i64(local_tid_79682)] =\n                (int64_t) 0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t x_73333;\n    int64_t x_73334;\n   ",
                   " int64_t x_79690;\n    int64_t x_79691;\n    bool ltid_in_bounds_79693 = slt64(sext_i32_i64(local_tid_79682),\n                                      stage1_num_groups_79651);\n    int32_t skip_threads_79694;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_79693) {\n            x_73334 = ((volatile __local\n                        int64_t *) scan_arr_mem_79686)[sext_i32_i64(local_tid_79682)];\n            if ((local_tid_79682 - squot32(local_tid_79682, 32) * 32) == 0) {\n                x_73333 = x_73334;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_79694 = 1;\n        while (slt32(skip_threads_79694, 32)) {\n            bool thread_active_79695 = sle32(skip_threads_79694,\n                                             local_tid_79682 -\n                                             squot32(local_tid_79682, 32) *\n                                             32) && ltid_in_bounds_79693;\n            \n            if (thread_active_79695) {\n                // read operands\n                {\n                    x_73333 = ((volatile __local\n                                int64_t *) scan_arr_mem_79686)[sext_i32_i64(local_tid_79682) -\n                                                               sext_i32_i64(skip_threads_79694)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_79696 =\n                     slt64(srem64((sext_i32_i64(local_tid_79682) +\n                                   (int64_t) 1) * (segscan_group_sizze_73326 *\n                                                   sdiv_up64(m_65343 * n_65344,\n                                                             sext_i32_i64(num_threads_79652))) -\n                                  (int64_t) 1, n_65344),\n                           (sext_i32_i64(local_tid_79682) + (int64_t) 1) *\n                           (segscan_group_sizze_73326 * sdiv_up64(m_65343 *\n                                 ",
                   "                                 n_65344,\n                                                                  sext_i32_i64(num_threads_79652))) -\n                           (int64_t) 1 - ((sext_i32_i64(local_tid_79682 -\n                                           skip_threads_79694) + (int64_t) 1) *\n                                          (segscan_group_sizze_73326 *\n                                           sdiv_up64(m_65343 * n_65344,\n                                                     sext_i32_i64(num_threads_79652))) -\n                                          (int64_t) 1));\n                \n                if (thread_active_79695 && inactive_79696) {\n                    x_73333 = x_73334;\n                }\n                if (thread_active_79695) {\n                    if (!inactive_79696) {\n                        int64_t defunc_1_op_res_73335 = add64(x_73333, x_73334);\n                        \n                        x_73333 = defunc_1_op_res_73335;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_79684, skip_threads_79694)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_79695) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_79686)[sext_i32_i64(local_tid_79682)] =\n                        x_73333;\n                    x_73334 = x_73333;\n                }\n            }\n            if (sle32(wave_sizze_79684, skip_threads_79694)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_79694 *= 2;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // last thread of block 'i' writes its result to offset 'i'\n    {\n        if ((local_tid_79682 - squot32(local_tid_79682, 32) * 32) == 31 &&\n            ltid_in_bounds_79693) {\n            ((volatile __local\n              int64_t *) scan_arr_mem_79686)[sext_i32_i64(squot32(local_tid_79682,\n                             ",
                   "                                     32))] =\n                x_73333;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_79697;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_79682, 32) == 0 && ltid_in_bounds_79693) {\n                x_79691 = ((volatile __local\n                            int64_t *) scan_arr_mem_79686)[sext_i32_i64(local_tid_79682)];\n                if ((local_tid_79682 - squot32(local_tid_79682, 32) * 32) ==\n                    0) {\n                    x_79690 = x_79691;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_79697 = 1;\n            while (slt32(skip_threads_79697, 32)) {\n                bool thread_active_79698 = sle32(skip_threads_79697,\n                                                 local_tid_79682 -\n                                                 squot32(local_tid_79682, 32) *\n                                                 32) &&\n                     (squot32(local_tid_79682, 32) == 0 &&\n                      ltid_in_bounds_79693);\n                \n                if (thread_active_79698) {\n                    // read operands\n                    {\n                        x_79690 = ((volatile __local\n                                    int64_t *) scan_arr_mem_79686)[sext_i32_i64(local_tid_79682) -\n                                                                   sext_i32_i64(skip_threads_79697)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_79699 =\n                         slt64(srem64((sext_i32_i64(local_tid_79682 * 32 + 32 -\n                                       1) + (int64_t) 1) *\n                                      (segscan_group_sizze_73326 *\n                                       sdiv_up64(m_",
                   "65343 * n_65344,\n                                                 sext_i32_i64(num_threads_79652))) -\n                                      (int64_t) 1, n_65344),\n                               (sext_i32_i64(local_tid_79682 * 32 + 32 - 1) +\n                                (int64_t) 1) * (segscan_group_sizze_73326 *\n                                                sdiv_up64(m_65343 * n_65344,\n                                                          sext_i32_i64(num_threads_79652))) -\n                               (int64_t) 1 - ((sext_i32_i64((local_tid_79682 -\n                                                             skip_threads_79697) *\n                                               32 + 32 - 1) + (int64_t) 1) *\n                                              (segscan_group_sizze_73326 *\n                                               sdiv_up64(m_65343 * n_65344,\n                                                         sext_i32_i64(num_threads_79652))) -\n                                              (int64_t) 1));\n                    \n                    if (thread_active_79698 && inactive_79699) {\n                        x_79690 = x_79691;\n                    }\n                    if (thread_active_79698) {\n                        if (!inactive_79699) {\n                            int64_t defunc_1_op_res_79692 = add64(x_79690,\n                                                                  x_79691);\n                            \n                            x_79690 = defunc_1_op_res_79692;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_79684, skip_threads_79697)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_79698) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_79686)[sext_i32_i64(local_tid_79682)] =\n                            x_79690;\n          ",
                   "              x_79691 = x_79690;\n                    }\n                }\n                if (sle32(wave_sizze_79684, skip_threads_79697)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_79697 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_79700 = squot32(local_tid_79682, 32) == 0 ||\n         !ltid_in_bounds_79693;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_79700) {\n                x_73334 = x_73333;\n                x_73333 = ((__local\n                            int64_t *) scan_arr_mem_79686)[sext_i32_i64(squot32(local_tid_79682,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_79701 = slt64(srem64((sext_i32_i64(local_tid_79682) +\n                                                (int64_t) 1) *\n                                               (segscan_group_sizze_73326 *\n                                                sdiv_up64(m_65343 * n_65344,\n                                                          sext_i32_i64(num_threads_79652))) -\n                                               (int64_t) 1, n_65344),\n                                        (sext_i32_i64(local_tid_79682) +\n                                         (int64_t) 1) *\n                                        (segscan_group_sizze_73326 *\n                                         sdiv_up64(m_65343 * n_65344,\n                                                   sext_i32_i64(num_threads_79652))) -\n                                        (int64_t) 1 -\n                                        ((sext_i32_i64(squot32(local_tid_79682,\n                                                               32) * 32 - 1) +\n                                ",
                   "          (int64_t) 1) *\n                                         (segscan_group_sizze_73326 *\n                                          sdiv_up64(m_65343 * n_65344,\n                                                    sext_i32_i64(num_threads_79652))) -\n                                         (int64_t) 1));\n            \n            if (!no_carry_in_79700) {\n                if (inactive_79701) {\n                    x_73333 = x_73334;\n                }\n            }\n            if (!no_carry_in_79700) {\n                if (!inactive_79701) {\n                    int64_t defunc_1_op_res_73335 = add64(x_73333, x_73334);\n                    \n                    x_73333 = defunc_1_op_res_73335;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_79700) {\n                ((__local\n                  int64_t *) scan_arr_mem_79686)[sext_i32_i64(local_tid_79682)] =\n                    x_73333;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_79682, 32) == 0 && ltid_in_bounds_79693) {\n            ((__local\n              int64_t *) scan_arr_mem_79686)[sext_i32_i64(local_tid_79682)] =\n                x_73334;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_73330, m_65343) && slt64(gtid_73331, n_65344)) {\n            int64_t tmp_79702;\n            \n            tmp_79702 = ((__local\n                          int64_t *) scan_arr_mem_79686)[sext_i32_i64(local_tid_79682)];\n            ((__global int64_t *) mem_77880)[gtid_73330 * n_65344 +\n                                             gtid_73331] = tmp_79702;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_73326\n}\n__kernel void mainziscan_stage2_74089(__global int *global_failure,\n                                      __local volatile\n                                      int64_t",
                   " *scan_arr_mem_79823_backing_aligned_0,\n                                      int64_t m_65343, int64_t n_65344,\n                                      int64_t stage1_num_groups_79788,\n                                      int32_t num_threads_79789, __global\n                                      unsigned char *mem_77934)\n{\n    #define segscan_group_sizze_74083 (mainzisegscan_group_sizze_74063)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict scan_arr_mem_79823_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) scan_arr_mem_79823_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79818;\n    int32_t local_tid_79819;\n    int64_t group_sizze_79822;\n    int32_t wave_sizze_79821;\n    int32_t group_tid_79820;\n    \n    global_tid_79818 = get_global_id(0);\n    local_tid_79819 = get_local_id(0);\n    group_sizze_79822 = get_local_size(0);\n    wave_sizze_79821 = LOCKSTEP_WIDTH;\n    group_tid_79820 = get_group_id(0);\n    \n    int32_t phys_tid_74089 = global_tid_79818;\n    __local unsigned char *scan_arr_mem_79823;\n    \n    scan_arr_mem_79823 = (__local unsigned char *) scan_arr_mem_79823_backing_0;\n    \n    int64_t flat_idx_79825 = (sext_i32_i64(local_tid_79819) + (int64_t) 1) *\n            (segscan_group_sizze_74083 * sdiv_up64(m_65343 * n_65344,\n                                                   sext_i32_i64(num_threads_79789))) -\n            (int64_t) 1;\n    int64_t gtid_74087 = squot64(flat_idx_79825, n_65344);\n    int64_t gtid_74088 = flat_idx_79825 - squot64(flat_idx_79825, n_65344) *\n            n_65344;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_74087, m_65343) && slt64(gtid_74088, n_65344)) {\n            int64_t tmp_79826;\n            \n            tmp_79826 = ((__global int64_t *) mem_77934)[gtid_74087 * n_65344 +\n ",
                   "                                                        gtid_74088];\n            ((__local\n              int64_t *) scan_arr_mem_79823)[sext_i32_i64(local_tid_79819)] =\n                tmp_79826;\n        } else {\n            ((__local\n              int64_t *) scan_arr_mem_79823)[sext_i32_i64(local_tid_79819)] =\n                (int64_t) 0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t x_74090;\n    int64_t x_74091;\n    int64_t x_79827;\n    int64_t x_79828;\n    bool ltid_in_bounds_79830 = slt64(sext_i32_i64(local_tid_79819),\n                                      stage1_num_groups_79788);\n    int32_t skip_threads_79831;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_79830) {\n            x_74091 = ((volatile __local\n                        int64_t *) scan_arr_mem_79823)[sext_i32_i64(local_tid_79819)];\n            if ((local_tid_79819 - squot32(local_tid_79819, 32) * 32) == 0) {\n                x_74090 = x_74091;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_79831 = 1;\n        while (slt32(skip_threads_79831, 32)) {\n            bool thread_active_79832 = sle32(skip_threads_79831,\n                                             local_tid_79819 -\n                                             squot32(local_tid_79819, 32) *\n                                             32) && ltid_in_bounds_79830;\n            \n            if (thread_active_79832) {\n                // read operands\n                {\n                    x_74090 = ((volatile __local\n                                int64_t *) scan_arr_mem_79823)[sext_i32_i64(local_tid_79819) -\n                                                               sext_i32_i64(skip_threads_79831)];\n                }\n            }\n            // perform operation\n            {\n                bool inactive_79833 =\n                     slt64(srem64((sext_i32_i64(local_tid_79819) +\n                                   (int64_t) 1) * (segs",
                   "can_group_sizze_74083 *\n                                                   sdiv_up64(m_65343 * n_65344,\n                                                             sext_i32_i64(num_threads_79789))) -\n                                  (int64_t) 1, n_65344),\n                           (sext_i32_i64(local_tid_79819) + (int64_t) 1) *\n                           (segscan_group_sizze_74083 * sdiv_up64(m_65343 *\n                                                                  n_65344,\n                                                                  sext_i32_i64(num_threads_79789))) -\n                           (int64_t) 1 - ((sext_i32_i64(local_tid_79819 -\n                                           skip_threads_79831) + (int64_t) 1) *\n                                          (segscan_group_sizze_74083 *\n                                           sdiv_up64(m_65343 * n_65344,\n                                                     sext_i32_i64(num_threads_79789))) -\n                                          (int64_t) 1));\n                \n                if (thread_active_79832 && inactive_79833) {\n                    x_74090 = x_74091;\n                }\n                if (thread_active_79832) {\n                    if (!inactive_79833) {\n                        int64_t defunc_1_op_res_74092 = add64(x_74090, x_74091);\n                        \n                        x_74090 = defunc_1_op_res_74092;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_79821, skip_threads_79831)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (thread_active_79832) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_79823)[sext_i32_i64(local_tid_79819)] =\n                        x_74090;\n                    x_74091 = x_74090;\n                }\n            }\n            if (sle32(wave_sizze_79821, skip_threads_79831)) {\n                barrier(CLK_L",
                   "OCAL_MEM_FENCE);\n            }\n            skip_threads_79831 *= 2;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // last thread of block 'i' writes its result to offset 'i'\n    {\n        if ((local_tid_79819 - squot32(local_tid_79819, 32) * 32) == 31 &&\n            ltid_in_bounds_79830) {\n            ((volatile __local\n              int64_t *) scan_arr_mem_79823)[sext_i32_i64(squot32(local_tid_79819,\n                                                                  32))] =\n                x_74090;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_79834;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_79819, 32) == 0 && ltid_in_bounds_79830) {\n                x_79828 = ((volatile __local\n                            int64_t *) scan_arr_mem_79823)[sext_i32_i64(local_tid_79819)];\n                if ((local_tid_79819 - squot32(local_tid_79819, 32) * 32) ==\n                    0) {\n                    x_79827 = x_79828;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_79834 = 1;\n            while (slt32(skip_threads_79834, 32)) {\n                bool thread_active_79835 = sle32(skip_threads_79834,\n                                                 local_tid_79819 -\n                                                 squot32(local_tid_79819, 32) *\n                                                 32) &&\n                     (squot32(local_tid_79819, 32) == 0 &&\n                      ltid_in_bounds_79830);\n                \n                if (thread_active_79835) {\n                    // read operands\n                    {\n                        x_79827 = ((volatile __local\n                                    int64_t *) scan_arr_mem_79823)[sext_i32_i64(local_tid_79819) -\n                                                      ",
                   "             sext_i32_i64(skip_threads_79834)];\n                    }\n                }\n                // perform operation\n                {\n                    bool inactive_79836 =\n                         slt64(srem64((sext_i32_i64(local_tid_79819 * 32 + 32 -\n                                       1) + (int64_t) 1) *\n                                      (segscan_group_sizze_74083 *\n                                       sdiv_up64(m_65343 * n_65344,\n                                                 sext_i32_i64(num_threads_79789))) -\n                                      (int64_t) 1, n_65344),\n                               (sext_i32_i64(local_tid_79819 * 32 + 32 - 1) +\n                                (int64_t) 1) * (segscan_group_sizze_74083 *\n                                                sdiv_up64(m_65343 * n_65344,\n                                                          sext_i32_i64(num_threads_79789))) -\n                               (int64_t) 1 - ((sext_i32_i64((local_tid_79819 -\n                                                             skip_threads_79834) *\n                                               32 + 32 - 1) + (int64_t) 1) *\n                                              (segscan_group_sizze_74083 *\n                                               sdiv_up64(m_65343 * n_65344,\n                                                         sext_i32_i64(num_threads_79789))) -\n                                              (int64_t) 1));\n                    \n                    if (thread_active_79835 && inactive_79836) {\n                        x_79827 = x_79828;\n                    }\n                    if (thread_active_79835) {\n                        if (!inactive_79836) {\n                            int64_t defunc_1_op_res_79829 = add64(x_79827,\n                                                                  x_79828);\n                            \n                            x_79827 = defunc_1_op_res_79829;\n                        }\n              ",
                   "      }\n                }\n                if (sle32(wave_sizze_79821, skip_threads_79834)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (thread_active_79835) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_79823)[sext_i32_i64(local_tid_79819)] =\n                            x_79827;\n                        x_79828 = x_79827;\n                    }\n                }\n                if (sle32(wave_sizze_79821, skip_threads_79834)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_79834 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    bool no_carry_in_79837 = squot32(local_tid_79819, 32) == 0 ||\n         !ltid_in_bounds_79830;\n    \n    // carry-in for every block except the first\n    {\n        // read operands\n        {\n            if (!no_carry_in_79837) {\n                x_74091 = x_74090;\n                x_74090 = ((__local\n                            int64_t *) scan_arr_mem_79823)[sext_i32_i64(squot32(local_tid_79819,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n        }\n        // perform operation\n        {\n            bool inactive_79838 = slt64(srem64((sext_i32_i64(local_tid_79819) +\n                                                (int64_t) 1) *\n                                               (segscan_group_sizze_74083 *\n                                                sdiv_up64(m_65343 * n_65344,\n                                                          sext_i32_i64(num_threads_79789))) -\n                                               (int64_t) 1, n_65344),\n                                        (sext_i32_i64(local_tid_79819) +\n                                         (int64_t) 1) *\n                             ",
                   "           (segscan_group_sizze_74083 *\n                                         sdiv_up64(m_65343 * n_65344,\n                                                   sext_i32_i64(num_threads_79789))) -\n                                        (int64_t) 1 -\n                                        ((sext_i32_i64(squot32(local_tid_79819,\n                                                               32) * 32 - 1) +\n                                          (int64_t) 1) *\n                                         (segscan_group_sizze_74083 *\n                                          sdiv_up64(m_65343 * n_65344,\n                                                    sext_i32_i64(num_threads_79789))) -\n                                         (int64_t) 1));\n            \n            if (!no_carry_in_79837) {\n                if (inactive_79838) {\n                    x_74090 = x_74091;\n                }\n            }\n            if (!no_carry_in_79837) {\n                if (!inactive_79838) {\n                    int64_t defunc_1_op_res_74092 = add64(x_74090, x_74091);\n                    \n                    x_74090 = defunc_1_op_res_74092;\n                }\n            }\n        }\n        // write final result\n        {\n            if (!no_carry_in_79837) {\n                ((__local\n                  int64_t *) scan_arr_mem_79823)[sext_i32_i64(local_tid_79819)] =\n                    x_74090;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_79819, 32) == 0 && ltid_in_bounds_79830) {\n            ((__local\n              int64_t *) scan_arr_mem_79823)[sext_i32_i64(local_tid_79819)] =\n                x_74091;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_74087, m_65343) && slt64(gtid_74088, n_65344)) {\n            int64_t tmp_79839;\n            \n            tmp_79839 = ((__local\n                          int64_t *)",
                   " scan_arr_mem_79823)[sext_i32_i64(local_tid_79819)];\n            ((__global int64_t *) mem_77934)[gtid_74087 * n_65344 +\n                                             gtid_74088] = tmp_79839;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_74083\n}\n__kernel void mainziscan_stage3_67850(__global int *global_failure,\n                                      int64_t m_65343, int64_t n_65344,\n                                      int64_t num_groups_67845,\n                                      int32_t num_threads_78322,\n                                      int32_t required_groups_78373, __global\n                                      unsigned char *mem_77082)\n{\n    #define segscan_group_sizze_67844 (mainzisegscan_group_sizze_67824)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78374;\n    int32_t local_tid_78375;\n    int64_t group_sizze_78378;\n    int32_t wave_sizze_78377;\n    int32_t group_tid_78376;\n    \n    global_tid_78374 = get_global_id(0);\n    local_tid_78375 = get_local_id(0);\n    group_sizze_78378 = get_local_size(0);\n    wave_sizze_78377 = LOCKSTEP_WIDTH;\n    group_tid_78376 = get_group_id(0);\n    \n    int32_t phys_tid_67850 = global_tid_78374;\n    int32_t phys_group_id_78379;\n    \n    phys_group_id_78379 = get_group_id(0);\n    for (int32_t i_78380 = 0; i_78380 < sdiv_up32(required_groups_78373 -\n                                                  phys_group_id_78379,\n                                                  sext_i64_i32(num_groups_67845));\n         i_78380++) {\n        int32_t virt_group_id_78381 = phys_group_id_78379 + i_78380 *\n                sext_i64_i32(num_groups_67845);\n        int64_t flat_idx_78382 = sext_i32_i64(virt_group_id_78381) *\n                segscan_group_sizze_67844 + sext_i32_i64(local_tid_78375);\n        int64_t gtid_67848 = squot64(flat_idx_78382, n_65344);\n        int64_t gtid_67849 ",
                   "= flat_idx_78382 - squot64(flat_idx_78382, n_65344) *\n                n_65344;\n        int64_t orig_group_78383 = squot64(flat_idx_78382,\n                                           segscan_group_sizze_67844 *\n                                           sdiv_up64(m_65343 * n_65344,\n                                                     sext_i32_i64(num_threads_78322)));\n        int64_t carry_in_flat_idx_78384 = orig_group_78383 *\n                (segscan_group_sizze_67844 * sdiv_up64(m_65343 * n_65344,\n                                                       sext_i32_i64(num_threads_78322))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_67848, m_65343) && slt64(gtid_67849, n_65344)) {\n            if (!(orig_group_78383 == (int64_t) 0 || (flat_idx_78382 ==\n                                                      (orig_group_78383 +\n                                                       (int64_t) 1) *\n                                                      (segscan_group_sizze_67844 *\n                                                       sdiv_up64(m_65343 *\n                                                                 n_65344,\n                                                                 sext_i32_i64(num_threads_78322))) -\n                                                      (int64_t) 1 ||\n                                                      slt64(srem64(flat_idx_78382,\n                                                                   n_65344),\n                                                            flat_idx_78382 -\n                                                            carry_in_flat_idx_78384)))) {\n                int64_t x_67851;\n                int64_t x_67852;\n                \n                x_67851 = ((__global\n                            int64_t *) mem_77082)[squot64(carry_in_flat_idx_78384,\n                                                          n_65344) * n_65344 +\n                                                  (carry_in_flat_idx",
                   "_78384 -\n                                                   squot64(carry_in_flat_idx_78384,\n                                                           n_65344) * n_65344)];\n                x_67852 = ((__global int64_t *) mem_77082)[gtid_67848 *\n                                                           n_65344 +\n                                                           gtid_67849];\n                \n                int64_t defunc_1_op_res_67853 = add64(x_67851, x_67852);\n                \n                x_67851 = defunc_1_op_res_67853;\n                ((__global int64_t *) mem_77082)[gtid_67848 * n_65344 +\n                                                 gtid_67849] = x_67851;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_67844\n}\n__kernel void mainziscan_stage3_69641(__global int *global_failure,\n                                      int64_t m_65343, int64_t n_65344,\n                                      int64_t num_groups_69636,\n                                      int32_t num_threads_78687,\n                                      int32_t required_groups_78738, __global\n                                      unsigned char *mem_77316)\n{\n    #define segscan_group_sizze_69635 (mainzisegscan_group_sizze_69615)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78739;\n    int32_t local_tid_78740;\n    int64_t group_sizze_78743;\n    int32_t wave_sizze_78742;\n    int32_t group_tid_78741;\n    \n    global_tid_78739 = get_global_id(0);\n    local_tid_78740 = get_local_id(0);\n    group_sizze_78743 = get_local_size(0);\n    wave_sizze_78742 = LOCKSTEP_WIDTH;\n    group_tid_78741 = get_group_id(0);\n    \n    int32_t phys_tid_69641 = global_tid_78739;\n    int32_t phys_group_id_78744;\n    \n    phys_group_id_78744 = get_group_id(0);\n    for (int32_t i_78745 = 0; i",
                   "_78745 < sdiv_up32(required_groups_78738 -\n                                                  phys_group_id_78744,\n                                                  sext_i64_i32(num_groups_69636));\n         i_78745++) {\n        int32_t virt_group_id_78746 = phys_group_id_78744 + i_78745 *\n                sext_i64_i32(num_groups_69636);\n        int64_t flat_idx_78747 = sext_i32_i64(virt_group_id_78746) *\n                segscan_group_sizze_69635 + sext_i32_i64(local_tid_78740);\n        int64_t gtid_69639 = squot64(flat_idx_78747, n_65344);\n        int64_t gtid_69640 = flat_idx_78747 - squot64(flat_idx_78747, n_65344) *\n                n_65344;\n        int64_t orig_group_78748 = squot64(flat_idx_78747,\n                                           segscan_group_sizze_69635 *\n                                           sdiv_up64(m_65343 * n_65344,\n                                                     sext_i32_i64(num_threads_78687)));\n        int64_t carry_in_flat_idx_78749 = orig_group_78748 *\n                (segscan_group_sizze_69635 * sdiv_up64(m_65343 * n_65344,\n                                                       sext_i32_i64(num_threads_78687))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_69639, m_65343) && slt64(gtid_69640, n_65344)) {\n            if (!(orig_group_78748 == (int64_t) 0 || (flat_idx_78747 ==\n                                                      (orig_group_78748 +\n                                                       (int64_t) 1) *\n                                                      (segscan_group_sizze_69635 *\n                                                       sdiv_up64(m_65343 *\n                                                                 n_65344,\n                                                                 sext_i32_i64(num_threads_78687))) -\n                                                      (int64_t) 1 ||\n                                                      slt64(srem64(flat_idx_78747,\n                       ",
                   "                                            n_65344),\n                                                            flat_idx_78747 -\n                                                            carry_in_flat_idx_78749)))) {\n                int64_t x_69642;\n                int64_t x_69643;\n                \n                x_69642 = ((__global\n                            int64_t *) mem_77316)[squot64(carry_in_flat_idx_78749,\n                                                          n_65344) * n_65344 +\n                                                  (carry_in_flat_idx_78749 -\n                                                   squot64(carry_in_flat_idx_78749,\n                                                           n_65344) * n_65344)];\n                x_69643 = ((__global int64_t *) mem_77316)[gtid_69639 *\n                                                           n_65344 +\n                                                           gtid_69640];\n                \n                int64_t defunc_1_op_res_69644 = add64(x_69642, x_69643);\n                \n                x_69642 = defunc_1_op_res_69644;\n                ((__global int64_t *) mem_77316)[gtid_69639 * n_65344 +\n                                                 gtid_69640] = x_69642;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_69635\n}\n__kernel void mainziscan_stage3_71680(__global int *global_failure,\n                                      int64_t m_65343, int64_t n_65344,\n                                      int64_t num_groups_71675,\n                                      int32_t num_threads_79104,\n                                      int32_t required_groups_79155, __global\n                                      unsigned char *mem_77608)\n{\n    #define segscan_group_sizze_71674 (mainzisegscan_group_sizze_71654)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    ",
                   "\n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79156;\n    int32_t local_tid_79157;\n    int64_t group_sizze_79160;\n    int32_t wave_sizze_79159;\n    int32_t group_tid_79158;\n    \n    global_tid_79156 = get_global_id(0);\n    local_tid_79157 = get_local_id(0);\n    group_sizze_79160 = get_local_size(0);\n    wave_sizze_79159 = LOCKSTEP_WIDTH;\n    group_tid_79158 = get_group_id(0);\n    \n    int32_t phys_tid_71680 = global_tid_79156;\n    int32_t phys_group_id_79161;\n    \n    phys_group_id_79161 = get_group_id(0);\n    for (int32_t i_79162 = 0; i_79162 < sdiv_up32(required_groups_79155 -\n                                                  phys_group_id_79161,\n                                                  sext_i64_i32(num_groups_71675));\n         i_79162++) {\n        int32_t virt_group_id_79163 = phys_group_id_79161 + i_79162 *\n                sext_i64_i32(num_groups_71675);\n        int64_t flat_idx_79164 = sext_i32_i64(virt_group_id_79163) *\n                segscan_group_sizze_71674 + sext_i32_i64(local_tid_79157);\n        int64_t gtid_71678 = squot64(flat_idx_79164, n_65344);\n        int64_t gtid_71679 = flat_idx_79164 - squot64(flat_idx_79164, n_65344) *\n                n_65344;\n        int64_t orig_group_79165 = squot64(flat_idx_79164,\n                                           segscan_group_sizze_71674 *\n                                           sdiv_up64(m_65343 * n_65344,\n                                                     sext_i32_i64(num_threads_79104)));\n        int64_t carry_in_flat_idx_79166 = orig_group_79165 *\n                (segscan_group_sizze_71674 * sdiv_up64(m_65343 * n_65344,\n                                                       sext_i32_i64(num_threads_79104))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_71678, m_65343) && slt64(gtid_71679, n_65344)) {\n            if (!(orig_group_79165 == (int64_t) 0 || (flat_idx_79164 ==\n                                                      (orig_group_79165 +\n       ",
                   "                                                (int64_t) 1) *\n                                                      (segscan_group_sizze_71674 *\n                                                       sdiv_up64(m_65343 *\n                                                                 n_65344,\n                                                                 sext_i32_i64(num_threads_79104))) -\n                                                      (int64_t) 1 ||\n                                                      slt64(srem64(flat_idx_79164,\n                                                                   n_65344),\n                                                            flat_idx_79164 -\n                                                            carry_in_flat_idx_79166)))) {\n                int64_t x_71681;\n                int64_t x_71682;\n                \n                x_71681 = ((__global\n                            int64_t *) mem_77608)[squot64(carry_in_flat_idx_79166,\n                                                          n_65344) * n_65344 +\n                                                  (carry_in_flat_idx_79166 -\n                                                   squot64(carry_in_flat_idx_79166,\n                                                           n_65344) * n_65344)];\n                x_71682 = ((__global int64_t *) mem_77608)[gtid_71678 *\n                                                           n_65344 +\n                                                           gtid_71679];\n                \n                int64_t defunc_1_op_res_71683 = add64(x_71681, x_71682);\n                \n                x_71681 = defunc_1_op_res_71683;\n                ((__global int64_t *) mem_77608)[gtid_71678 * n_65344 +\n                                                 gtid_71679] = x_71681;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_71674\n}\n__kernel void",
                   " mainziscan_stage3_72665(__global int *global_failure,\n                                      int64_t m_65343, int64_t n_65344,\n                                      int64_t num_groups_72660,\n                                      int32_t num_threads_79521,\n                                      int32_t required_groups_79572, __global\n                                      unsigned char *mem_77833)\n{\n    #define segscan_group_sizze_72659 (mainzisegscan_group_sizze_72639)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79573;\n    int32_t local_tid_79574;\n    int64_t group_sizze_79577;\n    int32_t wave_sizze_79576;\n    int32_t group_tid_79575;\n    \n    global_tid_79573 = get_global_id(0);\n    local_tid_79574 = get_local_id(0);\n    group_sizze_79577 = get_local_size(0);\n    wave_sizze_79576 = LOCKSTEP_WIDTH;\n    group_tid_79575 = get_group_id(0);\n    \n    int32_t phys_tid_72665 = global_tid_79573;\n    int32_t phys_group_id_79578;\n    \n    phys_group_id_79578 = get_group_id(0);\n    for (int32_t i_79579 = 0; i_79579 < sdiv_up32(required_groups_79572 -\n                                                  phys_group_id_79578,\n                                                  sext_i64_i32(num_groups_72660));\n         i_79579++) {\n        int32_t virt_group_id_79580 = phys_group_id_79578 + i_79579 *\n                sext_i64_i32(num_groups_72660);\n        int64_t flat_idx_79581 = sext_i32_i64(virt_group_id_79580) *\n                segscan_group_sizze_72659 + sext_i32_i64(local_tid_79574);\n        int64_t gtid_72663 = squot64(flat_idx_79581, n_65344);\n        int64_t gtid_72664 = flat_idx_79581 - squot64(flat_idx_79581, n_65344) *\n                n_65344;\n        int64_t orig_group_79582 = squot64(flat_idx_79581,\n                                           segscan_group_sizze_72659 *\n                                           sdiv_up64(m_65343 * n_65344,\n      ",
                   "                                               sext_i32_i64(num_threads_79521)));\n        int64_t carry_in_flat_idx_79583 = orig_group_79582 *\n                (segscan_group_sizze_72659 * sdiv_up64(m_65343 * n_65344,\n                                                       sext_i32_i64(num_threads_79521))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_72663, m_65343) && slt64(gtid_72664, n_65344)) {\n            if (!(orig_group_79582 == (int64_t) 0 || (flat_idx_79581 ==\n                                                      (orig_group_79582 +\n                                                       (int64_t) 1) *\n                                                      (segscan_group_sizze_72659 *\n                                                       sdiv_up64(m_65343 *\n                                                                 n_65344,\n                                                                 sext_i32_i64(num_threads_79521))) -\n                                                      (int64_t) 1 ||\n                                                      slt64(srem64(flat_idx_79581,\n                                                                   n_65344),\n                                                            flat_idx_79581 -\n                                                            carry_in_flat_idx_79583)))) {\n                int64_t x_72666;\n                int64_t x_72667;\n                \n                x_72666 = ((__global\n                            int64_t *) mem_77833)[squot64(carry_in_flat_idx_79583,\n                                                          n_65344) * n_65344 +\n                                                  (carry_in_flat_idx_79583 -\n                                                   squot64(carry_in_flat_idx_79583,\n                                                           n_65344) * n_65344)];\n                x_72667 = ((__global int64_t *) mem_77833)[gtid_72663 *\n                                         ",
                   "                  n_65344 +\n                                                           gtid_72664];\n                \n                int64_t defunc_1_op_res_72668 = add64(x_72666, x_72667);\n                \n                x_72666 = defunc_1_op_res_72668;\n                ((__global int64_t *) mem_77833)[gtid_72663 * n_65344 +\n                                                 gtid_72664] = x_72666;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_72659\n}\n__kernel void mainziscan_stage3_73332(__global int *global_failure,\n                                      int64_t m_65343, int64_t n_65344,\n                                      int64_t num_groups_73327,\n                                      int32_t num_threads_79652,\n                                      int32_t required_groups_79703, __global\n                                      unsigned char *mem_77880)\n{\n    #define segscan_group_sizze_73326 (mainzisegscan_group_sizze_73306)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79704;\n    int32_t local_tid_79705;\n    int64_t group_sizze_79708;\n    int32_t wave_sizze_79707;\n    int32_t group_tid_79706;\n    \n    global_tid_79704 = get_global_id(0);\n    local_tid_79705 = get_local_id(0);\n    group_sizze_79708 = get_local_size(0);\n    wave_sizze_79707 = LOCKSTEP_WIDTH;\n    group_tid_79706 = get_group_id(0);\n    \n    int32_t phys_tid_73332 = global_tid_79704;\n    int32_t phys_group_id_79709;\n    \n    phys_group_id_79709 = get_group_id(0);\n    for (int32_t i_79710 = 0; i_79710 < sdiv_up32(required_groups_79703 -\n                                                  phys_group_id_79709,\n                                                  sext_i64_i32(num_groups_73327));\n         i_79710++) {\n        int32_t virt_group_id_79711 = phys_group_id_79709 + i_79710 ",
                   "*\n                sext_i64_i32(num_groups_73327);\n        int64_t flat_idx_79712 = sext_i32_i64(virt_group_id_79711) *\n                segscan_group_sizze_73326 + sext_i32_i64(local_tid_79705);\n        int64_t gtid_73330 = squot64(flat_idx_79712, n_65344);\n        int64_t gtid_73331 = flat_idx_79712 - squot64(flat_idx_79712, n_65344) *\n                n_65344;\n        int64_t orig_group_79713 = squot64(flat_idx_79712,\n                                           segscan_group_sizze_73326 *\n                                           sdiv_up64(m_65343 * n_65344,\n                                                     sext_i32_i64(num_threads_79652)));\n        int64_t carry_in_flat_idx_79714 = orig_group_79713 *\n                (segscan_group_sizze_73326 * sdiv_up64(m_65343 * n_65344,\n                                                       sext_i32_i64(num_threads_79652))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_73330, m_65343) && slt64(gtid_73331, n_65344)) {\n            if (!(orig_group_79713 == (int64_t) 0 || (flat_idx_79712 ==\n                                                      (orig_group_79713 +\n                                                       (int64_t) 1) *\n                                                      (segscan_group_sizze_73326 *\n                                                       sdiv_up64(m_65343 *\n                                                                 n_65344,\n                                                                 sext_i32_i64(num_threads_79652))) -\n                                                      (int64_t) 1 ||\n                                                      slt64(srem64(flat_idx_79712,\n                                                                   n_65344),\n                                                            flat_idx_79712 -\n                                                            carry_in_flat_idx_79714)))) {\n                int64_t x_73333;\n                int64_t x_73334;\n",
                   "                \n                x_73333 = ((__global\n                            int64_t *) mem_77880)[squot64(carry_in_flat_idx_79714,\n                                                          n_65344) * n_65344 +\n                                                  (carry_in_flat_idx_79714 -\n                                                   squot64(carry_in_flat_idx_79714,\n                                                           n_65344) * n_65344)];\n                x_73334 = ((__global int64_t *) mem_77880)[gtid_73330 *\n                                                           n_65344 +\n                                                           gtid_73331];\n                \n                int64_t defunc_1_op_res_73335 = add64(x_73333, x_73334);\n                \n                x_73333 = defunc_1_op_res_73335;\n                ((__global int64_t *) mem_77880)[gtid_73330 * n_65344 +\n                                                 gtid_73331] = x_73333;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_73326\n}\n__kernel void mainziscan_stage3_74089(__global int *global_failure,\n                                      int64_t m_65343, int64_t n_65344,\n                                      int64_t num_groups_74084,\n                                      int32_t num_threads_79789,\n                                      int32_t required_groups_79840, __global\n                                      unsigned char *mem_77934)\n{\n    #define segscan_group_sizze_74083 (mainzisegscan_group_sizze_74063)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79841;\n    int32_t local_tid_79842;\n    int64_t group_sizze_79845;\n    int32_t wave_sizze_79844;\n    int32_t group_tid_79843;\n    \n    global_tid_79841 = get_global_id(0);\n    local_tid_79842 = get_local_id(0);\n ",
                   "   group_sizze_79845 = get_local_size(0);\n    wave_sizze_79844 = LOCKSTEP_WIDTH;\n    group_tid_79843 = get_group_id(0);\n    \n    int32_t phys_tid_74089 = global_tid_79841;\n    int32_t phys_group_id_79846;\n    \n    phys_group_id_79846 = get_group_id(0);\n    for (int32_t i_79847 = 0; i_79847 < sdiv_up32(required_groups_79840 -\n                                                  phys_group_id_79846,\n                                                  sext_i64_i32(num_groups_74084));\n         i_79847++) {\n        int32_t virt_group_id_79848 = phys_group_id_79846 + i_79847 *\n                sext_i64_i32(num_groups_74084);\n        int64_t flat_idx_79849 = sext_i32_i64(virt_group_id_79848) *\n                segscan_group_sizze_74083 + sext_i32_i64(local_tid_79842);\n        int64_t gtid_74087 = squot64(flat_idx_79849, n_65344);\n        int64_t gtid_74088 = flat_idx_79849 - squot64(flat_idx_79849, n_65344) *\n                n_65344;\n        int64_t orig_group_79850 = squot64(flat_idx_79849,\n                                           segscan_group_sizze_74083 *\n                                           sdiv_up64(m_65343 * n_65344,\n                                                     sext_i32_i64(num_threads_79789)));\n        int64_t carry_in_flat_idx_79851 = orig_group_79850 *\n                (segscan_group_sizze_74083 * sdiv_up64(m_65343 * n_65344,\n                                                       sext_i32_i64(num_threads_79789))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_74087, m_65343) && slt64(gtid_74088, n_65344)) {\n            if (!(orig_group_79850 == (int64_t) 0 || (flat_idx_79849 ==\n                                                      (orig_group_79850 +\n                                                       (int64_t) 1) *\n                                                      (segscan_group_sizze_74083 *\n                                                       sdiv_up64(m_65343 *\n                                                                 n",
                   "_65344,\n                                                                 sext_i32_i64(num_threads_79789))) -\n                                                      (int64_t) 1 ||\n                                                      slt64(srem64(flat_idx_79849,\n                                                                   n_65344),\n                                                            flat_idx_79849 -\n                                                            carry_in_flat_idx_79851)))) {\n                int64_t x_74090;\n                int64_t x_74091;\n                \n                x_74090 = ((__global\n                            int64_t *) mem_77934)[squot64(carry_in_flat_idx_79851,\n                                                          n_65344) * n_65344 +\n                                                  (carry_in_flat_idx_79851 -\n                                                   squot64(carry_in_flat_idx_79851,\n                                                           n_65344) * n_65344)];\n                x_74091 = ((__global int64_t *) mem_77934)[gtid_74087 *\n                                                           n_65344 +\n                                                           gtid_74088];\n                \n                int64_t defunc_1_op_res_74092 = add64(x_74090, x_74091);\n                \n                x_74090 = defunc_1_op_res_74092;\n                ((__global int64_t *) mem_77934)[gtid_74087 * n_65344 +\n                                                 gtid_74088] = x_74090;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_74083\n}\n__kernel void mainzisegmap_66881(__global int *global_failure,\n                                 int failure_is_an_option, __global\n                                 int64_t *global_failure_args, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                      ",
                   "           int64_t jump_65348, int64_t n_m_65352,\n                                 int64_t i_65358, unsigned char x_65359_bits,\n                                 int64_t min_res_65364,\n                                 unsigned char loop_cond_65369_bits,\n                                 float i64_res_65370, int64_t num_groups_66877,\n                                 int64_t num_threads_78201, __global\n                                 unsigned char *mem_76983, __global\n                                 unsigned char *mem_77077, __global\n                                 unsigned char *color_78129, __global\n                                 unsigned char *color_78130, __global\n                                 unsigned char *color_78131, __global\n                                 unsigned char *color_78132, __global\n                                 unsigned char *color_78133)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    \n    #define segmap_group_sizze_66876 (mainzisegmap_group_sizze_66697)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile __local bool local_failure;\n    \n    if (failure_is_an_option) {\n        int failed = *global_failure >= 0;\n        \n        if (failed)\n            return;\n    }\n    local_failure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_78287;\n    int32_t local_tid_78288;\n    int64_t group_sizze_78291;\n    int32_t wave_sizze_78290;\n    int32_t group_tid_78289;\n    \n    global_tid_78287 = get_global_id(0);\n    local_tid_78288 = get_local_id(0);\n    group_sizze_78291 = get_local_size(0);\n    wave_sizze_78290 = LOCKSTEP_WIDTH;\n    group_tid_78289 = get_group_id(0);\n    \n    int32_t phys_tid_66881 = global_tid_78287;\n    int32_t phys_group_id_78292;\n    \n    phys_group_id_78292 = get_group_id(0);\n    for (int32_t i_78293 = 0; i_78293 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_65343, segmap_group_sizze_66876)) -\n                 ",
                   "  phys_group_id_78292, sext_i64_i32(num_groups_66877));\n         i_78293++) {\n        int32_t virt_group_id_78294 = phys_group_id_78292 + i_78293 *\n                sext_i64_i32(num_groups_66877);\n        int64_t global_tid_78295 = sext_i32_i64(virt_group_id_78294) *\n                segmap_group_sizze_66876 + sext_i32_i64(local_tid_78288);\n        int64_t slice_78296 = m_65343;\n        int64_t gtid_66880 = global_tid_78295;\n        int64_t remnant_78297 = global_tid_78295 - gtid_66880;\n        \n        if (slt64(gtid_66880, m_65343)) {\n            int64_t discard_76791;\n            int64_t scanacc_76787 = (int64_t) 0;\n            \n            for (int64_t i_76789 = 0; i_76789 < n_65344; i_76789++) {\n                float x_66887;\n                \n                x_66887 = ((__global float *) mem_76983)[i_76789 * m_65343 +\n                                                         gtid_66880];\n                \n                bool isnan_res_66888;\n                \n                isnan_res_66888 = futrts_isnan32(x_66887);\n                \n                bool defunc_0_p_res_66889 = !isnan_res_66888;\n                int64_t defunc_0_f_res_66890 =\n                        btoi_bool_i64(defunc_0_p_res_66889);\n                int64_t defunc_1_op_res_66886 = add64(defunc_0_f_res_66890,\n                                                      scanacc_76787);\n                \n                ((__global int64_t *) color_78131)[phys_tid_66881 + i_76789 *\n                                                   num_threads_78201] =\n                    defunc_1_op_res_66886;\n                \n                int64_t scanacc_tmp_78298 = defunc_1_op_res_66886;\n                \n                scanacc_76787 = scanacc_tmp_78298;\n            }\n            discard_76791 = scanacc_76787;\n            \n            int64_t last_res_66891;\n            \n            last_res_66891 = ((__global int64_t *) color_78131)[phys_tid_66881 +\n                                                                i_65358",
                   " *\n                                                                num_threads_78201];\n            for (int64_t i_78300 = 0; i_78300 < n_65344; i_78300++) {\n                ((__global float *) color_78133)[phys_tid_66881 + i_78300 *\n                                                 num_threads_78201] = 0.0F;\n            }\n            for (int64_t i_78301 = 0; i_78301 < n_65344; i_78301++) {\n                ((__global int64_t *) color_78132)[phys_tid_66881 + i_78301 *\n                                                   num_threads_78201] =\n                    (int64_t) -1;\n            }\n            for (int64_t write_iter_76792 = 0; write_iter_76792 < n_65344;\n                 write_iter_76792++) {\n                float write_iv_76795;\n                \n                write_iv_76795 = ((__global\n                                   float *) mem_76983)[write_iter_76792 *\n                                                       m_65343 + gtid_66880];\n                \n                bool isnan_res_66899;\n                \n                isnan_res_66899 = futrts_isnan32(write_iv_76795);\n                \n                bool defunc_0_p_res_66900 = !isnan_res_66899;\n                int64_t defunc_1_f_res_66901;\n                \n                if (defunc_0_p_res_66900) {\n                    int64_t write_iv_76796;\n                    \n                    write_iv_76796 = ((__global\n                                       int64_t *) color_78131)[phys_tid_66881 +\n                                                               write_iter_76792 *\n                                                               num_threads_78201];\n                    \n                    int64_t defunc_1_f_res_t_res_66902 = sub64(write_iv_76796,\n                                                               (int64_t) 1);\n                    \n                    defunc_1_f_res_66901 = defunc_1_f_res_t_res_66902;\n                } else {\n                    defunc_1_f_res_66901 = (int64_t) -1;\n           ",
                   "     }\n                if (sle64((int64_t) 0, defunc_1_f_res_66901) &&\n                    slt64(defunc_1_f_res_66901, n_65344)) {\n                    ((__global int64_t *) color_78132)[phys_tid_66881 +\n                                                       defunc_1_f_res_66901 *\n                                                       num_threads_78201] =\n                        write_iter_76792;\n                }\n                if (sle64((int64_t) 0, defunc_1_f_res_66901) &&\n                    slt64(defunc_1_f_res_66901, n_65344)) {\n                    for (int64_t i_78304 = 0; i_78304 < (int64_t) 1;\n                         i_78304++) {\n                        float tmp_78305;\n                        \n                        tmp_78305 = ((__global float *) mem_76983)[m_65343 *\n                                                                   write_iter_76792 +\n                                                                   gtid_66880 +\n                                                                   i_78304 *\n                                                                   m_65343];\n                        ((__global float *) color_78133)[phys_tid_66881 +\n                                                         num_threads_78201 *\n                                                         defunc_1_f_res_66901 +\n                                                         i_78304 *\n                                                         num_threads_78201] =\n                            tmp_78305;\n                    }\n                }\n            }\n            for (int64_t i_76802 = 0; i_76802 < n_65344; i_76802++) {\n                int64_t x_66904;\n                \n                x_66904 = ((__global int64_t *) color_78132)[phys_tid_66881 +\n                                                             i_76802 *\n                                                             num_threads_78201];\n                \n                int64_t defunc_0_f_res_66905 = add64(",
                   "(int64_t) 1, x_66904);\n                \n                ((__global int64_t *) color_78131)[phys_tid_66881 + i_76802 *\n                                                   num_threads_78201] =\n                    defunc_0_f_res_66905;\n            }\n            \n            int64_t min_arg_66906 = sub64(last_res_66891, (int64_t) 1);\n            int64_t min_arg_66907 = sub64(last_res_66891, min_res_65364);\n            int64_t min_res_66908 = smin64(q_65346, last_res_66891);\n            float i64_res_66909 = sitofp_i64_f32(last_res_66891);\n            float x_66910 = i64_res_65370 - i64_res_66909;\n            float max_arg_66911 = x_66910 / 2.0F;\n            float max_res_66912 = fmax32(0.0F, max_arg_66911);\n            \n            for (int64_t i_76806 = 0; i_76806 < q_65346; i_76806++) {\n                bool cond_66915 = sle64(last_res_66891, i_76806);\n                float defunc_0_f_res_66916;\n                \n                if (cond_66915) {\n                    defunc_0_f_res_66916 = 0.0F;\n                } else {\n                    defunc_0_f_res_66916 = 1.0F;\n                }\n                ((__global float *) color_78130)[phys_tid_66881 + i_76806 *\n                                                 num_threads_78201] =\n                    defunc_0_f_res_66916;\n            }\n            for (int64_t i_76810 = 0; i_76810 < n_m_65352; i_76810++) {\n                int64_t min_arg_66919 = mul64(jump_65348, i_76810);\n                int64_t min_res_66920 = smin64(i_65358, min_arg_66919);\n                int64_t defunc_0_g_res_66921 = add64((int64_t) 1,\n                                                     min_res_66920);\n                bool init_idx_66922;\n                int64_t init_idx_66923;\n                int64_t init_idx_66924;\n                bool loop_while_66925;\n                int64_t low_66926;\n                int64_t high_66927;\n                \n                loop_while_66925 = x_65359;\n                low_66926 = (int64_t) 0;\n                high_6692",
                   "7 = i_65358;\n                while (loop_while_66925) {\n                    int64_t x_66928 = add64(low_66926, high_66927);\n                    int64_t mid_66929 = sdiv64(x_66928, (int64_t) 2);\n                    bool x_66930 = sle64((int64_t) 0, mid_66929);\n                    bool y_66931 = slt64(mid_66929, n_65344);\n                    bool bounds_check_66932 = x_66930 && y_66931;\n                    bool index_certs_66933;\n                    \n                    if (!bounds_check_66932) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          0) == -1) {\n                                global_failure_args[0] = (int64_t) mid_66929;\n                                global_failure_args[1] = (int64_t) n_65344;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t mid_id_66934;\n                    \n                    mid_id_66934 = ((__global\n                                     int64_t *) color_78131)[phys_tid_66881 +\n                                                             mid_66929 *\n                                                             num_threads_78201];\n                    \n                    bool cond_66935 = slt64(mid_id_66934, (int64_t) 0);\n                    int64_t mid_idx_66936;\n                    \n                    if (cond_66935) {\n                        mid_idx_66936 = (int64_t) 9223372036854775807;\n                    } else {\n                        mid_idx_66936 = mid_id_66934;\n                    }\n                    \n                    bool cond_66937 = sle64(defunc_0_g_res_66921,\n                                            mid_idx_66936);\n                    int64_t loopres_66938;\n                    int64_t loopres_66939;\n  ",
                   "                  \n                    if (cond_66937) {\n                        int64_t loopres_t_res_66940 = sub64(mid_66929,\n                                                            (int64_t) 1);\n                        \n                        loopres_66938 = low_66926;\n                        loopres_66939 = loopres_t_res_66940;\n                    } else {\n                        int64_t loopres_f_res_66941 = add64((int64_t) 1,\n                                                            mid_66929);\n                        \n                        loopres_66938 = loopres_f_res_66941;\n                        loopres_66939 = high_66927;\n                    }\n                    \n                    bool loop_cond_66942 = sle64(loopres_66938, loopres_66939);\n                    bool loop_while_tmp_78309 = loop_cond_66942;\n                    int64_t low_tmp_78310 = loopres_66938;\n                    int64_t high_tmp_78311 = loopres_66939;\n                    \n                    loop_while_66925 = loop_while_tmp_78309;\n                    low_66926 = low_tmp_78310;\n                    high_66927 = high_tmp_78311;\n                }\n                init_idx_66922 = loop_while_66925;\n                init_idx_66923 = low_66926;\n                init_idx_66924 = high_66927;\n                \n                bool idx_66943;\n                int64_t idx_66944;\n                int64_t idx_66945;\n                int64_t idx_66946;\n                bool loop_while_66947;\n                int64_t l_idx_66948;\n                int64_t r_idx_66949;\n                int64_t span_66950;\n                \n                loop_while_66947 = loop_cond_65369;\n                l_idx_66948 = init_idx_66923;\n                r_idx_66949 = init_idx_66923;\n                span_66950 = (int64_t) 1;\n                while (loop_while_66947) {\n                    int64_t max_arg_66951 = sub64(l_idx_66948, (int64_t) 1);\n                    int64_t max_res_66952 = smax64((int64_t) 0, max_arg_66951);\n",
                   "                    int64_t min_arg_66953 = add64((int64_t) 1, r_idx_66949);\n                    int64_t min_res_66954 = smin64(min_arg_66906,\n                                                   min_arg_66953);\n                    bool x_66955 = sle64((int64_t) 0, max_res_66952);\n                    bool y_66956 = slt64(max_res_66952, n_65344);\n                    bool bounds_check_66957 = x_66955 && y_66956;\n                    bool index_certs_66958;\n                    \n                    if (!bounds_check_66957) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          1) == -1) {\n                                global_failure_args[0] =\n                                    (int64_t) max_res_66952;\n                                global_failure_args[1] = (int64_t) n_65344;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t x_66959;\n                    \n                    x_66959 = ((__global\n                                int64_t *) color_78131)[phys_tid_66881 +\n                                                        max_res_66952 *\n                                                        num_threads_78201];\n                    \n                    int64_t abs_arg_66960 = sub64(x_66959,\n                                                  defunc_0_g_res_66921);\n                    int64_t abs_res_66961 = abs64(abs_arg_66960);\n                    bool x_66962 = sle64((int64_t) 0, min_res_66954);\n                    bool y_66963 = slt64(min_res_66954, n_65344);\n                    bool bounds_check_66964 = x_66962 && y_66963;\n                    bool index_certs_66965;\n                    \n                    if (!bounds_check_66964) {\n                        {\n    ",
                   "                        if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          2) == -1) {\n                                global_failure_args[0] =\n                                    (int64_t) min_res_66954;\n                                global_failure_args[1] = (int64_t) n_65344;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t x_66966;\n                    \n                    x_66966 = ((__global\n                                int64_t *) color_78131)[phys_tid_66881 +\n                                                        min_res_66954 *\n                                                        num_threads_78201];\n                    \n                    int64_t abs_arg_66967 = sub64(x_66966,\n                                                  defunc_0_g_res_66921);\n                    int64_t abs_res_66968 = abs64(abs_arg_66967);\n                    bool cond_66969 = max_res_66952 == l_idx_66948;\n                    int64_t loopres_66970;\n                    int64_t loopres_66971;\n                    int64_t loopres_66972;\n                    \n                    if (cond_66969) {\n                        loopres_66970 = l_idx_66948;\n                        loopres_66971 = r_idx_66949;\n                        loopres_66972 = min_res_65364;\n                    } else {\n                        bool cond_66973 = slt64(abs_res_66961, abs_res_66968);\n                        bool cond_f_res_66974 = min_res_66954 == r_idx_66949;\n                        bool x_66975 = !cond_66973;\n                        bool y_66976 = cond_f_res_66974 && x_66975;\n                        bool cond_66977 = cond_66973 || y_66976;\n                        int64_t loopres_f_res_66978;\n                        \n                        if (cond",
                   "_66977) {\n                            loopres_f_res_66978 = max_res_66952;\n                        } else {\n                            loopres_f_res_66978 = l_idx_66948;\n                        }\n                        \n                        int64_t loopres_f_res_66979;\n                        \n                        if (cond_66977) {\n                            loopres_f_res_66979 = r_idx_66949;\n                        } else {\n                            loopres_f_res_66979 = min_res_66954;\n                        }\n                        \n                        int64_t loopres_f_res_66980;\n                        \n                        if (cond_66977) {\n                            int64_t loopres_f_res_t_res_66981 =\n                                    add64((int64_t) 1, span_66950);\n                            \n                            loopres_f_res_66980 = loopres_f_res_t_res_66981;\n                        } else {\n                            int64_t loopres_f_res_f_res_66982 =\n                                    add64((int64_t) 1, span_66950);\n                            \n                            loopres_f_res_66980 = loopres_f_res_f_res_66982;\n                        }\n                        loopres_66970 = loopres_f_res_66978;\n                        loopres_66971 = loopres_f_res_66979;\n                        loopres_66972 = loopres_f_res_66980;\n                    }\n                    \n                    bool loop_cond_66983 = slt64(loopres_66972, min_res_65364);\n                    bool loop_while_tmp_78312 = loop_cond_66983;\n                    int64_t l_idx_tmp_78313 = loopres_66970;\n                    int64_t r_idx_tmp_78314 = loopres_66971;\n                    int64_t span_tmp_78315 = loopres_66972;\n                    \n                    loop_while_66947 = loop_while_tmp_78312;\n                    l_idx_66948 = l_idx_tmp_78313;\n                    r_idx_66949 = r_idx_tmp_78314;\n                    span_66950 = span_tmp_78315;\n     ",
                   "           }\n                idx_66943 = loop_while_66947;\n                idx_66944 = l_idx_66948;\n                idx_66945 = r_idx_66949;\n                idx_66946 = span_66950;\n                \n                int64_t min_res_66984 = smin64(min_arg_66907, idx_66944);\n                int64_t max_res_66985 = smax64((int64_t) 0, min_res_66984);\n                int64_t x_66986 = add64(min_res_66908, max_res_66985);\n                int64_t r_66987 = sub64(x_66986, (int64_t) 1);\n                bool x_66988 = sle64((int64_t) 0, r_66987);\n                bool y_66989 = slt64(r_66987, n_65344);\n                bool bounds_check_66990 = x_66988 && y_66989;\n                bool index_certs_66991;\n                \n                if (!bounds_check_66990) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 3) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) r_66987;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_66992;\n                \n                x_66992 = ((__global int64_t *) color_78132)[phys_tid_66881 +\n                                                             r_66987 *\n                                                             num_threads_78201];\n                \n                int64_t abs_arg_66993 = sub64(x_66992, min_res_66920);\n                int64_t abs_res_66994 = abs64(abs_arg_66993);\n                bool x_66995 = sle64((int64_t) 0, max_res_66985);\n                bool y_66996 = slt64(max_res_66985, n_65344);\n                bool bounds_check_66997 = x_66995 && y_66996;\n                bool index_certs_66998;\n                \n                if (!bounds_check_66997) {\n                    {\n                     ",
                   "   if (atomic_cmpxchg_i32_global(global_failure, -1, 4) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) max_res_66985;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_66999;\n                \n                x_66999 = ((__global int64_t *) color_78132)[phys_tid_66881 +\n                                                             max_res_66985 *\n                                                             num_threads_78201];\n                \n                int64_t abs_arg_67000 = sub64(x_66999, min_res_66920);\n                int64_t abs_res_67001 = abs64(abs_arg_67000);\n                int64_t max_res_67002 = smax64(abs_res_66994, abs_res_67001);\n                float defunc_0_f_res_67003 = sitofp_i64_f32(max_res_67002);\n                float defunc_1_f_res_67004 = max_res_66912 +\n                      defunc_0_f_res_67003;\n                float defunc_2_reduce_res_67005;\n                float redout_76812 = 0.0F;\n                \n                for (int64_t i_76813 = 0; i_76813 < q_65346; i_76813++) {\n                    float x_67010;\n                    \n                    x_67010 = ((__global float *) color_78130)[phys_tid_66881 +\n                                                               i_76813 *\n                                                               num_threads_78201];\n                    \n                    bool cond_67011 = sle64(last_res_66891, i_76813);\n                    int64_t defunc_0_f_res_67012;\n                    \n                    if (cond_67011) {\n                        defunc_0_f_res_67012 = (int64_t) 0;\n                    } else {\n                        int64_t i_67013 = add64(max_res_66985, i_76813);\n                        int6",
                   "4_t defunc_0_add_arg_67014;\n                        \n                        defunc_0_add_arg_67014 = ((__global\n                                                   int64_t *) color_78132)[phys_tid_66881 +\n                                                                           i_67013 *\n                                                                           num_threads_78201];\n                        \n                        int64_t defunc_1_add_res_67015 = add64((int64_t) 1,\n                                                               defunc_0_add_arg_67014);\n                        \n                        defunc_0_f_res_67012 = defunc_1_add_res_67015;\n                    }\n                    \n                    int64_t binop_p_67016 = sub64(defunc_0_f_res_67012,\n                                                  min_res_66920);\n                    float defunc_0_f_res_67017 = sitofp_i64_f32(binop_p_67016);\n                    float abs_res_67018 = (float) fabs(defunc_0_f_res_67017);\n                    float tmp1_67019 = abs_res_67018 / defunc_1_f_res_67004;\n                    float x_67020 = tmp1_67019 * tmp1_67019;\n                    float y_67021 = tmp1_67019 * x_67020;\n                    float tmp2_67022 = 1.0F - y_67021;\n                    float x_67023 = tmp2_67022 * tmp2_67022;\n                    float tmp3_67024 = tmp2_67022 * x_67023;\n                    float w_j_67025 = x_67010 * tmp3_67024;\n                    float defunc_1_op_res_67008 = w_j_67025 + redout_76812;\n                    float redout_tmp_78316 = defunc_1_op_res_67008;\n                    \n                    redout_76812 = redout_tmp_78316;\n                }\n                defunc_2_reduce_res_67005 = redout_76812;\n                \n                float a0_67026 = 1.0F / defunc_2_reduce_res_67005;\n                float defunc_2_reduce_res_67027;\n                float redout_76814 = 0.0F;\n                \n                for (int64_t i_76815 = 0; i_76815 < q_65346; i_76815++)",
                   " {\n                    float x_67032;\n                    \n                    x_67032 = ((__global float *) color_78130)[phys_tid_66881 +\n                                                               i_76815 *\n                                                               num_threads_78201];\n                    \n                    bool cond_67033 = sle64(last_res_66891, i_76815);\n                    int64_t defunc_0_f_res_67034;\n                    \n                    if (cond_67033) {\n                        defunc_0_f_res_67034 = (int64_t) 0;\n                    } else {\n                        int64_t i_67035 = add64(max_res_66985, i_76815);\n                        int64_t defunc_0_add_arg_67036;\n                        \n                        defunc_0_add_arg_67036 = ((__global\n                                                   int64_t *) color_78132)[phys_tid_66881 +\n                                                                           i_67035 *\n                                                                           num_threads_78201];\n                        \n                        int64_t defunc_1_add_res_67037 = add64((int64_t) 1,\n                                                               defunc_0_add_arg_67036);\n                        \n                        defunc_0_f_res_67034 = defunc_1_add_res_67037;\n                    }\n                    \n                    int64_t binop_p_67038 = sub64(defunc_0_f_res_67034,\n                                                  min_res_66920);\n                    float defunc_0_f_res_67039 = sitofp_i64_f32(binop_p_67038);\n                    float abs_res_67040 = (float) fabs(defunc_0_f_res_67039);\n                    float tmp1_67041 = abs_res_67040 / defunc_1_f_res_67004;\n                    float x_67042 = tmp1_67041 * tmp1_67041;\n                    float y_67043 = tmp1_67041 * x_67042;\n                    float tmp2_67044 = 1.0F - y_67043;\n                    float x_67045 = tmp2_67044 * tmp2_6",
                   "7044;\n                    float tmp3_67046 = tmp2_67044 * x_67045;\n                    float tmp4_67047 = x_67032 * tmp3_67046;\n                    float defunc_0_f_res_67048;\n                    \n                    if (cond_67033) {\n                        defunc_0_f_res_67048 = 0.0F;\n                    } else {\n                        int64_t i_67049 = add64(max_res_66985, i_76815);\n                        float defunc_0_add_arg_67050;\n                        \n                        defunc_0_add_arg_67050 = ((__global\n                                                   float *) color_78133)[phys_tid_66881 +\n                                                                         i_67049 *\n                                                                         num_threads_78201];\n                        defunc_0_f_res_67048 = defunc_0_add_arg_67050;\n                    }\n                    \n                    float x_67051 = a0_67026 * tmp4_67047;\n                    float defunc_9_fit_fun_res_67052 = defunc_0_f_res_67048 *\n                          x_67051;\n                    float defunc_1_op_res_67030 = defunc_9_fit_fun_res_67052 +\n                          redout_76814;\n                    float redout_tmp_78317 = defunc_1_op_res_67030;\n                    \n                    redout_76814 = redout_tmp_78317;\n                }\n                defunc_2_reduce_res_67027 = redout_76814;\n                ((__global float *) color_78129)[phys_tid_66881 + i_76810 *\n                                                 num_threads_78201] =\n                    defunc_2_reduce_res_67027;\n            }\n            for (int64_t i_78318 = 0; i_78318 < n_m_65352; i_78318++) {\n                float tmp_78319;\n                \n                tmp_78319 = ((__global float *) color_78129)[phys_tid_66881 +\n                                                             i_78318 *\n                                                             num_threads_78201];\n                ((__glo",
                   "bal float *) mem_77077)[gtid_66880 + i_78318 * m_65343] =\n                    tmp_78319;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_66876\n}\n__kernel void mainzisegmap_67903(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *Y_mem_76976, __global\n                                 unsigned char *mem_77082, __global\n                                 unsigned char *mem_77086, __global\n                                 unsigned char *mem_77090)\n{\n    #define segmap_group_sizze_67897 (mainzisegmap_group_sizze_67738)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78397;\n    int32_t local_tid_78398;\n    int64_t group_sizze_78401;\n    int32_t wave_sizze_78400;\n    int32_t group_tid_78399;\n    \n    global_tid_78397 = get_global_id(0);\n    local_tid_78398 = get_local_id(0);\n    group_sizze_78401 = get_local_size(0);\n    wave_sizze_78400 = LOCKSTEP_WIDTH;\n    group_tid_78399 = get_group_id(0);\n    \n    int32_t phys_tid_67903 = global_tid_78397;\n    int64_t global_tid_78402 = sext_i32_i64(group_tid_78399) *\n            segmap_group_sizze_67897 + sext_i32_i64(local_tid_78398);\n    int64_t slice_78403 = n_65344;\n    int64_t slice_78404 = m_65343 * slice_78403;\n    int64_t gtid_67901 = squot64(global_tid_78402, slice_78403);\n    int64_t remnant_78405 = global_tid_78402 - gtid_67901 * slice_78403;\n    int64_t gtid_67902 = remnant_78405;\n    int64_t remnant_78406 = remnant_78405 - gtid_67902;\n    \n    if (slt64(gtid_67901, m_65343) && slt64(gtid_67902, n_65344)) {\n        float x_67904;\n        \n        x_67904 = ((__global float *) Y_mem_76976)[gtid_67901 * n_65344 +\n                                                   gtid_67902];\n        \n        bool isna",
                   "n_res_67907;\n        \n        isnan_res_67907 = futrts_isnan32(x_67904);\n        \n        bool defunc_0_p_res_67908 = !isnan_res_67907;\n        int64_t defunc_1_f_res_67909;\n        \n        if (defunc_0_p_res_67908) {\n            int64_t x_67905;\n            \n            x_67905 = ((__global int64_t *) mem_77082)[gtid_67901 * n_65344 +\n                                                       gtid_67902];\n            \n            int64_t defunc_1_f_res_t_res_67910 = sub64(x_67905, (int64_t) 1);\n            \n            defunc_1_f_res_67909 = defunc_1_f_res_t_res_67910;\n        } else {\n            defunc_1_f_res_67909 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_67901) && slt64(gtid_67901, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_67909) &&\n             slt64(defunc_1_f_res_67909, n_65344))) {\n            ((__global int64_t *) mem_77090)[gtid_67901 * n_65344 +\n                                             defunc_1_f_res_67909] = gtid_67902;\n        }\n        if ((sle64((int64_t) 0, gtid_67901) && slt64(gtid_67901, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_67909) &&\n             slt64(defunc_1_f_res_67909, n_65344))) {\n            ((__global float *) mem_77086)[gtid_67901 * n_65344 +\n                                           defunc_1_f_res_67909] = x_67904;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_67897\n}\n__kernel void mainzisegmap_67922(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *mem_77090, __global\n                                 unsigned char *mem_77096)\n{\n    #define segmap_group_sizze_67917 (mainzisegmap_group_sizze_67712)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78407;\n    int32_t local_tid_78408;\n    int64_t group_sizze_78411;\n    int32_",
                   "t wave_sizze_78410;\n    int32_t group_tid_78409;\n    \n    global_tid_78407 = get_global_id(0);\n    local_tid_78408 = get_local_id(0);\n    group_sizze_78411 = get_local_size(0);\n    wave_sizze_78410 = LOCKSTEP_WIDTH;\n    group_tid_78409 = get_group_id(0);\n    \n    int32_t phys_tid_67922 = global_tid_78407;\n    int64_t global_tid_78412 = sext_i32_i64(group_tid_78409) *\n            segmap_group_sizze_67917 + sext_i32_i64(local_tid_78408);\n    int64_t slice_78413 = n_65344;\n    int64_t slice_78414 = m_65343 * slice_78413;\n    int64_t gtid_67920 = squot64(global_tid_78412, slice_78413);\n    int64_t remnant_78415 = global_tid_78412 - gtid_67920 * slice_78413;\n    int64_t gtid_67921 = remnant_78415;\n    int64_t remnant_78416 = remnant_78415 - gtid_67921;\n    \n    if (slt64(gtid_67920, m_65343) && slt64(gtid_67921, n_65344)) {\n        int64_t x_67923;\n        \n        x_67923 = ((__global int64_t *) mem_77090)[gtid_67920 * n_65344 +\n                                                   gtid_67921];\n        \n        int64_t defunc_0_f_res_67924 = add64((int64_t) 1, x_67923);\n        \n        ((__global int64_t *) mem_77096)[gtid_67920 * n_65344 + gtid_67921] =\n            defunc_0_f_res_67924;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_67917\n}\n__kernel void mainzisegmap_67934(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, int64_t min_res_65364,\n                                 float i64_res_65370, __global\n                                 unsigned char *mem_77082, __global\n                                 unsigned char *mem_77100, __global\n                                 unsigned char *mem_77103, __global\n                                 unsigned char *mem_77106, __global\n                                 unsigned char *mem_77109)\n{\n    #define segmap_group_sizze_67927 (mainzisegmap_group_sizze_67686)\n    \n    const int block_dim0 = 0;\n    co",
                   "nst int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78417;\n    int32_t local_tid_78418;\n    int64_t group_sizze_78421;\n    int32_t wave_sizze_78420;\n    int32_t group_tid_78419;\n    \n    global_tid_78417 = get_global_id(0);\n    local_tid_78418 = get_local_id(0);\n    group_sizze_78421 = get_local_size(0);\n    wave_sizze_78420 = LOCKSTEP_WIDTH;\n    group_tid_78419 = get_group_id(0);\n    \n    int32_t phys_tid_67934 = global_tid_78417;\n    int64_t global_tid_78422 = sext_i32_i64(group_tid_78419) *\n            segmap_group_sizze_67927 + sext_i32_i64(local_tid_78418);\n    int64_t slice_78423 = m_65343;\n    int64_t gtid_67933 = global_tid_78422;\n    int64_t remnant_78424 = global_tid_78422 - gtid_67933;\n    \n    if (slt64(gtid_67933, m_65343)) {\n        int64_t last_res_67935;\n        \n        last_res_67935 = ((__global int64_t *) mem_77082)[gtid_67933 * n_65344 +\n                                                          i_65358];\n        \n        int64_t min_arg_67936 = sub64(last_res_67935, (int64_t) 1);\n        int64_t min_arg_67937 = sub64(last_res_67935, min_res_65364);\n        int64_t min_res_67938 = smin64(q_65346, last_res_67935);\n        float i64_res_67939 = sitofp_i64_f32(last_res_67935);\n        float x_67940 = i64_res_65370 - i64_res_67939;\n        float max_arg_67941 = x_67940 / 2.0F;\n        float max_res_67942 = fmax32(0.0F, max_arg_67941);\n        \n        ((__global int64_t *) mem_77100)[gtid_67933] = min_arg_67936;\n        ((__global int64_t *) mem_77103)[gtid_67933] = min_arg_67937;\n        ((__global int64_t *) mem_77106)[gtid_67933] = min_res_67938;\n        ((__global float *) mem_77109)[gtid_67933] = max_res_67942;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_67927\n}\n__kernel void mainzisegmap_67954(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t",
                   " i_65358, __global\n                                 unsigned char *mem_77082, __global\n                                 unsigned char *mem_77114)\n{\n    #define segmap_group_sizze_67949 (mainzisegmap_group_sizze_67661)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78425;\n    int32_t local_tid_78426;\n    int64_t group_sizze_78429;\n    int32_t wave_sizze_78428;\n    int32_t group_tid_78427;\n    \n    global_tid_78425 = get_global_id(0);\n    local_tid_78426 = get_local_id(0);\n    group_sizze_78429 = get_local_size(0);\n    wave_sizze_78428 = LOCKSTEP_WIDTH;\n    group_tid_78427 = get_group_id(0);\n    \n    int32_t phys_tid_67954 = global_tid_78425;\n    int64_t global_tid_78430 = sext_i32_i64(group_tid_78427) *\n            segmap_group_sizze_67949 + sext_i32_i64(local_tid_78426);\n    int64_t slice_78431 = q_65346;\n    int64_t slice_78432 = m_65343 * slice_78431;\n    int64_t gtid_67952 = squot64(global_tid_78430, slice_78431);\n    int64_t remnant_78433 = global_tid_78430 - gtid_67952 * slice_78431;\n    int64_t gtid_67953 = remnant_78433;\n    int64_t remnant_78434 = remnant_78433 - gtid_67953;\n    \n    if (slt64(gtid_67952, m_65343) && slt64(gtid_67953, q_65346)) {\n        int64_t last_res_67955;\n        \n        last_res_67955 = ((__global int64_t *) mem_77082)[gtid_67952 * n_65344 +\n                                                          i_65358];\n        \n        bool cond_67957 = sle64(last_res_67955, gtid_67953);\n        float defunc_0_f_res_67958;\n        \n        if (cond_67957) {\n            defunc_0_f_res_67958 = 0.0F;\n        } else {\n            defunc_0_f_res_67958 = 1.0F;\n        }\n        ((__global float *) mem_77114)[gtid_67952 * q_65346 + gtid_67953] =\n            defunc_0_f_res_67958;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_67949\n}\n__kernel void mainzisegmap_68125(__global int *global_failure,\n               ",
                   "                  int failure_is_an_option, __global\n                                 int64_t *global_failure_args, int64_t m_65343,\n                                 int64_t n_65344, int64_t jump_65348,\n                                 int64_t n_m_65352, int64_t i_65358,\n                                 unsigned char x_65359_bits,\n                                 int64_t min_res_65364,\n                                 unsigned char loop_cond_65369_bits, __global\n                                 unsigned char *mem_77090, __global\n                                 unsigned char *mem_77096, __global\n                                 unsigned char *mem_77100, __global\n                                 unsigned char *mem_77103, __global\n                                 unsigned char *mem_77106, __global\n                                 unsigned char *mem_77109, __global\n                                 unsigned char *mem_77166, __global\n                                 unsigned char *mem_77170, __global\n                                 unsigned char *mem_77174)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    \n    #define segmap_group_sizze_68118 (mainzisegmap_group_sizze_67347)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78469;\n    int32_t local_tid_78470;\n    int64_t group_sizze_78473;\n    int32_t wave_sizze_78472;\n    int32_t group_tid_78471;\n    \n    global_tid_78469 = get_global_id(0);\n    local_tid_78470 = get_local_id(0);\n    group_sizze_78473 = get_local_size(0);\n    wave_sizze_78472 = LOCKSTEP_WIDTH;\n    group_tid_78471 = get_group_id(0);\n    \n    int32_t phys_tid_68125 = global_tid_78469;\n    int64_t global_tid_78474 = sext_i32_i64(group_tid_78471) *\n            segmap_group_sizze_68118 + sext_i32_i64(local_tid_78470);\n    int64_t slice_78475 = n_m_65352;\n    int64_t slice_78476 = m_65343 * slice_7",
                   "8475;\n    int64_t gtid_68123 = squot64(global_tid_78474, slice_78475);\n    int64_t remnant_78477 = global_tid_78474 - gtid_68123 * slice_78475;\n    int64_t gtid_68124 = remnant_78477;\n    int64_t remnant_78478 = remnant_78477 - gtid_68124;\n    \n    if (slt64(gtid_68123, m_65343) && slt64(gtid_68124, n_m_65352)) {\n        int64_t min_arg_68128;\n        \n        min_arg_68128 = ((__global int64_t *) mem_77100)[gtid_68123];\n        \n        int64_t min_arg_68129;\n        \n        min_arg_68129 = ((__global int64_t *) mem_77103)[gtid_68123];\n        \n        int64_t min_res_68130;\n        \n        min_res_68130 = ((__global int64_t *) mem_77106)[gtid_68123];\n        \n        float max_res_68131;\n        \n        max_res_68131 = ((__global float *) mem_77109)[gtid_68123];\n        \n        int64_t min_arg_68133 = mul64(jump_65348, gtid_68124);\n        int64_t min_res_68134 = smin64(i_65358, min_arg_68133);\n        int64_t defunc_0_g_res_68135 = add64((int64_t) 1, min_res_68134);\n        bool init_idx_68136;\n        int64_t init_idx_68137;\n        int64_t init_idx_68138;\n        bool loop_while_68139;\n        int64_t low_68140;\n        int64_t high_68141;\n        \n        loop_while_68139 = x_65359;\n        low_68140 = (int64_t) 0;\n        high_68141 = i_65358;\n        while (loop_while_68139) {\n            int64_t x_68142 = add64(low_68140, high_68141);\n            int64_t mid_68143 = sdiv64(x_68142, (int64_t) 2);\n            bool x_68144 = sle64((int64_t) 0, mid_68143);\n            bool y_68145 = slt64(mid_68143, n_65344);\n            bool bounds_check_68146 = x_68144 && y_68145;\n            bool index_certs_68147;\n            \n            if (!bounds_check_68146) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 10) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_68143;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }",
                   "\n                    return;\n                }\n            }\n            \n            int64_t mid_id_68148;\n            \n            mid_id_68148 = ((__global int64_t *) mem_77096)[gtid_68123 *\n                                                            n_65344 +\n                                                            mid_68143];\n            \n            bool cond_68149 = slt64(mid_id_68148, (int64_t) 0);\n            int64_t mid_idx_68150;\n            \n            if (cond_68149) {\n                mid_idx_68150 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_68150 = mid_id_68148;\n            }\n            \n            bool cond_68151 = sle64(defunc_0_g_res_68135, mid_idx_68150);\n            int64_t loopres_68152;\n            int64_t loopres_68153;\n            \n            if (cond_68151) {\n                int64_t loopres_t_res_68154 = sub64(mid_68143, (int64_t) 1);\n                \n                loopres_68152 = low_68140;\n                loopres_68153 = loopres_t_res_68154;\n            } else {\n                int64_t loopres_f_res_68155 = add64((int64_t) 1, mid_68143);\n                \n                loopres_68152 = loopres_f_res_68155;\n                loopres_68153 = high_68141;\n            }\n            \n            bool loop_cond_68156 = sle64(loopres_68152, loopres_68153);\n            bool loop_while_tmp_78479 = loop_cond_68156;\n            int64_t low_tmp_78480 = loopres_68152;\n            int64_t high_tmp_78481 = loopres_68153;\n            \n            loop_while_68139 = loop_while_tmp_78479;\n            low_68140 = low_tmp_78480;\n            high_68141 = high_tmp_78481;\n        }\n        init_idx_68136 = loop_while_68139;\n        init_idx_68137 = low_68140;\n        init_idx_68138 = high_68141;\n        \n        bool idx_68157;\n        int64_t idx_68158;\n        int64_t idx_68159;\n        int64_t idx_68160;\n        bool loop_while_68161;\n        int64_t l_idx_68162;\n        int64_t r_idx_68163;\n        int64_t span_68164;\n ",
                   "       \n        loop_while_68161 = loop_cond_65369;\n        l_idx_68162 = init_idx_68137;\n        r_idx_68163 = init_idx_68137;\n        span_68164 = (int64_t) 1;\n        while (loop_while_68161) {\n            int64_t max_arg_68165 = sub64(l_idx_68162, (int64_t) 1);\n            int64_t max_res_68166 = smax64((int64_t) 0, max_arg_68165);\n            int64_t min_arg_68167 = add64((int64_t) 1, r_idx_68163);\n            int64_t min_res_68168 = smin64(min_arg_68128, min_arg_68167);\n            bool x_68169 = sle64((int64_t) 0, max_res_68166);\n            bool y_68170 = slt64(max_res_68166, n_65344);\n            bool bounds_check_68171 = x_68169 && y_68170;\n            bool index_certs_68172;\n            \n            if (!bounds_check_68171) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 11) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_68166;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_68173;\n            \n            x_68173 = ((__global int64_t *) mem_77096)[gtid_68123 * n_65344 +\n                                                       max_res_68166];\n            \n            int64_t abs_arg_68174 = sub64(x_68173, defunc_0_g_res_68135);\n            int64_t abs_res_68175 = abs64(abs_arg_68174);\n            bool x_68176 = sle64((int64_t) 0, min_res_68168);\n            bool y_68177 = slt64(min_res_68168, n_65344);\n            bool bounds_check_68178 = x_68176 && y_68177;\n            bool index_certs_68179;\n            \n            if (!bounds_check_68178) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 12) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_68168;\n                        global_failure_args[1] = (int64_t) n_653",
                   "44;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_68180;\n            \n            x_68180 = ((__global int64_t *) mem_77096)[gtid_68123 * n_65344 +\n                                                       min_res_68168];\n            \n            int64_t abs_arg_68181 = sub64(x_68180, defunc_0_g_res_68135);\n            int64_t abs_res_68182 = abs64(abs_arg_68181);\n            bool cond_68183 = max_res_68166 == l_idx_68162;\n            int64_t loopres_68184;\n            int64_t loopres_68185;\n            int64_t loopres_68186;\n            \n            if (cond_68183) {\n                loopres_68184 = l_idx_68162;\n                loopres_68185 = r_idx_68163;\n                loopres_68186 = min_res_65364;\n            } else {\n                bool cond_68187 = slt64(abs_res_68175, abs_res_68182);\n                bool cond_f_res_68188 = min_res_68168 == r_idx_68163;\n                bool x_68189 = !cond_68187;\n                bool y_68190 = cond_f_res_68188 && x_68189;\n                bool cond_68191 = cond_68187 || y_68190;\n                int64_t loopres_f_res_68192;\n                \n                if (cond_68191) {\n                    loopres_f_res_68192 = max_res_68166;\n                } else {\n                    loopres_f_res_68192 = l_idx_68162;\n                }\n                \n                int64_t loopres_f_res_68193;\n                \n                if (cond_68191) {\n                    loopres_f_res_68193 = r_idx_68163;\n                } else {\n                    loopres_f_res_68193 = min_res_68168;\n                }\n                \n                int64_t loopres_f_res_68194;\n                \n                if (cond_68191) {\n                    int64_t loopres_f_res_t_res_68195 = add64((int64_t) 1,\n                                                              span_68164);\n                    \n                    loopres_f_res_68194 = loopres_f_res_t_res_68195;",
                   "\n                } else {\n                    int64_t loopres_f_res_f_res_68196 = add64((int64_t) 1,\n                                                              span_68164);\n                    \n                    loopres_f_res_68194 = loopres_f_res_f_res_68196;\n                }\n                loopres_68184 = loopres_f_res_68192;\n                loopres_68185 = loopres_f_res_68193;\n                loopres_68186 = loopres_f_res_68194;\n            }\n            \n            bool loop_cond_68197 = slt64(loopres_68186, min_res_65364);\n            bool loop_while_tmp_78482 = loop_cond_68197;\n            int64_t l_idx_tmp_78483 = loopres_68184;\n            int64_t r_idx_tmp_78484 = loopres_68185;\n            int64_t span_tmp_78485 = loopres_68186;\n            \n            loop_while_68161 = loop_while_tmp_78482;\n            l_idx_68162 = l_idx_tmp_78483;\n            r_idx_68163 = r_idx_tmp_78484;\n            span_68164 = span_tmp_78485;\n        }\n        idx_68157 = loop_while_68161;\n        idx_68158 = l_idx_68162;\n        idx_68159 = r_idx_68163;\n        idx_68160 = span_68164;\n        \n        int64_t min_res_68198 = smin64(min_arg_68129, idx_68158);\n        int64_t max_res_68199 = smax64((int64_t) 0, min_res_68198);\n        int64_t x_68200 = add64(min_res_68130, max_res_68199);\n        int64_t r_68201 = sub64(x_68200, (int64_t) 1);\n        bool x_68202 = sle64((int64_t) 0, r_68201);\n        bool y_68203 = slt64(r_68201, n_65344);\n        bool bounds_check_68204 = x_68202 && y_68203;\n        bool index_certs_68205;\n        \n        if (!bounds_check_68204) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 13) == -1) {\n                    global_failure_args[0] = (int64_t) r_68201;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_68206;\n        \n        x_68206 = ((__global int64_t *) mem_77090)[gtid_68123",
                   " * n_65344 +\n                                                   r_68201];\n        \n        int64_t abs_arg_68207 = sub64(x_68206, min_res_68134);\n        int64_t abs_res_68208 = abs64(abs_arg_68207);\n        bool x_68209 = sle64((int64_t) 0, max_res_68199);\n        bool y_68210 = slt64(max_res_68199, n_65344);\n        bool bounds_check_68211 = x_68209 && y_68210;\n        bool index_certs_68212;\n        \n        if (!bounds_check_68211) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 14) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_68199;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_68213;\n        \n        x_68213 = ((__global int64_t *) mem_77090)[gtid_68123 * n_65344 +\n                                                   max_res_68199];\n        \n        int64_t abs_arg_68214 = sub64(x_68213, min_res_68134);\n        int64_t abs_res_68215 = abs64(abs_arg_68214);\n        int64_t max_res_68216 = smax64(abs_res_68208, abs_res_68215);\n        float defunc_0_f_res_68217 = sitofp_i64_f32(max_res_68216);\n        float defunc_1_f_res_68218 = max_res_68131 + defunc_0_f_res_68217;\n        \n        ((__global int64_t *) mem_77166)[gtid_68123 * n_m_65352 + gtid_68124] =\n            min_res_68134;\n        ((__global int64_t *) mem_77170)[gtid_68123 * n_m_65352 + gtid_68124] =\n            max_res_68199;\n        ((__global float *) mem_77174)[gtid_68123 * n_m_65352 + gtid_68124] =\n            defunc_1_f_res_68218;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_68118\n}\n__kernel void mainzisegmap_68266(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_m_65352, __global\n                                 unsigned char *mem_77179, __global\n                                 unsigned char *mem_77184)\n{\n    #define segmap_group_sizze_68261 (mainz",
                   "isegmap_group_sizze_67289)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78558;\n    int32_t local_tid_78559;\n    int64_t group_sizze_78562;\n    int32_t wave_sizze_78561;\n    int32_t group_tid_78560;\n    \n    global_tid_78558 = get_global_id(0);\n    local_tid_78559 = get_local_id(0);\n    group_sizze_78562 = get_local_size(0);\n    wave_sizze_78561 = LOCKSTEP_WIDTH;\n    group_tid_78560 = get_group_id(0);\n    \n    int32_t phys_tid_68266 = global_tid_78558;\n    int64_t global_tid_78563 = sext_i32_i64(group_tid_78560) *\n            segmap_group_sizze_68261 + sext_i32_i64(local_tid_78559);\n    int64_t slice_78564 = n_m_65352;\n    int64_t slice_78565 = m_65343 * slice_78564;\n    int64_t gtid_68264 = squot64(global_tid_78563, slice_78564);\n    int64_t remnant_78566 = global_tid_78563 - gtid_68264 * slice_78564;\n    int64_t gtid_68265 = remnant_78566;\n    int64_t remnant_78567 = remnant_78566 - gtid_68265;\n    \n    if (slt64(gtid_68264, m_65343) && slt64(gtid_68265, n_m_65352)) {\n        float defunc_2_reduce_res_68267;\n        \n        defunc_2_reduce_res_68267 = ((__global float *) mem_77179)[gtid_68264 *\n                                                                   n_m_65352 +\n                                                                   gtid_68265];\n        \n        float a0_68268 = 1.0F / defunc_2_reduce_res_68267;\n        \n        ((__global float *) mem_77184)[gtid_68264 * n_m_65352 + gtid_68265] =\n            a0_68268;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_68261\n}\n__kernel void mainzisegmap_68538(__global int *global_failure,\n                                 int failure_is_an_option, __global\n                                 int64_t *global_failure_args, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t jump_65348, int64_t n_m_65352,",
                   "\n                                 int64_t i_65358, unsigned char x_65359_bits,\n                                 int64_t min_res_65364,\n                                 unsigned char loop_cond_65369_bits,\n                                 float i64_res_65370, int64_t num_groups_68533,\n                                 int64_t num_threads_78217, __global\n                                 unsigned char *mem_77199, __global\n                                 unsigned char *mem_77308, __global\n                                 unsigned char *mem_77311, __global\n                                 unsigned char *color_78142, __global\n                                 unsigned char *color_78143, __global\n                                 unsigned char *color_78144, __global\n                                 unsigned char *color_78145, __global\n                                 unsigned char *color_78146, __global\n                                 unsigned char *color_78147)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    \n    #define segmap_group_sizze_68532 (mainzisegmap_group_sizze_68324)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile __local bool local_failure;\n    \n    if (failure_is_an_option) {\n        int failed = *global_failure >= 0;\n        \n        if (failed)\n            return;\n    }\n    local_failure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_78646;\n    int32_t local_tid_78647;\n    int64_t group_sizze_78650;\n    int32_t wave_sizze_78649;\n    int32_t group_tid_78648;\n    \n    global_tid_78646 = get_global_id(0);\n    local_tid_78647 = get_local_id(0);\n    group_sizze_78650 = get_local_size(0);\n    wave_sizze_78649 = LOCKSTEP_WIDTH;\n    group_tid_78648 = get_group_id(0);\n    \n    int32_t phys_tid_68538 = global_tid_78646;\n    int32_t phys_group_id_78651;\n    \n    phys_group_id_78651 = get_group_id(0);\n    for (int32_t i_78652 = 0; i_78652 <\n        ",
                   " sdiv_up32(sext_i64_i32(sdiv_up64(m_65343, segmap_group_sizze_68532)) -\n                   phys_group_id_78651, sext_i64_i32(num_groups_68533));\n         i_78652++) {\n        int32_t virt_group_id_78653 = phys_group_id_78651 + i_78652 *\n                sext_i64_i32(num_groups_68533);\n        int64_t global_tid_78654 = sext_i32_i64(virt_group_id_78653) *\n                segmap_group_sizze_68532 + sext_i32_i64(local_tid_78647);\n        int64_t slice_78655 = m_65343;\n        int64_t gtid_68537 = global_tid_78654;\n        int64_t remnant_78656 = global_tid_78654 - gtid_68537;\n        \n        if (slt64(gtid_68537, m_65343)) {\n            int64_t discard_76827;\n            int64_t scanacc_76823 = (int64_t) 0;\n            \n            for (int64_t i_76825 = 0; i_76825 < n_65344; i_76825++) {\n                float x_68544;\n                \n                x_68544 = ((__global float *) mem_77199)[i_76825 * m_65343 +\n                                                         gtid_68537];\n                \n                bool isnan_res_68545;\n                \n                isnan_res_68545 = futrts_isnan32(x_68544);\n                \n                bool defunc_0_p_res_68546 = !isnan_res_68545;\n                int64_t defunc_0_f_res_68547 =\n                        btoi_bool_i64(defunc_0_p_res_68546);\n                int64_t defunc_1_op_res_68543 = add64(defunc_0_f_res_68547,\n                                                      scanacc_76823);\n                \n                ((__global int64_t *) color_78145)[phys_tid_68538 + i_76825 *\n                                                   num_threads_78217] =\n                    defunc_1_op_res_68543;\n                \n                int64_t scanacc_tmp_78657 = defunc_1_op_res_68543;\n                \n                scanacc_76823 = scanacc_tmp_78657;\n            }\n            discard_76827 = scanacc_76823;\n            \n            int64_t last_res_68548;\n            \n            last_res_68548 = ((__global int64_t *) color_78145)",
                   "[phys_tid_68538 +\n                                                                i_65358 *\n                                                                num_threads_78217];\n            for (int64_t i_78659 = 0; i_78659 < n_65344; i_78659++) {\n                ((__global float *) color_78147)[phys_tid_68538 + i_78659 *\n                                                 num_threads_78217] = 0.0F;\n            }\n            for (int64_t i_78660 = 0; i_78660 < n_65344; i_78660++) {\n                ((__global int64_t *) color_78146)[phys_tid_68538 + i_78660 *\n                                                   num_threads_78217] =\n                    (int64_t) -1;\n            }\n            for (int64_t write_iter_76828 = 0; write_iter_76828 < n_65344;\n                 write_iter_76828++) {\n                float write_iv_76831;\n                \n                write_iv_76831 = ((__global\n                                   float *) mem_77199)[write_iter_76828 *\n                                                       m_65343 + gtid_68537];\n                \n                bool isnan_res_68556;\n                \n                isnan_res_68556 = futrts_isnan32(write_iv_76831);\n                \n                bool defunc_0_p_res_68557 = !isnan_res_68556;\n                int64_t defunc_1_f_res_68558;\n                \n                if (defunc_0_p_res_68557) {\n                    int64_t write_iv_76832;\n                    \n                    write_iv_76832 = ((__global\n                                       int64_t *) color_78145)[phys_tid_68538 +\n                                                               write_iter_76828 *\n                                                               num_threads_78217];\n                    \n                    int64_t defunc_1_f_res_t_res_68559 = sub64(write_iv_76832,\n                                                               (int64_t) 1);\n                    \n                    defunc_1_f_res_68558 = defunc_1_f_res_t_res_68559;\n    ",
                   "            } else {\n                    defunc_1_f_res_68558 = (int64_t) -1;\n                }\n                if (sle64((int64_t) 0, defunc_1_f_res_68558) &&\n                    slt64(defunc_1_f_res_68558, n_65344)) {\n                    ((__global int64_t *) color_78146)[phys_tid_68538 +\n                                                       defunc_1_f_res_68558 *\n                                                       num_threads_78217] =\n                        write_iter_76828;\n                }\n                if (sle64((int64_t) 0, defunc_1_f_res_68558) &&\n                    slt64(defunc_1_f_res_68558, n_65344)) {\n                    for (int64_t i_78663 = 0; i_78663 < (int64_t) 1;\n                         i_78663++) {\n                        float tmp_78664;\n                        \n                        tmp_78664 = ((__global float *) mem_77199)[m_65343 *\n                                                                   write_iter_76828 +\n                                                                   gtid_68537 +\n                                                                   i_78663 *\n                                                                   m_65343];\n                        ((__global float *) color_78147)[phys_tid_68538 +\n                                                         num_threads_78217 *\n                                                         defunc_1_f_res_68558 +\n                                                         i_78663 *\n                                                         num_threads_78217] =\n                            tmp_78664;\n                    }\n                }\n            }\n            for (int64_t i_76838 = 0; i_76838 < n_65344; i_76838++) {\n                int64_t x_68561;\n                \n                x_68561 = ((__global int64_t *) color_78146)[phys_tid_68538 +\n                                                             i_76838 *\n                                                             n",
                   "um_threads_78217];\n                \n                int64_t defunc_0_f_res_68562 = add64((int64_t) 1, x_68561);\n                \n                ((__global int64_t *) color_78145)[phys_tid_68538 + i_76838 *\n                                                   num_threads_78217] =\n                    defunc_0_f_res_68562;\n            }\n            \n            int64_t min_arg_68563 = sub64(last_res_68548, (int64_t) 1);\n            int64_t min_arg_68564 = sub64(last_res_68548, min_res_65364);\n            int64_t min_res_68565 = smin64(q_65346, last_res_68548);\n            float i64_res_68566 = sitofp_i64_f32(last_res_68548);\n            float x_68567 = i64_res_65370 - i64_res_68566;\n            float max_arg_68568 = x_68567 / 2.0F;\n            float max_res_68569 = fmax32(0.0F, max_arg_68568);\n            \n            for (int64_t i_76842 = 0; i_76842 < q_65346; i_76842++) {\n                bool cond_68572 = sle64(last_res_68548, i_76842);\n                float defunc_0_f_res_68573;\n                \n                if (cond_68572) {\n                    defunc_0_f_res_68573 = 0.0F;\n                } else {\n                    defunc_0_f_res_68573 = 1.0F;\n                }\n                ((__global float *) color_78144)[phys_tid_68538 + i_76842 *\n                                                 num_threads_78217] =\n                    defunc_0_f_res_68573;\n            }\n            for (int64_t i_76848 = 0; i_76848 < n_m_65352; i_76848++) {\n                int64_t min_arg_68577 = mul64(jump_65348, i_76848);\n                int64_t min_res_68578 = smin64(i_65358, min_arg_68577);\n                int64_t defunc_0_g_res_68579 = add64((int64_t) 1,\n                                                     min_res_68578);\n                bool init_idx_68580;\n                int64_t init_idx_68581;\n                int64_t init_idx_68582;\n                bool loop_while_68583;\n                int64_t low_68584;\n                int64_t high_68585;\n                \n                loop_",
                   "while_68583 = x_65359;\n                low_68584 = (int64_t) 0;\n                high_68585 = i_65358;\n                while (loop_while_68583) {\n                    int64_t x_68586 = add64(low_68584, high_68585);\n                    int64_t mid_68587 = sdiv64(x_68586, (int64_t) 2);\n                    bool x_68588 = sle64((int64_t) 0, mid_68587);\n                    bool y_68589 = slt64(mid_68587, n_65344);\n                    bool bounds_check_68590 = x_68588 && y_68589;\n                    bool index_certs_68591;\n                    \n                    if (!bounds_check_68590) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          15) == -1) {\n                                global_failure_args[0] = (int64_t) mid_68587;\n                                global_failure_args[1] = (int64_t) n_65344;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t mid_id_68592;\n                    \n                    mid_id_68592 = ((__global\n                                     int64_t *) color_78145)[phys_tid_68538 +\n                                                             mid_68587 *\n                                                             num_threads_78217];\n                    \n                    bool cond_68593 = slt64(mid_id_68592, (int64_t) 0);\n                    int64_t mid_idx_68594;\n                    \n                    if (cond_68593) {\n                        mid_idx_68594 = (int64_t) 9223372036854775807;\n                    } else {\n                        mid_idx_68594 = mid_id_68592;\n                    }\n                    \n                    bool cond_68595 = sle64(defunc_0_g_res_68579,\n                                            mid_idx_68594)",
                   ";\n                    int64_t loopres_68596;\n                    int64_t loopres_68597;\n                    \n                    if (cond_68595) {\n                        int64_t loopres_t_res_68598 = sub64(mid_68587,\n                                                            (int64_t) 1);\n                        \n                        loopres_68596 = low_68584;\n                        loopres_68597 = loopres_t_res_68598;\n                    } else {\n                        int64_t loopres_f_res_68599 = add64((int64_t) 1,\n                                                            mid_68587);\n                        \n                        loopres_68596 = loopres_f_res_68599;\n                        loopres_68597 = high_68585;\n                    }\n                    \n                    bool loop_cond_68600 = sle64(loopres_68596, loopres_68597);\n                    bool loop_while_tmp_78669 = loop_cond_68600;\n                    int64_t low_tmp_78670 = loopres_68596;\n                    int64_t high_tmp_78671 = loopres_68597;\n                    \n                    loop_while_68583 = loop_while_tmp_78669;\n                    low_68584 = low_tmp_78670;\n                    high_68585 = high_tmp_78671;\n                }\n                init_idx_68580 = loop_while_68583;\n                init_idx_68581 = low_68584;\n                init_idx_68582 = high_68585;\n                \n                bool idx_68601;\n                int64_t idx_68602;\n                int64_t idx_68603;\n                int64_t idx_68604;\n                bool loop_while_68605;\n                int64_t l_idx_68606;\n                int64_t r_idx_68607;\n                int64_t span_68608;\n                \n                loop_while_68605 = loop_cond_65369;\n                l_idx_68606 = init_idx_68581;\n                r_idx_68607 = init_idx_68581;\n                span_68608 = (int64_t) 1;\n                while (loop_while_68605) {\n                    int64_t max_arg_68609 = sub64(l_idx_68606, (int",
                   "64_t) 1);\n                    int64_t max_res_68610 = smax64((int64_t) 0, max_arg_68609);\n                    int64_t min_arg_68611 = add64((int64_t) 1, r_idx_68607);\n                    int64_t min_res_68612 = smin64(min_arg_68563,\n                                                   min_arg_68611);\n                    bool x_68613 = sle64((int64_t) 0, max_res_68610);\n                    bool y_68614 = slt64(max_res_68610, n_65344);\n                    bool bounds_check_68615 = x_68613 && y_68614;\n                    bool index_certs_68616;\n                    \n                    if (!bounds_check_68615) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          16) == -1) {\n                                global_failure_args[0] =\n                                    (int64_t) max_res_68610;\n                                global_failure_args[1] = (int64_t) n_65344;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t x_68617;\n                    \n                    x_68617 = ((__global\n                                int64_t *) color_78145)[phys_tid_68538 +\n                                                        max_res_68610 *\n                                                        num_threads_78217];\n                    \n                    int64_t abs_arg_68618 = sub64(x_68617,\n                                                  defunc_0_g_res_68579);\n                    int64_t abs_res_68619 = abs64(abs_arg_68618);\n                    bool x_68620 = sle64((int64_t) 0, min_res_68612);\n                    bool y_68621 = slt64(min_res_68612, n_65344);\n                    bool bounds_check_68622 = x_68620 && y_68621;\n                    bool index_certs_68623;\n       ",
                   "             \n                    if (!bounds_check_68622) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          17) == -1) {\n                                global_failure_args[0] =\n                                    (int64_t) min_res_68612;\n                                global_failure_args[1] = (int64_t) n_65344;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t x_68624;\n                    \n                    x_68624 = ((__global\n                                int64_t *) color_78145)[phys_tid_68538 +\n                                                        min_res_68612 *\n                                                        num_threads_78217];\n                    \n                    int64_t abs_arg_68625 = sub64(x_68624,\n                                                  defunc_0_g_res_68579);\n                    int64_t abs_res_68626 = abs64(abs_arg_68625);\n                    bool cond_68627 = max_res_68610 == l_idx_68606;\n                    int64_t loopres_68628;\n                    int64_t loopres_68629;\n                    int64_t loopres_68630;\n                    \n                    if (cond_68627) {\n                        loopres_68628 = l_idx_68606;\n                        loopres_68629 = r_idx_68607;\n                        loopres_68630 = min_res_65364;\n                    } else {\n                        bool cond_68631 = slt64(abs_res_68619, abs_res_68626);\n                        bool cond_f_res_68632 = min_res_68612 == r_idx_68607;\n                        bool x_68633 = !cond_68631;\n                        bool y_68634 = cond_f_res_68632 && x_68633;\n                        bool cond_68635 = cond_68631 || y_68634;\n                  ",
                   "      int64_t loopres_f_res_68636;\n                        \n                        if (cond_68635) {\n                            loopres_f_res_68636 = max_res_68610;\n                        } else {\n                            loopres_f_res_68636 = l_idx_68606;\n                        }\n                        \n                        int64_t loopres_f_res_68637;\n                        \n                        if (cond_68635) {\n                            loopres_f_res_68637 = r_idx_68607;\n                        } else {\n                            loopres_f_res_68637 = min_res_68612;\n                        }\n                        \n                        int64_t loopres_f_res_68638;\n                        \n                        if (cond_68635) {\n                            int64_t loopres_f_res_t_res_68639 =\n                                    add64((int64_t) 1, span_68608);\n                            \n                            loopres_f_res_68638 = loopres_f_res_t_res_68639;\n                        } else {\n                            int64_t loopres_f_res_f_res_68640 =\n                                    add64((int64_t) 1, span_68608);\n                            \n                            loopres_f_res_68638 = loopres_f_res_f_res_68640;\n                        }\n                        loopres_68628 = loopres_f_res_68636;\n                        loopres_68629 = loopres_f_res_68637;\n                        loopres_68630 = loopres_f_res_68638;\n                    }\n                    \n                    bool loop_cond_68641 = slt64(loopres_68630, min_res_65364);\n                    bool loop_while_tmp_78672 = loop_cond_68641;\n                    int64_t l_idx_tmp_78673 = loopres_68628;\n                    int64_t r_idx_tmp_78674 = loopres_68629;\n                    int64_t span_tmp_78675 = loopres_68630;\n                    \n                    loop_while_68605 = loop_while_tmp_78672;\n                    l_idx_68606 = l_idx_tmp_78673;\n             ",
                   "       r_idx_68607 = r_idx_tmp_78674;\n                    span_68608 = span_tmp_78675;\n                }\n                idx_68601 = loop_while_68605;\n                idx_68602 = l_idx_68606;\n                idx_68603 = r_idx_68607;\n                idx_68604 = span_68608;\n                \n                int64_t min_res_68642 = smin64(min_arg_68564, idx_68602);\n                int64_t max_res_68643 = smax64((int64_t) 0, min_res_68642);\n                int64_t x_68644 = add64(min_res_68565, max_res_68643);\n                int64_t r_68645 = sub64(x_68644, (int64_t) 1);\n                bool x_68646 = sle64((int64_t) 0, r_68645);\n                bool y_68647 = slt64(r_68645, n_65344);\n                bool bounds_check_68648 = x_68646 && y_68647;\n                bool index_certs_68649;\n                \n                if (!bounds_check_68648) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 18) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) r_68645;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_68650;\n                \n                x_68650 = ((__global int64_t *) color_78146)[phys_tid_68538 +\n                                                             r_68645 *\n                                                             num_threads_78217];\n                \n                int64_t abs_arg_68651 = sub64(x_68650, min_res_68578);\n                int64_t abs_res_68652 = abs64(abs_arg_68651);\n                bool x_68653 = sle64((int64_t) 0, max_res_68643);\n                bool y_68654 = slt64(max_res_68643, n_65344);\n                bool bounds_check_68655 = x_68653 && y_68654;\n                bool index_certs_68656;\n          ",
                   "      \n                if (!bounds_check_68655) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 19) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) max_res_68643;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_68657;\n                \n                x_68657 = ((__global int64_t *) color_78146)[phys_tid_68538 +\n                                                             max_res_68643 *\n                                                             num_threads_78217];\n                \n                int64_t abs_arg_68658 = sub64(x_68657, min_res_68578);\n                int64_t abs_res_68659 = abs64(abs_arg_68658);\n                int64_t max_res_68660 = smax64(abs_res_68652, abs_res_68659);\n                float defunc_0_f_res_68661 = sitofp_i64_f32(max_res_68660);\n                float defunc_1_f_res_68662 = max_res_68569 +\n                      defunc_0_f_res_68661;\n                float defunc_2_reduce_res_68663;\n                float defunc_2_reduce_res_68664;\n                float defunc_2_reduce_res_68665;\n                float redout_76851;\n                float redout_76852;\n                float redout_76853;\n                \n                redout_76851 = 0.0F;\n                redout_76852 = 0.0F;\n                redout_76853 = 0.0F;\n                for (int64_t i_76854 = 0; i_76854 < q_65346; i_76854++) {\n                    float x_68676;\n                    \n                    x_68676 = ((__global float *) color_78144)[phys_tid_68538 +\n                                                               i_76854 *\n                                                               num_threads_78217];\n                    \n ",
                   "                   bool cond_68677 = sle64(last_res_68548, i_76854);\n                    int64_t defunc_0_f_res_68678;\n                    \n                    if (cond_68677) {\n                        defunc_0_f_res_68678 = (int64_t) 0;\n                    } else {\n                        int64_t i_68679 = add64(max_res_68643, i_76854);\n                        int64_t defunc_0_add_arg_68680;\n                        \n                        defunc_0_add_arg_68680 = ((__global\n                                                   int64_t *) color_78146)[phys_tid_68538 +\n                                                                           i_68679 *\n                                                                           num_threads_78217];\n                        \n                        int64_t defunc_1_add_res_68681 = add64((int64_t) 1,\n                                                               defunc_0_add_arg_68680);\n                        \n                        defunc_0_f_res_68678 = defunc_1_add_res_68681;\n                    }\n                    \n                    int64_t binop_p_68682 = sub64(defunc_0_f_res_68678,\n                                                  min_res_68578);\n                    float defunc_0_f_res_68683 = sitofp_i64_f32(binop_p_68682);\n                    float abs_res_68684 = (float) fabs(defunc_0_f_res_68683);\n                    float tmp1_68685 = abs_res_68684 / defunc_1_f_res_68662;\n                    float x_68686 = tmp1_68685 * tmp1_68685;\n                    float y_68687 = tmp1_68685 * x_68686;\n                    float tmp2_68688 = 1.0F - y_68687;\n                    float x_68689 = tmp2_68688 * tmp2_68688;\n                    float tmp3_68690 = tmp2_68688 * x_68689;\n                    float w_j_68691 = x_68676 * tmp3_68690;\n                    float xw_j_68692 = defunc_0_f_res_68683 * w_j_68691;\n                    float x2w_j_68693 = defunc_0_f_res_68683 * xw_j_68692;\n                    float defunc_1_op_res_",
                   "68668 = w_j_68691 + redout_76851;\n                    float defunc_1_op_res_68671 = xw_j_68692 + redout_76852;\n                    float defunc_1_op_res_68674 = x2w_j_68693 + redout_76853;\n                    float redout_tmp_78676 = defunc_1_op_res_68668;\n                    float redout_tmp_78677 = defunc_1_op_res_68671;\n                    float redout_tmp_78678 = defunc_1_op_res_68674;\n                    \n                    redout_76851 = redout_tmp_78676;\n                    redout_76852 = redout_tmp_78677;\n                    redout_76853 = redout_tmp_78678;\n                }\n                defunc_2_reduce_res_68663 = redout_76851;\n                defunc_2_reduce_res_68664 = redout_76852;\n                defunc_2_reduce_res_68665 = redout_76853;\n                \n                float x_68694 = defunc_2_reduce_res_68663 *\n                      defunc_2_reduce_res_68665;\n                float y_68695 = defunc_2_reduce_res_68664 *\n                      defunc_2_reduce_res_68664;\n                float y_68696 = x_68694 - y_68695;\n                float det1_68697 = 1.0F / y_68696;\n                float a11_68698 = defunc_2_reduce_res_68665 * det1_68697;\n                float x_68699 = 0.0F - defunc_2_reduce_res_68664;\n                float b11_68700 = det1_68697 * x_68699;\n                float c11_68701 = defunc_2_reduce_res_68663 * det1_68697;\n                float defunc_2_reduce_res_68702;\n                float defunc_2_reduce_res_68703;\n                float redout_76855;\n                float redout_76856;\n                \n                redout_76855 = 0.0F;\n                redout_76856 = 0.0F;\n                for (int64_t i_76857 = 0; i_76857 < q_65346; i_76857++) {\n                    float x_68711;\n                    \n                    x_68711 = ((__global float *) color_78144)[phys_tid_68538 +\n                                                               i_76857 *\n                                                               num_threads_78217];\n ",
                   "                   \n                    bool cond_68712 = sle64(last_res_68548, i_76857);\n                    int64_t defunc_0_f_res_68713;\n                    \n                    if (cond_68712) {\n                        defunc_0_f_res_68713 = (int64_t) 0;\n                    } else {\n                        int64_t i_68714 = add64(max_res_68643, i_76857);\n                        int64_t defunc_0_add_arg_68715;\n                        \n                        defunc_0_add_arg_68715 = ((__global\n                                                   int64_t *) color_78146)[phys_tid_68538 +\n                                                                           i_68714 *\n                                                                           num_threads_78217];\n                        \n                        int64_t defunc_1_add_res_68716 = add64((int64_t) 1,\n                                                               defunc_0_add_arg_68715);\n                        \n                        defunc_0_f_res_68713 = defunc_1_add_res_68716;\n                    }\n                    \n                    int64_t binop_p_68717 = sub64(defunc_0_f_res_68713,\n                                                  min_res_68578);\n                    float defunc_0_f_res_68718 = sitofp_i64_f32(binop_p_68717);\n                    float abs_res_68719 = (float) fabs(defunc_0_f_res_68718);\n                    float tmp1_68720 = abs_res_68719 / defunc_1_f_res_68662;\n                    float x_68721 = tmp1_68720 * tmp1_68720;\n                    float y_68722 = tmp1_68720 * x_68721;\n                    float tmp2_68723 = 1.0F - y_68722;\n                    float x_68724 = tmp2_68723 * tmp2_68723;\n                    float tmp3_68725 = tmp2_68723 * x_68724;\n                    float tmp4_68726 = x_68711 * tmp3_68725;\n                    float defunc_1_f_res_68727 = defunc_0_f_res_68718 *\n                          tmp4_68726;\n                    float defunc_0_f_res_68728;\n          ",
                   "          \n                    if (cond_68712) {\n                        defunc_0_f_res_68728 = 0.0F;\n                    } else {\n                        int64_t i_68729 = add64(max_res_68643, i_76857);\n                        float defunc_0_add_arg_68730;\n                        \n                        defunc_0_add_arg_68730 = ((__global\n                                                   float *) color_78147)[phys_tid_68538 +\n                                                                         i_68729 *\n                                                                         num_threads_78217];\n                        defunc_0_f_res_68728 = defunc_0_add_arg_68730;\n                    }\n                    \n                    float x_68731 = a11_68698 * tmp4_68726;\n                    float y_68732 = b11_68700 * defunc_1_f_res_68727;\n                    float x_68733 = x_68731 + y_68732;\n                    float defunc_9_fit_fun_res_68734 = defunc_0_f_res_68728 *\n                          x_68733;\n                    float x_68735 = b11_68700 * tmp4_68726;\n                    float y_68736 = c11_68701 * defunc_1_f_res_68727;\n                    float x_68737 = x_68735 + y_68736;\n                    float defunc_9_slope_fun_res_68738 = defunc_0_f_res_68728 *\n                          x_68737;\n                    float defunc_1_op_res_68706 = defunc_9_fit_fun_res_68734 +\n                          redout_76855;\n                    float defunc_1_op_res_68709 = defunc_9_slope_fun_res_68738 +\n                          redout_76856;\n                    float redout_tmp_78679 = defunc_1_op_res_68706;\n                    float redout_tmp_78680 = defunc_1_op_res_68709;\n                    \n                    redout_76855 = redout_tmp_78679;\n                    redout_76856 = redout_tmp_78680;\n                }\n                defunc_2_reduce_res_68702 = redout_76855;\n                defunc_2_reduce_res_68703 = redout_76856;\n                ((__global float *) color_",
                   "78143)[phys_tid_68538 + i_76848 *\n                                                 num_threads_78217] =\n                    defunc_2_reduce_res_68702;\n                ((__global float *) color_78142)[phys_tid_68538 + i_76848 *\n                                                 num_threads_78217] =\n                    defunc_2_reduce_res_68703;\n            }\n            for (int64_t i_78681 = 0; i_78681 < n_m_65352; i_78681++) {\n                float tmp_78682;\n                \n                tmp_78682 = ((__global float *) color_78143)[phys_tid_68538 +\n                                                             i_78681 *\n                                                             num_threads_78217];\n                ((__global float *) mem_77308)[gtid_68537 + i_78681 * m_65343] =\n                    tmp_78682;\n            }\n            for (int64_t i_78683 = 0; i_78683 < n_m_65352; i_78683++) {\n                float tmp_78684;\n                \n                tmp_78684 = ((__global float *) color_78142)[phys_tid_68538 +\n                                                             i_78683 *\n                                                             num_threads_78217];\n                ((__global float *) mem_77311)[gtid_68537 + i_78683 * m_65343] =\n                    tmp_78684;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_68532\n}\n__kernel void mainzisegmap_69694(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *Y_mem_76976, __global\n                                 unsigned char *mem_77316, __global\n                                 unsigned char *mem_77320, __global\n                                 unsigned char *mem_77324)\n{\n    #define segmap_group_sizze_69688 (mainzisegmap_group_sizze_69529)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n  ",
                   "  const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78750;\n    int32_t local_tid_78751;\n    int64_t group_sizze_78754;\n    int32_t wave_sizze_78753;\n    int32_t group_tid_78752;\n    \n    global_tid_78750 = get_global_id(0);\n    local_tid_78751 = get_local_id(0);\n    group_sizze_78754 = get_local_size(0);\n    wave_sizze_78753 = LOCKSTEP_WIDTH;\n    group_tid_78752 = get_group_id(0);\n    \n    int32_t phys_tid_69694 = global_tid_78750;\n    int64_t global_tid_78755 = sext_i32_i64(group_tid_78752) *\n            segmap_group_sizze_69688 + sext_i32_i64(local_tid_78751);\n    int64_t slice_78756 = n_65344;\n    int64_t slice_78757 = m_65343 * slice_78756;\n    int64_t gtid_69692 = squot64(global_tid_78755, slice_78756);\n    int64_t remnant_78758 = global_tid_78755 - gtid_69692 * slice_78756;\n    int64_t gtid_69693 = remnant_78758;\n    int64_t remnant_78759 = remnant_78758 - gtid_69693;\n    \n    if (slt64(gtid_69692, m_65343) && slt64(gtid_69693, n_65344)) {\n        float x_69695;\n        \n        x_69695 = ((__global float *) Y_mem_76976)[gtid_69692 * n_65344 +\n                                                   gtid_69693];\n        \n        bool isnan_res_69698;\n        \n        isnan_res_69698 = futrts_isnan32(x_69695);\n        \n        bool defunc_0_p_res_69699 = !isnan_res_69698;\n        int64_t defunc_1_f_res_69700;\n        \n        if (defunc_0_p_res_69699) {\n            int64_t x_69696;\n            \n            x_69696 = ((__global int64_t *) mem_77316)[gtid_69692 * n_65344 +\n                                                       gtid_69693];\n            \n            int64_t defunc_1_f_res_t_res_69701 = sub64(x_69696, (int64_t) 1);\n            \n            defunc_1_f_res_69700 = defunc_1_f_res_t_res_69701;\n        } else {\n            defunc_1_f_res_69700 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_69692) && slt64(gtid_69692, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_69700) &&\n    ",
                   "         slt64(defunc_1_f_res_69700, n_65344))) {\n            ((__global int64_t *) mem_77324)[gtid_69692 * n_65344 +\n                                             defunc_1_f_res_69700] = gtid_69693;\n        }\n        if ((sle64((int64_t) 0, gtid_69692) && slt64(gtid_69692, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_69700) &&\n             slt64(defunc_1_f_res_69700, n_65344))) {\n            ((__global float *) mem_77320)[gtid_69692 * n_65344 +\n                                           defunc_1_f_res_69700] = x_69695;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_69688\n}\n__kernel void mainzisegmap_69713(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *mem_77324, __global\n                                 unsigned char *mem_77330)\n{\n    #define segmap_group_sizze_69708 (mainzisegmap_group_sizze_69503)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78760;\n    int32_t local_tid_78761;\n    int64_t group_sizze_78764;\n    int32_t wave_sizze_78763;\n    int32_t group_tid_78762;\n    \n    global_tid_78760 = get_global_id(0);\n    local_tid_78761 = get_local_id(0);\n    group_sizze_78764 = get_local_size(0);\n    wave_sizze_78763 = LOCKSTEP_WIDTH;\n    group_tid_78762 = get_group_id(0);\n    \n    int32_t phys_tid_69713 = global_tid_78760;\n    int64_t global_tid_78765 = sext_i32_i64(group_tid_78762) *\n            segmap_group_sizze_69708 + sext_i32_i64(local_tid_78761);\n    int64_t slice_78766 = n_65344;\n    int64_t slice_78767 = m_65343 * slice_78766;\n    int64_t gtid_69711 = squot64(global_tid_78765, slice_78766);\n    int64_t remnant_78768 = global_tid_78765 - gtid_69711 * slice_78766;\n    int64_t gtid_69712 = remnant_78768;\n    int64_t remnant_78769 = remnant_78768 - gtid_69712;\n    \n    if (slt64(gtid_69711, ",
                   "m_65343) && slt64(gtid_69712, n_65344)) {\n        int64_t x_69714;\n        \n        x_69714 = ((__global int64_t *) mem_77324)[gtid_69711 * n_65344 +\n                                                   gtid_69712];\n        \n        int64_t defunc_0_f_res_69715 = add64((int64_t) 1, x_69714);\n        \n        ((__global int64_t *) mem_77330)[gtid_69711 * n_65344 + gtid_69712] =\n            defunc_0_f_res_69715;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_69708\n}\n__kernel void mainzisegmap_69725(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, int64_t min_res_65364,\n                                 float i64_res_65370, __global\n                                 unsigned char *mem_77316, __global\n                                 unsigned char *mem_77334, __global\n                                 unsigned char *mem_77337, __global\n                                 unsigned char *mem_77340, __global\n                                 unsigned char *mem_77343)\n{\n    #define segmap_group_sizze_69718 (mainzisegmap_group_sizze_69477)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78770;\n    int32_t local_tid_78771;\n    int64_t group_sizze_78774;\n    int32_t wave_sizze_78773;\n    int32_t group_tid_78772;\n    \n    global_tid_78770 = get_global_id(0);\n    local_tid_78771 = get_local_id(0);\n    group_sizze_78774 = get_local_size(0);\n    wave_sizze_78773 = LOCKSTEP_WIDTH;\n    group_tid_78772 = get_group_id(0);\n    \n    int32_t phys_tid_69725 = global_tid_78770;\n    int64_t global_tid_78775 = sext_i32_i64(group_tid_78772) *\n            segmap_group_sizze_69718 + sext_i32_i64(local_tid_78771);\n    int64_t slice_78776 = m_65343;\n    int64_t gtid_69724 = global_tid_78775;\n    int64_t remnant_78777 = global_tid_78775 - gtid_69724;\n  ",
                   "  \n    if (slt64(gtid_69724, m_65343)) {\n        int64_t last_res_69726;\n        \n        last_res_69726 = ((__global int64_t *) mem_77316)[gtid_69724 * n_65344 +\n                                                          i_65358];\n        \n        int64_t min_arg_69727 = sub64(last_res_69726, (int64_t) 1);\n        int64_t min_arg_69728 = sub64(last_res_69726, min_res_65364);\n        int64_t min_res_69729 = smin64(q_65346, last_res_69726);\n        float i64_res_69730 = sitofp_i64_f32(last_res_69726);\n        float x_69731 = i64_res_65370 - i64_res_69730;\n        float max_arg_69732 = x_69731 / 2.0F;\n        float max_res_69733 = fmax32(0.0F, max_arg_69732);\n        \n        ((__global int64_t *) mem_77334)[gtid_69724] = min_arg_69727;\n        ((__global int64_t *) mem_77337)[gtid_69724] = min_arg_69728;\n        ((__global int64_t *) mem_77340)[gtid_69724] = min_res_69729;\n        ((__global float *) mem_77343)[gtid_69724] = max_res_69733;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_69718\n}\n__kernel void mainzisegmap_69745(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, __global\n                                 unsigned char *mem_77316, __global\n                                 unsigned char *mem_77348)\n{\n    #define segmap_group_sizze_69740 (mainzisegmap_group_sizze_69452)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78778;\n    int32_t local_tid_78779;\n    int64_t group_sizze_78782;\n    int32_t wave_sizze_78781;\n    int32_t group_tid_78780;\n    \n    global_tid_78778 = get_global_id(0);\n    local_tid_78779 = get_local_id(0);\n    group_sizze_78782 = get_local_size(0);\n    wave_sizze_78781 = LOCKSTEP_WIDTH;\n    group_tid_78780 = get_group_id(0);\n    \n    int32_t phys_tid_69745 = global_tid_78778;\n    int64_t g",
                   "lobal_tid_78783 = sext_i32_i64(group_tid_78780) *\n            segmap_group_sizze_69740 + sext_i32_i64(local_tid_78779);\n    int64_t slice_78784 = q_65346;\n    int64_t slice_78785 = m_65343 * slice_78784;\n    int64_t gtid_69743 = squot64(global_tid_78783, slice_78784);\n    int64_t remnant_78786 = global_tid_78783 - gtid_69743 * slice_78784;\n    int64_t gtid_69744 = remnant_78786;\n    int64_t remnant_78787 = remnant_78786 - gtid_69744;\n    \n    if (slt64(gtid_69743, m_65343) && slt64(gtid_69744, q_65346)) {\n        int64_t last_res_69746;\n        \n        last_res_69746 = ((__global int64_t *) mem_77316)[gtid_69743 * n_65344 +\n                                                          i_65358];\n        \n        bool cond_69748 = sle64(last_res_69746, gtid_69744);\n        float defunc_0_f_res_69749;\n        \n        if (cond_69748) {\n            defunc_0_f_res_69749 = 0.0F;\n        } else {\n            defunc_0_f_res_69749 = 1.0F;\n        }\n        ((__global float *) mem_77348)[gtid_69743 * q_65346 + gtid_69744] =\n            defunc_0_f_res_69749;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_69740\n}\n__kernel void mainzisegmap_69946(__global int *global_failure,\n                                 int failure_is_an_option, __global\n                                 int64_t *global_failure_args, int64_t m_65343,\n                                 int64_t n_65344, int64_t jump_65348,\n                                 int64_t n_m_65352, int64_t i_65358,\n                                 unsigned char x_65359_bits,\n                                 int64_t min_res_65364,\n                                 unsigned char loop_cond_65369_bits, __global\n                                 unsigned char *mem_77324, __global\n                                 unsigned char *mem_77330, __global\n                                 unsigned char *mem_77334, __global\n                                 unsigned char *mem_77337, __global\n                                 unsigned char *me",
                   "m_77340, __global\n                                 unsigned char *mem_77343, __global\n                                 unsigned char *mem_77431, __global\n                                 unsigned char *mem_77435, __global\n                                 unsigned char *mem_77439)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    \n    #define segmap_group_sizze_69939 (mainzisegmap_group_sizze_69101)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78842;\n    int32_t local_tid_78843;\n    int64_t group_sizze_78846;\n    int32_t wave_sizze_78845;\n    int32_t group_tid_78844;\n    \n    global_tid_78842 = get_global_id(0);\n    local_tid_78843 = get_local_id(0);\n    group_sizze_78846 = get_local_size(0);\n    wave_sizze_78845 = LOCKSTEP_WIDTH;\n    group_tid_78844 = get_group_id(0);\n    \n    int32_t phys_tid_69946 = global_tid_78842;\n    int64_t global_tid_78847 = sext_i32_i64(group_tid_78844) *\n            segmap_group_sizze_69939 + sext_i32_i64(local_tid_78843);\n    int64_t slice_78848 = n_m_65352;\n    int64_t slice_78849 = m_65343 * slice_78848;\n    int64_t gtid_69944 = squot64(global_tid_78847, slice_78848);\n    int64_t remnant_78850 = global_tid_78847 - gtid_69944 * slice_78848;\n    int64_t gtid_69945 = remnant_78850;\n    int64_t remnant_78851 = remnant_78850 - gtid_69945;\n    \n    if (slt64(gtid_69944, m_65343) && slt64(gtid_69945, n_m_65352)) {\n        int64_t min_arg_69949;\n        \n        min_arg_69949 = ((__global int64_t *) mem_77334)[gtid_69944];\n        \n        int64_t min_arg_69950;\n        \n        min_arg_69950 = ((__global int64_t *) mem_77337)[gtid_69944];\n        \n        int64_t min_res_69951;\n        \n        min_res_69951 = ((__global int64_t *) mem_77340)[gtid_69944];\n        \n        float max_res_69952;\n        \n        max_res_69952 = ((__global float *) mem_77343)[gtid_69944];\n        \n  ",
                   "      int64_t min_arg_69954 = mul64(jump_65348, gtid_69945);\n        int64_t min_res_69955 = smin64(i_65358, min_arg_69954);\n        int64_t defunc_0_g_res_69956 = add64((int64_t) 1, min_res_69955);\n        bool init_idx_69957;\n        int64_t init_idx_69958;\n        int64_t init_idx_69959;\n        bool loop_while_69960;\n        int64_t low_69961;\n        int64_t high_69962;\n        \n        loop_while_69960 = x_65359;\n        low_69961 = (int64_t) 0;\n        high_69962 = i_65358;\n        while (loop_while_69960) {\n            int64_t x_69963 = add64(low_69961, high_69962);\n            int64_t mid_69964 = sdiv64(x_69963, (int64_t) 2);\n            bool x_69965 = sle64((int64_t) 0, mid_69964);\n            bool y_69966 = slt64(mid_69964, n_65344);\n            bool bounds_check_69967 = x_69965 && y_69966;\n            bool index_certs_69968;\n            \n            if (!bounds_check_69967) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 25) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_69964;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t mid_id_69969;\n            \n            mid_id_69969 = ((__global int64_t *) mem_77330)[gtid_69944 *\n                                                            n_65344 +\n                                                            mid_69964];\n            \n            bool cond_69970 = slt64(mid_id_69969, (int64_t) 0);\n            int64_t mid_idx_69971;\n            \n            if (cond_69970) {\n                mid_idx_69971 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_69971 = mid_id_69969;\n            }\n            \n            bool cond_69972 = sle64(defunc_0_g_res_69956, mid_idx_69971);\n            int64_t loopres_69973;\n            int64_t loopres_6997",
                   "4;\n            \n            if (cond_69972) {\n                int64_t loopres_t_res_69975 = sub64(mid_69964, (int64_t) 1);\n                \n                loopres_69973 = low_69961;\n                loopres_69974 = loopres_t_res_69975;\n            } else {\n                int64_t loopres_f_res_69976 = add64((int64_t) 1, mid_69964);\n                \n                loopres_69973 = loopres_f_res_69976;\n                loopres_69974 = high_69962;\n            }\n            \n            bool loop_cond_69977 = sle64(loopres_69973, loopres_69974);\n            bool loop_while_tmp_78852 = loop_cond_69977;\n            int64_t low_tmp_78853 = loopres_69973;\n            int64_t high_tmp_78854 = loopres_69974;\n            \n            loop_while_69960 = loop_while_tmp_78852;\n            low_69961 = low_tmp_78853;\n            high_69962 = high_tmp_78854;\n        }\n        init_idx_69957 = loop_while_69960;\n        init_idx_69958 = low_69961;\n        init_idx_69959 = high_69962;\n        \n        bool idx_69978;\n        int64_t idx_69979;\n        int64_t idx_69980;\n        int64_t idx_69981;\n        bool loop_while_69982;\n        int64_t l_idx_69983;\n        int64_t r_idx_69984;\n        int64_t span_69985;\n        \n        loop_while_69982 = loop_cond_65369;\n        l_idx_69983 = init_idx_69958;\n        r_idx_69984 = init_idx_69958;\n        span_69985 = (int64_t) 1;\n        while (loop_while_69982) {\n            int64_t max_arg_69986 = sub64(l_idx_69983, (int64_t) 1);\n            int64_t max_res_69987 = smax64((int64_t) 0, max_arg_69986);\n            int64_t min_arg_69988 = add64((int64_t) 1, r_idx_69984);\n            int64_t min_res_69989 = smin64(min_arg_69949, min_arg_69988);\n            bool x_69990 = sle64((int64_t) 0, max_res_69987);\n            bool y_69991 = slt64(max_res_69987, n_65344);\n            bool bounds_check_69992 = x_69990 && y_69991;\n            bool index_certs_69993;\n            \n            if (!bounds_check_69992) {\n                {\n                    if (",
                   "atomic_cmpxchg_i32_global(global_failure, -1, 26) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_69987;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_69994;\n            \n            x_69994 = ((__global int64_t *) mem_77330)[gtid_69944 * n_65344 +\n                                                       max_res_69987];\n            \n            int64_t abs_arg_69995 = sub64(x_69994, defunc_0_g_res_69956);\n            int64_t abs_res_69996 = abs64(abs_arg_69995);\n            bool x_69997 = sle64((int64_t) 0, min_res_69989);\n            bool y_69998 = slt64(min_res_69989, n_65344);\n            bool bounds_check_69999 = x_69997 && y_69998;\n            bool index_certs_70000;\n            \n            if (!bounds_check_69999) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 27) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_69989;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_70001;\n            \n            x_70001 = ((__global int64_t *) mem_77330)[gtid_69944 * n_65344 +\n                                                       min_res_69989];\n            \n            int64_t abs_arg_70002 = sub64(x_70001, defunc_0_g_res_69956);\n            int64_t abs_res_70003 = abs64(abs_arg_70002);\n            bool cond_70004 = max_res_69987 == l_idx_69983;\n            int64_t loopres_70005;\n            int64_t loopres_70006;\n            int64_t loopres_70007;\n            \n            if (cond_70004) {\n                loopres_70005 = l_idx_69983;\n                loopres_70006 = r_idx_69984;\n                loopres_70007 ",
                   "= min_res_65364;\n            } else {\n                bool cond_70008 = slt64(abs_res_69996, abs_res_70003);\n                bool cond_f_res_70009 = min_res_69989 == r_idx_69984;\n                bool x_70010 = !cond_70008;\n                bool y_70011 = cond_f_res_70009 && x_70010;\n                bool cond_70012 = cond_70008 || y_70011;\n                int64_t loopres_f_res_70013;\n                \n                if (cond_70012) {\n                    loopres_f_res_70013 = max_res_69987;\n                } else {\n                    loopres_f_res_70013 = l_idx_69983;\n                }\n                \n                int64_t loopres_f_res_70014;\n                \n                if (cond_70012) {\n                    loopres_f_res_70014 = r_idx_69984;\n                } else {\n                    loopres_f_res_70014 = min_res_69989;\n                }\n                \n                int64_t loopres_f_res_70015;\n                \n                if (cond_70012) {\n                    int64_t loopres_f_res_t_res_70016 = add64((int64_t) 1,\n                                                              span_69985);\n                    \n                    loopres_f_res_70015 = loopres_f_res_t_res_70016;\n                } else {\n                    int64_t loopres_f_res_f_res_70017 = add64((int64_t) 1,\n                                                              span_69985);\n                    \n                    loopres_f_res_70015 = loopres_f_res_f_res_70017;\n                }\n                loopres_70005 = loopres_f_res_70013;\n                loopres_70006 = loopres_f_res_70014;\n                loopres_70007 = loopres_f_res_70015;\n            }\n            \n            bool loop_cond_70018 = slt64(loopres_70007, min_res_65364);\n            bool loop_while_tmp_78855 = loop_cond_70018;\n            int64_t l_idx_tmp_78856 = loopres_70005;\n            int64_t r_idx_tmp_78857 = loopres_70006;\n            int64_t span_tmp_78858 = loopres_70007;\n            \n            loop_wh",
                   "ile_69982 = loop_while_tmp_78855;\n            l_idx_69983 = l_idx_tmp_78856;\n            r_idx_69984 = r_idx_tmp_78857;\n            span_69985 = span_tmp_78858;\n        }\n        idx_69978 = loop_while_69982;\n        idx_69979 = l_idx_69983;\n        idx_69980 = r_idx_69984;\n        idx_69981 = span_69985;\n        \n        int64_t min_res_70019 = smin64(min_arg_69950, idx_69979);\n        int64_t max_res_70020 = smax64((int64_t) 0, min_res_70019);\n        int64_t x_70021 = add64(min_res_69951, max_res_70020);\n        int64_t r_70022 = sub64(x_70021, (int64_t) 1);\n        bool x_70023 = sle64((int64_t) 0, r_70022);\n        bool y_70024 = slt64(r_70022, n_65344);\n        bool bounds_check_70025 = x_70023 && y_70024;\n        bool index_certs_70026;\n        \n        if (!bounds_check_70025) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 28) == -1) {\n                    global_failure_args[0] = (int64_t) r_70022;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_70027;\n        \n        x_70027 = ((__global int64_t *) mem_77324)[gtid_69944 * n_65344 +\n                                                   r_70022];\n        \n        int64_t abs_arg_70028 = sub64(x_70027, min_res_69955);\n        int64_t abs_res_70029 = abs64(abs_arg_70028);\n        bool x_70030 = sle64((int64_t) 0, max_res_70020);\n        bool y_70031 = slt64(max_res_70020, n_65344);\n        bool bounds_check_70032 = x_70030 && y_70031;\n        bool index_certs_70033;\n        \n        if (!bounds_check_70032) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 29) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_70020;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_70034",
                   ";\n        \n        x_70034 = ((__global int64_t *) mem_77324)[gtid_69944 * n_65344 +\n                                                   max_res_70020];\n        \n        int64_t abs_arg_70035 = sub64(x_70034, min_res_69955);\n        int64_t abs_res_70036 = abs64(abs_arg_70035);\n        int64_t max_res_70037 = smax64(abs_res_70029, abs_res_70036);\n        float defunc_0_f_res_70038 = sitofp_i64_f32(max_res_70037);\n        float defunc_1_f_res_70039 = max_res_69952 + defunc_0_f_res_70038;\n        \n        ((__global int64_t *) mem_77431)[gtid_69944 * n_m_65352 + gtid_69945] =\n            min_res_69955;\n        ((__global int64_t *) mem_77435)[gtid_69944 * n_m_65352 + gtid_69945] =\n            max_res_70020;\n        ((__global float *) mem_77439)[gtid_69944 * n_m_65352 + gtid_69945] =\n            defunc_1_f_res_70039;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_69939\n}\n__kernel void mainzisegmap_70099(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_m_65352, __global\n                                 unsigned char *mem_77444, __global\n                                 unsigned char *mem_77448, __global\n                                 unsigned char *mem_77452, __global\n                                 unsigned char *mem_77457, __global\n                                 unsigned char *mem_77461, __global\n                                 unsigned char *mem_77465)\n{\n    #define segmap_group_sizze_70092 (mainzisegmap_group_sizze_69026)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78959;\n    int32_t local_tid_78960;\n    int64_t group_sizze_78963;\n    int32_t wave_sizze_78962;\n    int32_t group_tid_78961;\n    \n    global_tid_78959 = get_global_id(0);\n    local_tid_78960 = get_local_id(0);\n    group_sizze_78963 = get_local_size(0);\n    wave_sizze_78962 = LOCKSTEP_WIDTH;\n    group_tid_78961 = g",
                   "et_group_id(0);\n    \n    int32_t phys_tid_70099 = global_tid_78959;\n    int64_t global_tid_78964 = sext_i32_i64(group_tid_78961) *\n            segmap_group_sizze_70092 + sext_i32_i64(local_tid_78960);\n    int64_t slice_78965 = n_m_65352;\n    int64_t slice_78966 = m_65343 * slice_78965;\n    int64_t gtid_70097 = squot64(global_tid_78964, slice_78965);\n    int64_t remnant_78967 = global_tid_78964 - gtid_70097 * slice_78965;\n    int64_t gtid_70098 = remnant_78967;\n    int64_t remnant_78968 = remnant_78967 - gtid_70098;\n    \n    if (slt64(gtid_70097, m_65343) && slt64(gtid_70098, n_m_65352)) {\n        float defunc_2_reduce_res_70100;\n        \n        defunc_2_reduce_res_70100 = ((__global float *) mem_77444)[gtid_70097 *\n                                                                   n_m_65352 +\n                                                                   gtid_70098];\n        \n        float defunc_2_reduce_res_70101;\n        \n        defunc_2_reduce_res_70101 = ((__global float *) mem_77448)[gtid_70097 *\n                                                                   n_m_65352 +\n                                                                   gtid_70098];\n        \n        float defunc_2_reduce_res_70102;\n        \n        defunc_2_reduce_res_70102 = ((__global float *) mem_77452)[gtid_70097 *\n                                                                   n_m_65352 +\n                                                                   gtid_70098];\n        \n        float x_70103 = defunc_2_reduce_res_70100 * defunc_2_reduce_res_70102;\n        float y_70104 = defunc_2_reduce_res_70101 * defunc_2_reduce_res_70101;\n        float y_70105 = x_70103 - y_70104;\n        float det1_70106 = 1.0F / y_70105;\n        float a11_70107 = defunc_2_reduce_res_70102 * det1_70106;\n        float x_70108 = 0.0F - defunc_2_reduce_res_70101;\n        float b11_70109 = det1_70106 * x_70108;\n        float c11_70110 = defunc_2_reduce_res_70100 * det1_70106;\n        \n        ((__global ",
                   "float *) mem_77457)[gtid_70097 * n_m_65352 + gtid_70098] =\n            a11_70107;\n        ((__global float *) mem_77461)[gtid_70097 * n_m_65352 + gtid_70098] =\n            b11_70109;\n        ((__global float *) mem_77465)[gtid_70097 * n_m_65352 + gtid_70098] =\n            c11_70110;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_70092\n}\n__kernel void mainzisegmap_70429(__global int *global_failure,\n                                 int failure_is_an_option, __global\n                                 int64_t *global_failure_args, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t jump_65348, int64_t n_m_65352,\n                                 int64_t i_65358, unsigned char x_65359_bits,\n                                 int64_t min_res_65364,\n                                 unsigned char loop_cond_65369_bits,\n                                 float i64_res_65370, int64_t num_groups_70424,\n                                 int64_t num_threads_78234, __global\n                                 unsigned char *mem_77491, __global\n                                 unsigned char *mem_77600, __global\n                                 unsigned char *mem_77603, __global\n                                 unsigned char *color_78164, __global\n                                 unsigned char *color_78165, __global\n                                 unsigned char *color_78166, __global\n                                 unsigned char *color_78167, __global\n                                 unsigned char *color_78168, __global\n                                 unsigned char *color_78169)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    \n    #define segmap_group_sizze_70423 (mainzisegmap_group_sizze_70183)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    volatile __local bool local_failure;\n    \n    if (failure_is_an_optio",
                   "n) {\n        int failed = *global_failure >= 0;\n        \n        if (failed)\n            return;\n    }\n    local_failure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_79061;\n    int32_t local_tid_79062;\n    int64_t group_sizze_79065;\n    int32_t wave_sizze_79064;\n    int32_t group_tid_79063;\n    \n    global_tid_79061 = get_global_id(0);\n    local_tid_79062 = get_local_id(0);\n    group_sizze_79065 = get_local_size(0);\n    wave_sizze_79064 = LOCKSTEP_WIDTH;\n    group_tid_79063 = get_group_id(0);\n    \n    int32_t phys_tid_70429 = global_tid_79061;\n    int32_t phys_group_id_79066;\n    \n    phys_group_id_79066 = get_group_id(0);\n    for (int32_t i_79067 = 0; i_79067 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_65343, segmap_group_sizze_70423)) -\n                   phys_group_id_79066, sext_i64_i32(num_groups_70424));\n         i_79067++) {\n        int32_t virt_group_id_79068 = phys_group_id_79066 + i_79067 *\n                sext_i64_i32(num_groups_70424);\n        int64_t global_tid_79069 = sext_i32_i64(virt_group_id_79068) *\n                segmap_group_sizze_70423 + sext_i32_i64(local_tid_79062);\n        int64_t slice_79070 = m_65343;\n        int64_t gtid_70428 = global_tid_79069;\n        int64_t remnant_79071 = global_tid_79069 - gtid_70428;\n        \n        if (slt64(gtid_70428, m_65343)) {\n            int64_t discard_76874;\n            int64_t scanacc_76870 = (int64_t) 0;\n            \n            for (int64_t i_76872 = 0; i_76872 < n_65344; i_76872++) {\n                float x_70435;\n                \n                x_70435 = ((__global float *) mem_77491)[i_76872 * m_65343 +\n                                                         gtid_70428];\n                \n                bool isnan_res_70436;\n                \n                isnan_res_70436 = futrts_isnan32(x_70435);\n                \n                bool defunc_0_p_res_70437 = !isnan_res_70436;\n                int64_t defunc_0_f_res_70438 =\n                        btoi_bool_i64(defunc_0",
                   "_p_res_70437);\n                int64_t defunc_1_op_res_70434 = add64(defunc_0_f_res_70438,\n                                                      scanacc_76870);\n                \n                ((__global int64_t *) color_78167)[phys_tid_70429 + i_76872 *\n                                                   num_threads_78234] =\n                    defunc_1_op_res_70434;\n                \n                int64_t scanacc_tmp_79072 = defunc_1_op_res_70434;\n                \n                scanacc_76870 = scanacc_tmp_79072;\n            }\n            discard_76874 = scanacc_76870;\n            \n            int64_t last_res_70439;\n            \n            last_res_70439 = ((__global int64_t *) color_78167)[phys_tid_70429 +\n                                                                i_65358 *\n                                                                num_threads_78234];\n            for (int64_t i_79074 = 0; i_79074 < n_65344; i_79074++) {\n                ((__global float *) color_78169)[phys_tid_70429 + i_79074 *\n                                                 num_threads_78234] = 0.0F;\n            }\n            for (int64_t i_79075 = 0; i_79075 < n_65344; i_79075++) {\n                ((__global int64_t *) color_78168)[phys_tid_70429 + i_79075 *\n                                                   num_threads_78234] =\n                    (int64_t) -1;\n            }\n            for (int64_t write_iter_76875 = 0; write_iter_76875 < n_65344;\n                 write_iter_76875++) {\n                float write_iv_76878;\n                \n                write_iv_76878 = ((__global\n                                   float *) mem_77491)[write_iter_76875 *\n                                                       m_65343 + gtid_70428];\n                \n                bool isnan_res_70447;\n                \n                isnan_res_70447 = futrts_isnan32(write_iv_76878);\n                \n                bool defunc_0_p_res_70448 = !isnan_res_70447;\n                int64_t defunc_1_",
                   "f_res_70449;\n                \n                if (defunc_0_p_res_70448) {\n                    int64_t write_iv_76879;\n                    \n                    write_iv_76879 = ((__global\n                                       int64_t *) color_78167)[phys_tid_70429 +\n                                                               write_iter_76875 *\n                                                               num_threads_78234];\n                    \n                    int64_t defunc_1_f_res_t_res_70450 = sub64(write_iv_76879,\n                                                               (int64_t) 1);\n                    \n                    defunc_1_f_res_70449 = defunc_1_f_res_t_res_70450;\n                } else {\n                    defunc_1_f_res_70449 = (int64_t) -1;\n                }\n                if (sle64((int64_t) 0, defunc_1_f_res_70449) &&\n                    slt64(defunc_1_f_res_70449, n_65344)) {\n                    ((__global int64_t *) color_78168)[phys_tid_70429 +\n                                                       defunc_1_f_res_70449 *\n                                                       num_threads_78234] =\n                        write_iter_76875;\n                }\n                if (sle64((int64_t) 0, defunc_1_f_res_70449) &&\n                    slt64(defunc_1_f_res_70449, n_65344)) {\n                    for (int64_t i_79078 = 0; i_79078 < (int64_t) 1;\n                         i_79078++) {\n                        float tmp_79079;\n                        \n                        tmp_79079 = ((__global float *) mem_77491)[m_65343 *\n                                                                   write_iter_76875 +\n                                                                   gtid_70428 +\n                                                                   i_79078 *\n                                                                   m_65343];\n                        ((__global float *) color_78169)[phys_tid_70429 +\n                     ",
                   "                                    num_threads_78234 *\n                                                         defunc_1_f_res_70449 +\n                                                         i_79078 *\n                                                         num_threads_78234] =\n                            tmp_79079;\n                    }\n                }\n            }\n            for (int64_t i_76885 = 0; i_76885 < n_65344; i_76885++) {\n                int64_t x_70452;\n                \n                x_70452 = ((__global int64_t *) color_78168)[phys_tid_70429 +\n                                                             i_76885 *\n                                                             num_threads_78234];\n                \n                int64_t defunc_0_f_res_70453 = add64((int64_t) 1, x_70452);\n                \n                ((__global int64_t *) color_78167)[phys_tid_70429 + i_76885 *\n                                                   num_threads_78234] =\n                    defunc_0_f_res_70453;\n            }\n            \n            int64_t min_arg_70454 = sub64(last_res_70439, (int64_t) 1);\n            int64_t min_arg_70455 = sub64(last_res_70439, min_res_65364);\n            int64_t min_res_70456 = smin64(q_65346, last_res_70439);\n            float i64_res_70457 = sitofp_i64_f32(last_res_70439);\n            float x_70458 = i64_res_65370 - i64_res_70457;\n            float max_arg_70459 = x_70458 / 2.0F;\n            float max_res_70460 = fmax32(0.0F, max_arg_70459);\n            \n            for (int64_t i_76889 = 0; i_76889 < q_65346; i_76889++) {\n                bool cond_70463 = sle64(last_res_70439, i_76889);\n                float defunc_0_f_res_70464;\n                \n                if (cond_70463) {\n                    defunc_0_f_res_70464 = 0.0F;\n                } else {\n                    defunc_0_f_res_70464 = 1.0F;\n                }\n                ((__global float *) color_78166)[phys_tid_70429 + i_76889 *\n                                 ",
                   "                num_threads_78234] =\n                    defunc_0_f_res_70464;\n            }\n            for (int64_t i_76895 = 0; i_76895 < n_m_65352; i_76895++) {\n                int64_t min_arg_70468 = mul64(jump_65348, i_76895);\n                int64_t min_res_70469 = smin64(i_65358, min_arg_70468);\n                int64_t defunc_0_g_res_70470 = add64((int64_t) 1,\n                                                     min_res_70469);\n                bool init_idx_70471;\n                int64_t init_idx_70472;\n                int64_t init_idx_70473;\n                bool loop_while_70474;\n                int64_t low_70475;\n                int64_t high_70476;\n                \n                loop_while_70474 = x_65359;\n                low_70475 = (int64_t) 0;\n                high_70476 = i_65358;\n                while (loop_while_70474) {\n                    int64_t x_70477 = add64(low_70475, high_70476);\n                    int64_t mid_70478 = sdiv64(x_70477, (int64_t) 2);\n                    bool x_70479 = sle64((int64_t) 0, mid_70478);\n                    bool y_70480 = slt64(mid_70478, n_65344);\n                    bool bounds_check_70481 = x_70479 && y_70480;\n                    bool index_certs_70482;\n                    \n                    if (!bounds_check_70481) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          30) == -1) {\n                                global_failure_args[0] = (int64_t) mid_70478;\n                                global_failure_args[1] = (int64_t) n_65344;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t mid_id_70483;\n                    \n                    mid_id_70483 = ((__global\n                                     int64_",
                   "t *) color_78167)[phys_tid_70429 +\n                                                             mid_70478 *\n                                                             num_threads_78234];\n                    \n                    bool cond_70484 = slt64(mid_id_70483, (int64_t) 0);\n                    int64_t mid_idx_70485;\n                    \n                    if (cond_70484) {\n                        mid_idx_70485 = (int64_t) 9223372036854775807;\n                    } else {\n                        mid_idx_70485 = mid_id_70483;\n                    }\n                    \n                    bool cond_70486 = sle64(defunc_0_g_res_70470,\n                                            mid_idx_70485);\n                    int64_t loopres_70487;\n                    int64_t loopres_70488;\n                    \n                    if (cond_70486) {\n                        int64_t loopres_t_res_70489 = sub64(mid_70478,\n                                                            (int64_t) 1);\n                        \n                        loopres_70487 = low_70475;\n                        loopres_70488 = loopres_t_res_70489;\n                    } else {\n                        int64_t loopres_f_res_70490 = add64((int64_t) 1,\n                                                            mid_70478);\n                        \n                        loopres_70487 = loopres_f_res_70490;\n                        loopres_70488 = high_70476;\n                    }\n                    \n                    bool loop_cond_70491 = sle64(loopres_70487, loopres_70488);\n                    bool loop_while_tmp_79084 = loop_cond_70491;\n                    int64_t low_tmp_79085 = loopres_70487;\n                    int64_t high_tmp_79086 = loopres_70488;\n                    \n                    loop_while_70474 = loop_while_tmp_79084;\n                    low_70475 = low_tmp_79085;\n                    high_70476 = high_tmp_79086;\n                }\n                init_idx_70471 = loop_while_70474;\n",
                   "                init_idx_70472 = low_70475;\n                init_idx_70473 = high_70476;\n                \n                bool idx_70492;\n                int64_t idx_70493;\n                int64_t idx_70494;\n                int64_t idx_70495;\n                bool loop_while_70496;\n                int64_t l_idx_70497;\n                int64_t r_idx_70498;\n                int64_t span_70499;\n                \n                loop_while_70496 = loop_cond_65369;\n                l_idx_70497 = init_idx_70472;\n                r_idx_70498 = init_idx_70472;\n                span_70499 = (int64_t) 1;\n                while (loop_while_70496) {\n                    int64_t max_arg_70500 = sub64(l_idx_70497, (int64_t) 1);\n                    int64_t max_res_70501 = smax64((int64_t) 0, max_arg_70500);\n                    int64_t min_arg_70502 = add64((int64_t) 1, r_idx_70498);\n                    int64_t min_res_70503 = smin64(min_arg_70454,\n                                                   min_arg_70502);\n                    bool x_70504 = sle64((int64_t) 0, max_res_70501);\n                    bool y_70505 = slt64(max_res_70501, n_65344);\n                    bool bounds_check_70506 = x_70504 && y_70505;\n                    bool index_certs_70507;\n                    \n                    if (!bounds_check_70506) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          31) == -1) {\n                                global_failure_args[0] =\n                                    (int64_t) max_res_70501;\n                                global_failure_args[1] = (int64_t) n_65344;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t x_70508;\n                    \n                    x_70508 =",
                   " ((__global\n                                int64_t *) color_78167)[phys_tid_70429 +\n                                                        max_res_70501 *\n                                                        num_threads_78234];\n                    \n                    int64_t abs_arg_70509 = sub64(x_70508,\n                                                  defunc_0_g_res_70470);\n                    int64_t abs_res_70510 = abs64(abs_arg_70509);\n                    bool x_70511 = sle64((int64_t) 0, min_res_70503);\n                    bool y_70512 = slt64(min_res_70503, n_65344);\n                    bool bounds_check_70513 = x_70511 && y_70512;\n                    bool index_certs_70514;\n                    \n                    if (!bounds_check_70513) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          32) == -1) {\n                                global_failure_args[0] =\n                                    (int64_t) min_res_70503;\n                                global_failure_args[1] = (int64_t) n_65344;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t x_70515;\n                    \n                    x_70515 = ((__global\n                                int64_t *) color_78167)[phys_tid_70429 +\n                                                        min_res_70503 *\n                                                        num_threads_78234];\n                    \n                    int64_t abs_arg_70516 = sub64(x_70515,\n                                                  defunc_0_g_res_70470);\n                    int64_t abs_res_70517 = abs64(abs_arg_70516);\n                    bool cond_70518 = max_res_70501 == l_idx_70497;\n                    int64_t loopr",
                   "es_70519;\n                    int64_t loopres_70520;\n                    int64_t loopres_70521;\n                    \n                    if (cond_70518) {\n                        loopres_70519 = l_idx_70497;\n                        loopres_70520 = r_idx_70498;\n                        loopres_70521 = min_res_65364;\n                    } else {\n                        bool cond_70522 = slt64(abs_res_70510, abs_res_70517);\n                        bool cond_f_res_70523 = min_res_70503 == r_idx_70498;\n                        bool x_70524 = !cond_70522;\n                        bool y_70525 = cond_f_res_70523 && x_70524;\n                        bool cond_70526 = cond_70522 || y_70525;\n                        int64_t loopres_f_res_70527;\n                        \n                        if (cond_70526) {\n                            loopres_f_res_70527 = max_res_70501;\n                        } else {\n                            loopres_f_res_70527 = l_idx_70497;\n                        }\n                        \n                        int64_t loopres_f_res_70528;\n                        \n                        if (cond_70526) {\n                            loopres_f_res_70528 = r_idx_70498;\n                        } else {\n                            loopres_f_res_70528 = min_res_70503;\n                        }\n                        \n                        int64_t loopres_f_res_70529;\n                        \n                        if (cond_70526) {\n                            int64_t loopres_f_res_t_res_70530 =\n                                    add64((int64_t) 1, span_70499);\n                            \n                            loopres_f_res_70529 = loopres_f_res_t_res_70530;\n                        } else {\n                            int64_t loopres_f_res_f_res_70531 =\n                                    add64((int64_t) 1, span_70499);\n                            \n                            loopres_f_res_70529 = loopres_f_res_f_res_70531;\n                    ",
                   "    }\n                        loopres_70519 = loopres_f_res_70527;\n                        loopres_70520 = loopres_f_res_70528;\n                        loopres_70521 = loopres_f_res_70529;\n                    }\n                    \n                    bool loop_cond_70532 = slt64(loopres_70521, min_res_65364);\n                    bool loop_while_tmp_79087 = loop_cond_70532;\n                    int64_t l_idx_tmp_79088 = loopres_70519;\n                    int64_t r_idx_tmp_79089 = loopres_70520;\n                    int64_t span_tmp_79090 = loopres_70521;\n                    \n                    loop_while_70496 = loop_while_tmp_79087;\n                    l_idx_70497 = l_idx_tmp_79088;\n                    r_idx_70498 = r_idx_tmp_79089;\n                    span_70499 = span_tmp_79090;\n                }\n                idx_70492 = loop_while_70496;\n                idx_70493 = l_idx_70497;\n                idx_70494 = r_idx_70498;\n                idx_70495 = span_70499;\n                \n                int64_t min_res_70533 = smin64(min_arg_70455, idx_70493);\n                int64_t max_res_70534 = smax64((int64_t) 0, min_res_70533);\n                int64_t x_70535 = add64(min_res_70456, max_res_70534);\n                int64_t r_70536 = sub64(x_70535, (int64_t) 1);\n                bool x_70537 = sle64((int64_t) 0, r_70536);\n                bool y_70538 = slt64(r_70536, n_65344);\n                bool bounds_check_70539 = x_70537 && y_70538;\n                bool index_certs_70540;\n                \n                if (!bounds_check_70539) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 33) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) r_70536;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n",
                   "                }\n                \n                int64_t x_70541;\n                \n                x_70541 = ((__global int64_t *) color_78168)[phys_tid_70429 +\n                                                             r_70536 *\n                                                             num_threads_78234];\n                \n                int64_t abs_arg_70542 = sub64(x_70541, min_res_70469);\n                int64_t abs_res_70543 = abs64(abs_arg_70542);\n                bool x_70544 = sle64((int64_t) 0, max_res_70534);\n                bool y_70545 = slt64(max_res_70534, n_65344);\n                bool bounds_check_70546 = x_70544 && y_70545;\n                bool index_certs_70547;\n                \n                if (!bounds_check_70546) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 34) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) max_res_70534;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_70548;\n                \n                x_70548 = ((__global int64_t *) color_78168)[phys_tid_70429 +\n                                                             max_res_70534 *\n                                                             num_threads_78234];\n                \n                int64_t abs_arg_70549 = sub64(x_70548, min_res_70469);\n                int64_t abs_res_70550 = abs64(abs_arg_70549);\n                int64_t max_res_70551 = smax64(abs_res_70543, abs_res_70550);\n                float defunc_0_f_res_70552 = sitofp_i64_f32(max_res_70551);\n                float defunc_1_f_res_70553 = max_res_70460 +\n                      defunc_0_f_res_70552;\n                float defunc_2_reduce_res_70554;\n                f",
                   "loat defunc_2_reduce_res_70555;\n                float defunc_2_reduce_res_70556;\n                float defunc_2_reduce_res_70557;\n                float defunc_2_reduce_res_70558;\n                float redout_76898;\n                float redout_76899;\n                float redout_76900;\n                float redout_76901;\n                float redout_76902;\n                \n                redout_76898 = 0.0F;\n                redout_76899 = 0.0F;\n                redout_76900 = 0.0F;\n                redout_76901 = 0.0F;\n                redout_76902 = 0.0F;\n                for (int64_t i_76903 = 0; i_76903 < q_65346; i_76903++) {\n                    float x_70575;\n                    \n                    x_70575 = ((__global float *) color_78166)[phys_tid_70429 +\n                                                               i_76903 *\n                                                               num_threads_78234];\n                    \n                    bool cond_70576 = sle64(last_res_70439, i_76903);\n                    int64_t defunc_0_f_res_70577;\n                    \n                    if (cond_70576) {\n                        defunc_0_f_res_70577 = (int64_t) 0;\n                    } else {\n                        int64_t i_70578 = add64(max_res_70534, i_76903);\n                        int64_t defunc_0_add_arg_70579;\n                        \n                        defunc_0_add_arg_70579 = ((__global\n                                                   int64_t *) color_78168)[phys_tid_70429 +\n                                                                           i_70578 *\n                                                                           num_threads_78234];\n                        \n                        int64_t defunc_1_add_res_70580 = add64((int64_t) 1,\n                                                               defunc_0_add_arg_70579);\n                        \n                        defunc_0_f_res_70577 = defunc_1_add_res_70580;\n             ",
                   "       }\n                    \n                    int64_t binop_p_70581 = sub64(defunc_0_f_res_70577,\n                                                  min_res_70469);\n                    float defunc_0_f_res_70582 = sitofp_i64_f32(binop_p_70581);\n                    float abs_res_70583 = (float) fabs(defunc_0_f_res_70582);\n                    float tmp1_70584 = abs_res_70583 / defunc_1_f_res_70553;\n                    float x_70585 = tmp1_70584 * tmp1_70584;\n                    float y_70586 = tmp1_70584 * x_70585;\n                    float tmp2_70587 = 1.0F - y_70586;\n                    float x_70588 = tmp2_70587 * tmp2_70587;\n                    float tmp3_70589 = tmp2_70587 * x_70588;\n                    float w_j_70590 = x_70575 * tmp3_70589;\n                    float xw_j_70591 = defunc_0_f_res_70582 * w_j_70590;\n                    float x2w_j_70592 = defunc_0_f_res_70582 * xw_j_70591;\n                    float x3w_j_70593 = defunc_0_f_res_70582 * x2w_j_70592;\n                    float x4w_j_70594 = defunc_0_f_res_70582 * x3w_j_70593;\n                    float defunc_1_op_res_70561 = w_j_70590 + redout_76898;\n                    float defunc_1_op_res_70564 = xw_j_70591 + redout_76899;\n                    float defunc_1_op_res_70567 = x2w_j_70592 + redout_76900;\n                    float defunc_1_op_res_70570 = x3w_j_70593 + redout_76901;\n                    float defunc_1_op_res_70573 = x4w_j_70594 + redout_76902;\n                    float redout_tmp_79091 = defunc_1_op_res_70561;\n                    float redout_tmp_79092 = defunc_1_op_res_70564;\n                    float redout_tmp_79093 = defunc_1_op_res_70567;\n                    float redout_tmp_79094 = defunc_1_op_res_70570;\n                    float redout_tmp_79095 = defunc_1_op_res_70573;\n                    \n                    redout_76898 = redout_tmp_79091;\n                    redout_76899 = redout_tmp_79092;\n                    redout_76900 = redout_tmp_79093;\n                    redout_76901 =",
                   " redout_tmp_79094;\n                    redout_76902 = redout_tmp_79095;\n                }\n                defunc_2_reduce_res_70554 = redout_76898;\n                defunc_2_reduce_res_70555 = redout_76899;\n                defunc_2_reduce_res_70556 = redout_76900;\n                defunc_2_reduce_res_70557 = redout_76901;\n                defunc_2_reduce_res_70558 = redout_76902;\n                \n                float x_70595 = defunc_2_reduce_res_70556 *\n                      defunc_2_reduce_res_70558;\n                float y_70596 = defunc_2_reduce_res_70557 *\n                      defunc_2_reduce_res_70557;\n                float a12_70597 = x_70595 - y_70596;\n                float x_70598 = defunc_2_reduce_res_70556 *\n                      defunc_2_reduce_res_70557;\n                float y_70599 = defunc_2_reduce_res_70555 *\n                      defunc_2_reduce_res_70558;\n                float b12_70600 = x_70598 - y_70599;\n                float x_70601 = defunc_2_reduce_res_70555 *\n                      defunc_2_reduce_res_70557;\n                float y_70602 = defunc_2_reduce_res_70556 *\n                      defunc_2_reduce_res_70556;\n                float c12_70603 = x_70601 - y_70602;\n                float x_70604 = defunc_2_reduce_res_70554 *\n                      defunc_2_reduce_res_70558;\n                float b2_70605 = x_70604 - y_70602;\n                float x_70606 = defunc_2_reduce_res_70555 *\n                      defunc_2_reduce_res_70556;\n                float y_70607 = defunc_2_reduce_res_70554 *\n                      defunc_2_reduce_res_70557;\n                float c2_70608 = x_70606 - y_70607;\n                float x_70609 = defunc_2_reduce_res_70554 * a12_70597;\n                float y_70610 = defunc_2_reduce_res_70555 * b12_70600;\n                float x_70611 = x_70609 + y_70610;\n                float y_70612 = defunc_2_reduce_res_70556 * c12_70603;\n                float y_70613 = x_70611 + y_70612;\n                float det_70614 = 1.0F / y_7",
                   "0613;\n                float a12_70615 = a12_70597 * det_70614;\n                float b12_70616 = b12_70600 * det_70614;\n                float c12_70617 = c12_70603 * det_70614;\n                float b2_70618 = b2_70605 * det_70614;\n                float c2_70619 = c2_70608 * det_70614;\n                float defunc_2_reduce_res_70620;\n                float defunc_2_reduce_res_70621;\n                float redout_76904;\n                float redout_76905;\n                \n                redout_76904 = 0.0F;\n                redout_76905 = 0.0F;\n                for (int64_t i_76906 = 0; i_76906 < q_65346; i_76906++) {\n                    float x_70629;\n                    \n                    x_70629 = ((__global float *) color_78166)[phys_tid_70429 +\n                                                               i_76906 *\n                                                               num_threads_78234];\n                    \n                    bool cond_70630 = sle64(last_res_70439, i_76906);\n                    int64_t defunc_0_f_res_70631;\n                    \n                    if (cond_70630) {\n                        defunc_0_f_res_70631 = (int64_t) 0;\n                    } else {\n                        int64_t i_70632 = add64(max_res_70534, i_76906);\n                        int64_t defunc_0_add_arg_70633;\n                        \n                        defunc_0_add_arg_70633 = ((__global\n                                                   int64_t *) color_78168)[phys_tid_70429 +\n                                                                           i_70632 *\n                                                                           num_threads_78234];\n                        \n                        int64_t defunc_1_add_res_70634 = add64((int64_t) 1,\n                                                               defunc_0_add_arg_70633);\n                        \n                        defunc_0_f_res_70631 = defunc_1_add_res_70634;\n                    }\n    ",
                   "                \n                    int64_t binop_p_70635 = sub64(defunc_0_f_res_70631,\n                                                  min_res_70469);\n                    float defunc_0_f_res_70636 = sitofp_i64_f32(binop_p_70635);\n                    float abs_res_70637 = (float) fabs(defunc_0_f_res_70636);\n                    float tmp1_70638 = abs_res_70637 / defunc_1_f_res_70553;\n                    float x_70639 = tmp1_70638 * tmp1_70638;\n                    float y_70640 = tmp1_70638 * x_70639;\n                    float tmp2_70641 = 1.0F - y_70640;\n                    float x_70642 = tmp2_70641 * tmp2_70641;\n                    float tmp3_70643 = tmp2_70641 * x_70642;\n                    float tmp4_70644 = x_70629 * tmp3_70643;\n                    float defunc_1_f_res_70645 = defunc_0_f_res_70636 *\n                          tmp4_70644;\n                    float defunc_1_f_res_70646 = defunc_0_f_res_70636 *\n                          defunc_1_f_res_70645;\n                    float defunc_0_f_res_70647;\n                    \n                    if (cond_70630) {\n                        defunc_0_f_res_70647 = 0.0F;\n                    } else {\n                        int64_t i_70648 = add64(max_res_70534, i_76906);\n                        float defunc_0_add_arg_70649;\n                        \n                        defunc_0_add_arg_70649 = ((__global\n                                                   float *) color_78169)[phys_tid_70429 +\n                                                                         i_70648 *\n                                                                         num_threads_78234];\n                        defunc_0_f_res_70647 = defunc_0_add_arg_70649;\n                    }\n                    \n                    float x_70650 = a12_70615 * tmp4_70644;\n                    float y_70651 = b12_70616 * defunc_1_f_res_70645;\n                    float x_70652 = x_70650 + y_70651;\n                    float y_70653 = c12_70617 * defunc_1_",
                   "f_res_70646;\n                    float x_70654 = x_70652 + y_70653;\n                    float defunc_9_fit_fun_res_70655 = defunc_0_f_res_70647 *\n                          x_70654;\n                    float x_70656 = b12_70616 * tmp4_70644;\n                    float y_70657 = b2_70618 * defunc_1_f_res_70645;\n                    float x_70658 = x_70656 + y_70657;\n                    float y_70659 = c2_70619 * defunc_1_f_res_70646;\n                    float x_70660 = x_70658 + y_70659;\n                    float defunc_9_slope_fun_res_70661 = defunc_0_f_res_70647 *\n                          x_70660;\n                    float defunc_1_op_res_70624 = defunc_9_fit_fun_res_70655 +\n                          redout_76904;\n                    float defunc_1_op_res_70627 = defunc_9_slope_fun_res_70661 +\n                          redout_76905;\n                    float redout_tmp_79096 = defunc_1_op_res_70624;\n                    float redout_tmp_79097 = defunc_1_op_res_70627;\n                    \n                    redout_76904 = redout_tmp_79096;\n                    redout_76905 = redout_tmp_79097;\n                }\n                defunc_2_reduce_res_70620 = redout_76904;\n                defunc_2_reduce_res_70621 = redout_76905;\n                ((__global float *) color_78165)[phys_tid_70429 + i_76895 *\n                                                 num_threads_78234] =\n                    defunc_2_reduce_res_70620;\n                ((__global float *) color_78164)[phys_tid_70429 + i_76895 *\n                                                 num_threads_78234] =\n                    defunc_2_reduce_res_70621;\n            }\n            for (int64_t i_79098 = 0; i_79098 < n_m_65352; i_79098++) {\n                float tmp_79099;\n                \n                tmp_79099 = ((__global float *) color_78165)[phys_tid_70429 +\n                                                             i_79098 *\n                                                             num_threads_78234];\n       ",
                   "         ((__global float *) mem_77600)[gtid_70428 + i_79098 * m_65343] =\n                    tmp_79099;\n            }\n            for (int64_t i_79100 = 0; i_79100 < n_m_65352; i_79100++) {\n                float tmp_79101;\n                \n                tmp_79101 = ((__global float *) color_78164)[phys_tid_70429 +\n                                                             i_79100 *\n                                                             num_threads_78234];\n                ((__global float *) mem_77603)[gtid_70428 + i_79100 * m_65343] =\n                    tmp_79101;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_70423\n}\n__kernel void mainzisegmap_71733(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *Y_mem_76976, __global\n                                 unsigned char *mem_77608, __global\n                                 unsigned char *mem_77612, __global\n                                 unsigned char *mem_77616)\n{\n    #define segmap_group_sizze_71727 (mainzisegmap_group_sizze_71568)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79167;\n    int32_t local_tid_79168;\n    int64_t group_sizze_79171;\n    int32_t wave_sizze_79170;\n    int32_t group_tid_79169;\n    \n    global_tid_79167 = get_global_id(0);\n    local_tid_79168 = get_local_id(0);\n    group_sizze_79171 = get_local_size(0);\n    wave_sizze_79170 = LOCKSTEP_WIDTH;\n    group_tid_79169 = get_group_id(0);\n    \n    int32_t phys_tid_71733 = global_tid_79167;\n    int64_t global_tid_79172 = sext_i32_i64(group_tid_79169) *\n            segmap_group_sizze_71727 + sext_i32_i64(local_tid_79168);\n    int64_t slice_79173 = n_65344;\n    int64_t slice_79174 = m_65343 * slice_79173;\n    int64",
                   "_t gtid_71731 = squot64(global_tid_79172, slice_79173);\n    int64_t remnant_79175 = global_tid_79172 - gtid_71731 * slice_79173;\n    int64_t gtid_71732 = remnant_79175;\n    int64_t remnant_79176 = remnant_79175 - gtid_71732;\n    \n    if (slt64(gtid_71731, m_65343) && slt64(gtid_71732, n_65344)) {\n        float x_71734;\n        \n        x_71734 = ((__global float *) Y_mem_76976)[gtid_71731 * n_65344 +\n                                                   gtid_71732];\n        \n        bool isnan_res_71737;\n        \n        isnan_res_71737 = futrts_isnan32(x_71734);\n        \n        bool defunc_0_p_res_71738 = !isnan_res_71737;\n        int64_t defunc_1_f_res_71739;\n        \n        if (defunc_0_p_res_71738) {\n            int64_t x_71735;\n            \n            x_71735 = ((__global int64_t *) mem_77608)[gtid_71731 * n_65344 +\n                                                       gtid_71732];\n            \n            int64_t defunc_1_f_res_t_res_71740 = sub64(x_71735, (int64_t) 1);\n            \n            defunc_1_f_res_71739 = defunc_1_f_res_t_res_71740;\n        } else {\n            defunc_1_f_res_71739 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_71731) && slt64(gtid_71731, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_71739) &&\n             slt64(defunc_1_f_res_71739, n_65344))) {\n            ((__global int64_t *) mem_77616)[gtid_71731 * n_65344 +\n                                             defunc_1_f_res_71739] = gtid_71732;\n        }\n        if ((sle64((int64_t) 0, gtid_71731) && slt64(gtid_71731, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_71739) &&\n             slt64(defunc_1_f_res_71739, n_65344))) {\n            ((__global float *) mem_77612)[gtid_71731 * n_65344 +\n                                           defunc_1_f_res_71739] = x_71734;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_71727\n}\n__kernel void mainzisegmap_71752(__global int *global_failure, int64_t m_65343,\n               ",
                   "                  int64_t n_65344, __global\n                                 unsigned char *mem_77616, __global\n                                 unsigned char *mem_77622)\n{\n    #define segmap_group_sizze_71747 (mainzisegmap_group_sizze_71542)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79177;\n    int32_t local_tid_79178;\n    int64_t group_sizze_79181;\n    int32_t wave_sizze_79180;\n    int32_t group_tid_79179;\n    \n    global_tid_79177 = get_global_id(0);\n    local_tid_79178 = get_local_id(0);\n    group_sizze_79181 = get_local_size(0);\n    wave_sizze_79180 = LOCKSTEP_WIDTH;\n    group_tid_79179 = get_group_id(0);\n    \n    int32_t phys_tid_71752 = global_tid_79177;\n    int64_t global_tid_79182 = sext_i32_i64(group_tid_79179) *\n            segmap_group_sizze_71747 + sext_i32_i64(local_tid_79178);\n    int64_t slice_79183 = n_65344;\n    int64_t slice_79184 = m_65343 * slice_79183;\n    int64_t gtid_71750 = squot64(global_tid_79182, slice_79183);\n    int64_t remnant_79185 = global_tid_79182 - gtid_71750 * slice_79183;\n    int64_t gtid_71751 = remnant_79185;\n    int64_t remnant_79186 = remnant_79185 - gtid_71751;\n    \n    if (slt64(gtid_71750, m_65343) && slt64(gtid_71751, n_65344)) {\n        int64_t x_71753;\n        \n        x_71753 = ((__global int64_t *) mem_77616)[gtid_71750 * n_65344 +\n                                                   gtid_71751];\n        \n        int64_t defunc_0_f_res_71754 = add64((int64_t) 1, x_71753);\n        \n        ((__global int64_t *) mem_77622)[gtid_71750 * n_65344 + gtid_71751] =\n            defunc_0_f_res_71754;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_71747\n}\n__kernel void mainzisegmap_71764(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, int64_t min_res_65364,\n             ",
                   "                    float i64_res_65370, __global\n                                 unsigned char *mem_77608, __global\n                                 unsigned char *mem_77626, __global\n                                 unsigned char *mem_77629, __global\n                                 unsigned char *mem_77632, __global\n                                 unsigned char *mem_77635)\n{\n    #define segmap_group_sizze_71757 (mainzisegmap_group_sizze_71516)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79187;\n    int32_t local_tid_79188;\n    int64_t group_sizze_79191;\n    int32_t wave_sizze_79190;\n    int32_t group_tid_79189;\n    \n    global_tid_79187 = get_global_id(0);\n    local_tid_79188 = get_local_id(0);\n    group_sizze_79191 = get_local_size(0);\n    wave_sizze_79190 = LOCKSTEP_WIDTH;\n    group_tid_79189 = get_group_id(0);\n    \n    int32_t phys_tid_71764 = global_tid_79187;\n    int64_t global_tid_79192 = sext_i32_i64(group_tid_79189) *\n            segmap_group_sizze_71757 + sext_i32_i64(local_tid_79188);\n    int64_t slice_79193 = m_65343;\n    int64_t gtid_71763 = global_tid_79192;\n    int64_t remnant_79194 = global_tid_79192 - gtid_71763;\n    \n    if (slt64(gtid_71763, m_65343)) {\n        int64_t last_res_71765;\n        \n        last_res_71765 = ((__global int64_t *) mem_77608)[gtid_71763 * n_65344 +\n                                                          i_65358];\n        \n        int64_t min_arg_71766 = sub64(last_res_71765, (int64_t) 1);\n        int64_t min_arg_71767 = sub64(last_res_71765, min_res_65364);\n        int64_t min_res_71768 = smin64(q_65346, last_res_71765);\n        float i64_res_71769 = sitofp_i64_f32(last_res_71765);\n        float x_71770 = i64_res_65370 - i64_res_71769;\n        float max_arg_71771 = x_71770 / 2.0F;\n        float max_res_71772 = fmax32(0.0F, max_arg_71771);\n        \n        ((__global int64_t *) mem_77626)[gt",
                   "id_71763] = min_arg_71766;\n        ((__global int64_t *) mem_77629)[gtid_71763] = min_arg_71767;\n        ((__global int64_t *) mem_77632)[gtid_71763] = min_res_71768;\n        ((__global float *) mem_77635)[gtid_71763] = max_res_71772;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_71757\n}\n__kernel void mainzisegmap_71784(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, __global\n                                 unsigned char *mem_77608, __global\n                                 unsigned char *mem_77640)\n{\n    #define segmap_group_sizze_71779 (mainzisegmap_group_sizze_71491)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79195;\n    int32_t local_tid_79196;\n    int64_t group_sizze_79199;\n    int32_t wave_sizze_79198;\n    int32_t group_tid_79197;\n    \n    global_tid_79195 = get_global_id(0);\n    local_tid_79196 = get_local_id(0);\n    group_sizze_79199 = get_local_size(0);\n    wave_sizze_79198 = LOCKSTEP_WIDTH;\n    group_tid_79197 = get_group_id(0);\n    \n    int32_t phys_tid_71784 = global_tid_79195;\n    int64_t global_tid_79200 = sext_i32_i64(group_tid_79197) *\n            segmap_group_sizze_71779 + sext_i32_i64(local_tid_79196);\n    int64_t slice_79201 = q_65346;\n    int64_t slice_79202 = m_65343 * slice_79201;\n    int64_t gtid_71782 = squot64(global_tid_79200, slice_79201);\n    int64_t remnant_79203 = global_tid_79200 - gtid_71782 * slice_79201;\n    int64_t gtid_71783 = remnant_79203;\n    int64_t remnant_79204 = remnant_79203 - gtid_71783;\n    \n    if (slt64(gtid_71782, m_65343) && slt64(gtid_71783, q_65346)) {\n        int64_t last_res_71785;\n        \n        last_res_71785 = ((__global int64_t *) mem_77608)[gtid_71782 * n_65344 +\n                                                          i_65358];\n        \n       ",
                   " bool cond_71787 = sle64(last_res_71785, gtid_71783);\n        float defunc_0_f_res_71788;\n        \n        if (cond_71787) {\n            defunc_0_f_res_71788 = 0.0F;\n        } else {\n            defunc_0_f_res_71788 = 1.0F;\n        }\n        ((__global float *) mem_77640)[gtid_71782 * q_65346 + gtid_71783] =\n            defunc_0_f_res_71788;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_71779\n}\n__kernel void mainzisegmap_72017(__global int *global_failure,\n                                 int failure_is_an_option, __global\n                                 int64_t *global_failure_args, int64_t m_65343,\n                                 int64_t n_65344, int64_t jump_65348,\n                                 int64_t n_m_65352, int64_t i_65358,\n                                 unsigned char x_65359_bits,\n                                 int64_t min_res_65364,\n                                 unsigned char loop_cond_65369_bits, __global\n                                 unsigned char *mem_77616, __global\n                                 unsigned char *mem_77622, __global\n                                 unsigned char *mem_77626, __global\n                                 unsigned char *mem_77629, __global\n                                 unsigned char *mem_77632, __global\n                                 unsigned char *mem_77635, __global\n                                 unsigned char *mem_77747, __global\n                                 unsigned char *mem_77751, __global\n                                 unsigned char *mem_77755)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    \n    #define segmap_group_sizze_72010 (mainzisegmap_group_sizze_71100)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79275;\n    int32_t local_tid_79276;\n    int64_t group_sizze_79279;\n    int32_t wave_sizze_79278;\n    in",
                   "t32_t group_tid_79277;\n    \n    global_tid_79275 = get_global_id(0);\n    local_tid_79276 = get_local_id(0);\n    group_sizze_79279 = get_local_size(0);\n    wave_sizze_79278 = LOCKSTEP_WIDTH;\n    group_tid_79277 = get_group_id(0);\n    \n    int32_t phys_tid_72017 = global_tid_79275;\n    int64_t global_tid_79280 = sext_i32_i64(group_tid_79277) *\n            segmap_group_sizze_72010 + sext_i32_i64(local_tid_79276);\n    int64_t slice_79281 = n_m_65352;\n    int64_t slice_79282 = m_65343 * slice_79281;\n    int64_t gtid_72015 = squot64(global_tid_79280, slice_79281);\n    int64_t remnant_79283 = global_tid_79280 - gtid_72015 * slice_79281;\n    int64_t gtid_72016 = remnant_79283;\n    int64_t remnant_79284 = remnant_79283 - gtid_72016;\n    \n    if (slt64(gtid_72015, m_65343) && slt64(gtid_72016, n_m_65352)) {\n        int64_t min_arg_72020;\n        \n        min_arg_72020 = ((__global int64_t *) mem_77626)[gtid_72015];\n        \n        int64_t min_arg_72021;\n        \n        min_arg_72021 = ((__global int64_t *) mem_77629)[gtid_72015];\n        \n        int64_t min_res_72022;\n        \n        min_res_72022 = ((__global int64_t *) mem_77632)[gtid_72015];\n        \n        float max_res_72023;\n        \n        max_res_72023 = ((__global float *) mem_77635)[gtid_72015];\n        \n        int64_t min_arg_72025 = mul64(jump_65348, gtid_72016);\n        int64_t min_res_72026 = smin64(i_65358, min_arg_72025);\n        int64_t defunc_0_g_res_72027 = add64((int64_t) 1, min_res_72026);\n        bool init_idx_72028;\n        int64_t init_idx_72029;\n        int64_t init_idx_72030;\n        bool loop_while_72031;\n        int64_t low_72032;\n        int64_t high_72033;\n        \n        loop_while_72031 = x_65359;\n        low_72032 = (int64_t) 0;\n        high_72033 = i_65358;\n        while (loop_while_72031) {\n            int64_t x_72034 = add64(low_72032, high_72033);\n            int64_t mid_72035 = sdiv64(x_72034, (int64_t) 2);\n            bool x_72036 = sle64((int64_t) 0, mid_72035);\n            bool",
                   " y_72037 = slt64(mid_72035, n_65344);\n            bool bounds_check_72038 = x_72036 && y_72037;\n            bool index_certs_72039;\n            \n            if (!bounds_check_72038) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 40) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) mid_72035;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t mid_id_72040;\n            \n            mid_id_72040 = ((__global int64_t *) mem_77622)[gtid_72015 *\n                                                            n_65344 +\n                                                            mid_72035];\n            \n            bool cond_72041 = slt64(mid_id_72040, (int64_t) 0);\n            int64_t mid_idx_72042;\n            \n            if (cond_72041) {\n                mid_idx_72042 = (int64_t) 9223372036854775807;\n            } else {\n                mid_idx_72042 = mid_id_72040;\n            }\n            \n            bool cond_72043 = sle64(defunc_0_g_res_72027, mid_idx_72042);\n            int64_t loopres_72044;\n            int64_t loopres_72045;\n            \n            if (cond_72043) {\n                int64_t loopres_t_res_72046 = sub64(mid_72035, (int64_t) 1);\n                \n                loopres_72044 = low_72032;\n                loopres_72045 = loopres_t_res_72046;\n            } else {\n                int64_t loopres_f_res_72047 = add64((int64_t) 1, mid_72035);\n                \n                loopres_72044 = loopres_f_res_72047;\n                loopres_72045 = high_72033;\n            }\n            \n            bool loop_cond_72048 = sle64(loopres_72044, loopres_72045);\n            bool loop_while_tmp_79285 = loop_cond_72048;\n            int64_t low_tmp_79286 = loopres_72044;\n            int64_t high_tmp_79287 = loopres_72045;\n          ",
                   "  \n            loop_while_72031 = loop_while_tmp_79285;\n            low_72032 = low_tmp_79286;\n            high_72033 = high_tmp_79287;\n        }\n        init_idx_72028 = loop_while_72031;\n        init_idx_72029 = low_72032;\n        init_idx_72030 = high_72033;\n        \n        bool idx_72049;\n        int64_t idx_72050;\n        int64_t idx_72051;\n        int64_t idx_72052;\n        bool loop_while_72053;\n        int64_t l_idx_72054;\n        int64_t r_idx_72055;\n        int64_t span_72056;\n        \n        loop_while_72053 = loop_cond_65369;\n        l_idx_72054 = init_idx_72029;\n        r_idx_72055 = init_idx_72029;\n        span_72056 = (int64_t) 1;\n        while (loop_while_72053) {\n            int64_t max_arg_72057 = sub64(l_idx_72054, (int64_t) 1);\n            int64_t max_res_72058 = smax64((int64_t) 0, max_arg_72057);\n            int64_t min_arg_72059 = add64((int64_t) 1, r_idx_72055);\n            int64_t min_res_72060 = smin64(min_arg_72020, min_arg_72059);\n            bool x_72061 = sle64((int64_t) 0, max_res_72058);\n            bool y_72062 = slt64(max_res_72058, n_65344);\n            bool bounds_check_72063 = x_72061 && y_72062;\n            bool index_certs_72064;\n            \n            if (!bounds_check_72063) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 41) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_72058;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_72065;\n            \n            x_72065 = ((__global int64_t *) mem_77622)[gtid_72015 * n_65344 +\n                                                       max_res_72058];\n            \n            int64_t abs_arg_72066 = sub64(x_72065, defunc_0_g_res_72027);\n            int64_t abs_res_72067 = abs64(abs_arg_72066);\n            bool x_72068 = sle64((i",
                   "nt64_t) 0, min_res_72060);\n            bool y_72069 = slt64(min_res_72060, n_65344);\n            bool bounds_check_72070 = x_72068 && y_72069;\n            bool index_certs_72071;\n            \n            if (!bounds_check_72070) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 42) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) min_res_72060;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_72072;\n            \n            x_72072 = ((__global int64_t *) mem_77622)[gtid_72015 * n_65344 +\n                                                       min_res_72060];\n            \n            int64_t abs_arg_72073 = sub64(x_72072, defunc_0_g_res_72027);\n            int64_t abs_res_72074 = abs64(abs_arg_72073);\n            bool cond_72075 = max_res_72058 == l_idx_72054;\n            int64_t loopres_72076;\n            int64_t loopres_72077;\n            int64_t loopres_72078;\n            \n            if (cond_72075) {\n                loopres_72076 = l_idx_72054;\n                loopres_72077 = r_idx_72055;\n                loopres_72078 = min_res_65364;\n            } else {\n                bool cond_72079 = slt64(abs_res_72067, abs_res_72074);\n                bool cond_f_res_72080 = min_res_72060 == r_idx_72055;\n                bool x_72081 = !cond_72079;\n                bool y_72082 = cond_f_res_72080 && x_72081;\n                bool cond_72083 = cond_72079 || y_72082;\n                int64_t loopres_f_res_72084;\n                \n                if (cond_72083) {\n                    loopres_f_res_72084 = max_res_72058;\n                } else {\n                    loopres_f_res_72084 = l_idx_72054;\n                }\n                \n                int64_t loopres_f_res_72085;\n                \n                if (cond_72083) {\n             ",
                   "       loopres_f_res_72085 = r_idx_72055;\n                } else {\n                    loopres_f_res_72085 = min_res_72060;\n                }\n                \n                int64_t loopres_f_res_72086;\n                \n                if (cond_72083) {\n                    int64_t loopres_f_res_t_res_72087 = add64((int64_t) 1,\n                                                              span_72056);\n                    \n                    loopres_f_res_72086 = loopres_f_res_t_res_72087;\n                } else {\n                    int64_t loopres_f_res_f_res_72088 = add64((int64_t) 1,\n                                                              span_72056);\n                    \n                    loopres_f_res_72086 = loopres_f_res_f_res_72088;\n                }\n                loopres_72076 = loopres_f_res_72084;\n                loopres_72077 = loopres_f_res_72085;\n                loopres_72078 = loopres_f_res_72086;\n            }\n            \n            bool loop_cond_72089 = slt64(loopres_72078, min_res_65364);\n            bool loop_while_tmp_79288 = loop_cond_72089;\n            int64_t l_idx_tmp_79289 = loopres_72076;\n            int64_t r_idx_tmp_79290 = loopres_72077;\n            int64_t span_tmp_79291 = loopres_72078;\n            \n            loop_while_72053 = loop_while_tmp_79288;\n            l_idx_72054 = l_idx_tmp_79289;\n            r_idx_72055 = r_idx_tmp_79290;\n            span_72056 = span_tmp_79291;\n        }\n        idx_72049 = loop_while_72053;\n        idx_72050 = l_idx_72054;\n        idx_72051 = r_idx_72055;\n        idx_72052 = span_72056;\n        \n        int64_t min_res_72090 = smin64(min_arg_72021, idx_72050);\n        int64_t max_res_72091 = smax64((int64_t) 0, min_res_72090);\n        int64_t x_72092 = add64(min_res_72022, max_res_72091);\n        int64_t r_72093 = sub64(x_72092, (int64_t) 1);\n        bool x_72094 = sle64((int64_t) 0, r_72093);\n        bool y_72095 = slt64(r_72093, n_65344);\n        bool bounds_check_72096 = x_72094 && y_72",
                   "095;\n        bool index_certs_72097;\n        \n        if (!bounds_check_72096) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 43) == -1) {\n                    global_failure_args[0] = (int64_t) r_72093;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_72098;\n        \n        x_72098 = ((__global int64_t *) mem_77616)[gtid_72015 * n_65344 +\n                                                   r_72093];\n        \n        int64_t abs_arg_72099 = sub64(x_72098, min_res_72026);\n        int64_t abs_res_72100 = abs64(abs_arg_72099);\n        bool x_72101 = sle64((int64_t) 0, max_res_72091);\n        bool y_72102 = slt64(max_res_72091, n_65344);\n        bool bounds_check_72103 = x_72101 && y_72102;\n        bool index_certs_72104;\n        \n        if (!bounds_check_72103) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 44) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_72091;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_72105;\n        \n        x_72105 = ((__global int64_t *) mem_77616)[gtid_72015 * n_65344 +\n                                                   max_res_72091];\n        \n        int64_t abs_arg_72106 = sub64(x_72105, min_res_72026);\n        int64_t abs_res_72107 = abs64(abs_arg_72106);\n        int64_t max_res_72108 = smax64(abs_res_72100, abs_res_72107);\n        float defunc_0_f_res_72109 = sitofp_i64_f32(max_res_72108);\n        float defunc_1_f_res_72110 = max_res_72023 + defunc_0_f_res_72109;\n        \n        ((__global int64_t *) mem_77747)[gtid_72015 * n_m_65352 + gtid_72016] =\n            min_res_72026;\n        ((__global int64_t *) mem_77751)[gtid_72015 * n_m_65352 + gtid_72016] =\n            max_res_72091;\n   ",
                   "     ((__global float *) mem_77755)[gtid_72015 * n_m_65352 + gtid_72016] =\n            defunc_1_f_res_72110;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_72010\n}\n__kernel void mainzisegmap_72182(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_m_65352, __global\n                                 unsigned char *mem_77760, __global\n                                 unsigned char *mem_77764, __global\n                                 unsigned char *mem_77768, __global\n                                 unsigned char *mem_77772, __global\n                                 unsigned char *mem_77776, __global\n                                 unsigned char *mem_77781, __global\n                                 unsigned char *mem_77785, __global\n                                 unsigned char *mem_77789, __global\n                                 unsigned char *mem_77793, __global\n                                 unsigned char *mem_77797)\n{\n    #define segmap_group_sizze_72173 (mainzisegmap_group_sizze_70998)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79420;\n    int32_t local_tid_79421;\n    int64_t group_sizze_79424;\n    int32_t wave_sizze_79423;\n    int32_t group_tid_79422;\n    \n    global_tid_79420 = get_global_id(0);\n    local_tid_79421 = get_local_id(0);\n    group_sizze_79424 = get_local_size(0);\n    wave_sizze_79423 = LOCKSTEP_WIDTH;\n    group_tid_79422 = get_group_id(0);\n    \n    int32_t phys_tid_72182 = global_tid_79420;\n    int64_t global_tid_79425 = sext_i32_i64(group_tid_79422) *\n            segmap_group_sizze_72173 + sext_i32_i64(local_tid_79421);\n    int64_t slice_79426 = n_m_65352;\n    int64_t slice_79427 = m_65343 * slice_79426;\n    int64_t gtid_72180 = squot64(global_tid_79425, slice_79426);\n    int64_t remnant_79428 = global_tid_79425 - gtid_72180 * slice_79426;\n    int64_t gtid_721",
                   "81 = remnant_79428;\n    int64_t remnant_79429 = remnant_79428 - gtid_72181;\n    \n    if (slt64(gtid_72180, m_65343) && slt64(gtid_72181, n_m_65352)) {\n        float defunc_2_reduce_res_72183;\n        \n        defunc_2_reduce_res_72183 = ((__global float *) mem_77760)[gtid_72180 *\n                                                                   n_m_65352 +\n                                                                   gtid_72181];\n        \n        float defunc_2_reduce_res_72184;\n        \n        defunc_2_reduce_res_72184 = ((__global float *) mem_77764)[gtid_72180 *\n                                                                   n_m_65352 +\n                                                                   gtid_72181];\n        \n        float defunc_2_reduce_res_72185;\n        \n        defunc_2_reduce_res_72185 = ((__global float *) mem_77768)[gtid_72180 *\n                                                                   n_m_65352 +\n                                                                   gtid_72181];\n        \n        float defunc_2_reduce_res_72186;\n        \n        defunc_2_reduce_res_72186 = ((__global float *) mem_77772)[gtid_72180 *\n                                                                   n_m_65352 +\n                                                                   gtid_72181];\n        \n        float defunc_2_reduce_res_72187;\n        \n        defunc_2_reduce_res_72187 = ((__global float *) mem_77776)[gtid_72180 *\n                                                                   n_m_65352 +\n                                                                   gtid_72181];\n        \n        float x_72188 = defunc_2_reduce_res_72185 * defunc_2_reduce_res_72187;\n        float y_72189 = defunc_2_reduce_res_72186 * defunc_2_reduce_res_72186;\n        float a12_72190 = x_72188 - y_72189;\n        float x_72191 = defunc_2_reduce_res_72185 * defunc_2_reduce_res_72186;\n        float y_72192 = defunc_2_reduce_res_72184 * defunc_2_reduce_res_72187",
                   ";\n        float b12_72193 = x_72191 - y_72192;\n        float x_72194 = defunc_2_reduce_res_72184 * defunc_2_reduce_res_72186;\n        float y_72195 = defunc_2_reduce_res_72185 * defunc_2_reduce_res_72185;\n        float c12_72196 = x_72194 - y_72195;\n        float x_72197 = defunc_2_reduce_res_72183 * defunc_2_reduce_res_72187;\n        float b2_72198 = x_72197 - y_72195;\n        float x_72199 = defunc_2_reduce_res_72184 * defunc_2_reduce_res_72185;\n        float y_72200 = defunc_2_reduce_res_72183 * defunc_2_reduce_res_72186;\n        float c2_72201 = x_72199 - y_72200;\n        float x_72202 = defunc_2_reduce_res_72183 * a12_72190;\n        float y_72203 = defunc_2_reduce_res_72184 * b12_72193;\n        float x_72204 = x_72202 + y_72203;\n        float y_72205 = defunc_2_reduce_res_72185 * c12_72196;\n        float y_72206 = x_72204 + y_72205;\n        float det_72207 = 1.0F / y_72206;\n        float a12_72208 = a12_72190 * det_72207;\n        float b12_72209 = b12_72193 * det_72207;\n        float c12_72210 = c12_72196 * det_72207;\n        float b2_72211 = b2_72198 * det_72207;\n        float c2_72212 = c2_72201 * det_72207;\n        \n        ((__global float *) mem_77781)[gtid_72180 * n_m_65352 + gtid_72181] =\n            a12_72208;\n        ((__global float *) mem_77785)[gtid_72180 * n_m_65352 + gtid_72181] =\n            b12_72209;\n        ((__global float *) mem_77789)[gtid_72180 * n_m_65352 + gtid_72181] =\n            c12_72210;\n        ((__global float *) mem_77793)[gtid_72180 * n_m_65352 + gtid_72181] =\n            b2_72211;\n        ((__global float *) mem_77797)[gtid_72180 * n_m_65352 + gtid_72181] =\n            c2_72212;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_72173\n}\n__kernel void mainzisegmap_72718(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *Y_mem_76976, __global\n                                 unsigned char *mem_77833, __global\n      ",
                   "                           unsigned char *mem_77837, __global\n                                 unsigned char *mem_77841)\n{\n    #define segmap_group_sizze_72712 (mainzisegmap_group_sizze_72553)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79584;\n    int32_t local_tid_79585;\n    int64_t group_sizze_79588;\n    int32_t wave_sizze_79587;\n    int32_t group_tid_79586;\n    \n    global_tid_79584 = get_global_id(0);\n    local_tid_79585 = get_local_id(0);\n    group_sizze_79588 = get_local_size(0);\n    wave_sizze_79587 = LOCKSTEP_WIDTH;\n    group_tid_79586 = get_group_id(0);\n    \n    int32_t phys_tid_72718 = global_tid_79584;\n    int64_t global_tid_79589 = sext_i32_i64(group_tid_79586) *\n            segmap_group_sizze_72712 + sext_i32_i64(local_tid_79585);\n    int64_t slice_79590 = n_65344;\n    int64_t slice_79591 = m_65343 * slice_79590;\n    int64_t gtid_72716 = squot64(global_tid_79589, slice_79590);\n    int64_t remnant_79592 = global_tid_79589 - gtid_72716 * slice_79590;\n    int64_t gtid_72717 = remnant_79592;\n    int64_t remnant_79593 = remnant_79592 - gtid_72717;\n    \n    if (slt64(gtid_72716, m_65343) && slt64(gtid_72717, n_65344)) {\n        float x_72719;\n        \n        x_72719 = ((__global float *) Y_mem_76976)[gtid_72716 * n_65344 +\n                                                   gtid_72717];\n        \n        bool isnan_res_72722;\n        \n        isnan_res_72722 = futrts_isnan32(x_72719);\n        \n        bool defunc_0_p_res_72723 = !isnan_res_72722;\n        int64_t defunc_1_f_res_72724;\n        \n        if (defunc_0_p_res_72723) {\n            int64_t x_72720;\n            \n            x_72720 = ((__global int64_t *) mem_77833)[gtid_72716 * n_65344 +\n                                                       gtid_72717];\n            \n            int64_t defunc_1_f_res_t_res_72725 = sub64(x_72720, (int64_t) 1);\n            \n            defunc",
                   "_1_f_res_72724 = defunc_1_f_res_t_res_72725;\n        } else {\n            defunc_1_f_res_72724 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_72716) && slt64(gtid_72716, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_72724) &&\n             slt64(defunc_1_f_res_72724, n_65344))) {\n            ((__global int64_t *) mem_77841)[gtid_72716 * n_65344 +\n                                             defunc_1_f_res_72724] = gtid_72717;\n        }\n        if ((sle64((int64_t) 0, gtid_72716) && slt64(gtid_72716, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_72724) &&\n             slt64(defunc_1_f_res_72724, n_65344))) {\n            ((__global float *) mem_77837)[gtid_72716 * n_65344 +\n                                           defunc_1_f_res_72724] = x_72719;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_72712\n}\n__kernel void mainzisegmap_72737(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *mem_77841, __global\n                                 unsigned char *mem_77847)\n{\n    #define segmap_group_sizze_72732 (mainzisegmap_group_sizze_72527)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79594;\n    int32_t local_tid_79595;\n    int64_t group_sizze_79598;\n    int32_t wave_sizze_79597;\n    int32_t group_tid_79596;\n    \n    global_tid_79594 = get_global_id(0);\n    local_tid_79595 = get_local_id(0);\n    group_sizze_79598 = get_local_size(0);\n    wave_sizze_79597 = LOCKSTEP_WIDTH;\n    group_tid_79596 = get_group_id(0);\n    \n    int32_t phys_tid_72737 = global_tid_79594;\n    int64_t global_tid_79599 = sext_i32_i64(group_tid_79596) *\n            segmap_group_sizze_72732 + sext_i32_i64(local_tid_79595);\n    int64_t slice_79600 = n_65344;\n    int64_t slice_79601 = m_65343 * slice_79600;\n    i",
                   "nt64_t gtid_72735 = squot64(global_tid_79599, slice_79600);\n    int64_t remnant_79602 = global_tid_79599 - gtid_72735 * slice_79600;\n    int64_t gtid_72736 = remnant_79602;\n    int64_t remnant_79603 = remnant_79602 - gtid_72736;\n    \n    if (slt64(gtid_72735, m_65343) && slt64(gtid_72736, n_65344)) {\n        int64_t x_72738;\n        \n        x_72738 = ((__global int64_t *) mem_77841)[gtid_72735 * n_65344 +\n                                                   gtid_72736];\n        \n        int64_t defunc_0_f_res_72739 = add64((int64_t) 1, x_72738);\n        \n        ((__global int64_t *) mem_77847)[gtid_72735 * n_65344 + gtid_72736] =\n            defunc_0_f_res_72739;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_72732\n}\n__kernel void mainzisegmap_72749(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, int64_t min_res_65364,\n                                 float i64_res_65370, __global\n                                 unsigned char *mem_77833, __global\n                                 unsigned char *mem_77851, __global\n                                 unsigned char *mem_77854, __global\n                                 unsigned char *mem_77857, __global\n                                 unsigned char *mem_77860)\n{\n    #define segmap_group_sizze_72742 (mainzisegmap_group_sizze_72501)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79604;\n    int32_t local_tid_79605;\n    int64_t group_sizze_79608;\n    int32_t wave_sizze_79607;\n    int32_t group_tid_79606;\n    \n    global_tid_79604 = get_global_id(0);\n    local_tid_79605 = get_local_id(0);\n    group_sizze_79608 = get_local_size(0);\n    wave_sizze_79607 = LOCKSTEP_WIDTH;\n    group_tid_79606 = get_group_id(0);\n    \n    int32_t phys_tid_72749 = global_tid_79604;\n    int64_t ",
                   "global_tid_79609 = sext_i32_i64(group_tid_79606) *\n            segmap_group_sizze_72742 + sext_i32_i64(local_tid_79605);\n    int64_t slice_79610 = m_65343;\n    int64_t gtid_72748 = global_tid_79609;\n    int64_t remnant_79611 = global_tid_79609 - gtid_72748;\n    \n    if (slt64(gtid_72748, m_65343)) {\n        int64_t last_res_72750;\n        \n        last_res_72750 = ((__global int64_t *) mem_77833)[gtid_72748 * n_65344 +\n                                                          i_65358];\n        \n        int64_t min_arg_72751 = sub64(last_res_72750, (int64_t) 1);\n        int64_t min_arg_72752 = sub64(last_res_72750, min_res_65364);\n        int64_t min_res_72753 = smin64(q_65346, last_res_72750);\n        float i64_res_72754 = sitofp_i64_f32(last_res_72750);\n        float x_72755 = i64_res_65370 - i64_res_72754;\n        float max_arg_72756 = x_72755 / 2.0F;\n        float max_res_72757 = fmax32(0.0F, max_arg_72756);\n        \n        ((__global int64_t *) mem_77851)[gtid_72748] = min_arg_72751;\n        ((__global int64_t *) mem_77854)[gtid_72748] = min_arg_72752;\n        ((__global int64_t *) mem_77857)[gtid_72748] = min_res_72753;\n        ((__global float *) mem_77860)[gtid_72748] = max_res_72757;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_72742\n}\n__kernel void mainzisegmap_72769(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, __global\n                                 unsigned char *mem_77833, __global\n                                 unsigned char *mem_77865)\n{\n    #define segmap_group_sizze_72764 (mainzisegmap_group_sizze_72476)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79612;\n    int32_t local_tid_79613;\n    int64_t group_sizze_79616;\n    int32_t wave_sizze_79615;\n    int32_t group_tid_79614;\n    \n    gl",
                   "obal_tid_79612 = get_global_id(0);\n    local_tid_79613 = get_local_id(0);\n    group_sizze_79616 = get_local_size(0);\n    wave_sizze_79615 = LOCKSTEP_WIDTH;\n    group_tid_79614 = get_group_id(0);\n    \n    int32_t phys_tid_72769 = global_tid_79612;\n    int64_t global_tid_79617 = sext_i32_i64(group_tid_79614) *\n            segmap_group_sizze_72764 + sext_i32_i64(local_tid_79613);\n    int64_t slice_79618 = q_65346;\n    int64_t slice_79619 = m_65343 * slice_79618;\n    int64_t gtid_72767 = squot64(global_tid_79617, slice_79618);\n    int64_t remnant_79620 = global_tid_79617 - gtid_72767 * slice_79618;\n    int64_t gtid_72768 = remnant_79620;\n    int64_t remnant_79621 = remnant_79620 - gtid_72768;\n    \n    if (slt64(gtid_72767, m_65343) && slt64(gtid_72768, q_65346)) {\n        int64_t last_res_72770;\n        \n        last_res_72770 = ((__global int64_t *) mem_77833)[gtid_72767 * n_65344 +\n                                                          i_65358];\n        \n        bool cond_72772 = sle64(last_res_72770, gtid_72768);\n        float defunc_0_f_res_72773;\n        \n        if (cond_72772) {\n            defunc_0_f_res_72773 = 0.0F;\n        } else {\n            defunc_0_f_res_72773 = 1.0F;\n        }\n        ((__global float *) mem_77865)[gtid_72767 * q_65346 + gtid_72768] =\n            defunc_0_f_res_72773;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_72764\n}\n__kernel void mainzisegmap_73385(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *Y_mem_76976, __global\n                                 unsigned char *mem_77880, __global\n                                 unsigned char *mem_77884, __global\n                                 unsigned char *mem_77888)\n{\n    #define segmap_group_sizze_73379 (mainzisegmap_group_sizze_73220)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n ",
                   "       return;\n    \n    int32_t global_tid_79715;\n    int32_t local_tid_79716;\n    int64_t group_sizze_79719;\n    int32_t wave_sizze_79718;\n    int32_t group_tid_79717;\n    \n    global_tid_79715 = get_global_id(0);\n    local_tid_79716 = get_local_id(0);\n    group_sizze_79719 = get_local_size(0);\n    wave_sizze_79718 = LOCKSTEP_WIDTH;\n    group_tid_79717 = get_group_id(0);\n    \n    int32_t phys_tid_73385 = global_tid_79715;\n    int64_t global_tid_79720 = sext_i32_i64(group_tid_79717) *\n            segmap_group_sizze_73379 + sext_i32_i64(local_tid_79716);\n    int64_t slice_79721 = n_65344;\n    int64_t slice_79722 = m_65343 * slice_79721;\n    int64_t gtid_73383 = squot64(global_tid_79720, slice_79721);\n    int64_t remnant_79723 = global_tid_79720 - gtid_73383 * slice_79721;\n    int64_t gtid_73384 = remnant_79723;\n    int64_t remnant_79724 = remnant_79723 - gtid_73384;\n    \n    if (slt64(gtid_73383, m_65343) && slt64(gtid_73384, n_65344)) {\n        float x_73386;\n        \n        x_73386 = ((__global float *) Y_mem_76976)[gtid_73383 * n_65344 +\n                                                   gtid_73384];\n        \n        bool isnan_res_73389;\n        \n        isnan_res_73389 = futrts_isnan32(x_73386);\n        \n        bool defunc_0_p_res_73390 = !isnan_res_73389;\n        int64_t defunc_1_f_res_73391;\n        \n        if (defunc_0_p_res_73390) {\n            int64_t x_73387;\n            \n            x_73387 = ((__global int64_t *) mem_77880)[gtid_73383 * n_65344 +\n                                                       gtid_73384];\n            \n            int64_t defunc_1_f_res_t_res_73392 = sub64(x_73387, (int64_t) 1);\n            \n            defunc_1_f_res_73391 = defunc_1_f_res_t_res_73392;\n        } else {\n            defunc_1_f_res_73391 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_73383) && slt64(gtid_73383, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_73391) &&\n             slt64(defunc_1_f_res_73391, n_65344))) {\n            ((",
                   "__global int64_t *) mem_77888)[gtid_73383 * n_65344 +\n                                             defunc_1_f_res_73391] = gtid_73384;\n        }\n        if ((sle64((int64_t) 0, gtid_73383) && slt64(gtid_73383, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_73391) &&\n             slt64(defunc_1_f_res_73391, n_65344))) {\n            ((__global float *) mem_77884)[gtid_73383 * n_65344 +\n                                           defunc_1_f_res_73391] = x_73386;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_73379\n}\n__kernel void mainzisegmap_73404(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *mem_77888, __global\n                                 unsigned char *mem_77894)\n{\n    #define segmap_group_sizze_73399 (mainzisegmap_group_sizze_73194)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79725;\n    int32_t local_tid_79726;\n    int64_t group_sizze_79729;\n    int32_t wave_sizze_79728;\n    int32_t group_tid_79727;\n    \n    global_tid_79725 = get_global_id(0);\n    local_tid_79726 = get_local_id(0);\n    group_sizze_79729 = get_local_size(0);\n    wave_sizze_79728 = LOCKSTEP_WIDTH;\n    group_tid_79727 = get_group_id(0);\n    \n    int32_t phys_tid_73404 = global_tid_79725;\n    int64_t global_tid_79730 = sext_i32_i64(group_tid_79727) *\n            segmap_group_sizze_73399 + sext_i32_i64(local_tid_79726);\n    int64_t slice_79731 = n_65344;\n    int64_t slice_79732 = m_65343 * slice_79731;\n    int64_t gtid_73402 = squot64(global_tid_79730, slice_79731);\n    int64_t remnant_79733 = global_tid_79730 - gtid_73402 * slice_79731;\n    int64_t gtid_73403 = remnant_79733;\n    int64_t remnant_79734 = remnant_79733 - gtid_73403;\n    \n    if (slt64(gtid_73402, m_65343) && slt64(gtid_73403, n_65344)) {\n        int64_t x_7340",
                   "5;\n        \n        x_73405 = ((__global int64_t *) mem_77888)[gtid_73402 * n_65344 +\n                                                   gtid_73403];\n        \n        int64_t defunc_0_f_res_73406 = add64((int64_t) 1, x_73405);\n        \n        ((__global int64_t *) mem_77894)[gtid_73402 * n_65344 + gtid_73403] =\n            defunc_0_f_res_73406;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_73399\n}\n__kernel void mainzisegmap_73416(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, int64_t min_res_65364,\n                                 float i64_res_65370, __global\n                                 unsigned char *mem_77880, __global\n                                 unsigned char *mem_77898, __global\n                                 unsigned char *mem_77901, __global\n                                 unsigned char *mem_77904, __global\n                                 unsigned char *mem_77907)\n{\n    #define segmap_group_sizze_73409 (mainzisegmap_group_sizze_73168)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79735;\n    int32_t local_tid_79736;\n    int64_t group_sizze_79739;\n    int32_t wave_sizze_79738;\n    int32_t group_tid_79737;\n    \n    global_tid_79735 = get_global_id(0);\n    local_tid_79736 = get_local_id(0);\n    group_sizze_79739 = get_local_size(0);\n    wave_sizze_79738 = LOCKSTEP_WIDTH;\n    group_tid_79737 = get_group_id(0);\n    \n    int32_t phys_tid_73416 = global_tid_79735;\n    int64_t global_tid_79740 = sext_i32_i64(group_tid_79737) *\n            segmap_group_sizze_73409 + sext_i32_i64(local_tid_79736);\n    int64_t slice_79741 = m_65343;\n    int64_t gtid_73415 = global_tid_79740;\n    int64_t remnant_79742 = global_tid_79740 - gtid_73415;\n    \n    if (slt64(gtid_73415, m_65343)) {\n        int64_t last_re",
                   "s_73417;\n        \n        last_res_73417 = ((__global int64_t *) mem_77880)[gtid_73415 * n_65344 +\n                                                          i_65358];\n        \n        int64_t min_arg_73418 = sub64(last_res_73417, (int64_t) 1);\n        int64_t min_arg_73419 = sub64(last_res_73417, min_res_65364);\n        int64_t min_res_73420 = smin64(q_65346, last_res_73417);\n        float i64_res_73421 = sitofp_i64_f32(last_res_73417);\n        float x_73422 = i64_res_65370 - i64_res_73421;\n        float max_arg_73423 = x_73422 / 2.0F;\n        float max_res_73424 = fmax32(0.0F, max_arg_73423);\n        \n        ((__global int64_t *) mem_77898)[gtid_73415] = min_arg_73418;\n        ((__global int64_t *) mem_77901)[gtid_73415] = min_arg_73419;\n        ((__global int64_t *) mem_77904)[gtid_73415] = min_res_73420;\n        ((__global float *) mem_77907)[gtid_73415] = max_res_73424;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_73409\n}\n__kernel void mainzisegmap_73436(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, __global\n                                 unsigned char *mem_77880, __global\n                                 unsigned char *mem_77912)\n{\n    #define segmap_group_sizze_73431 (mainzisegmap_group_sizze_73143)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79743;\n    int32_t local_tid_79744;\n    int64_t group_sizze_79747;\n    int32_t wave_sizze_79746;\n    int32_t group_tid_79745;\n    \n    global_tid_79743 = get_global_id(0);\n    local_tid_79744 = get_local_id(0);\n    group_sizze_79747 = get_local_size(0);\n    wave_sizze_79746 = LOCKSTEP_WIDTH;\n    group_tid_79745 = get_group_id(0);\n    \n    int32_t phys_tid_73436 = global_tid_79743;\n    int64_t global_tid_79748 = sext_i32_i64(group_tid_79745) *\n            se",
                   "gmap_group_sizze_73431 + sext_i32_i64(local_tid_79744);\n    int64_t slice_79749 = q_65346;\n    int64_t slice_79750 = m_65343 * slice_79749;\n    int64_t gtid_73434 = squot64(global_tid_79748, slice_79749);\n    int64_t remnant_79751 = global_tid_79748 - gtid_73434 * slice_79749;\n    int64_t gtid_73435 = remnant_79751;\n    int64_t remnant_79752 = remnant_79751 - gtid_73435;\n    \n    if (slt64(gtid_73434, m_65343) && slt64(gtid_73435, q_65346)) {\n        int64_t last_res_73437;\n        \n        last_res_73437 = ((__global int64_t *) mem_77880)[gtid_73434 * n_65344 +\n                                                          i_65358];\n        \n        bool cond_73439 = sle64(last_res_73437, gtid_73435);\n        float defunc_0_f_res_73440;\n        \n        if (cond_73439) {\n            defunc_0_f_res_73440 = 0.0F;\n        } else {\n            defunc_0_f_res_73440 = 1.0F;\n        }\n        ((__global float *) mem_77912)[gtid_73434 * q_65346 + gtid_73435] =\n            defunc_0_f_res_73440;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_73431\n}\n__kernel void mainzisegmap_74142(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *Y_mem_76976, __global\n                                 unsigned char *mem_77934, __global\n                                 unsigned char *mem_77938, __global\n                                 unsigned char *mem_77942)\n{\n    #define segmap_group_sizze_74136 (mainzisegmap_group_sizze_73977)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79852;\n    int32_t local_tid_79853;\n    int64_t group_sizze_79856;\n    int32_t wave_sizze_79855;\n    int32_t group_tid_79854;\n    \n    global_tid_79852 = get_global_id(0);\n    local_tid_79853 = get_local_id(0);\n    group_sizze_79856 = get_local_size(0);\n    wave_sizze_79855 = LOCK",
                   "STEP_WIDTH;\n    group_tid_79854 = get_group_id(0);\n    \n    int32_t phys_tid_74142 = global_tid_79852;\n    int64_t global_tid_79857 = sext_i32_i64(group_tid_79854) *\n            segmap_group_sizze_74136 + sext_i32_i64(local_tid_79853);\n    int64_t slice_79858 = n_65344;\n    int64_t slice_79859 = m_65343 * slice_79858;\n    int64_t gtid_74140 = squot64(global_tid_79857, slice_79858);\n    int64_t remnant_79860 = global_tid_79857 - gtid_74140 * slice_79858;\n    int64_t gtid_74141 = remnant_79860;\n    int64_t remnant_79861 = remnant_79860 - gtid_74141;\n    \n    if (slt64(gtid_74140, m_65343) && slt64(gtid_74141, n_65344)) {\n        float x_74143;\n        \n        x_74143 = ((__global float *) Y_mem_76976)[gtid_74140 * n_65344 +\n                                                   gtid_74141];\n        \n        bool isnan_res_74146;\n        \n        isnan_res_74146 = futrts_isnan32(x_74143);\n        \n        bool defunc_0_p_res_74147 = !isnan_res_74146;\n        int64_t defunc_1_f_res_74148;\n        \n        if (defunc_0_p_res_74147) {\n            int64_t x_74144;\n            \n            x_74144 = ((__global int64_t *) mem_77934)[gtid_74140 * n_65344 +\n                                                       gtid_74141];\n            \n            int64_t defunc_1_f_res_t_res_74149 = sub64(x_74144, (int64_t) 1);\n            \n            defunc_1_f_res_74148 = defunc_1_f_res_t_res_74149;\n        } else {\n            defunc_1_f_res_74148 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_74140) && slt64(gtid_74140, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_74148) &&\n             slt64(defunc_1_f_res_74148, n_65344))) {\n            ((__global int64_t *) mem_77942)[gtid_74140 * n_65344 +\n                                             defunc_1_f_res_74148] = gtid_74141;\n        }\n        if ((sle64((int64_t) 0, gtid_74140) && slt64(gtid_74140, m_65343)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_74148) &&\n             slt64(defunc_1_f_res_74148, n_6",
                   "5344))) {\n            ((__global float *) mem_77938)[gtid_74140 * n_65344 +\n                                           defunc_1_f_res_74148] = x_74143;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_74136\n}\n__kernel void mainzisegmap_74161(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, __global\n                                 unsigned char *mem_77942, __global\n                                 unsigned char *mem_77948)\n{\n    #define segmap_group_sizze_74156 (mainzisegmap_group_sizze_73951)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79862;\n    int32_t local_tid_79863;\n    int64_t group_sizze_79866;\n    int32_t wave_sizze_79865;\n    int32_t group_tid_79864;\n    \n    global_tid_79862 = get_global_id(0);\n    local_tid_79863 = get_local_id(0);\n    group_sizze_79866 = get_local_size(0);\n    wave_sizze_79865 = LOCKSTEP_WIDTH;\n    group_tid_79864 = get_group_id(0);\n    \n    int32_t phys_tid_74161 = global_tid_79862;\n    int64_t global_tid_79867 = sext_i32_i64(group_tid_79864) *\n            segmap_group_sizze_74156 + sext_i32_i64(local_tid_79863);\n    int64_t slice_79868 = n_65344;\n    int64_t slice_79869 = m_65343 * slice_79868;\n    int64_t gtid_74159 = squot64(global_tid_79867, slice_79868);\n    int64_t remnant_79870 = global_tid_79867 - gtid_74159 * slice_79868;\n    int64_t gtid_74160 = remnant_79870;\n    int64_t remnant_79871 = remnant_79870 - gtid_74160;\n    \n    if (slt64(gtid_74159, m_65343) && slt64(gtid_74160, n_65344)) {\n        int64_t x_74162;\n        \n        x_74162 = ((__global int64_t *) mem_77942)[gtid_74159 * n_65344 +\n                                                   gtid_74160];\n        \n        int64_t defunc_0_f_res_74163 = add64((int64_t) 1, x_74162);\n        \n        ((__global int64_t *) mem_77948)[gtid_74159 * n_65344 + gtid_74160] =\n          ",
                   "  defunc_0_f_res_74163;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_74156\n}\n__kernel void mainzisegmap_74173(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, int64_t min_res_65364,\n                                 float i64_res_65370, __global\n                                 unsigned char *mem_77934, __global\n                                 unsigned char *mem_77952, __global\n                                 unsigned char *mem_77955, __global\n                                 unsigned char *mem_77958, __global\n                                 unsigned char *mem_77961)\n{\n    #define segmap_group_sizze_74166 (mainzisegmap_group_sizze_73925)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79872;\n    int32_t local_tid_79873;\n    int64_t group_sizze_79876;\n    int32_t wave_sizze_79875;\n    int32_t group_tid_79874;\n    \n    global_tid_79872 = get_global_id(0);\n    local_tid_79873 = get_local_id(0);\n    group_sizze_79876 = get_local_size(0);\n    wave_sizze_79875 = LOCKSTEP_WIDTH;\n    group_tid_79874 = get_group_id(0);\n    \n    int32_t phys_tid_74173 = global_tid_79872;\n    int64_t global_tid_79877 = sext_i32_i64(group_tid_79874) *\n            segmap_group_sizze_74166 + sext_i32_i64(local_tid_79873);\n    int64_t slice_79878 = m_65343;\n    int64_t gtid_74172 = global_tid_79877;\n    int64_t remnant_79879 = global_tid_79877 - gtid_74172;\n    \n    if (slt64(gtid_74172, m_65343)) {\n        int64_t last_res_74174;\n        \n        last_res_74174 = ((__global int64_t *) mem_77934)[gtid_74172 * n_65344 +\n                                                          i_65358];\n        \n        int64_t min_arg_74175 = sub64(last_res_74174, (int64_t) 1);\n        int64_t min_arg_74176 = sub64(last_res_74174, min_res_65364);\n        in",
                   "t64_t min_res_74177 = smin64(q_65346, last_res_74174);\n        float i64_res_74178 = sitofp_i64_f32(last_res_74174);\n        float x_74179 = i64_res_65370 - i64_res_74178;\n        float max_arg_74180 = x_74179 / 2.0F;\n        float max_res_74181 = fmax32(0.0F, max_arg_74180);\n        \n        ((__global int64_t *) mem_77952)[gtid_74172] = min_arg_74175;\n        ((__global int64_t *) mem_77955)[gtid_74172] = min_arg_74176;\n        ((__global int64_t *) mem_77958)[gtid_74172] = min_res_74177;\n        ((__global float *) mem_77961)[gtid_74172] = max_res_74181;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_74166\n}\n__kernel void mainzisegmap_74193(__global int *global_failure, int64_t m_65343,\n                                 int64_t n_65344, int64_t q_65346,\n                                 int64_t i_65358, __global\n                                 unsigned char *mem_77934, __global\n                                 unsigned char *mem_77966)\n{\n    #define segmap_group_sizze_74188 (mainzisegmap_group_sizze_73900)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79880;\n    int32_t local_tid_79881;\n    int64_t group_sizze_79884;\n    int32_t wave_sizze_79883;\n    int32_t group_tid_79882;\n    \n    global_tid_79880 = get_global_id(0);\n    local_tid_79881 = get_local_id(0);\n    group_sizze_79884 = get_local_size(0);\n    wave_sizze_79883 = LOCKSTEP_WIDTH;\n    group_tid_79882 = get_group_id(0);\n    \n    int32_t phys_tid_74193 = global_tid_79880;\n    int64_t global_tid_79885 = sext_i32_i64(group_tid_79882) *\n            segmap_group_sizze_74188 + sext_i32_i64(local_tid_79881);\n    int64_t slice_79886 = q_65346;\n    int64_t slice_79887 = m_65343 * slice_79886;\n    int64_t gtid_74191 = squot64(global_tid_79885, slice_79886);\n    int64_t remnant_79888 = global_tid_79885 - gtid_74191 * slice_79886;\n    int64_t gtid_74192 = remnant_79888;\n    in",
                   "t64_t remnant_79889 = remnant_79888 - gtid_74192;\n    \n    if (slt64(gtid_74191, m_65343) && slt64(gtid_74192, q_65346)) {\n        int64_t last_res_74194;\n        \n        last_res_74194 = ((__global int64_t *) mem_77934)[gtid_74191 * n_65344 +\n                                                          i_65358];\n        \n        bool cond_74196 = sle64(last_res_74194, gtid_74192);\n        float defunc_0_f_res_74197;\n        \n        if (cond_74196) {\n            defunc_0_f_res_74197 = 0.0F;\n        } else {\n            defunc_0_f_res_74197 = 1.0F;\n        }\n        ((__global float *) mem_77966)[gtid_74191 * q_65346 + gtid_74192] =\n            defunc_0_f_res_74197;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_74188\n}\n__kernel void mainzisegmap_74555(__global int *global_failure,\n                                 int failure_is_an_option, __global\n                                 int64_t *global_failure_args, int64_t m_65343,\n                                 int64_t n_65344, int64_t jump_65348,\n                                 int64_t n_m_65352, int64_t i_65358,\n                                 int64_t y_66637, __global\n                                 unsigned char *ext_mem_77995, __global\n                                 unsigned char *ext_mem_77996, __global\n                                 unsigned char *mem_78001)\n{\n    #define segmap_group_sizze_74550 (mainzisegmap_group_sizze_74432)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79927;\n    int32_t local_tid_79928;\n    int64_t group_sizze_79931;\n    int32_t wave_sizze_79930;\n    int32_t group_tid_79929;\n    \n    global_tid_79927 = get_global_id(0);\n    local_tid_79928 = get_local_id(0);\n    group_sizze_79931 = get_local_size(0);\n    wave_sizze_79930 = LOCKSTEP_WIDTH;\n    group_tid_79929 = get_group_id(0);\n    \n    int32_t phys_tid_74555 = global_tid_79927;\n    int64_t g",
                   "lobal_tid_79932 = sext_i32_i64(group_tid_79929) *\n            segmap_group_sizze_74550 + sext_i32_i64(local_tid_79928);\n    int64_t slice_79933 = n_65344;\n    int64_t slice_79934 = m_65343 * slice_79933;\n    int64_t gtid_74553 = squot64(global_tid_79932, slice_79933);\n    int64_t remnant_79935 = global_tid_79932 - gtid_74553 * slice_79933;\n    int64_t gtid_74554 = remnant_79935;\n    int64_t remnant_79936 = remnant_79935 - gtid_74554;\n    \n    if (slt64(gtid_74553, m_65343) && slt64(gtid_74554, n_65344)) {\n        int64_t m_v_74559 = sdiv64(gtid_74554, jump_65348);\n        bool cond_74560 = m_v_74559 == y_66637;\n        int64_t j_74561;\n        \n        if (cond_74560) {\n            int64_t j_t_res_74562 = sub64(m_v_74559, (int64_t) 1);\n            \n            j_74561 = j_t_res_74562;\n        } else {\n            j_74561 = m_v_74559;\n        }\n        \n        int64_t min_arg_74563 = mul64(jump_65348, j_74561);\n        int64_t min_res_74564 = smin64(i_65358, min_arg_74563);\n        int64_t defunc_0_m_fun_arg_74565 = add64((int64_t) 1, j_74561);\n        int64_t min_arg_74566 = mul64(jump_65348, defunc_0_m_fun_arg_74565);\n        int64_t min_res_74567 = smin64(i_65358, min_arg_74566);\n        int64_t i64_arg_74568 = sub64(min_res_74567, min_res_74564);\n        float i64_res_74569 = sitofp_i64_f32(i64_arg_74568);\n        int64_t i64_arg_74570 = sub64(gtid_74554, min_res_74564);\n        float i64_res_74571 = sitofp_i64_f32(i64_arg_74570);\n        float u_74572 = i64_res_74571 / i64_res_74569;\n        float u2_74573 = u_74572 * u_74572;\n        float u3_74574 = u_74572 * u2_74573;\n        float x_74575 = 2.0F * u3_74574;\n        float y_74576 = 3.0F * u2_74573;\n        float x_74577 = x_74575 - y_74576;\n        float x_74578 = 1.0F + x_74577;\n        bool x_74579 = sle64((int64_t) 0, j_74561);\n        bool y_74580 = slt64(j_74561, n_m_65352);\n        bool bounds_check_74581 = x_74579 && y_74580;\n        bool index_certs_74582;\n        \n        if (!bounds_check_74581) {\n",
                   "            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 60) == -1) {\n                    global_failure_args[0] = (int64_t) j_74561;\n                    global_failure_args[1] = (int64_t) n_m_65352;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        float y_74583;\n        \n        y_74583 = ((__global float *) ext_mem_77996)[gtid_74553 * n_m_65352 +\n                                                     j_74561];\n        \n        float x_74584 = x_74578 * y_74583;\n        float x_74585 = y_74576 - x_74575;\n        bool x_74586 = sle64((int64_t) 0, defunc_0_m_fun_arg_74565);\n        bool y_74587 = slt64(defunc_0_m_fun_arg_74565, n_m_65352);\n        bool bounds_check_74588 = x_74586 && y_74587;\n        bool index_certs_74589;\n        \n        if (!bounds_check_74588) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 61) == -1) {\n                    global_failure_args[0] = (int64_t) defunc_0_m_fun_arg_74565;\n                    global_failure_args[1] = (int64_t) n_m_65352;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        float y_74590;\n        \n        y_74590 = ((__global float *) ext_mem_77996)[gtid_74553 * n_m_65352 +\n                                                     defunc_0_m_fun_arg_74565];\n        \n        float y_74591 = x_74585 * y_74590;\n        float x_74592 = x_74584 + y_74591;\n        float y_74593 = 2.0F * u2_74573;\n        float x_74594 = u3_74574 - y_74593;\n        float x_74595 = u_74572 + x_74594;\n        float y_74596;\n        \n        y_74596 = ((__global float *) ext_mem_77995)[gtid_74553 * n_m_65352 +\n                                                     j_74561];\n        \n        float x_74597 = x_74595 * y_74596;\n        float y_74598 = i64_res_74569 * x_74597;\n        float x_74599 = x_74592 + y_74598;\n        float x_74600 = u3_74574 - u2_74573;\n        float y_74601;\n        \n  ",
                   "      y_74601 = ((__global float *) ext_mem_77995)[gtid_74553 * n_m_65352 +\n                                                     defunc_0_m_fun_arg_74565];\n        \n        float x_74602 = x_74600 * y_74601;\n        float y_74603 = i64_res_74569 * x_74602;\n        float defunc_4_interpolate_proc_res_74604 = x_74599 + y_74603;\n        \n        ((__global float *) mem_78001)[gtid_74553 * n_65344 + gtid_74554] =\n            defunc_4_interpolate_proc_res_74604;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_74550\n}\n__kernel void mainzisegmap_intragroup_72785(__global int *global_failure,\n                                            int failure_is_an_option, __global\n                                            int64_t *global_failure_args,\n                                            __local volatile\n                                            int64_t *red_arr_mem_79645_backing_aligned_0,\n                                            __local volatile\n                                            int64_t *red_arr_mem_79641_backing_aligned_1,\n                                            __local volatile\n                                            int64_t *color_78194_backing_aligned_2,\n                                            int64_t m_65343, int64_t n_65344,\n                                            int64_t q_65346, int64_t jump_65348,\n                                            int64_t n_m_65352, int64_t i_65358,\n                                            unsigned char x_65359_bits,\n                                            int64_t min_res_65364,\n                                            unsigned char loop_cond_65369_bits,\n                                            __global unsigned char *mem_77833,\n                                            __global unsigned char *mem_77837,\n                                            __global unsigned char *mem_77841,\n                                            __global unsigned char *mem_77847,\n                  ",
                   "                          __global unsigned char *mem_77851,\n                                            __global unsigned char *mem_77854,\n                                            __global unsigned char *mem_77857,\n                                            __global unsigned char *mem_77860,\n                                            __global unsigned char *mem_77865,\n                                            __global unsigned char *mem_77875)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_79645_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79645_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_79641_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79641_backing_aligned_1;\n    __local volatile unsigned char *restrict color_78194_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_78194_backing_aligned_2;\n    volatile __local bool local_failure;\n    \n    if (failure_is_an_option) {\n        int failed = *global_failure >= 0;\n        \n        if (failed)\n            return;\n    }\n    local_failure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_79622;\n    int32_t local_tid_79623;\n    int64_t group_sizze_79626;\n    int32_t wave_sizze_79625;\n    int32_t group_tid_79624;\n    \n    global_tid_79622 = get_global_id(0);\n    local_tid_79623 = get_local_id(0);\n    group_sizze_79626 = get_local_size(0);\n    wave_sizze_79625 = LOCKSTEP_WIDTH;\n    group_tid_79624 = get_group_id(0);\n    \n    int32_t phys_tid_72785 = group_tid_79624;\n    int64_t slice_79628 = q_65346;\n    int64_t ltid_pre_79627 = sext_i32_i64(loc",
                   "al_tid_79623);\n    int64_t remnant_79629 = sext_i32_i64(local_tid_79623) - ltid_pre_79627;\n    int64_t slice_79630 = n_m_65352;\n    int64_t slice_79631 = m_65343 * slice_79630;\n    int64_t gtid_72783 = squot64(sext_i32_i64(group_tid_79624), slice_79630);\n    int64_t remnant_79632 = sext_i32_i64(group_tid_79624) - gtid_72783 *\n            slice_79630;\n    int64_t gtid_72784 = remnant_79632;\n    int64_t remnant_79633 = remnant_79632 - gtid_72784;\n    __local unsigned char *color_78194;\n    \n    color_78194 = (__local unsigned char *) color_78194_backing_0;\n    \n    int64_t last_res_72786;\n    \n    last_res_72786 = ((__global int64_t *) mem_77833)[gtid_72783 * n_65344 +\n                                                      i_65358];\n    \n    int64_t min_arg_72793;\n    \n    min_arg_72793 = ((__global int64_t *) mem_77851)[gtid_72783];\n    \n    int64_t min_arg_72794;\n    \n    min_arg_72794 = ((__global int64_t *) mem_77854)[gtid_72783];\n    \n    int64_t min_res_72795;\n    \n    min_res_72795 = ((__global int64_t *) mem_77857)[gtid_72783];\n    \n    float max_res_72796;\n    \n    max_res_72796 = ((__global float *) mem_77860)[gtid_72783];\n    \n    int64_t min_arg_72800 = mul64(jump_65348, gtid_72784);\n    int64_t min_res_72801 = smin64(i_65358, min_arg_72800);\n    int64_t defunc_0_g_res_72802 = add64((int64_t) 1, min_res_72801);\n    bool init_idx_72803;\n    int64_t init_idx_72804;\n    int64_t init_idx_72805;\n    bool loop_while_72806;\n    int64_t low_72807;\n    int64_t high_72808;\n    \n    loop_while_72806 = x_65359;\n    low_72807 = (int64_t) 0;\n    high_72808 = i_65358;\n    while (loop_while_72806) {\n        int64_t x_72809 = add64(low_72807, high_72808);\n        int64_t mid_72810 = sdiv64(x_72809, (int64_t) 2);\n        bool x_72811 = sle64((int64_t) 0, mid_72810);\n        bool y_72812 = slt64(mid_72810, n_65344);\n        bool bounds_check_72813 = x_72811 && y_72812;\n        bool index_certs_72814;\n        \n        if (!bounds_check_72813) {\n            {\n                if",
                   " (atomic_cmpxchg_i32_global(global_failure, -1, 45) == -1) {\n                    global_failure_args[0] = (int64_t) mid_72810;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                local_failure = true;\n                goto error_0;\n            }\n        }\n        \n        int64_t mid_id_72815;\n        \n        mid_id_72815 = ((__global int64_t *) mem_77847)[gtid_72783 * n_65344 +\n                                                        mid_72810];\n        \n        bool cond_72816 = slt64(mid_id_72815, (int64_t) 0);\n        int64_t mid_idx_72817;\n        \n        if (cond_72816) {\n            mid_idx_72817 = (int64_t) 9223372036854775807;\n        } else {\n            mid_idx_72817 = mid_id_72815;\n        }\n        \n        bool cond_72818 = sle64(defunc_0_g_res_72802, mid_idx_72817);\n        int64_t loopres_72819;\n        int64_t loopres_72820;\n        \n        if (cond_72818) {\n            int64_t loopres_t_res_72821 = sub64(mid_72810, (int64_t) 1);\n            \n            loopres_72819 = low_72807;\n            loopres_72820 = loopres_t_res_72821;\n        } else {\n            int64_t loopres_f_res_72822 = add64((int64_t) 1, mid_72810);\n            \n            loopres_72819 = loopres_f_res_72822;\n            loopres_72820 = high_72808;\n        }\n        \n        bool loop_cond_72823 = sle64(loopres_72819, loopres_72820);\n        bool loop_while_tmp_79634 = loop_cond_72823;\n        int64_t low_tmp_79635 = loopres_72819;\n        int64_t high_tmp_79636 = loopres_72820;\n        \n        loop_while_72806 = loop_while_tmp_79634;\n        low_72807 = low_tmp_79635;\n        high_72808 = high_tmp_79636;\n    }\n    init_idx_72803 = loop_while_72806;\n    init_idx_72804 = low_72807;\n    init_idx_72805 = high_72808;\n    \n    bool idx_72824;\n    int64_t idx_72825;\n    int64_t idx_72826;\n    int64_t idx_72827;\n    bool loop_while_72828;\n    int64_t l_idx_72829;\n    int64_t r_idx_72830;\n    int64_t span_72831;\n    \n  ",
                   "  loop_while_72828 = loop_cond_65369;\n    l_idx_72829 = init_idx_72804;\n    r_idx_72830 = init_idx_72804;\n    span_72831 = (int64_t) 1;\n    while (loop_while_72828) {\n        int64_t max_arg_72832 = sub64(l_idx_72829, (int64_t) 1);\n        int64_t max_res_72833 = smax64((int64_t) 0, max_arg_72832);\n        int64_t min_arg_72834 = add64((int64_t) 1, r_idx_72830);\n        int64_t min_res_72835 = smin64(min_arg_72793, min_arg_72834);\n        bool x_72836 = sle64((int64_t) 0, max_res_72833);\n        bool y_72837 = slt64(max_res_72833, n_65344);\n        bool bounds_check_72838 = x_72836 && y_72837;\n        bool index_certs_72839;\n        \n        if (!bounds_check_72838) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 46) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_72833;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                local_failure = true;\n                goto error_0;\n            }\n        }\n        \n        int64_t x_72840;\n        \n        x_72840 = ((__global int64_t *) mem_77847)[gtid_72783 * n_65344 +\n                                                   max_res_72833];\n        \n        int64_t abs_arg_72841 = sub64(x_72840, defunc_0_g_res_72802);\n        int64_t abs_res_72842 = abs64(abs_arg_72841);\n        bool x_72843 = sle64((int64_t) 0, min_res_72835);\n        bool y_72844 = slt64(min_res_72835, n_65344);\n        bool bounds_check_72845 = x_72843 && y_72844;\n        bool index_certs_72846;\n        \n        if (!bounds_check_72845) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 47) == -1) {\n                    global_failure_args[0] = (int64_t) min_res_72835;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                local_failure = true;\n                goto error_0;\n            }\n        }\n        \n        int64_t x_72847;\n        \n   ",
                   "     x_72847 = ((__global int64_t *) mem_77847)[gtid_72783 * n_65344 +\n                                                   min_res_72835];\n        \n        int64_t abs_arg_72848 = sub64(x_72847, defunc_0_g_res_72802);\n        int64_t abs_res_72849 = abs64(abs_arg_72848);\n        bool cond_72850 = max_res_72833 == l_idx_72829;\n        int64_t loopres_72851;\n        int64_t loopres_72852;\n        int64_t loopres_72853;\n        \n        if (cond_72850) {\n            loopres_72851 = l_idx_72829;\n            loopres_72852 = r_idx_72830;\n            loopres_72853 = min_res_65364;\n        } else {\n            bool cond_72854 = slt64(abs_res_72842, abs_res_72849);\n            bool cond_f_res_72855 = min_res_72835 == r_idx_72830;\n            bool x_72856 = !cond_72854;\n            bool y_72857 = cond_f_res_72855 && x_72856;\n            bool cond_72858 = cond_72854 || y_72857;\n            int64_t loopres_f_res_72859;\n            \n            if (cond_72858) {\n                loopres_f_res_72859 = max_res_72833;\n            } else {\n                loopres_f_res_72859 = l_idx_72829;\n            }\n            \n            int64_t loopres_f_res_72860;\n            \n            if (cond_72858) {\n                loopres_f_res_72860 = r_idx_72830;\n            } else {\n                loopres_f_res_72860 = min_res_72835;\n            }\n            \n            int64_t loopres_f_res_72861;\n            \n            if (cond_72858) {\n                int64_t loopres_f_res_t_res_72862 = add64((int64_t) 1,\n                                                          span_72831);\n                \n                loopres_f_res_72861 = loopres_f_res_t_res_72862;\n            } else {\n                int64_t loopres_f_res_f_res_72863 = add64((int64_t) 1,\n                                                          span_72831);\n                \n                loopres_f_res_72861 = loopres_f_res_f_res_72863;\n            }\n            loopres_72851 = loopres_f_res_72859;\n            loopres_72852 = loopr",
                   "es_f_res_72860;\n            loopres_72853 = loopres_f_res_72861;\n        }\n        \n        bool loop_cond_72864 = slt64(loopres_72853, min_res_65364);\n        bool loop_while_tmp_79637 = loop_cond_72864;\n        int64_t l_idx_tmp_79638 = loopres_72851;\n        int64_t r_idx_tmp_79639 = loopres_72852;\n        int64_t span_tmp_79640 = loopres_72853;\n        \n        loop_while_72828 = loop_while_tmp_79637;\n        l_idx_72829 = l_idx_tmp_79638;\n        r_idx_72830 = r_idx_tmp_79639;\n        span_72831 = span_tmp_79640;\n    }\n    idx_72824 = loop_while_72828;\n    idx_72825 = l_idx_72829;\n    idx_72826 = r_idx_72830;\n    idx_72827 = span_72831;\n    \n    int64_t min_res_72865 = smin64(min_arg_72794, idx_72825);\n    int64_t max_res_72866 = smax64((int64_t) 0, min_res_72865);\n    int64_t x_72867 = add64(min_res_72795, max_res_72866);\n    int64_t r_72868 = sub64(x_72867, (int64_t) 1);\n    bool x_72869 = sle64((int64_t) 0, r_72868);\n    bool y_72870 = slt64(r_72868, n_65344);\n    bool bounds_check_72871 = x_72869 && y_72870;\n    bool index_certs_72872;\n    \n    if (!bounds_check_72871) {\n        {\n            if (atomic_cmpxchg_i32_global(global_failure, -1, 48) == -1) {\n                global_failure_args[0] = (int64_t) r_72868;\n                global_failure_args[1] = (int64_t) n_65344;\n                ;\n            }\n            local_failure = true;\n            goto error_0;\n        }\n    }\n    \n    int64_t x_72873;\n    \n    x_72873 = ((__global int64_t *) mem_77841)[gtid_72783 * n_65344 + r_72868];\n    \n    int64_t abs_arg_72874 = sub64(x_72873, min_res_72801);\n    int64_t abs_res_72875 = abs64(abs_arg_72874);\n    bool x_72876 = sle64((int64_t) 0, max_res_72866);\n    bool y_72877 = slt64(max_res_72866, n_65344);\n    bool bounds_check_72878 = x_72876 && y_72877;\n    bool index_certs_72879;\n    \n    if (!bounds_check_72878) {\n        {\n            if (atomic_cmpxchg_i32_global(global_failure, -1, 49) == -1) {\n                global_failure_args[0] = (int64_t) max_res_728",
                   "66;\n                global_failure_args[1] = (int64_t) n_65344;\n                ;\n            }\n            local_failure = true;\n            goto error_0;\n        }\n    }\n    \n    int64_t x_72880;\n    \n    x_72880 = ((__global int64_t *) mem_77841)[gtid_72783 * n_65344 +\n                                               max_res_72866];\n    \n    int64_t abs_arg_72881 = sub64(x_72880, min_res_72801);\n    int64_t abs_res_72882 = abs64(abs_arg_72881);\n    int64_t max_res_72883 = smax64(abs_res_72875, abs_res_72882);\n    float defunc_0_f_res_72884 = sitofp_i64_f32(max_res_72883);\n    float defunc_1_f_res_72885 = max_res_72796 + defunc_0_f_res_72884;\n    float defunc_2_reduce_res_72886;\n    int64_t gtid_72888 = sext_i32_i64(sext_i64_i32(ltid_pre_79627));\n    int32_t phys_tid_72889 = local_tid_79623;\n    __local unsigned char *red_arr_mem_79641;\n    \n    red_arr_mem_79641 = (__local unsigned char *) red_arr_mem_79641_backing_1;\n    \n    float x_72894;\n    \n    x_72894 = ((__global float *) mem_77865)[gtid_72783 * q_65346 + gtid_72888];\n    \n    bool cond_72895 = sle64(last_res_72786, gtid_72888);\n    int64_t defunc_0_f_res_72896;\n    \n    if (cond_72895) {\n        defunc_0_f_res_72896 = (int64_t) 0;\n    } else {\n        int64_t i_72897 = add64(max_res_72866, gtid_72888);\n        int64_t defunc_0_add_arg_72898;\n        \n        defunc_0_add_arg_72898 = ((__global int64_t *) mem_77841)[gtid_72783 *\n                                                                  n_65344 +\n                                                                  i_72897];\n        \n        int64_t defunc_1_add_res_72899 = add64((int64_t) 1,\n                                               defunc_0_add_arg_72898);\n        \n        defunc_0_f_res_72896 = defunc_1_add_res_72899;\n    }\n    \n    int64_t binop_p_72900 = sub64(defunc_0_f_res_72896, min_res_72801);\n    float defunc_0_f_res_72901 = sitofp_i64_f32(binop_p_72900);\n    float abs_res_72902 = (float) fabs(defunc_0_f_res_72901);\n    float tmp1_72903 = ",
                   "abs_res_72902 / defunc_1_f_res_72885;\n    float x_72904 = tmp1_72903 * tmp1_72903;\n    float y_72905 = tmp1_72903 * x_72904;\n    float tmp2_72906 = 1.0F - y_72905;\n    float x_72907 = tmp2_72906 * tmp2_72906;\n    float tmp3_72908 = tmp2_72906 * x_72907;\n    float tmp4_72909 = x_72894 * tmp3_72908;\n    \n    ((__local float *) red_arr_mem_79641)[gtid_72888] = tmp4_72909;\n    ((__local float *) color_78194)[gtid_72888] = tmp4_72909;\n    \n  error_0:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_79643;\n    int32_t skip_waves_79644 = 1;\n    float x_72890;\n    float x_72891;\n    \n    offset_79643 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_79623, sext_i64_i32(q_65346))) {\n            x_72890 = ((__local\n                        float *) red_arr_mem_79641)[sext_i32_i64(local_tid_79623 +\n                                                    offset_79643)];\n        }\n    }\n    offset_79643 = 1;\n    while (slt32(offset_79643, wave_sizze_79625)) {\n        if (slt32(local_tid_79623 + offset_79643, sext_i64_i32(q_65346)) &&\n            ((local_tid_79623 - squot32(local_tid_79623, wave_sizze_79625) *\n              wave_sizze_79625) & (2 * offset_79643 - 1)) == 0) {\n            // read array element\n            {\n                x_72891 = ((volatile __local\n                            float *) red_arr_mem_79641)[sext_i32_i64(local_tid_79623 +\n                                                        offset_79643)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_72892 = x_72890 + x_72891;\n                \n                x_72890 = defunc_1_op_res_72892;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_79641)[sext_i32_i64(local_tid_79623)] =\n                    x_72890;\n            }\n        }\n        offs",
                   "et_79643 *= 2;\n    }\n    while (slt32(skip_waves_79644, squot32(sext_i64_i32(q_65346) +\n                                           wave_sizze_79625 - 1,\n                                           wave_sizze_79625))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_79643 = skip_waves_79644 * wave_sizze_79625;\n        if (slt32(local_tid_79623 + offset_79643, sext_i64_i32(q_65346)) &&\n            ((local_tid_79623 - squot32(local_tid_79623, wave_sizze_79625) *\n              wave_sizze_79625) == 0 && (squot32(local_tid_79623,\n                                                 wave_sizze_79625) & (2 *\n                                                                      skip_waves_79644 -\n                                                                      1)) ==\n             0)) {\n            // read array element\n            {\n                x_72891 = ((__local\n                            float *) red_arr_mem_79641)[sext_i32_i64(local_tid_79623 +\n                                                        offset_79643)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_72892 = x_72890 + x_72891;\n                \n                x_72890 = defunc_1_op_res_72892;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_79641)[sext_i32_i64(local_tid_79623)] =\n                    x_72890;\n            }\n        }\n        skip_waves_79644 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_72886 = ((__local\n                                  float *) red_arr_mem_79641)[(int64_t) 0];\n    \n    float a0_72910 = 1.0F / defunc_2_reduce_res_72886;\n    float defunc_2_reduce_res_72911;\n    int64_t gtid_72912 = sext_i32_i64(sext_i64_i32(ltid_pre_79627));\n    int32_t phys_tid_72913 = local_tid_79623;\n    __local unsigned char *red_arr_mem_79645;\n    \n    red_arr_mem_79645 = (__local unsigned char *) red_arr_mem_79645_backing_2;\n    \n",
                   "    float x_72918;\n    \n    x_72918 = ((__local float *) color_78194)[gtid_72912];\n    \n    bool cond_72919 = sle64(last_res_72786, gtid_72912);\n    float defunc_0_f_res_72920;\n    \n    if (cond_72919) {\n        defunc_0_f_res_72920 = 0.0F;\n    } else {\n        int64_t i_72921 = add64(max_res_72866, gtid_72912);\n        float defunc_0_add_arg_72922;\n        \n        defunc_0_add_arg_72922 = ((__global float *) mem_77837)[gtid_72783 *\n                                                                n_65344 +\n                                                                i_72921];\n        defunc_0_f_res_72920 = defunc_0_add_arg_72922;\n    }\n    \n    float x_72923 = a0_72910 * x_72918;\n    float defunc_9_fit_fun_res_72924 = defunc_0_f_res_72920 * x_72923;\n    \n    ((__local float *) red_arr_mem_79645)[gtid_72912] =\n        defunc_9_fit_fun_res_72924;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_79647;\n    int32_t skip_waves_79648 = 1;\n    float x_72914;\n    float x_72915;\n    \n    offset_79647 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_79623, sext_i64_i32(q_65346))) {\n            x_72914 = ((__local\n                        float *) red_arr_mem_79645)[sext_i32_i64(local_tid_79623 +\n                                                    offset_79647)];\n        }\n    }\n    offset_79647 = 1;\n    while (slt32(offset_79647, wave_sizze_79625)) {\n        if (slt32(local_tid_79623 + offset_79647, sext_i64_i32(q_65346)) &&\n            ((local_tid_79623 - squot32(local_tid_79623, wave_sizze_79625) *\n              wave_sizze_79625) & (2 * offset_79647 - 1)) == 0) {\n            // read array element\n            {\n                x_72915 = ((volatile __local\n                            float *) red_arr_mem_79645)[sext_i32_i64(local_tid_79623 +\n                                                        offset_79647)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_7291",
                   "6 = x_72914 + x_72915;\n                \n                x_72914 = defunc_1_op_res_72916;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_79645)[sext_i32_i64(local_tid_79623)] =\n                    x_72914;\n            }\n        }\n        offset_79647 *= 2;\n    }\n    while (slt32(skip_waves_79648, squot32(sext_i64_i32(q_65346) +\n                                           wave_sizze_79625 - 1,\n                                           wave_sizze_79625))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_79647 = skip_waves_79648 * wave_sizze_79625;\n        if (slt32(local_tid_79623 + offset_79647, sext_i64_i32(q_65346)) &&\n            ((local_tid_79623 - squot32(local_tid_79623, wave_sizze_79625) *\n              wave_sizze_79625) == 0 && (squot32(local_tid_79623,\n                                                 wave_sizze_79625) & (2 *\n                                                                      skip_waves_79648 -\n                                                                      1)) ==\n             0)) {\n            // read array element\n            {\n                x_72915 = ((__local\n                            float *) red_arr_mem_79645)[sext_i32_i64(local_tid_79623 +\n                                                        offset_79647)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_72916 = x_72914 + x_72915;\n                \n                x_72914 = defunc_1_op_res_72916;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_79645)[sext_i32_i64(local_tid_79623)] =\n                    x_72914;\n            }\n        }\n        skip_waves_79648 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_72911 = ((__local\n                                  float *) red_arr_mem_79645)[(int64_t) 0];\n    if (lo",
                   "cal_tid_79623 == 0) {\n        ((__global float *) mem_77875)[gtid_72783 * n_m_65352 + gtid_72784] =\n            defunc_2_reduce_res_72911;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_73453(__global int *global_failure,\n                                            int failure_is_an_option, __global\n                                            int64_t *global_failure_args,\n                                            __local volatile\n                                            int64_t *red_arr_mem_79782_backing_aligned_0,\n                                            __local volatile\n                                            int64_t *red_arr_mem_79780_backing_aligned_1,\n                                            __local volatile\n                                            int64_t *red_arr_mem_79776_backing_aligned_2,\n                                            __local volatile\n                                            int64_t *red_arr_mem_79774_backing_aligned_3,\n                                            __local volatile\n                                            int64_t *red_arr_mem_79772_backing_aligned_4,\n                                            __local volatile\n                                            int64_t *color_78196_backing_aligned_5,\n                                            __local volatile\n                                            int64_t *color_78195_backing_aligned_6,\n                                            int64_t m_65343, int64_t n_65344,\n                                            int64_t q_65346, int64_t jump_65348,\n                                            int64_t n_m_65352, int64_t i_65358,\n                                            unsigned char x_65359_bits,\n                                            int64_t min_res_65364,\n                                            unsigned char loop_cond_65369_bits,\n                                            __global unsigned char *mem_77880,\n                ",
                   "                            __global unsigned char *mem_77884,\n                                            __global unsigned char *mem_77888,\n                                            __global unsigned char *mem_77894,\n                                            __global unsigned char *mem_77898,\n                                            __global unsigned char *mem_77901,\n                                            __global unsigned char *mem_77904,\n                                            __global unsigned char *mem_77907,\n                                            __global unsigned char *mem_77912,\n                                            __global unsigned char *mem_77925,\n                                            __global unsigned char *mem_77929)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_79782_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79782_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_79780_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79780_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_79776_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79776_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_79774_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79774_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_79772_backing_2 =\n                                   (__local volatile\n                                    unsigned char *)",
                   " red_arr_mem_79772_backing_aligned_4;\n    __local volatile unsigned char *restrict color_78196_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_78196_backing_aligned_5;\n    __local volatile unsigned char *restrict color_78195_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_78195_backing_aligned_6;\n    volatile __local bool local_failure;\n    \n    if (failure_is_an_option) {\n        int failed = *global_failure >= 0;\n        \n        if (failed)\n            return;\n    }\n    local_failure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_79753;\n    int32_t local_tid_79754;\n    int64_t group_sizze_79757;\n    int32_t wave_sizze_79756;\n    int32_t group_tid_79755;\n    \n    global_tid_79753 = get_global_id(0);\n    local_tid_79754 = get_local_id(0);\n    group_sizze_79757 = get_local_size(0);\n    wave_sizze_79756 = LOCKSTEP_WIDTH;\n    group_tid_79755 = get_group_id(0);\n    \n    int32_t phys_tid_73453 = group_tid_79755;\n    int64_t slice_79759 = q_65346;\n    int64_t ltid_pre_79758 = sext_i32_i64(local_tid_79754);\n    int64_t remnant_79760 = sext_i32_i64(local_tid_79754) - ltid_pre_79758;\n    int64_t slice_79761 = n_m_65352;\n    int64_t slice_79762 = m_65343 * slice_79761;\n    int64_t gtid_73451 = squot64(sext_i32_i64(group_tid_79755), slice_79761);\n    int64_t remnant_79763 = sext_i32_i64(group_tid_79755) - gtid_73451 *\n            slice_79761;\n    int64_t gtid_73452 = remnant_79763;\n    int64_t remnant_79764 = remnant_79763 - gtid_73452;\n    __local unsigned char *color_78195;\n    \n    color_78195 = (__local unsigned char *) color_78195_backing_0;\n    \n    __local unsigned char *color_78196;\n    \n    color_78196 = (__local unsigned char *) color_78196_backing_1;\n    \n    int64_t last_res_73454;\n    \n    last_res_73454 = ((__global int64_t *) mem_77880)[gtid_73451 * n_65344 +\n                             ",
                   "                         i_65358];\n    \n    int64_t min_arg_73461;\n    \n    min_arg_73461 = ((__global int64_t *) mem_77898)[gtid_73451];\n    \n    int64_t min_arg_73462;\n    \n    min_arg_73462 = ((__global int64_t *) mem_77901)[gtid_73451];\n    \n    int64_t min_res_73463;\n    \n    min_res_73463 = ((__global int64_t *) mem_77904)[gtid_73451];\n    \n    float max_res_73464;\n    \n    max_res_73464 = ((__global float *) mem_77907)[gtid_73451];\n    \n    int64_t min_arg_73468 = mul64(jump_65348, gtid_73452);\n    int64_t min_res_73469 = smin64(i_65358, min_arg_73468);\n    int64_t defunc_0_g_res_73470 = add64((int64_t) 1, min_res_73469);\n    bool init_idx_73471;\n    int64_t init_idx_73472;\n    int64_t init_idx_73473;\n    bool loop_while_73474;\n    int64_t low_73475;\n    int64_t high_73476;\n    \n    loop_while_73474 = x_65359;\n    low_73475 = (int64_t) 0;\n    high_73476 = i_65358;\n    while (loop_while_73474) {\n        int64_t x_73477 = add64(low_73475, high_73476);\n        int64_t mid_73478 = sdiv64(x_73477, (int64_t) 2);\n        bool x_73479 = sle64((int64_t) 0, mid_73478);\n        bool y_73480 = slt64(mid_73478, n_65344);\n        bool bounds_check_73481 = x_73479 && y_73480;\n        bool index_certs_73482;\n        \n        if (!bounds_check_73481) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 50) == -1) {\n                    global_failure_args[0] = (int64_t) mid_73478;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                local_failure = true;\n                goto error_0;\n            }\n        }\n        \n        int64_t mid_id_73483;\n        \n        mid_id_73483 = ((__global int64_t *) mem_77894)[gtid_73451 * n_65344 +\n                                                        mid_73478];\n        \n        bool cond_73484 = slt64(mid_id_73483, (int64_t) 0);\n        int64_t mid_idx_73485;\n        \n        if (cond_73484) {\n            mid_idx_73485 = (int64_t) 92233720368547",
                   "75807;\n        } else {\n            mid_idx_73485 = mid_id_73483;\n        }\n        \n        bool cond_73486 = sle64(defunc_0_g_res_73470, mid_idx_73485);\n        int64_t loopres_73487;\n        int64_t loopres_73488;\n        \n        if (cond_73486) {\n            int64_t loopres_t_res_73489 = sub64(mid_73478, (int64_t) 1);\n            \n            loopres_73487 = low_73475;\n            loopres_73488 = loopres_t_res_73489;\n        } else {\n            int64_t loopres_f_res_73490 = add64((int64_t) 1, mid_73478);\n            \n            loopres_73487 = loopres_f_res_73490;\n            loopres_73488 = high_73476;\n        }\n        \n        bool loop_cond_73491 = sle64(loopres_73487, loopres_73488);\n        bool loop_while_tmp_79765 = loop_cond_73491;\n        int64_t low_tmp_79766 = loopres_73487;\n        int64_t high_tmp_79767 = loopres_73488;\n        \n        loop_while_73474 = loop_while_tmp_79765;\n        low_73475 = low_tmp_79766;\n        high_73476 = high_tmp_79767;\n    }\n    init_idx_73471 = loop_while_73474;\n    init_idx_73472 = low_73475;\n    init_idx_73473 = high_73476;\n    \n    bool idx_73492;\n    int64_t idx_73493;\n    int64_t idx_73494;\n    int64_t idx_73495;\n    bool loop_while_73496;\n    int64_t l_idx_73497;\n    int64_t r_idx_73498;\n    int64_t span_73499;\n    \n    loop_while_73496 = loop_cond_65369;\n    l_idx_73497 = init_idx_73472;\n    r_idx_73498 = init_idx_73472;\n    span_73499 = (int64_t) 1;\n    while (loop_while_73496) {\n        int64_t max_arg_73500 = sub64(l_idx_73497, (int64_t) 1);\n        int64_t max_res_73501 = smax64((int64_t) 0, max_arg_73500);\n        int64_t min_arg_73502 = add64((int64_t) 1, r_idx_73498);\n        int64_t min_res_73503 = smin64(min_arg_73461, min_arg_73502);\n        bool x_73504 = sle64((int64_t) 0, max_res_73501);\n        bool y_73505 = slt64(max_res_73501, n_65344);\n        bool bounds_check_73506 = x_73504 && y_73505;\n        bool index_certs_73507;\n        \n        if (!bounds_check_73506) {\n            {\n              ",
                   "  if (atomic_cmpxchg_i32_global(global_failure, -1, 51) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_73501;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                local_failure = true;\n                goto error_0;\n            }\n        }\n        \n        int64_t x_73508;\n        \n        x_73508 = ((__global int64_t *) mem_77894)[gtid_73451 * n_65344 +\n                                                   max_res_73501];\n        \n        int64_t abs_arg_73509 = sub64(x_73508, defunc_0_g_res_73470);\n        int64_t abs_res_73510 = abs64(abs_arg_73509);\n        bool x_73511 = sle64((int64_t) 0, min_res_73503);\n        bool y_73512 = slt64(min_res_73503, n_65344);\n        bool bounds_check_73513 = x_73511 && y_73512;\n        bool index_certs_73514;\n        \n        if (!bounds_check_73513) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 52) == -1) {\n                    global_failure_args[0] = (int64_t) min_res_73503;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                local_failure = true;\n                goto error_0;\n            }\n        }\n        \n        int64_t x_73515;\n        \n        x_73515 = ((__global int64_t *) mem_77894)[gtid_73451 * n_65344 +\n                                                   min_res_73503];\n        \n        int64_t abs_arg_73516 = sub64(x_73515, defunc_0_g_res_73470);\n        int64_t abs_res_73517 = abs64(abs_arg_73516);\n        bool cond_73518 = max_res_73501 == l_idx_73497;\n        int64_t loopres_73519;\n        int64_t loopres_73520;\n        int64_t loopres_73521;\n        \n        if (cond_73518) {\n            loopres_73519 = l_idx_73497;\n            loopres_73520 = r_idx_73498;\n            loopres_73521 = min_res_65364;\n        } else {\n            bool cond_73522 = slt64(abs_res_73510, abs_res_73517);\n            bool cond_f_res_73523 = min_r",
                   "es_73503 == r_idx_73498;\n            bool x_73524 = !cond_73522;\n            bool y_73525 = cond_f_res_73523 && x_73524;\n            bool cond_73526 = cond_73522 || y_73525;\n            int64_t loopres_f_res_73527;\n            \n            if (cond_73526) {\n                loopres_f_res_73527 = max_res_73501;\n            } else {\n                loopres_f_res_73527 = l_idx_73497;\n            }\n            \n            int64_t loopres_f_res_73528;\n            \n            if (cond_73526) {\n                loopres_f_res_73528 = r_idx_73498;\n            } else {\n                loopres_f_res_73528 = min_res_73503;\n            }\n            \n            int64_t loopres_f_res_73529;\n            \n            if (cond_73526) {\n                int64_t loopres_f_res_t_res_73530 = add64((int64_t) 1,\n                                                          span_73499);\n                \n                loopres_f_res_73529 = loopres_f_res_t_res_73530;\n            } else {\n                int64_t loopres_f_res_f_res_73531 = add64((int64_t) 1,\n                                                          span_73499);\n                \n                loopres_f_res_73529 = loopres_f_res_f_res_73531;\n            }\n            loopres_73519 = loopres_f_res_73527;\n            loopres_73520 = loopres_f_res_73528;\n            loopres_73521 = loopres_f_res_73529;\n        }\n        \n        bool loop_cond_73532 = slt64(loopres_73521, min_res_65364);\n        bool loop_while_tmp_79768 = loop_cond_73532;\n        int64_t l_idx_tmp_79769 = loopres_73519;\n        int64_t r_idx_tmp_79770 = loopres_73520;\n        int64_t span_tmp_79771 = loopres_73521;\n        \n        loop_while_73496 = loop_while_tmp_79768;\n        l_idx_73497 = l_idx_tmp_79769;\n        r_idx_73498 = r_idx_tmp_79770;\n        span_73499 = span_tmp_79771;\n    }\n    idx_73492 = loop_while_73496;\n    idx_73493 = l_idx_73497;\n    idx_73494 = r_idx_73498;\n    idx_73495 = span_73499;\n    \n    int64_t min_res_73533 = smin64(min_arg_73462, ",
                   "idx_73493);\n    int64_t max_res_73534 = smax64((int64_t) 0, min_res_73533);\n    int64_t x_73535 = add64(min_res_73463, max_res_73534);\n    int64_t r_73536 = sub64(x_73535, (int64_t) 1);\n    bool x_73537 = sle64((int64_t) 0, r_73536);\n    bool y_73538 = slt64(r_73536, n_65344);\n    bool bounds_check_73539 = x_73537 && y_73538;\n    bool index_certs_73540;\n    \n    if (!bounds_check_73539) {\n        {\n            if (atomic_cmpxchg_i32_global(global_failure, -1, 53) == -1) {\n                global_failure_args[0] = (int64_t) r_73536;\n                global_failure_args[1] = (int64_t) n_65344;\n                ;\n            }\n            local_failure = true;\n            goto error_0;\n        }\n    }\n    \n    int64_t x_73541;\n    \n    x_73541 = ((__global int64_t *) mem_77888)[gtid_73451 * n_65344 + r_73536];\n    \n    int64_t abs_arg_73542 = sub64(x_73541, min_res_73469);\n    int64_t abs_res_73543 = abs64(abs_arg_73542);\n    bool x_73544 = sle64((int64_t) 0, max_res_73534);\n    bool y_73545 = slt64(max_res_73534, n_65344);\n    bool bounds_check_73546 = x_73544 && y_73545;\n    bool index_certs_73547;\n    \n    if (!bounds_check_73546) {\n        {\n            if (atomic_cmpxchg_i32_global(global_failure, -1, 54) == -1) {\n                global_failure_args[0] = (int64_t) max_res_73534;\n                global_failure_args[1] = (int64_t) n_65344;\n                ;\n            }\n            local_failure = true;\n            goto error_0;\n        }\n    }\n    \n    int64_t x_73548;\n    \n    x_73548 = ((__global int64_t *) mem_77888)[gtid_73451 * n_65344 +\n                                               max_res_73534];\n    \n    int64_t abs_arg_73549 = sub64(x_73548, min_res_73469);\n    int64_t abs_res_73550 = abs64(abs_arg_73549);\n    int64_t max_res_73551 = smax64(abs_res_73543, abs_res_73550);\n    float defunc_0_f_res_73552 = sitofp_i64_f32(max_res_73551);\n    float defunc_1_f_res_73553 = max_res_73464 + defunc_0_f_res_73552;\n    float defunc_2_reduce_res_73554;\n    float defunc_",
                   "2_reduce_res_73555;\n    float defunc_2_reduce_res_73556;\n    int64_t gtid_73559 = sext_i32_i64(sext_i64_i32(ltid_pre_79758));\n    int32_t phys_tid_73560 = local_tid_79754;\n    __local unsigned char *red_arr_mem_79772;\n    \n    red_arr_mem_79772 = (__local unsigned char *) red_arr_mem_79772_backing_2;\n    \n    __local unsigned char *red_arr_mem_79774;\n    \n    red_arr_mem_79774 = (__local unsigned char *) red_arr_mem_79774_backing_3;\n    \n    __local unsigned char *red_arr_mem_79776;\n    \n    red_arr_mem_79776 = (__local unsigned char *) red_arr_mem_79776_backing_4;\n    \n    float x_73571;\n    \n    x_73571 = ((__global float *) mem_77912)[gtid_73451 * q_65346 + gtid_73559];\n    \n    bool cond_73572 = sle64(last_res_73454, gtid_73559);\n    int64_t defunc_0_f_res_73573;\n    \n    if (cond_73572) {\n        defunc_0_f_res_73573 = (int64_t) 0;\n    } else {\n        int64_t i_73574 = add64(max_res_73534, gtid_73559);\n        int64_t defunc_0_add_arg_73575;\n        \n        defunc_0_add_arg_73575 = ((__global int64_t *) mem_77888)[gtid_73451 *\n                                                                  n_65344 +\n                                                                  i_73574];\n        \n        int64_t defunc_1_add_res_73576 = add64((int64_t) 1,\n                                               defunc_0_add_arg_73575);\n        \n        defunc_0_f_res_73573 = defunc_1_add_res_73576;\n    }\n    \n    int64_t binop_p_73577 = sub64(defunc_0_f_res_73573, min_res_73469);\n    float defunc_0_f_res_73578 = sitofp_i64_f32(binop_p_73577);\n    float abs_res_73579 = (float) fabs(defunc_0_f_res_73578);\n    float tmp1_73580 = abs_res_73579 / defunc_1_f_res_73553;\n    float x_73581 = tmp1_73580 * tmp1_73580;\n    float y_73582 = tmp1_73580 * x_73581;\n    float tmp2_73583 = 1.0F - y_73582;\n    float x_73584 = tmp2_73583 * tmp2_73583;\n    float tmp3_73585 = tmp2_73583 * x_73584;\n    float tmp4_73586 = x_73571 * tmp3_73585;\n    float defunc_1_f_res_73587 = defunc_0_f_res_73578 * tmp4_7",
                   "3586;\n    float defunc_1_f_res_73588 = defunc_0_f_res_73578 * defunc_1_f_res_73587;\n    \n    ((__local float *) red_arr_mem_79772)[gtid_73559] = tmp4_73586;\n    ((__local float *) red_arr_mem_79774)[gtid_73559] = defunc_1_f_res_73587;\n    ((__local float *) red_arr_mem_79776)[gtid_73559] = defunc_1_f_res_73588;\n    ((__local float *) color_78196)[gtid_73559] = defunc_1_f_res_73587;\n    ((__local float *) color_78195)[gtid_73559] = tmp4_73586;\n    \n  error_0:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_79778;\n    int32_t skip_waves_79779 = 1;\n    float x_73561;\n    float x_73562;\n    float x_73563;\n    float x_73564;\n    float x_73565;\n    float x_73566;\n    \n    offset_79778 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_79754, sext_i64_i32(q_65346))) {\n            x_73561 = ((__local\n                        float *) red_arr_mem_79772)[sext_i32_i64(local_tid_79754 +\n                                                    offset_79778)];\n            x_73562 = ((__local\n                        float *) red_arr_mem_79774)[sext_i32_i64(local_tid_79754 +\n                                                    offset_79778)];\n            x_73563 = ((__local\n                        float *) red_arr_mem_79776)[sext_i32_i64(local_tid_79754 +\n                                                    offset_79778)];\n        }\n    }\n    offset_79778 = 1;\n    while (slt32(offset_79778, wave_sizze_79756)) {\n        if (slt32(local_tid_79754 + offset_79778, sext_i64_i32(q_65346)) &&\n            ((local_tid_79754 - squot32(local_tid_79754, wave_sizze_79756) *\n              wave_sizze_79756) & (2 * offset_79778 - 1)) == 0) {\n            // read array element\n            {\n                x_73564 = ((volatile __local\n                            float *) red_arr_mem_79772)[sext_i32_i64(local_tid_79754 +\n                                                        offset_79",
                   "778)];\n                x_73565 = ((volatile __local\n                            float *) red_arr_mem_79774)[sext_i32_i64(local_tid_79754 +\n                                                        offset_79778)];\n                x_73566 = ((volatile __local\n                            float *) red_arr_mem_79776)[sext_i32_i64(local_tid_79754 +\n                                                        offset_79778)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_73567 = x_73561 + x_73564;\n                float defunc_1_op_res_73568 = x_73562 + x_73565;\n                float defunc_1_op_res_73569 = x_73563 + x_73566;\n                \n                x_73561 = defunc_1_op_res_73567;\n                x_73562 = defunc_1_op_res_73568;\n                x_73563 = defunc_1_op_res_73569;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_79772)[sext_i32_i64(local_tid_79754)] =\n                    x_73561;\n                ((volatile __local\n                  float *) red_arr_mem_79774)[sext_i32_i64(local_tid_79754)] =\n                    x_73562;\n                ((volatile __local\n                  float *) red_arr_mem_79776)[sext_i32_i64(local_tid_79754)] =\n                    x_73563;\n            }\n        }\n        offset_79778 *= 2;\n    }\n    while (slt32(skip_waves_79779, squot32(sext_i64_i32(q_65346) +\n                                           wave_sizze_79756 - 1,\n                                           wave_sizze_79756))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_79778 = skip_waves_79779 * wave_sizze_79756;\n        if (slt32(local_tid_79754 + offset_79778, sext_i64_i32(q_65346)) &&\n            ((local_tid_79754 - squot32(local_tid_79754, wave_sizze_79756) *\n              wave_sizze_79756) == 0 && (squot32(local_tid_79754,\n                                                 wave_sizze_79756) & (2 *\n              ",
                   "                                                        skip_waves_79779 -\n                                                                      1)) ==\n             0)) {\n            // read array element\n            {\n                x_73564 = ((__local\n                            float *) red_arr_mem_79772)[sext_i32_i64(local_tid_79754 +\n                                                        offset_79778)];\n                x_73565 = ((__local\n                            float *) red_arr_mem_79774)[sext_i32_i64(local_tid_79754 +\n                                                        offset_79778)];\n                x_73566 = ((__local\n                            float *) red_arr_mem_79776)[sext_i32_i64(local_tid_79754 +\n                                                        offset_79778)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_73567 = x_73561 + x_73564;\n                float defunc_1_op_res_73568 = x_73562 + x_73565;\n                float defunc_1_op_res_73569 = x_73563 + x_73566;\n                \n                x_73561 = defunc_1_op_res_73567;\n                x_73562 = defunc_1_op_res_73568;\n                x_73563 = defunc_1_op_res_73569;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_79772)[sext_i32_i64(local_tid_79754)] =\n                    x_73561;\n                ((__local\n                  float *) red_arr_mem_79774)[sext_i32_i64(local_tid_79754)] =\n                    x_73562;\n                ((__local\n                  float *) red_arr_mem_79776)[sext_i32_i64(local_tid_79754)] =\n                    x_73563;\n            }\n        }\n        skip_waves_79779 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_73554 = ((__local\n                                  float *) red_arr_mem_79772)[(int64_t) 0];\n    defunc_2_reduce_res_73555 = ((__local\n                                  float *)",
                   " red_arr_mem_79774)[(int64_t) 0];\n    defunc_2_reduce_res_73556 = ((__local\n                                  float *) red_arr_mem_79776)[(int64_t) 0];\n    \n    float x_73589 = defunc_2_reduce_res_73554 * defunc_2_reduce_res_73556;\n    float y_73590 = defunc_2_reduce_res_73555 * defunc_2_reduce_res_73555;\n    float y_73591 = x_73589 - y_73590;\n    float det1_73592 = 1.0F / y_73591;\n    float a11_73593 = defunc_2_reduce_res_73556 * det1_73592;\n    float x_73594 = 0.0F - defunc_2_reduce_res_73555;\n    float b11_73595 = det1_73592 * x_73594;\n    float c11_73596 = defunc_2_reduce_res_73554 * det1_73592;\n    float defunc_2_reduce_res_73597;\n    float defunc_2_reduce_res_73598;\n    int64_t gtid_73599 = sext_i32_i64(sext_i64_i32(ltid_pre_79758));\n    int32_t phys_tid_73600 = local_tid_79754;\n    __local unsigned char *red_arr_mem_79780;\n    \n    red_arr_mem_79780 = (__local unsigned char *) red_arr_mem_79780_backing_5;\n    \n    __local unsigned char *red_arr_mem_79782;\n    \n    red_arr_mem_79782 = (__local unsigned char *) red_arr_mem_79782_backing_6;\n    \n    float x_73608;\n    \n    x_73608 = ((__local float *) color_78195)[gtid_73599];\n    \n    float x_73609;\n    \n    x_73609 = ((__local float *) color_78196)[gtid_73599];\n    \n    bool cond_73610 = sle64(last_res_73454, gtid_73599);\n    float defunc_0_f_res_73611;\n    \n    if (cond_73610) {\n        defunc_0_f_res_73611 = 0.0F;\n    } else {\n        int64_t i_73612 = add64(max_res_73534, gtid_73599);\n        float defunc_0_add_arg_73613;\n        \n        defunc_0_add_arg_73613 = ((__global float *) mem_77884)[gtid_73451 *\n                                                                n_65344 +\n                                                                i_73612];\n        defunc_0_f_res_73611 = defunc_0_add_arg_73613;\n    }\n    \n    float x_73614 = a11_73593 * x_73608;\n    float y_73615 = b11_73595 * x_73609;\n    float x_73616 = x_73614 + y_73615;\n    float defunc_9_fit_fun_res_73617 = defunc_0_f_res_73611 * x_73616;\n  ",
                   "  float x_73618 = b11_73595 * x_73608;\n    float y_73619 = c11_73596 * x_73609;\n    float x_73620 = x_73618 + y_73619;\n    float defunc_9_slope_fun_res_73621 = defunc_0_f_res_73611 * x_73620;\n    \n    ((__local float *) red_arr_mem_79780)[gtid_73599] =\n        defunc_9_fit_fun_res_73617;\n    ((__local float *) red_arr_mem_79782)[gtid_73599] =\n        defunc_9_slope_fun_res_73621;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_79784;\n    int32_t skip_waves_79785 = 1;\n    float x_73601;\n    float x_73602;\n    float x_73603;\n    float x_73604;\n    \n    offset_79784 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_79754, sext_i64_i32(q_65346))) {\n            x_73601 = ((__local\n                        float *) red_arr_mem_79780)[sext_i32_i64(local_tid_79754 +\n                                                    offset_79784)];\n            x_73602 = ((__local\n                        float *) red_arr_mem_79782)[sext_i32_i64(local_tid_79754 +\n                                                    offset_79784)];\n        }\n    }\n    offset_79784 = 1;\n    while (slt32(offset_79784, wave_sizze_79756)) {\n        if (slt32(local_tid_79754 + offset_79784, sext_i64_i32(q_65346)) &&\n            ((local_tid_79754 - squot32(local_tid_79754, wave_sizze_79756) *\n              wave_sizze_79756) & (2 * offset_79784 - 1)) == 0) {\n            // read array element\n            {\n                x_73603 = ((volatile __local\n                            float *) red_arr_mem_79780)[sext_i32_i64(local_tid_79754 +\n                                                        offset_79784)];\n                x_73604 = ((volatile __local\n                            float *) red_arr_mem_79782)[sext_i32_i64(local_tid_79754 +\n                                                        offset_79784)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_73605 = x_73601 + x_73603;\n                float defunc_",
                   "1_op_res_73606 = x_73602 + x_73604;\n                \n                x_73601 = defunc_1_op_res_73605;\n                x_73602 = defunc_1_op_res_73606;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_79780)[sext_i32_i64(local_tid_79754)] =\n                    x_73601;\n                ((volatile __local\n                  float *) red_arr_mem_79782)[sext_i32_i64(local_tid_79754)] =\n                    x_73602;\n            }\n        }\n        offset_79784 *= 2;\n    }\n    while (slt32(skip_waves_79785, squot32(sext_i64_i32(q_65346) +\n                                           wave_sizze_79756 - 1,\n                                           wave_sizze_79756))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_79784 = skip_waves_79785 * wave_sizze_79756;\n        if (slt32(local_tid_79754 + offset_79784, sext_i64_i32(q_65346)) &&\n            ((local_tid_79754 - squot32(local_tid_79754, wave_sizze_79756) *\n              wave_sizze_79756) == 0 && (squot32(local_tid_79754,\n                                                 wave_sizze_79756) & (2 *\n                                                                      skip_waves_79785 -\n                                                                      1)) ==\n             0)) {\n            // read array element\n            {\n                x_73603 = ((__local\n                            float *) red_arr_mem_79780)[sext_i32_i64(local_tid_79754 +\n                                                        offset_79784)];\n                x_73604 = ((__local\n                            float *) red_arr_mem_79782)[sext_i32_i64(local_tid_79754 +\n                                                        offset_79784)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_73605 = x_73601 + x_73603;\n                float defunc_1_op_res_73606 = x_73602 + x_73604;\n                \n          ",
                   "      x_73601 = defunc_1_op_res_73605;\n                x_73602 = defunc_1_op_res_73606;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_79780)[sext_i32_i64(local_tid_79754)] =\n                    x_73601;\n                ((__local\n                  float *) red_arr_mem_79782)[sext_i32_i64(local_tid_79754)] =\n                    x_73602;\n            }\n        }\n        skip_waves_79785 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_73597 = ((__local\n                                  float *) red_arr_mem_79780)[(int64_t) 0];\n    defunc_2_reduce_res_73598 = ((__local\n                                  float *) red_arr_mem_79782)[(int64_t) 0];\n    if (local_tid_79754 == 0) {\n        ((__global float *) mem_77925)[gtid_73451 * n_m_65352 + gtid_73452] =\n            defunc_2_reduce_res_73597;\n    }\n    if (local_tid_79754 == 0) {\n        ((__global float *) mem_77929)[gtid_73451 * n_m_65352 + gtid_73452] =\n            defunc_2_reduce_res_73598;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_74210(__global int *global_failure,\n                                            int failure_is_an_option, __global\n                                            int64_t *global_failure_args,\n                                            __local volatile\n                                            int64_t *red_arr_mem_79923_backing_aligned_0,\n                                            __local volatile\n                                            int64_t *red_arr_mem_79921_backing_aligned_1,\n                                            __local volatile\n                                            int64_t *red_arr_mem_79917_backing_aligned_2,\n                                            __local volatile\n                                            int64_t *red_arr_mem_79915_backing_aligned_3,\n                                            __local volatile\n            ",
                   "                                int64_t *red_arr_mem_79913_backing_aligned_4,\n                                            __local volatile\n                                            int64_t *red_arr_mem_79911_backing_aligned_5,\n                                            __local volatile\n                                            int64_t *red_arr_mem_79909_backing_aligned_6,\n                                            __local volatile\n                                            int64_t *color_78200_backing_aligned_7,\n                                            __local volatile\n                                            int64_t *color_78199_backing_aligned_8,\n                                            __local volatile\n                                            int64_t *color_78198_backing_aligned_9,\n                                            __local volatile\n                                            int64_t *color_78197_backing_aligned_10,\n                                            int64_t m_65343, int64_t n_65344,\n                                            int64_t q_65346, int64_t jump_65348,\n                                            int64_t n_m_65352, int64_t i_65358,\n                                            unsigned char x_65359_bits,\n                                            int64_t min_res_65364,\n                                            unsigned char loop_cond_65369_bits,\n                                            __global unsigned char *mem_77934,\n                                            __global unsigned char *mem_77938,\n                                            __global unsigned char *mem_77942,\n                                            __global unsigned char *mem_77948,\n                                            __global unsigned char *mem_77952,\n                                            __global unsigned char *mem_77955,\n                                            __global unsigned char *mem_77958,\n                            ",
                   "                __global unsigned char *mem_77961,\n                                            __global unsigned char *mem_77966,\n                                            __global unsigned char *mem_77986,\n                                            __global unsigned char *mem_77990)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_79923_backing_10 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79923_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_79921_backing_9 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79921_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_79917_backing_8 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79917_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_79915_backing_7 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79915_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_79913_backing_6 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79913_backing_aligned_4;\n    __local volatile unsigned char *restrict red_arr_mem_79911_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79911_backing_aligned_5;\n    __local volatile unsigned char *restrict red_arr_mem_79909_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79909_backing_aligned_6;\n    __local",
                   " volatile unsigned char *restrict color_78200_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) color_78200_backing_aligned_7;\n    __local volatile unsigned char *restrict color_78199_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) color_78199_backing_aligned_8;\n    __local volatile unsigned char *restrict color_78198_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) color_78198_backing_aligned_9;\n    __local volatile unsigned char *restrict color_78197_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_78197_backing_aligned_10;\n    volatile __local bool local_failure;\n    \n    if (failure_is_an_option) {\n        int failed = *global_failure >= 0;\n        \n        if (failed)\n            return;\n    }\n    local_failure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_79890;\n    int32_t local_tid_79891;\n    int64_t group_sizze_79894;\n    int32_t wave_sizze_79893;\n    int32_t group_tid_79892;\n    \n    global_tid_79890 = get_global_id(0);\n    local_tid_79891 = get_local_id(0);\n    group_sizze_79894 = get_local_size(0);\n    wave_sizze_79893 = LOCKSTEP_WIDTH;\n    group_tid_79892 = get_group_id(0);\n    \n    int32_t phys_tid_74210 = group_tid_79892;\n    int64_t slice_79896 = q_65346;\n    int64_t ltid_pre_79895 = sext_i32_i64(local_tid_79891);\n    int64_t remnant_79897 = sext_i32_i64(local_tid_79891) - ltid_pre_79895;\n    int64_t slice_79898 = n_m_65352;\n    int64_t slice_79899 = m_65343 * slice_79898;\n    int64_t gtid_74208 = squot64(sext_i32_i64(group_tid_79892), slice_79898);\n    int64_t remnant_79900 = sext_i32_i64(group_tid_79892) - gtid_74208 *\n            slice_79898;\n    int64_t gtid_74209 = remnant_79900;\n    int64_t remnant_79901 = remnant_79900 - gtid_74209;\n    __loc",
                   "al unsigned char *color_78197;\n    \n    color_78197 = (__local unsigned char *) color_78197_backing_0;\n    \n    __local unsigned char *color_78198;\n    \n    color_78198 = (__local unsigned char *) color_78198_backing_1;\n    \n    __local unsigned char *color_78199;\n    \n    color_78199 = (__local unsigned char *) color_78199_backing_2;\n    \n    __local unsigned char *color_78200;\n    \n    color_78200 = (__local unsigned char *) color_78200_backing_3;\n    \n    int64_t last_res_74211;\n    \n    last_res_74211 = ((__global int64_t *) mem_77934)[gtid_74208 * n_65344 +\n                                                      i_65358];\n    \n    int64_t min_arg_74218;\n    \n    min_arg_74218 = ((__global int64_t *) mem_77952)[gtid_74208];\n    \n    int64_t min_arg_74219;\n    \n    min_arg_74219 = ((__global int64_t *) mem_77955)[gtid_74208];\n    \n    int64_t min_res_74220;\n    \n    min_res_74220 = ((__global int64_t *) mem_77958)[gtid_74208];\n    \n    float max_res_74221;\n    \n    max_res_74221 = ((__global float *) mem_77961)[gtid_74208];\n    \n    int64_t min_arg_74225 = mul64(jump_65348, gtid_74209);\n    int64_t min_res_74226 = smin64(i_65358, min_arg_74225);\n    int64_t defunc_0_g_res_74227 = add64((int64_t) 1, min_res_74226);\n    bool init_idx_74228;\n    int64_t init_idx_74229;\n    int64_t init_idx_74230;\n    bool loop_while_74231;\n    int64_t low_74232;\n    int64_t high_74233;\n    \n    loop_while_74231 = x_65359;\n    low_74232 = (int64_t) 0;\n    high_74233 = i_65358;\n    while (loop_while_74231) {\n        int64_t x_74234 = add64(low_74232, high_74233);\n        int64_t mid_74235 = sdiv64(x_74234, (int64_t) 2);\n        bool x_74236 = sle64((int64_t) 0, mid_74235);\n        bool y_74237 = slt64(mid_74235, n_65344);\n        bool bounds_check_74238 = x_74236 && y_74237;\n        bool index_certs_74239;\n        \n        if (!bounds_check_74238) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 55) == -1) {\n                    global_failure_args[0] = (",
                   "int64_t) mid_74235;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                local_failure = true;\n                goto error_0;\n            }\n        }\n        \n        int64_t mid_id_74240;\n        \n        mid_id_74240 = ((__global int64_t *) mem_77948)[gtid_74208 * n_65344 +\n                                                        mid_74235];\n        \n        bool cond_74241 = slt64(mid_id_74240, (int64_t) 0);\n        int64_t mid_idx_74242;\n        \n        if (cond_74241) {\n            mid_idx_74242 = (int64_t) 9223372036854775807;\n        } else {\n            mid_idx_74242 = mid_id_74240;\n        }\n        \n        bool cond_74243 = sle64(defunc_0_g_res_74227, mid_idx_74242);\n        int64_t loopres_74244;\n        int64_t loopres_74245;\n        \n        if (cond_74243) {\n            int64_t loopres_t_res_74246 = sub64(mid_74235, (int64_t) 1);\n            \n            loopres_74244 = low_74232;\n            loopres_74245 = loopres_t_res_74246;\n        } else {\n            int64_t loopres_f_res_74247 = add64((int64_t) 1, mid_74235);\n            \n            loopres_74244 = loopres_f_res_74247;\n            loopres_74245 = high_74233;\n        }\n        \n        bool loop_cond_74248 = sle64(loopres_74244, loopres_74245);\n        bool loop_while_tmp_79902 = loop_cond_74248;\n        int64_t low_tmp_79903 = loopres_74244;\n        int64_t high_tmp_79904 = loopres_74245;\n        \n        loop_while_74231 = loop_while_tmp_79902;\n        low_74232 = low_tmp_79903;\n        high_74233 = high_tmp_79904;\n    }\n    init_idx_74228 = loop_while_74231;\n    init_idx_74229 = low_74232;\n    init_idx_74230 = high_74233;\n    \n    bool idx_74249;\n    int64_t idx_74250;\n    int64_t idx_74251;\n    int64_t idx_74252;\n    bool loop_while_74253;\n    int64_t l_idx_74254;\n    int64_t r_idx_74255;\n    int64_t span_74256;\n    \n    loop_while_74253 = loop_cond_65369;\n    l_idx_74254 = init_idx_74229;\n    r_idx_74255 = init_idx_74229;\n ",
                   "   span_74256 = (int64_t) 1;\n    while (loop_while_74253) {\n        int64_t max_arg_74257 = sub64(l_idx_74254, (int64_t) 1);\n        int64_t max_res_74258 = smax64((int64_t) 0, max_arg_74257);\n        int64_t min_arg_74259 = add64((int64_t) 1, r_idx_74255);\n        int64_t min_res_74260 = smin64(min_arg_74218, min_arg_74259);\n        bool x_74261 = sle64((int64_t) 0, max_res_74258);\n        bool y_74262 = slt64(max_res_74258, n_65344);\n        bool bounds_check_74263 = x_74261 && y_74262;\n        bool index_certs_74264;\n        \n        if (!bounds_check_74263) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 56) == -1) {\n                    global_failure_args[0] = (int64_t) max_res_74258;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                local_failure = true;\n                goto error_0;\n            }\n        }\n        \n        int64_t x_74265;\n        \n        x_74265 = ((__global int64_t *) mem_77948)[gtid_74208 * n_65344 +\n                                                   max_res_74258];\n        \n        int64_t abs_arg_74266 = sub64(x_74265, defunc_0_g_res_74227);\n        int64_t abs_res_74267 = abs64(abs_arg_74266);\n        bool x_74268 = sle64((int64_t) 0, min_res_74260);\n        bool y_74269 = slt64(min_res_74260, n_65344);\n        bool bounds_check_74270 = x_74268 && y_74269;\n        bool index_certs_74271;\n        \n        if (!bounds_check_74270) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 57) == -1) {\n                    global_failure_args[0] = (int64_t) min_res_74260;\n                    global_failure_args[1] = (int64_t) n_65344;\n                    ;\n                }\n                local_failure = true;\n                goto error_0;\n            }\n        }\n        \n        int64_t x_74272;\n        \n        x_74272 = ((__global int64_t *) mem_77948)[gtid_74208 * n_65344 +\n                                    ",
                   "               min_res_74260];\n        \n        int64_t abs_arg_74273 = sub64(x_74272, defunc_0_g_res_74227);\n        int64_t abs_res_74274 = abs64(abs_arg_74273);\n        bool cond_74275 = max_res_74258 == l_idx_74254;\n        int64_t loopres_74276;\n        int64_t loopres_74277;\n        int64_t loopres_74278;\n        \n        if (cond_74275) {\n            loopres_74276 = l_idx_74254;\n            loopres_74277 = r_idx_74255;\n            loopres_74278 = min_res_65364;\n        } else {\n            bool cond_74279 = slt64(abs_res_74267, abs_res_74274);\n            bool cond_f_res_74280 = min_res_74260 == r_idx_74255;\n            bool x_74281 = !cond_74279;\n            bool y_74282 = cond_f_res_74280 && x_74281;\n            bool cond_74283 = cond_74279 || y_74282;\n            int64_t loopres_f_res_74284;\n            \n            if (cond_74283) {\n                loopres_f_res_74284 = max_res_74258;\n            } else {\n                loopres_f_res_74284 = l_idx_74254;\n            }\n            \n            int64_t loopres_f_res_74285;\n            \n            if (cond_74283) {\n                loopres_f_res_74285 = r_idx_74255;\n            } else {\n                loopres_f_res_74285 = min_res_74260;\n            }\n            \n            int64_t loopres_f_res_74286;\n            \n            if (cond_74283) {\n                int64_t loopres_f_res_t_res_74287 = add64((int64_t) 1,\n                                                          span_74256);\n                \n                loopres_f_res_74286 = loopres_f_res_t_res_74287;\n            } else {\n                int64_t loopres_f_res_f_res_74288 = add64((int64_t) 1,\n                                                          span_74256);\n                \n                loopres_f_res_74286 = loopres_f_res_f_res_74288;\n            }\n            loopres_74276 = loopres_f_res_74284;\n            loopres_74277 = loopres_f_res_74285;\n            loopres_74278 = loopres_f_res_74286;\n        }\n        \n        bool loop_cond_",
                   "74289 = slt64(loopres_74278, min_res_65364);\n        bool loop_while_tmp_79905 = loop_cond_74289;\n        int64_t l_idx_tmp_79906 = loopres_74276;\n        int64_t r_idx_tmp_79907 = loopres_74277;\n        int64_t span_tmp_79908 = loopres_74278;\n        \n        loop_while_74253 = loop_while_tmp_79905;\n        l_idx_74254 = l_idx_tmp_79906;\n        r_idx_74255 = r_idx_tmp_79907;\n        span_74256 = span_tmp_79908;\n    }\n    idx_74249 = loop_while_74253;\n    idx_74250 = l_idx_74254;\n    idx_74251 = r_idx_74255;\n    idx_74252 = span_74256;\n    \n    int64_t min_res_74290 = smin64(min_arg_74219, idx_74250);\n    int64_t max_res_74291 = smax64((int64_t) 0, min_res_74290);\n    int64_t x_74292 = add64(min_res_74220, max_res_74291);\n    int64_t r_74293 = sub64(x_74292, (int64_t) 1);\n    bool x_74294 = sle64((int64_t) 0, r_74293);\n    bool y_74295 = slt64(r_74293, n_65344);\n    bool bounds_check_74296 = x_74294 && y_74295;\n    bool index_certs_74297;\n    \n    if (!bounds_check_74296) {\n        {\n            if (atomic_cmpxchg_i32_global(global_failure, -1, 58) == -1) {\n                global_failure_args[0] = (int64_t) r_74293;\n                global_failure_args[1] = (int64_t) n_65344;\n                ;\n            }\n            local_failure = true;\n            goto error_0;\n        }\n    }\n    \n    int64_t x_74298;\n    \n    x_74298 = ((__global int64_t *) mem_77942)[gtid_74208 * n_65344 + r_74293];\n    \n    int64_t abs_arg_74299 = sub64(x_74298, min_res_74226);\n    int64_t abs_res_74300 = abs64(abs_arg_74299);\n    bool x_74301 = sle64((int64_t) 0, max_res_74291);\n    bool y_74302 = slt64(max_res_74291, n_65344);\n    bool bounds_check_74303 = x_74301 && y_74302;\n    bool index_certs_74304;\n    \n    if (!bounds_check_74303) {\n        {\n            if (atomic_cmpxchg_i32_global(global_failure, -1, 59) == -1) {\n                global_failure_args[0] = (int64_t) max_res_74291;\n                global_failure_args[1] = (int64_t) n_65344;\n                ;\n            }\n           ",
                   " local_failure = true;\n            goto error_0;\n        }\n    }\n    \n    int64_t x_74305;\n    \n    x_74305 = ((__global int64_t *) mem_77942)[gtid_74208 * n_65344 +\n                                               max_res_74291];\n    \n    int64_t abs_arg_74306 = sub64(x_74305, min_res_74226);\n    int64_t abs_res_74307 = abs64(abs_arg_74306);\n    int64_t max_res_74308 = smax64(abs_res_74300, abs_res_74307);\n    float defunc_0_f_res_74309 = sitofp_i64_f32(max_res_74308);\n    float defunc_1_f_res_74310 = max_res_74221 + defunc_0_f_res_74309;\n    int64_t gtid_74313 = sext_i32_i64(sext_i64_i32(ltid_pre_79895));\n    int32_t phys_tid_74314 = local_tid_79891;\n    float x_74316;\n    \n    x_74316 = ((__global float *) mem_77966)[gtid_74208 * q_65346 + gtid_74313];\n    \n    bool cond_74317 = sle64(last_res_74211, gtid_74313);\n    int64_t defunc_0_f_res_74318;\n    \n    if (cond_74317) {\n        defunc_0_f_res_74318 = (int64_t) 0;\n    } else {\n        int64_t i_74319 = add64(max_res_74291, gtid_74313);\n        int64_t defunc_0_add_arg_74320;\n        \n        defunc_0_add_arg_74320 = ((__global int64_t *) mem_77942)[gtid_74208 *\n                                                                  n_65344 +\n                                                                  i_74319];\n        \n        int64_t defunc_1_add_res_74321 = add64((int64_t) 1,\n                                               defunc_0_add_arg_74320);\n        \n        defunc_0_f_res_74318 = defunc_1_add_res_74321;\n    }\n    \n    int64_t binop_p_74322 = sub64(defunc_0_f_res_74318, min_res_74226);\n    float defunc_0_f_res_74323 = sitofp_i64_f32(binop_p_74322);\n    float abs_res_74324 = (float) fabs(defunc_0_f_res_74323);\n    float tmp1_74325 = abs_res_74324 / defunc_1_f_res_74310;\n    float x_74326 = tmp1_74325 * tmp1_74325;\n    float y_74327 = tmp1_74325 * x_74326;\n    float tmp2_74328 = 1.0F - y_74327;\n    float x_74329 = tmp2_74328 * tmp2_74328;\n    float tmp3_74330 = tmp2_74328 * x_74329;\n    float tmp4_74331 = x_",
                   "74316 * tmp3_74330;\n    \n    ((__local float *) color_78200)[gtid_74313] = defunc_0_f_res_74323;\n    ((__local float *) color_78199)[gtid_74313] = tmp4_74331;\n    \n  error_0:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    float defunc_2_reduce_res_74332;\n    float defunc_2_reduce_res_74333;\n    float defunc_2_reduce_res_74334;\n    float defunc_2_reduce_res_74335;\n    float defunc_2_reduce_res_74336;\n    int64_t gtid_74339 = sext_i32_i64(sext_i64_i32(ltid_pre_79895));\n    int32_t phys_tid_74340 = local_tid_79891;\n    __local unsigned char *red_arr_mem_79909;\n    \n    red_arr_mem_79909 = (__local unsigned char *) red_arr_mem_79909_backing_4;\n    \n    __local unsigned char *red_arr_mem_79911;\n    \n    red_arr_mem_79911 = (__local unsigned char *) red_arr_mem_79911_backing_5;\n    \n    __local unsigned char *red_arr_mem_79913;\n    \n    red_arr_mem_79913 = (__local unsigned char *) red_arr_mem_79913_backing_6;\n    \n    __local unsigned char *red_arr_mem_79915;\n    \n    red_arr_mem_79915 = (__local unsigned char *) red_arr_mem_79915_backing_7;\n    \n    __local unsigned char *red_arr_mem_79917;\n    \n    red_arr_mem_79917 = (__local unsigned char *) red_arr_mem_79917_backing_8;\n    \n    float x_74356;\n    \n    x_74356 = ((__local float *) color_78200)[gtid_74339];\n    \n    float x_74357;\n    \n    x_74357 = ((__local float *) color_78199)[gtid_74339];\n    \n    float defunc_1_f_res_74358 = x_74356 * x_74357;\n    float defunc_1_f_res_74359 = x_74356 * defunc_1_f_res_74358;\n    float defunc_1_f_res_74360 = x_74356 * defunc_1_f_res_74359;\n    float defunc_1_f_res_74361 = x_74356 * defunc_1_f_res_74360;\n    \n    ((__local float *) red_arr_mem_79909)[gtid_74339] = x_74357;\n    ((__local float *) red_arr_mem_79911)[gtid_74339] = defunc_1_f_res_74358;\n    ((__local float *) red_arr_mem_79913)[gtid_74339] = defunc_1_f_res_74359;\n    ((__local float *) red_arr_mem_79915)[gtid_74339] = defunc_1_f_res_74360;\n    ((__loc",
                   "al float *) red_arr_mem_79917)[gtid_74339] = defunc_1_f_res_74361;\n    ((__local float *) color_78198)[gtid_74339] = defunc_1_f_res_74359;\n    ((__local float *) color_78197)[gtid_74339] = defunc_1_f_res_74358;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_79919;\n    int32_t skip_waves_79920 = 1;\n    float x_74341;\n    float x_74342;\n    float x_74343;\n    float x_74344;\n    float x_74345;\n    float x_74346;\n    float x_74347;\n    float x_74348;\n    float x_74349;\n    float x_74350;\n    \n    offset_79919 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_79891, sext_i64_i32(q_65346))) {\n            x_74341 = ((__local\n                        float *) red_arr_mem_79909)[sext_i32_i64(local_tid_79891 +\n                                                    offset_79919)];\n            x_74342 = ((__local\n                        float *) red_arr_mem_79911)[sext_i32_i64(local_tid_79891 +\n                                                    offset_79919)];\n            x_74343 = ((__local\n                        float *) red_arr_mem_79913)[sext_i32_i64(local_tid_79891 +\n                                                    offset_79919)];\n            x_74344 = ((__local\n                        float *) red_arr_mem_79915)[sext_i32_i64(local_tid_79891 +\n                                                    offset_79919)];\n            x_74345 = ((__local\n                        float *) red_arr_mem_79917)[sext_i32_i64(local_tid_79891 +\n                                                    offset_79919)];\n        }\n    }\n    offset_79919 = 1;\n    while (slt32(offset_79919, wave_sizze_79893)) {\n        if (slt32(local_tid_79891 + offset_79919, sext_i64_i32(q_65346)) &&\n            ((local_tid_79891 - squot32(local_tid_79891, wave_sizze_79893) *\n              wave_sizze_79893) & (2 * offset_79919 - 1)) == 0) {\n            // read array element\n            {\n                x_74346 = ((volatile __local\n                            float *",
                   ") red_arr_mem_79909)[sext_i32_i64(local_tid_79891 +\n                                                        offset_79919)];\n                x_74347 = ((volatile __local\n                            float *) red_arr_mem_79911)[sext_i32_i64(local_tid_79891 +\n                                                        offset_79919)];\n                x_74348 = ((volatile __local\n                            float *) red_arr_mem_79913)[sext_i32_i64(local_tid_79891 +\n                                                        offset_79919)];\n                x_74349 = ((volatile __local\n                            float *) red_arr_mem_79915)[sext_i32_i64(local_tid_79891 +\n                                                        offset_79919)];\n                x_74350 = ((volatile __local\n                            float *) red_arr_mem_79917)[sext_i32_i64(local_tid_79891 +\n                                                        offset_79919)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_74351 = x_74341 + x_74346;\n                float defunc_1_op_res_74352 = x_74342 + x_74347;\n                float defunc_1_op_res_74353 = x_74343 + x_74348;\n                float defunc_1_op_res_74354 = x_74344 + x_74349;\n                float defunc_1_op_res_74355 = x_74345 + x_74350;\n                \n                x_74341 = defunc_1_op_res_74351;\n                x_74342 = defunc_1_op_res_74352;\n                x_74343 = defunc_1_op_res_74353;\n                x_74344 = defunc_1_op_res_74354;\n                x_74345 = defunc_1_op_res_74355;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_79909)[sext_i32_i64(local_tid_79891)] =\n                    x_74341;\n                ((volatile __local\n                  float *) red_arr_mem_79911)[sext_i32_i64(local_tid_79891)] =\n                    x_74342;\n                ((volatile __local\n              ",
                   "    float *) red_arr_mem_79913)[sext_i32_i64(local_tid_79891)] =\n                    x_74343;\n                ((volatile __local\n                  float *) red_arr_mem_79915)[sext_i32_i64(local_tid_79891)] =\n                    x_74344;\n                ((volatile __local\n                  float *) red_arr_mem_79917)[sext_i32_i64(local_tid_79891)] =\n                    x_74345;\n            }\n        }\n        offset_79919 *= 2;\n    }\n    while (slt32(skip_waves_79920, squot32(sext_i64_i32(q_65346) +\n                                           wave_sizze_79893 - 1,\n                                           wave_sizze_79893))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_79919 = skip_waves_79920 * wave_sizze_79893;\n        if (slt32(local_tid_79891 + offset_79919, sext_i64_i32(q_65346)) &&\n            ((local_tid_79891 - squot32(local_tid_79891, wave_sizze_79893) *\n              wave_sizze_79893) == 0 && (squot32(local_tid_79891,\n                                                 wave_sizze_79893) & (2 *\n                                                                      skip_waves_79920 -\n                                                                      1)) ==\n             0)) {\n            // read array element\n            {\n                x_74346 = ((__local\n                            float *) red_arr_mem_79909)[sext_i32_i64(local_tid_79891 +\n                                                        offset_79919)];\n                x_74347 = ((__local\n                            float *) red_arr_mem_79911)[sext_i32_i64(local_tid_79891 +\n                                                        offset_79919)];\n                x_74348 = ((__local\n                            float *) red_arr_mem_79913)[sext_i32_i64(local_tid_79891 +\n                                                        offset_79919)];\n                x_74349 = ((__local\n                            float *) red_arr_mem_79915)[sext_i32_i64(local_tid_79891 +\n                                  ",
                   "                      offset_79919)];\n                x_74350 = ((__local\n                            float *) red_arr_mem_79917)[sext_i32_i64(local_tid_79891 +\n                                                        offset_79919)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_74351 = x_74341 + x_74346;\n                float defunc_1_op_res_74352 = x_74342 + x_74347;\n                float defunc_1_op_res_74353 = x_74343 + x_74348;\n                float defunc_1_op_res_74354 = x_74344 + x_74349;\n                float defunc_1_op_res_74355 = x_74345 + x_74350;\n                \n                x_74341 = defunc_1_op_res_74351;\n                x_74342 = defunc_1_op_res_74352;\n                x_74343 = defunc_1_op_res_74353;\n                x_74344 = defunc_1_op_res_74354;\n                x_74345 = defunc_1_op_res_74355;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_79909)[sext_i32_i64(local_tid_79891)] =\n                    x_74341;\n                ((__local\n                  float *) red_arr_mem_79911)[sext_i32_i64(local_tid_79891)] =\n                    x_74342;\n                ((__local\n                  float *) red_arr_mem_79913)[sext_i32_i64(local_tid_79891)] =\n                    x_74343;\n                ((__local\n                  float *) red_arr_mem_79915)[sext_i32_i64(local_tid_79891)] =\n                    x_74344;\n                ((__local\n                  float *) red_arr_mem_79917)[sext_i32_i64(local_tid_79891)] =\n                    x_74345;\n            }\n        }\n        skip_waves_79920 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_74332 = ((__local\n                                  float *) red_arr_mem_79909)[(int64_t) 0];\n    defunc_2_reduce_res_74333 = ((__local\n                                  float *) red_arr_mem_79911)[(int64_t) 0];\n    defunc_2_reduce_res_74334 = ((__local",
                   "\n                                  float *) red_arr_mem_79913)[(int64_t) 0];\n    defunc_2_reduce_res_74335 = ((__local\n                                  float *) red_arr_mem_79915)[(int64_t) 0];\n    defunc_2_reduce_res_74336 = ((__local\n                                  float *) red_arr_mem_79917)[(int64_t) 0];\n    \n    float x_74362 = defunc_2_reduce_res_74334 * defunc_2_reduce_res_74336;\n    float y_74363 = defunc_2_reduce_res_74335 * defunc_2_reduce_res_74335;\n    float a12_74364 = x_74362 - y_74363;\n    float x_74365 = defunc_2_reduce_res_74334 * defunc_2_reduce_res_74335;\n    float y_74366 = defunc_2_reduce_res_74333 * defunc_2_reduce_res_74336;\n    float b12_74367 = x_74365 - y_74366;\n    float x_74368 = defunc_2_reduce_res_74333 * defunc_2_reduce_res_74335;\n    float y_74369 = defunc_2_reduce_res_74334 * defunc_2_reduce_res_74334;\n    float c12_74370 = x_74368 - y_74369;\n    float x_74371 = defunc_2_reduce_res_74332 * defunc_2_reduce_res_74336;\n    float b2_74372 = x_74371 - y_74369;\n    float x_74373 = defunc_2_reduce_res_74333 * defunc_2_reduce_res_74334;\n    float y_74374 = defunc_2_reduce_res_74332 * defunc_2_reduce_res_74335;\n    float c2_74375 = x_74373 - y_74374;\n    float x_74376 = defunc_2_reduce_res_74332 * a12_74364;\n    float y_74377 = defunc_2_reduce_res_74333 * b12_74367;\n    float x_74378 = x_74376 + y_74377;\n    float y_74379 = defunc_2_reduce_res_74334 * c12_74370;\n    float y_74380 = x_74378 + y_74379;\n    float det_74381 = 1.0F / y_74380;\n    float a12_74382 = a12_74364 * det_74381;\n    float b12_74383 = b12_74367 * det_74381;\n    float c12_74384 = c12_74370 * det_74381;\n    float b2_74385 = b2_74372 * det_74381;\n    float c2_74386 = c2_74375 * det_74381;\n    float defunc_2_reduce_res_74387;\n    float defunc_2_reduce_res_74388;\n    int64_t gtid_74389 = sext_i32_i64(sext_i64_i32(ltid_pre_79895));\n    int32_t phys_tid_74390 = local_tid_79891;\n    __local unsigned char *red_arr_mem_79921;\n    \n    red_arr_mem_79921 = (__local unsigned char *) ",
                   "red_arr_mem_79921_backing_9;\n    \n    __local unsigned char *red_arr_mem_79923;\n    \n    red_arr_mem_79923 = (__local unsigned char *) red_arr_mem_79923_backing_10;\n    \n    float x_74398;\n    \n    x_74398 = ((__local float *) color_78199)[gtid_74389];\n    \n    float x_74399;\n    \n    x_74399 = ((__local float *) color_78197)[gtid_74389];\n    \n    float x_74400;\n    \n    x_74400 = ((__local float *) color_78198)[gtid_74389];\n    \n    bool cond_74401 = sle64(last_res_74211, gtid_74389);\n    float defunc_0_f_res_74402;\n    \n    if (cond_74401) {\n        defunc_0_f_res_74402 = 0.0F;\n    } else {\n        int64_t i_74403 = add64(max_res_74291, gtid_74389);\n        float defunc_0_add_arg_74404;\n        \n        defunc_0_add_arg_74404 = ((__global float *) mem_77938)[gtid_74208 *\n                                                                n_65344 +\n                                                                i_74403];\n        defunc_0_f_res_74402 = defunc_0_add_arg_74404;\n    }\n    \n    float x_74405 = a12_74382 * x_74398;\n    float y_74406 = b12_74383 * x_74399;\n    float x_74407 = x_74405 + y_74406;\n    float y_74408 = c12_74384 * x_74400;\n    float x_74409 = x_74407 + y_74408;\n    float defunc_9_fit_fun_res_74410 = defunc_0_f_res_74402 * x_74409;\n    float x_74411 = b12_74383 * x_74398;\n    float y_74412 = b2_74385 * x_74399;\n    float x_74413 = x_74411 + y_74412;\n    float y_74414 = c2_74386 * x_74400;\n    float x_74415 = x_74413 + y_74414;\n    float defunc_9_slope_fun_res_74416 = defunc_0_f_res_74402 * x_74415;\n    \n    ((__local float *) red_arr_mem_79921)[gtid_74389] =\n        defunc_9_fit_fun_res_74410;\n    ((__local float *) red_arr_mem_79923)[gtid_74389] =\n        defunc_9_slope_fun_res_74416;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_79925;\n    int32_t skip_waves_79926 = 1;\n    float x_74391;\n    float x_74392;\n    float x_74393;\n    float x_74394;\n    \n    offset_79925 = 0;\n    // participating threads read initial accumulator\n    {\n     ",
                   "   if (slt32(local_tid_79891, sext_i64_i32(q_65346))) {\n            x_74391 = ((__local\n                        float *) red_arr_mem_79921)[sext_i32_i64(local_tid_79891 +\n                                                    offset_79925)];\n            x_74392 = ((__local\n                        float *) red_arr_mem_79923)[sext_i32_i64(local_tid_79891 +\n                                                    offset_79925)];\n        }\n    }\n    offset_79925 = 1;\n    while (slt32(offset_79925, wave_sizze_79893)) {\n        if (slt32(local_tid_79891 + offset_79925, sext_i64_i32(q_65346)) &&\n            ((local_tid_79891 - squot32(local_tid_79891, wave_sizze_79893) *\n              wave_sizze_79893) & (2 * offset_79925 - 1)) == 0) {\n            // read array element\n            {\n                x_74393 = ((volatile __local\n                            float *) red_arr_mem_79921)[sext_i32_i64(local_tid_79891 +\n                                                        offset_79925)];\n                x_74394 = ((volatile __local\n                            float *) red_arr_mem_79923)[sext_i32_i64(local_tid_79891 +\n                                                        offset_79925)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_74395 = x_74391 + x_74393;\n                float defunc_1_op_res_74396 = x_74392 + x_74394;\n                \n                x_74391 = defunc_1_op_res_74395;\n                x_74392 = defunc_1_op_res_74396;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_79921)[sext_i32_i64(local_tid_79891)] =\n                    x_74391;\n                ((volatile __local\n                  float *) red_arr_mem_79923)[sext_i32_i64(local_tid_79891)] =\n                    x_74392;\n            }\n        }\n        offset_79925 *= 2;\n    }\n    while (slt32(skip_waves_79926, squot32(sext_i64_i32(q_65346) +\n                    ",
                   "                       wave_sizze_79893 - 1,\n                                           wave_sizze_79893))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_79925 = skip_waves_79926 * wave_sizze_79893;\n        if (slt32(local_tid_79891 + offset_79925, sext_i64_i32(q_65346)) &&\n            ((local_tid_79891 - squot32(local_tid_79891, wave_sizze_79893) *\n              wave_sizze_79893) == 0 && (squot32(local_tid_79891,\n                                                 wave_sizze_79893) & (2 *\n                                                                      skip_waves_79926 -\n                                                                      1)) ==\n             0)) {\n            // read array element\n            {\n                x_74393 = ((__local\n                            float *) red_arr_mem_79921)[sext_i32_i64(local_tid_79891 +\n                                                        offset_79925)];\n                x_74394 = ((__local\n                            float *) red_arr_mem_79923)[sext_i32_i64(local_tid_79891 +\n                                                        offset_79925)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_74395 = x_74391 + x_74393;\n                float defunc_1_op_res_74396 = x_74392 + x_74394;\n                \n                x_74391 = defunc_1_op_res_74395;\n                x_74392 = defunc_1_op_res_74396;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_79921)[sext_i32_i64(local_tid_79891)] =\n                    x_74391;\n                ((__local\n                  float *) red_arr_mem_79923)[sext_i32_i64(local_tid_79891)] =\n                    x_74392;\n            }\n        }\n        skip_waves_79926 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_74387 = ((__local\n                                  float *) red_arr_mem_79921)[(int64_t) 0];\n    defunc_2",
                   "_reduce_res_74388 = ((__local\n                                  float *) red_arr_mem_79923)[(int64_t) 0];\n    if (local_tid_79891 == 0) {\n        ((__global float *) mem_77986)[gtid_74208 * n_m_65352 + gtid_74209] =\n            defunc_2_reduce_res_74387;\n    }\n    if (local_tid_79891 == 0) {\n        ((__global float *) mem_77990)[gtid_74208 * n_m_65352 + gtid_74209] =\n            defunc_2_reduce_res_74388;\n    }\n    \n  error_5:\n    return;\n}\n__kernel void mainzisegmap_intragroup_74758(__global int *global_failure,\n                                            int failure_is_an_option, __global\n                                            int64_t *global_failure_args,\n                                            __local volatile\n                                            int64_t *color_78137_backing_aligned_0,\n                                            int64_t m_65343, int64_t n_65344,\n                                            int64_t q_65346, int64_t jump_65348,\n                                            int64_t n_m_65352, int64_t i_65358,\n                                            unsigned char x_65359_bits,\n                                            int64_t min_res_65364,\n                                            unsigned char loop_cond_65369_bits,\n                                            int64_t num_groups_x_74755,\n                                            int64_t num_groups_y_74756,\n                                            int64_t num_whole_tiles_74888,\n                                            int64_t residual_input_75084,\n                                            unsigned char cond_75085_bits,\n                                            __global unsigned char *mem_77082,\n                                            __global unsigned char *mem_77086,\n                                            __global unsigned char *mem_77090,\n                                            __global unsigned char *mem_77096,\n                                        ",
                   "    __global unsigned char *mem_77100,\n                                            __global unsigned char *mem_77103,\n                                            __global unsigned char *mem_77106,\n                                            __global unsigned char *mem_77109,\n                                            __global unsigned char *mem_77114,\n                                            __global unsigned char *mem_77161)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    bool cond_75085 = cond_75085_bits;\n    \n    #define tile_sizze_74753 (mainzitile_sizze_74752)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict color_78137_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_78137_backing_aligned_0;\n    volatile __local bool local_failure;\n    \n    if (failure_is_an_option) {\n        int failed = *global_failure >= 0;\n        \n        if (failed)\n            return;\n    }\n    local_failure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_78435;\n    int32_t local_tid_78436;\n    int64_t group_sizze_78439;\n    int32_t wave_sizze_78438;\n    int32_t group_tid_78437;\n    \n    global_tid_78435 = get_global_id(0);\n    local_tid_78436 = get_local_id(0);\n    group_sizze_78439 = get_local_size(0);\n    wave_sizze_78438 = LOCKSTEP_WIDTH;\n    group_tid_78437 = get_group_id(0);\n    \n    int32_t gid_flat_74758 = group_tid_78437;\n    int64_t slice_78442 = tile_sizze_74753;\n    int64_t slice_78443 = tile_sizze_74753 * slice_78442;\n    int64_t ltid_pre_78440 = squot64(sext_i32_i64(local_tid_78436),\n                                     slice_78442);\n    int64_t remnant_78444 = sext_i32_i64(local_tid_78436) - ltid_pre_78440 *\n            slice_78442;\n    int64_t ltid_pre_78441 = remnant_78444;\n    int64_t remnant_78445 = remnant_78444 - ltid_pre_78441;\n    int6",
                   "4_t slice_78446 = num_groups_y_74756;\n    int64_t slice_78447 = num_groups_x_74755 * slice_78446;\n    int64_t gid_x_74750 = squot64(sext_i32_i64(group_tid_78437), slice_78446);\n    int64_t remnant_78448 = sext_i32_i64(group_tid_78437) - gid_x_74750 *\n            slice_78446;\n    int64_t gid_y_74751 = remnant_78448;\n    int64_t remnant_78449 = remnant_78448 - gid_y_74751;\n    float color_78135[1];\n    float color_78136[1];\n    __local unsigned char *color_78137;\n    \n    color_78137 = (__local unsigned char *) color_78137_backing_0;\n    \n    float color_78138[1];\n    int64_t color_78139[1];\n    int64_t color_78140[1];\n    int64_t color_78141[1];\n    int64_t binop_x_74778 = gid_x_74750 * tile_sizze_74753;\n    int64_t binop_x_74780 = gid_y_74751 * tile_sizze_74753;\n    int64_t ltid_y_74777 = sext_i32_i64(sext_i64_i32(ltid_pre_78440));\n    int64_t ltid_x_74775 = sext_i32_i64(sext_i64_i32(ltid_pre_78441));\n    int32_t ltid_flat_74776 = local_tid_78436;\n    \n    if (slt64(ltid_y_74777, tile_sizze_74753) && slt64(ltid_x_74775,\n                                                       tile_sizze_74753)) {\n        int64_t gtid_74779 = ltid_y_74777 + binop_x_74778;\n        int64_t gtid_74781 = ltid_x_74775 + binop_x_74780;\n        bool binop_x_74782 = slt64(gtid_74779, m_65343);\n        bool binop_y_74783 = slt64(gtid_74781, n_m_65352);\n        bool cond_74784 = binop_x_74782 && binop_y_74783;\n        int64_t pre_74785;\n        int64_t pre_74786;\n        int64_t pre_74787;\n        float pre_74788;\n        \n        if (cond_74784) {\n            int64_t last_res_74789;\n            \n            last_res_74789 = ((__global int64_t *) mem_77082)[gtid_74779 *\n                                                              n_65344 +\n                                                              i_65358];\n            \n            int64_t min_arg_74790;\n            \n            min_arg_74790 = ((__global int64_t *) mem_77100)[gtid_74779];\n            \n            int64_t min_arg_74791;\n    ",
                   "        \n            min_arg_74791 = ((__global int64_t *) mem_77103)[gtid_74779];\n            \n            int64_t min_res_74792;\n            \n            min_res_74792 = ((__global int64_t *) mem_77106)[gtid_74779];\n            \n            float max_res_74793;\n            \n            max_res_74793 = ((__global float *) mem_77109)[gtid_74779];\n            \n            int64_t min_arg_74794 = mul64(jump_65348, gtid_74781);\n            int64_t min_res_74795 = smin64(i_65358, min_arg_74794);\n            int64_t defunc_0_g_res_74796 = add64((int64_t) 1, min_res_74795);\n            bool init_idx_74797;\n            int64_t init_idx_74798;\n            int64_t init_idx_74799;\n            bool loop_while_74800;\n            int64_t low_74801;\n            int64_t high_74802;\n            \n            loop_while_74800 = x_65359;\n            low_74801 = (int64_t) 0;\n            high_74802 = i_65358;\n            while (loop_while_74800) {\n                int64_t x_74803 = add64(low_74801, high_74802);\n                int64_t mid_74804 = sdiv64(x_74803, (int64_t) 2);\n                bool x_74805 = sle64((int64_t) 0, mid_74804);\n                bool y_74806 = slt64(mid_74804, n_65344);\n                bool bounds_check_74807 = x_74805 && y_74806;\n                bool index_certs_74808;\n                \n                if (!bounds_check_74807) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 5) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) mid_74804;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t mid_id_74809;\n                \n                mid_id_74809 = ((__global int64_t *) mem_77096)[gtid_74779 *\n                                    ",
                   "                            n_65344 +\n                                                                mid_74804];\n                \n                bool cond_74810 = slt64(mid_id_74809, (int64_t) 0);\n                int64_t mid_idx_74811;\n                \n                if (cond_74810) {\n                    mid_idx_74811 = (int64_t) 9223372036854775807;\n                } else {\n                    mid_idx_74811 = mid_id_74809;\n                }\n                \n                bool cond_74812 = sle64(defunc_0_g_res_74796, mid_idx_74811);\n                int64_t loopres_74813;\n                int64_t loopres_74814;\n                \n                if (cond_74812) {\n                    int64_t loopres_t_res_74815 = sub64(mid_74804, (int64_t) 1);\n                    \n                    loopres_74813 = low_74801;\n                    loopres_74814 = loopres_t_res_74815;\n                } else {\n                    int64_t loopres_f_res_74816 = add64((int64_t) 1, mid_74804);\n                    \n                    loopres_74813 = loopres_f_res_74816;\n                    loopres_74814 = high_74802;\n                }\n                \n                bool loop_cond_74817 = sle64(loopres_74813, loopres_74814);\n                bool loop_while_tmp_78450 = loop_cond_74817;\n                int64_t low_tmp_78451 = loopres_74813;\n                int64_t high_tmp_78452 = loopres_74814;\n                \n                loop_while_74800 = loop_while_tmp_78450;\n                low_74801 = low_tmp_78451;\n                high_74802 = high_tmp_78452;\n            }\n            init_idx_74797 = loop_while_74800;\n            init_idx_74798 = low_74801;\n            init_idx_74799 = high_74802;\n            \n            bool idx_74818;\n            int64_t idx_74819;\n            int64_t idx_74820;\n            int64_t idx_74821;\n            bool loop_while_74822;\n            int64_t l_idx_74823;\n            int64_t r_idx_74824;\n            int64_t span_74825;\n            \n            loop_while",
                   "_74822 = loop_cond_65369;\n            l_idx_74823 = init_idx_74798;\n            r_idx_74824 = init_idx_74798;\n            span_74825 = (int64_t) 1;\n            while (loop_while_74822) {\n                int64_t max_arg_74826 = sub64(l_idx_74823, (int64_t) 1);\n                int64_t max_res_74827 = smax64((int64_t) 0, max_arg_74826);\n                int64_t min_arg_74828 = add64((int64_t) 1, r_idx_74824);\n                int64_t min_res_74829 = smin64(min_arg_74790, min_arg_74828);\n                bool x_74830 = sle64((int64_t) 0, max_res_74827);\n                bool y_74831 = slt64(max_res_74827, n_65344);\n                bool bounds_check_74832 = x_74830 && y_74831;\n                bool index_certs_74833;\n                \n                if (!bounds_check_74832) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 6) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) max_res_74827;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_74834;\n                \n                x_74834 = ((__global int64_t *) mem_77096)[gtid_74779 *\n                                                           n_65344 +\n                                                           max_res_74827];\n                \n                int64_t abs_arg_74835 = sub64(x_74834, defunc_0_g_res_74796);\n                int64_t abs_res_74836 = abs64(abs_arg_74835);\n                bool x_74837 = sle64((int64_t) 0, min_res_74829);\n                bool y_74838 = slt64(min_res_74829, n_65344);\n                bool bounds_check_74839 = x_74837 && y_74838;\n                bool index_certs_74840;\n                \n                if (!bounds_check_74839) {\n                    {\n     ",
                   "                   if (atomic_cmpxchg_i32_global(global_failure, -1, 7) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) min_res_74829;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_74841;\n                \n                x_74841 = ((__global int64_t *) mem_77096)[gtid_74779 *\n                                                           n_65344 +\n                                                           min_res_74829];\n                \n                int64_t abs_arg_74842 = sub64(x_74841, defunc_0_g_res_74796);\n                int64_t abs_res_74843 = abs64(abs_arg_74842);\n                bool cond_74844 = max_res_74827 == l_idx_74823;\n                int64_t loopres_74845;\n                int64_t loopres_74846;\n                int64_t loopres_74847;\n                \n                if (cond_74844) {\n                    loopres_74845 = l_idx_74823;\n                    loopres_74846 = r_idx_74824;\n                    loopres_74847 = min_res_65364;\n                } else {\n                    bool cond_74848 = slt64(abs_res_74836, abs_res_74843);\n                    bool cond_f_res_74849 = min_res_74829 == r_idx_74824;\n                    bool x_74850 = !cond_74848;\n                    bool y_74851 = cond_f_res_74849 && x_74850;\n                    bool cond_74852 = cond_74848 || y_74851;\n                    int64_t loopres_f_res_74853;\n                    \n                    if (cond_74852) {\n                        loopres_f_res_74853 = max_res_74827;\n                    } else {\n                        loopres_f_res_74853 = l_idx_74823;\n                    }\n                    \n                    int64_t loopres_f_res_74854;\n                    \n                    if ",
                   "(cond_74852) {\n                        loopres_f_res_74854 = r_idx_74824;\n                    } else {\n                        loopres_f_res_74854 = min_res_74829;\n                    }\n                    \n                    int64_t loopres_f_res_74855;\n                    \n                    if (cond_74852) {\n                        int64_t loopres_f_res_t_res_74856 = add64((int64_t) 1,\n                                                                  span_74825);\n                        \n                        loopres_f_res_74855 = loopres_f_res_t_res_74856;\n                    } else {\n                        int64_t loopres_f_res_f_res_74857 = add64((int64_t) 1,\n                                                                  span_74825);\n                        \n                        loopres_f_res_74855 = loopres_f_res_f_res_74857;\n                    }\n                    loopres_74845 = loopres_f_res_74853;\n                    loopres_74846 = loopres_f_res_74854;\n                    loopres_74847 = loopres_f_res_74855;\n                }\n                \n                bool loop_cond_74858 = slt64(loopres_74847, min_res_65364);\n                bool loop_while_tmp_78453 = loop_cond_74858;\n                int64_t l_idx_tmp_78454 = loopres_74845;\n                int64_t r_idx_tmp_78455 = loopres_74846;\n                int64_t span_tmp_78456 = loopres_74847;\n                \n                loop_while_74822 = loop_while_tmp_78453;\n                l_idx_74823 = l_idx_tmp_78454;\n                r_idx_74824 = r_idx_tmp_78455;\n                span_74825 = span_tmp_78456;\n            }\n            idx_74818 = loop_while_74822;\n            idx_74819 = l_idx_74823;\n            idx_74820 = r_idx_74824;\n            idx_74821 = span_74825;\n            \n            int64_t min_res_74859 = smin64(min_arg_74791, idx_74819);\n            int64_t max_res_74860 = smax64((int64_t) 0, min_res_74859);\n            int64_t x_74861 = add64(min_res_74792, max_res_74860);\n        ",
                   "    int64_t r_74862 = sub64(x_74861, (int64_t) 1);\n            bool x_74863 = sle64((int64_t) 0, r_74862);\n            bool y_74864 = slt64(r_74862, n_65344);\n            bool bounds_check_74865 = x_74863 && y_74864;\n            bool index_certs_74866;\n            \n            if (!bounds_check_74865) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 8) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) r_74862;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_0;\n                }\n            }\n            \n            int64_t x_74867;\n            \n            x_74867 = ((__global int64_t *) mem_77090)[gtid_74779 * n_65344 +\n                                                       r_74862];\n            \n            int64_t abs_arg_74868 = sub64(x_74867, min_res_74795);\n            int64_t abs_res_74869 = abs64(abs_arg_74868);\n            bool x_74870 = sle64((int64_t) 0, max_res_74860);\n            bool y_74871 = slt64(max_res_74860, n_65344);\n            bool bounds_check_74872 = x_74870 && y_74871;\n            bool index_certs_74873;\n            \n            if (!bounds_check_74872) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 9) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_74860;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_0;\n                }\n            }\n            \n            int64_t x_74874;\n            \n            x_74874 = ((__global int64_t *) mem_77090)[gtid_74779 * n_65344 +\n                                                       max_res_74860];\n            \n            int64_t abs_arg_74875 = su",
                   "b64(x_74874, min_res_74795);\n            int64_t abs_res_74876 = abs64(abs_arg_74875);\n            int64_t max_res_74877 = smax64(abs_res_74869, abs_res_74876);\n            float defunc_0_f_res_74878 = sitofp_i64_f32(max_res_74877);\n            float defunc_1_f_res_74879 = max_res_74793 + defunc_0_f_res_74878;\n            \n            pre_74785 = last_res_74789;\n            pre_74786 = min_res_74795;\n            pre_74787 = max_res_74860;\n            pre_74788 = defunc_1_f_res_74879;\n        } else {\n            pre_74785 = (int64_t) 0;\n            pre_74786 = (int64_t) 0;\n            pre_74787 = (int64_t) 0;\n            pre_74788 = 0.0F;\n        }\n        color_78141[(int64_t) 0] = pre_74785;\n        color_78140[(int64_t) 0] = pre_74786;\n        color_78139[(int64_t) 0] = pre_74787;\n        color_78138[(int64_t) 0] = pre_74788;\n    }\n    \n  error_0:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t ltid_y_74896 = sext_i32_i64(sext_i64_i32(ltid_pre_78440));\n    int64_t ltid_x_74894 = sext_i32_i64(sext_i64_i32(ltid_pre_78441));\n    int32_t ltid_flat_74895 = local_tid_78436;\n    \n    if (slt64(ltid_y_74896, tile_sizze_74753) && slt64(ltid_x_74894,\n                                                       tile_sizze_74753)) {\n        color_78136[(int64_t) 0] = 0.0F;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    float tmp_78457;\n    \n    tmp_78457 = color_78136[(int64_t) 0];\n    color_78135[(int64_t) 0] = tmp_78457;\n    \n    float ext_mem_77143[1];\n    float ext_mem_unused_78078[1];\n    float mem_param_77133[1];\n    float mem_param_out_78079[1];\n    \n    for (int32_t i_1 = 0; i_1 < 1; i_1++)\n        mem_param_77133[i_1] = color_78135[i_1];\n    for (int32_t i_2 = 0; i_2 < 1; i_2++)\n        mem_param_out_78079[i_2] = color_78136[i_2];\n    for (int64_t tile_id_74903 = 0; tile_id_74903 < num_whole_tiles_74888;\n         tile_id_74903++) {\n        int64_t binop_x_75004 = tile_sizze_74753 * tile_id_74903",
                   ";\n        int64_t ltid_y_75001 = sext_i32_i64(sext_i64_i32(ltid_pre_78440));\n        int64_t ltid_x_74999 = sext_i32_i64(sext_i64_i32(ltid_pre_78441));\n        int32_t ltid_flat_75000 = local_tid_78436;\n        int64_t j_75005 = ltid_x_74999 + binop_x_75004;\n        int64_t gtid_75007 = binop_x_74778 + ltid_y_75001;\n        bool binop_x_75015 = slt64(j_75005, q_65346);\n        bool binop_y_75016 = slt64(gtid_75007, m_65343);\n        bool cond_75017 = binop_x_75015 && binop_y_75016;\n        float pre2d_75018;\n        \n        if (cond_75017) {\n            float x_75019;\n            \n            x_75019 = ((__global float *) mem_77114)[gtid_75007 * q_65346 +\n                                                     j_75005];\n            pre2d_75018 = x_75019;\n        } else {\n            pre2d_75018 = 0.0F;\n        }\n        ((__local float *) color_78137)[ltid_y_75001 * tile_sizze_74753 +\n                                        ltid_x_74999] = pre2d_75018;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t ltid_y_75024 = sext_i32_i64(sext_i64_i32(ltid_pre_78440));\n        int64_t ltid_x_75022 = sext_i32_i64(sext_i64_i32(ltid_pre_78441));\n        int32_t ltid_flat_75023 = local_tid_78436;\n        int64_t gtid_75026 = binop_x_74778 + ltid_y_75024;\n        int64_t gtid_75028 = binop_x_74780 + ltid_x_75022;\n        float acc_75034;\n        \n        acc_75034 = mem_param_77133[(int64_t) 0];\n        \n        bool binop_x_75038 = slt64(gtid_75026, m_65343);\n        bool binop_y_75039 = slt64(gtid_75028, n_m_65352);\n        bool cond_75040 = binop_x_75038 && binop_y_75039;\n        float acc_75041;\n        \n        if (cond_75040) {\n            int64_t last_res_75029;\n            \n            last_res_75029 = color_78141[(int64_t) 0];\n            \n            int64_t min_res_75030;\n            \n            min_res_75030 = color_78140[(int64_t) 0];\n            \n            int64_t max_res_75031;\n            \n            max_res_75031 = color_78139[(int64_t) 0];\n        ",
                   "    \n            float defunc_1_f_res_75032;\n            \n            defunc_1_f_res_75032 = color_78138[(int64_t) 0];\n            \n            float x_75042;\n            float redout_76816 = acc_75034;\n            \n            for (int64_t i_76817 = 0; i_76817 < tile_sizze_74753; i_76817++) {\n                int64_t index_primexp_76939 = add64(binop_x_75004, i_76817);\n                float x_75047;\n                \n                x_75047 = ((__local float *) color_78137)[ltid_y_75024 *\n                                                          tile_sizze_74753 +\n                                                          i_76817];\n                \n                bool cond_75048 = sle64(last_res_75029, index_primexp_76939);\n                int64_t defunc_0_f_res_75049;\n                \n                if (cond_75048) {\n                    defunc_0_f_res_75049 = (int64_t) 0;\n                } else {\n                    int64_t i_75050 = add64(max_res_75031, index_primexp_76939);\n                    int64_t defunc_0_add_arg_75051;\n                    \n                    defunc_0_add_arg_75051 = ((__global\n                                               int64_t *) mem_77090)[gtid_75026 *\n                                                                     n_65344 +\n                                                                     i_75050];\n                    \n                    int64_t defunc_1_add_res_75052 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_75051);\n                    \n                    defunc_0_f_res_75049 = defunc_1_add_res_75052;\n                }\n                \n                int64_t binop_p_75053 = sub64(defunc_0_f_res_75049,\n                                              min_res_75030);\n                float defunc_0_f_res_75054 = sitofp_i64_f32(binop_p_75053);\n                float abs_res_75055 = (float) fabs(defunc_0_f_res_75054);\n                float tmp1_75056 = abs_res_75055 / defunc_1",
                   "_f_res_75032;\n                float x_75057 = tmp1_75056 * tmp1_75056;\n                float y_75058 = tmp1_75056 * x_75057;\n                float tmp2_75059 = 1.0F - y_75058;\n                float x_75060 = tmp2_75059 * tmp2_75059;\n                float tmp3_75061 = tmp2_75059 * x_75060;\n                float w_j_75062 = x_75047 * tmp3_75061;\n                float defunc_1_op_res_75045 = w_j_75062 + redout_76816;\n                float redout_tmp_78461 = defunc_1_op_res_75045;\n                \n                redout_76816 = redout_tmp_78461;\n            }\n            x_75042 = redout_76816;\n            acc_75041 = x_75042;\n        } else {\n            acc_75041 = acc_75034;\n        }\n        mem_param_out_78079[(int64_t) 0] = acc_75041;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        float mem_param_tmp_78458[1];\n        \n        for (int32_t i_3 = 0; i_3 < 1; i_3++)\n            mem_param_tmp_78458[i_3] = mem_param_out_78079[i_3];\n        \n        float mem_param_out_tmp_78459[1];\n        \n        for (int32_t i_4 = 0; i_4 < 1; i_4++)\n            mem_param_out_tmp_78459[i_4] = mem_param_77133[i_4];\n        for (int32_t i_5 = 0; i_5 < 1; i_5++)\n            mem_param_77133[i_5] = mem_param_tmp_78458[i_5];\n        for (int32_t i_6 = 0; i_6 < 1; i_6++)\n            mem_param_out_78079[i_6] = mem_param_out_tmp_78459[i_6];\n    }\n    for (int32_t i_7 = 0; i_7 < 1; i_7++)\n        ext_mem_77143[i_7] = mem_param_77133[i_7];\n    for (int32_t i_8 = 0; i_8 < 1; i_8++)\n        ext_mem_unused_78078[i_8] = mem_param_out_78079[i_8];\n    if (cond_75085) {\n        float tmp_78462;\n        \n        tmp_78462 = ext_mem_77143[(int64_t) 0];\n        color_78135[(int64_t) 0] = tmp_78462;\n    } else {\n        int64_t binop_x_75187 = tile_sizze_74753 * num_whole_tiles_74888;\n        int64_t ltid_y_75184 = sext_i32_i64(sext_i64_i32(ltid_pre_78440));\n        int64_t ltid_x_75182 = sext_i32_i64(sext_i64_i32(ltid_pre_78441));\n        int32_t ltid_flat_75183 = local_tid_78436;\n        int64_",
                   "t j_75188 = ltid_x_75182 + binop_x_75187;\n        int64_t gtid_75190 = binop_x_74778 + ltid_y_75184;\n        bool binop_x_75198 = slt64(j_75188, q_65346);\n        bool binop_y_75199 = slt64(gtid_75190, m_65343);\n        bool cond_75200 = binop_x_75198 && binop_y_75199;\n        float pre2d_75201;\n        \n        if (cond_75200) {\n            float x_75202;\n            \n            x_75202 = ((__global float *) mem_77114)[gtid_75190 * q_65346 +\n                                                     j_75188];\n            pre2d_75201 = x_75202;\n        } else {\n            pre2d_75201 = 0.0F;\n        }\n        ((__local float *) color_78137)[ltid_y_75184 * tile_sizze_74753 +\n                                        ltid_x_75182] = pre2d_75201;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t ltid_y_75208 = sext_i32_i64(sext_i64_i32(ltid_pre_78440));\n        int64_t ltid_x_75206 = sext_i32_i64(sext_i64_i32(ltid_pre_78441));\n        int32_t ltid_flat_75207 = local_tid_78436;\n        int64_t gtid_75210 = binop_x_74778 + ltid_y_75208;\n        int64_t gtid_75212 = binop_x_74780 + ltid_x_75206;\n        float acc_75218;\n        \n        acc_75218 = ext_mem_77143[(int64_t) 0];\n        \n        bool binop_x_75222 = slt64(gtid_75210, m_65343);\n        bool binop_y_75223 = slt64(gtid_75212, n_m_65352);\n        bool cond_75224 = binop_x_75222 && binop_y_75223;\n        float acc_75225;\n        \n        if (cond_75224) {\n            int64_t last_res_75213;\n            \n            last_res_75213 = color_78141[(int64_t) 0];\n            \n            int64_t min_res_75214;\n            \n            min_res_75214 = color_78140[(int64_t) 0];\n            \n            int64_t max_res_75215;\n            \n            max_res_75215 = color_78139[(int64_t) 0];\n            \n            float defunc_1_f_res_75216;\n            \n            defunc_1_f_res_75216 = color_78138[(int64_t) 0];\n            \n            float x_75226;\n            float redout_76818 = acc_75218;\n            \n   ",
                   "         for (int64_t i_76819 = 0; i_76819 < residual_input_75084;\n                 i_76819++) {\n                int64_t index_primexp_76937 = add64(binop_x_75187, i_76819);\n                float x_75231;\n                \n                x_75231 = ((__local float *) color_78137)[ltid_y_75208 *\n                                                          tile_sizze_74753 +\n                                                          i_76819];\n                \n                bool cond_75232 = sle64(last_res_75213, index_primexp_76937);\n                int64_t defunc_0_f_res_75233;\n                \n                if (cond_75232) {\n                    defunc_0_f_res_75233 = (int64_t) 0;\n                } else {\n                    int64_t i_75234 = add64(max_res_75215, index_primexp_76937);\n                    int64_t defunc_0_add_arg_75235;\n                    \n                    defunc_0_add_arg_75235 = ((__global\n                                               int64_t *) mem_77090)[gtid_75210 *\n                                                                     n_65344 +\n                                                                     i_75234];\n                    \n                    int64_t defunc_1_add_res_75236 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_75235);\n                    \n                    defunc_0_f_res_75233 = defunc_1_add_res_75236;\n                }\n                \n                int64_t binop_p_75237 = sub64(defunc_0_f_res_75233,\n                                              min_res_75214);\n                float defunc_0_f_res_75238 = sitofp_i64_f32(binop_p_75237);\n                float abs_res_75239 = (float) fabs(defunc_0_f_res_75238);\n                float tmp1_75240 = abs_res_75239 / defunc_1_f_res_75216;\n                float x_75241 = tmp1_75240 * tmp1_75240;\n                float y_75242 = tmp1_75240 * x_75241;\n                float tmp2_75243 = 1.0F - y_75242;\n                float ",
                   "x_75244 = tmp2_75243 * tmp2_75243;\n                float tmp3_75245 = tmp2_75243 * x_75244;\n                float w_j_75246 = x_75231 * tmp3_75245;\n                float defunc_1_op_res_75229 = w_j_75246 + redout_76818;\n                float redout_tmp_78463 = defunc_1_op_res_75229;\n                \n                redout_76818 = redout_tmp_78463;\n            }\n            x_75226 = redout_76818;\n            acc_75225 = x_75226;\n        } else {\n            acc_75225 = acc_75218;\n        }\n        color_78136[(int64_t) 0] = acc_75225;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        float tmp_78464;\n        \n        tmp_78464 = color_78136[(int64_t) 0];\n        color_78135[(int64_t) 0] = tmp_78464;\n    }\n    \n    int64_t ltid_y_75260 = sext_i32_i64(sext_i64_i32(ltid_pre_78440));\n    int64_t ltid_x_75258 = sext_i32_i64(sext_i64_i32(ltid_pre_78441));\n    int32_t ltid_flat_75259 = local_tid_78436;\n    \n    if (slt64(ltid_y_75260, tile_sizze_74753) && slt64(ltid_x_75258,\n                                                       tile_sizze_74753)) {\n        int64_t gtid_75262 = binop_x_74778 + ltid_y_75260;\n        int64_t gtid_75264 = binop_x_74780 + ltid_x_75258;\n        bool binop_x_75266 = slt64(gtid_75262, m_65343);\n        bool binop_y_75267 = slt64(gtid_75264, n_m_65352);\n        bool cond_75268 = binop_x_75266 && binop_y_75267;\n        float postlude_75269;\n        \n        if (cond_75268) {\n            float defunc_2_reduce_res_75265;\n            \n            defunc_2_reduce_res_75265 = color_78135[(int64_t) 0];\n            \n            int64_t last_res_75270;\n            \n            last_res_75270 = color_78141[(int64_t) 0];\n            \n            int64_t min_res_75271;\n            \n            min_res_75271 = color_78140[(int64_t) 0];\n            \n            int64_t max_res_75272;\n            \n            max_res_75272 = color_78139[(int64_t) 0];\n            \n            float defunc_1_f_res_75273;\n            \n            defunc_1_f_res_75273 = color_7",
                   "8138[(int64_t) 0];\n            \n            float a0_75275 = 1.0F / defunc_2_reduce_res_75265;\n            float defunc_2_reduce_res_75276;\n            float redout_76820 = 0.0F;\n            \n            for (int64_t i_76821 = 0; i_76821 < q_65346; i_76821++) {\n                float x_75281;\n                \n                x_75281 = ((__global float *) mem_77114)[gtid_75262 * q_65346 +\n                                                         i_76821];\n                \n                bool cond_75282 = sle64(last_res_75270, i_76821);\n                int64_t defunc_0_f_res_75283;\n                \n                if (cond_75282) {\n                    defunc_0_f_res_75283 = (int64_t) 0;\n                } else {\n                    int64_t i_75284 = add64(max_res_75272, i_76821);\n                    int64_t defunc_0_add_arg_75285;\n                    \n                    defunc_0_add_arg_75285 = ((__global\n                                               int64_t *) mem_77090)[gtid_75262 *\n                                                                     n_65344 +\n                                                                     i_75284];\n                    \n                    int64_t defunc_1_add_res_75286 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_75285);\n                    \n                    defunc_0_f_res_75283 = defunc_1_add_res_75286;\n                }\n                \n                int64_t binop_p_75287 = sub64(defunc_0_f_res_75283,\n                                              min_res_75271);\n                float defunc_0_f_res_75288 = sitofp_i64_f32(binop_p_75287);\n                float abs_res_75289 = (float) fabs(defunc_0_f_res_75288);\n                float tmp1_75290 = abs_res_75289 / defunc_1_f_res_75273;\n                float x_75291 = tmp1_75290 * tmp1_75290;\n                float y_75292 = tmp1_75290 * x_75291;\n                float tmp2_75293 = 1.0F - y_75292;\n                float x_75294",
                   " = tmp2_75293 * tmp2_75293;\n                float tmp3_75295 = tmp2_75293 * x_75294;\n                float tmp4_75296 = x_75281 * tmp3_75295;\n                float defunc_0_f_res_75297;\n                \n                if (cond_75282) {\n                    defunc_0_f_res_75297 = 0.0F;\n                } else {\n                    int64_t i_75298 = add64(max_res_75272, i_76821);\n                    float defunc_0_add_arg_75299;\n                    \n                    defunc_0_add_arg_75299 = ((__global\n                                               float *) mem_77086)[gtid_75262 *\n                                                                   n_65344 +\n                                                                   i_75298];\n                    defunc_0_f_res_75297 = defunc_0_add_arg_75299;\n                }\n                \n                float x_75300 = a0_75275 * tmp4_75296;\n                float defunc_9_fit_fun_res_75301 = defunc_0_f_res_75297 *\n                      x_75300;\n                float defunc_1_op_res_75279 = defunc_9_fit_fun_res_75301 +\n                      redout_76820;\n                float redout_tmp_78465 = defunc_1_op_res_75279;\n                \n                redout_76820 = redout_tmp_78465;\n            }\n            defunc_2_reduce_res_75276 = redout_76820;\n            postlude_75269 = defunc_2_reduce_res_75276;\n        } else {\n            postlude_75269 = 0.0F;\n        }\n        color_78136[(int64_t) 0] = postlude_75269;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t thread_out_index_78466 = gid_x_74750 * tile_sizze_74753 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_78440));\n    int64_t thread_out_index_78467 = gid_y_74751 * tile_sizze_74753 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_78441));\n    \n    if (slt64(thread_out_index_78466, m_65343) && slt64(thread_out_index_78467,\n                                                        n_m_65352)) {\n        float tmp_78468;\n        \n        tmp_78468 = color_78136[(",
                   "int64_t) 0];\n        ((__global float *) mem_77161)[thread_out_index_78466 * n_m_65352 +\n                                       thread_out_index_78467] = tmp_78468;\n    }\n    \n  error_7:\n    return;\n    #undef tile_sizze_74753\n}\n__kernel void mainzisegmap_intragroup_75312(__global int *global_failure,\n                                            int failure_is_an_option, __global\n                                            int64_t *global_failure_args,\n                                            __local volatile\n                                            int64_t *color_78159_backing_aligned_0,\n                                            int64_t m_65343, int64_t n_65344,\n                                            int64_t q_65346, int64_t jump_65348,\n                                            int64_t n_m_65352, int64_t i_65358,\n                                            unsigned char x_65359_bits,\n                                            int64_t min_res_65364,\n                                            unsigned char loop_cond_65369_bits,\n                                            int64_t num_groups_x_75309,\n                                            int64_t num_groups_y_75310,\n                                            int64_t num_whole_tiles_75442,\n                                            int64_t residual_input_75690,\n                                            unsigned char cond_75691_bits,\n                                            __global unsigned char *mem_77316,\n                                            __global unsigned char *mem_77320,\n                                            __global unsigned char *mem_77324,\n                                            __global unsigned char *mem_77330,\n                                            __global unsigned char *mem_77334,\n                                            __global unsigned char *mem_77337,\n                                            __global unsigned char *mem_77340,\n                    ",
                   "                        __global unsigned char *mem_77343,\n                                            __global unsigned char *mem_77348,\n                                            __global unsigned char *mem_77422,\n                                            __global unsigned char *mem_77426)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    bool cond_75691 = cond_75691_bits;\n    \n    #define tile_sizze_75307 (mainzitile_sizze_75306)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict color_78159_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_78159_backing_aligned_0;\n    volatile __local bool local_failure;\n    \n    if (failure_is_an_option) {\n        int failed = *global_failure >= 0;\n        \n        if (failed)\n            return;\n    }\n    local_failure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_78788;\n    int32_t local_tid_78789;\n    int64_t group_sizze_78792;\n    int32_t wave_sizze_78791;\n    int32_t group_tid_78790;\n    \n    global_tid_78788 = get_global_id(0);\n    local_tid_78789 = get_local_id(0);\n    group_sizze_78792 = get_local_size(0);\n    wave_sizze_78791 = LOCKSTEP_WIDTH;\n    group_tid_78790 = get_group_id(0);\n    \n    int32_t gid_flat_75312 = group_tid_78790;\n    int64_t slice_78795 = tile_sizze_75307;\n    int64_t slice_78796 = tile_sizze_75307 * slice_78795;\n    int64_t ltid_pre_78793 = squot64(sext_i32_i64(local_tid_78789),\n                                     slice_78795);\n    int64_t remnant_78797 = sext_i32_i64(local_tid_78789) - ltid_pre_78793 *\n            slice_78795;\n    int64_t ltid_pre_78794 = remnant_78797;\n    int64_t remnant_78798 = remnant_78797 - ltid_pre_78794;\n    int64_t slice_78799 = num_groups_y_75310;\n    int64_t slice_78800 = num_groups_x_75309 * slice_78799;\n    int64_t gid_x_75304 = squot64(sext_i",
                   "32_i64(group_tid_78790), slice_78799);\n    int64_t remnant_78801 = sext_i32_i64(group_tid_78790) - gid_x_75304 *\n            slice_78799;\n    int64_t gid_y_75305 = remnant_78801;\n    int64_t remnant_78802 = remnant_78801 - gid_y_75305;\n    float color_78153[1];\n    float color_78154[1];\n    float color_78155[1];\n    float color_78156[1];\n    float color_78157[1];\n    float color_78158[1];\n    __local unsigned char *color_78159;\n    \n    color_78159 = (__local unsigned char *) color_78159_backing_0;\n    \n    float color_78160[1];\n    int64_t color_78161[1];\n    int64_t color_78162[1];\n    int64_t color_78163[1];\n    int64_t binop_x_75332 = gid_x_75304 * tile_sizze_75307;\n    int64_t binop_x_75334 = gid_y_75305 * tile_sizze_75307;\n    int64_t ltid_y_75331 = sext_i32_i64(sext_i64_i32(ltid_pre_78793));\n    int64_t ltid_x_75329 = sext_i32_i64(sext_i64_i32(ltid_pre_78794));\n    int32_t ltid_flat_75330 = local_tid_78789;\n    \n    if (slt64(ltid_y_75331, tile_sizze_75307) && slt64(ltid_x_75329,\n                                                       tile_sizze_75307)) {\n        int64_t gtid_75333 = ltid_y_75331 + binop_x_75332;\n        int64_t gtid_75335 = ltid_x_75329 + binop_x_75334;\n        bool binop_x_75336 = slt64(gtid_75333, m_65343);\n        bool binop_y_75337 = slt64(gtid_75335, n_m_65352);\n        bool cond_75338 = binop_x_75336 && binop_y_75337;\n        int64_t pre_75339;\n        int64_t pre_75340;\n        int64_t pre_75341;\n        float pre_75342;\n        \n        if (cond_75338) {\n            int64_t last_res_75343;\n            \n            last_res_75343 = ((__global int64_t *) mem_77316)[gtid_75333 *\n                                                              n_65344 +\n                                                              i_65358];\n            \n            int64_t min_arg_75344;\n            \n            min_arg_75344 = ((__global int64_t *) mem_77334)[gtid_75333];\n            \n            int64_t min_arg_75345;\n            \n            min_arg_75345",
                   " = ((__global int64_t *) mem_77337)[gtid_75333];\n            \n            int64_t min_res_75346;\n            \n            min_res_75346 = ((__global int64_t *) mem_77340)[gtid_75333];\n            \n            float max_res_75347;\n            \n            max_res_75347 = ((__global float *) mem_77343)[gtid_75333];\n            \n            int64_t min_arg_75348 = mul64(jump_65348, gtid_75335);\n            int64_t min_res_75349 = smin64(i_65358, min_arg_75348);\n            int64_t defunc_0_g_res_75350 = add64((int64_t) 1, min_res_75349);\n            bool init_idx_75351;\n            int64_t init_idx_75352;\n            int64_t init_idx_75353;\n            bool loop_while_75354;\n            int64_t low_75355;\n            int64_t high_75356;\n            \n            loop_while_75354 = x_65359;\n            low_75355 = (int64_t) 0;\n            high_75356 = i_65358;\n            while (loop_while_75354) {\n                int64_t x_75357 = add64(low_75355, high_75356);\n                int64_t mid_75358 = sdiv64(x_75357, (int64_t) 2);\n                bool x_75359 = sle64((int64_t) 0, mid_75358);\n                bool y_75360 = slt64(mid_75358, n_65344);\n                bool bounds_check_75361 = x_75359 && y_75360;\n                bool index_certs_75362;\n                \n                if (!bounds_check_75361) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 20) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) mid_75358;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t mid_id_75363;\n                \n                mid_id_75363 = ((__global int64_t *) mem_77330)[gtid_75333 *\n                                                                n_653",
                   "44 +\n                                                                mid_75358];\n                \n                bool cond_75364 = slt64(mid_id_75363, (int64_t) 0);\n                int64_t mid_idx_75365;\n                \n                if (cond_75364) {\n                    mid_idx_75365 = (int64_t) 9223372036854775807;\n                } else {\n                    mid_idx_75365 = mid_id_75363;\n                }\n                \n                bool cond_75366 = sle64(defunc_0_g_res_75350, mid_idx_75365);\n                int64_t loopres_75367;\n                int64_t loopres_75368;\n                \n                if (cond_75366) {\n                    int64_t loopres_t_res_75369 = sub64(mid_75358, (int64_t) 1);\n                    \n                    loopres_75367 = low_75355;\n                    loopres_75368 = loopres_t_res_75369;\n                } else {\n                    int64_t loopres_f_res_75370 = add64((int64_t) 1, mid_75358);\n                    \n                    loopres_75367 = loopres_f_res_75370;\n                    loopres_75368 = high_75356;\n                }\n                \n                bool loop_cond_75371 = sle64(loopres_75367, loopres_75368);\n                bool loop_while_tmp_78803 = loop_cond_75371;\n                int64_t low_tmp_78804 = loopres_75367;\n                int64_t high_tmp_78805 = loopres_75368;\n                \n                loop_while_75354 = loop_while_tmp_78803;\n                low_75355 = low_tmp_78804;\n                high_75356 = high_tmp_78805;\n            }\n            init_idx_75351 = loop_while_75354;\n            init_idx_75352 = low_75355;\n            init_idx_75353 = high_75356;\n            \n            bool idx_75372;\n            int64_t idx_75373;\n            int64_t idx_75374;\n            int64_t idx_75375;\n            bool loop_while_75376;\n            int64_t l_idx_75377;\n            int64_t r_idx_75378;\n            int64_t span_75379;\n            \n            loop_while_75376 = loop_cond_65369;\n       ",
                   "     l_idx_75377 = init_idx_75352;\n            r_idx_75378 = init_idx_75352;\n            span_75379 = (int64_t) 1;\n            while (loop_while_75376) {\n                int64_t max_arg_75380 = sub64(l_idx_75377, (int64_t) 1);\n                int64_t max_res_75381 = smax64((int64_t) 0, max_arg_75380);\n                int64_t min_arg_75382 = add64((int64_t) 1, r_idx_75378);\n                int64_t min_res_75383 = smin64(min_arg_75344, min_arg_75382);\n                bool x_75384 = sle64((int64_t) 0, max_res_75381);\n                bool y_75385 = slt64(max_res_75381, n_65344);\n                bool bounds_check_75386 = x_75384 && y_75385;\n                bool index_certs_75387;\n                \n                if (!bounds_check_75386) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 21) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) max_res_75381;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_75388;\n                \n                x_75388 = ((__global int64_t *) mem_77330)[gtid_75333 *\n                                                           n_65344 +\n                                                           max_res_75381];\n                \n                int64_t abs_arg_75389 = sub64(x_75388, defunc_0_g_res_75350);\n                int64_t abs_res_75390 = abs64(abs_arg_75389);\n                bool x_75391 = sle64((int64_t) 0, min_res_75383);\n                bool y_75392 = slt64(min_res_75383, n_65344);\n                bool bounds_check_75393 = x_75391 && y_75392;\n                bool index_certs_75394;\n                \n                if (!bounds_check_75393) {\n                    {\n                        if (atomic_cm",
                   "pxchg_i32_global(global_failure, -1, 22) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) min_res_75383;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_75395;\n                \n                x_75395 = ((__global int64_t *) mem_77330)[gtid_75333 *\n                                                           n_65344 +\n                                                           min_res_75383];\n                \n                int64_t abs_arg_75396 = sub64(x_75395, defunc_0_g_res_75350);\n                int64_t abs_res_75397 = abs64(abs_arg_75396);\n                bool cond_75398 = max_res_75381 == l_idx_75377;\n                int64_t loopres_75399;\n                int64_t loopres_75400;\n                int64_t loopres_75401;\n                \n                if (cond_75398) {\n                    loopres_75399 = l_idx_75377;\n                    loopres_75400 = r_idx_75378;\n                    loopres_75401 = min_res_65364;\n                } else {\n                    bool cond_75402 = slt64(abs_res_75390, abs_res_75397);\n                    bool cond_f_res_75403 = min_res_75383 == r_idx_75378;\n                    bool x_75404 = !cond_75402;\n                    bool y_75405 = cond_f_res_75403 && x_75404;\n                    bool cond_75406 = cond_75402 || y_75405;\n                    int64_t loopres_f_res_75407;\n                    \n                    if (cond_75406) {\n                        loopres_f_res_75407 = max_res_75381;\n                    } else {\n                        loopres_f_res_75407 = l_idx_75377;\n                    }\n                    \n                    int64_t loopres_f_res_75408;\n                    \n                    if (cond_75406) {\n                ",
                   "        loopres_f_res_75408 = r_idx_75378;\n                    } else {\n                        loopres_f_res_75408 = min_res_75383;\n                    }\n                    \n                    int64_t loopres_f_res_75409;\n                    \n                    if (cond_75406) {\n                        int64_t loopres_f_res_t_res_75410 = add64((int64_t) 1,\n                                                                  span_75379);\n                        \n                        loopres_f_res_75409 = loopres_f_res_t_res_75410;\n                    } else {\n                        int64_t loopres_f_res_f_res_75411 = add64((int64_t) 1,\n                                                                  span_75379);\n                        \n                        loopres_f_res_75409 = loopres_f_res_f_res_75411;\n                    }\n                    loopres_75399 = loopres_f_res_75407;\n                    loopres_75400 = loopres_f_res_75408;\n                    loopres_75401 = loopres_f_res_75409;\n                }\n                \n                bool loop_cond_75412 = slt64(loopres_75401, min_res_65364);\n                bool loop_while_tmp_78806 = loop_cond_75412;\n                int64_t l_idx_tmp_78807 = loopres_75399;\n                int64_t r_idx_tmp_78808 = loopres_75400;\n                int64_t span_tmp_78809 = loopres_75401;\n                \n                loop_while_75376 = loop_while_tmp_78806;\n                l_idx_75377 = l_idx_tmp_78807;\n                r_idx_75378 = r_idx_tmp_78808;\n                span_75379 = span_tmp_78809;\n            }\n            idx_75372 = loop_while_75376;\n            idx_75373 = l_idx_75377;\n            idx_75374 = r_idx_75378;\n            idx_75375 = span_75379;\n            \n            int64_t min_res_75413 = smin64(min_arg_75345, idx_75373);\n            int64_t max_res_75414 = smax64((int64_t) 0, min_res_75413);\n            int64_t x_75415 = add64(min_res_75346, max_res_75414);\n            int64_t r_75416 = sub64(x_7",
                   "5415, (int64_t) 1);\n            bool x_75417 = sle64((int64_t) 0, r_75416);\n            bool y_75418 = slt64(r_75416, n_65344);\n            bool bounds_check_75419 = x_75417 && y_75418;\n            bool index_certs_75420;\n            \n            if (!bounds_check_75419) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 23) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) r_75416;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_0;\n                }\n            }\n            \n            int64_t x_75421;\n            \n            x_75421 = ((__global int64_t *) mem_77324)[gtid_75333 * n_65344 +\n                                                       r_75416];\n            \n            int64_t abs_arg_75422 = sub64(x_75421, min_res_75349);\n            int64_t abs_res_75423 = abs64(abs_arg_75422);\n            bool x_75424 = sle64((int64_t) 0, max_res_75414);\n            bool y_75425 = slt64(max_res_75414, n_65344);\n            bool bounds_check_75426 = x_75424 && y_75425;\n            bool index_certs_75427;\n            \n            if (!bounds_check_75426) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 24) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_75414;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_0;\n                }\n            }\n            \n            int64_t x_75428;\n            \n            x_75428 = ((__global int64_t *) mem_77324)[gtid_75333 * n_65344 +\n                                                       max_res_75414];\n            \n            int64_t abs_arg_75429 = sub64(x_75428, min_res_75349);\n",
                   "            int64_t abs_res_75430 = abs64(abs_arg_75429);\n            int64_t max_res_75431 = smax64(abs_res_75423, abs_res_75430);\n            float defunc_0_f_res_75432 = sitofp_i64_f32(max_res_75431);\n            float defunc_1_f_res_75433 = max_res_75347 + defunc_0_f_res_75432;\n            \n            pre_75339 = last_res_75343;\n            pre_75340 = min_res_75349;\n            pre_75341 = max_res_75414;\n            pre_75342 = defunc_1_f_res_75433;\n        } else {\n            pre_75339 = (int64_t) 0;\n            pre_75340 = (int64_t) 0;\n            pre_75341 = (int64_t) 0;\n            pre_75342 = 0.0F;\n        }\n        color_78163[(int64_t) 0] = pre_75339;\n        color_78162[(int64_t) 0] = pre_75340;\n        color_78161[(int64_t) 0] = pre_75341;\n        color_78160[(int64_t) 0] = pre_75342;\n    }\n    \n  error_0:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t ltid_y_75450 = sext_i32_i64(sext_i64_i32(ltid_pre_78793));\n    int64_t ltid_x_75448 = sext_i32_i64(sext_i64_i32(ltid_pre_78794));\n    int32_t ltid_flat_75449 = local_tid_78789;\n    \n    if (slt64(ltid_y_75450, tile_sizze_75307) && slt64(ltid_x_75448,\n                                                       tile_sizze_75307)) {\n        color_78154[(int64_t) 0] = 0.0F;\n        color_78153[(int64_t) 0] = 0.0F;\n        color_78156[(int64_t) 0] = 0.0F;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    float tmp_78810;\n    \n    tmp_78810 = color_78154[(int64_t) 0];\n    color_78155[(int64_t) 0] = tmp_78810;\n    \n    float tmp_78811;\n    \n    tmp_78811 = color_78153[(int64_t) 0];\n    color_78154[(int64_t) 0] = tmp_78811;\n    \n    float tmp_78812;\n    \n    tmp_78812 = color_78156[(int64_t) 0];\n    color_78153[(int64_t) 0] = tmp_78812;\n    \n    float ext_mem_77393[1];\n    float ext_mem_unused_78084[1];\n    float ext_mem_77392[1];\n    float ext_mem_unused_78089[1];\n    float ext_mem_77391[1];\n    float ext_mem_unused_78094[1];\n    float mem",
                   "_param_77373[1];\n    float mem_param_77374[1];\n    float mem_param_77375[1];\n    float mem_param_out_78085[1];\n    float mem_param_out_78090[1];\n    float mem_param_out_78095[1];\n    \n    for (int32_t i_1 = 0; i_1 < 1; i_1++)\n        mem_param_77373[i_1] = color_78155[i_1];\n    for (int32_t i_2 = 0; i_2 < 1; i_2++)\n        mem_param_out_78085[i_2] = color_78158[i_2];\n    for (int32_t i_3 = 0; i_3 < 1; i_3++)\n        mem_param_77374[i_3] = color_78154[i_3];\n    for (int32_t i_4 = 0; i_4 < 1; i_4++)\n        mem_param_out_78090[i_4] = color_78157[i_4];\n    for (int32_t i_5 = 0; i_5 < 1; i_5++)\n        mem_param_77375[i_5] = color_78153[i_5];\n    for (int32_t i_6 = 0; i_6 < 1; i_6++)\n        mem_param_out_78095[i_6] = color_78156[i_6];\n    for (int64_t tile_id_75461 = 0; tile_id_75461 < num_whole_tiles_75442;\n         tile_id_75461++) {\n        int64_t binop_x_75584 = tile_sizze_75307 * tile_id_75461;\n        int64_t ltid_y_75581 = sext_i32_i64(sext_i64_i32(ltid_pre_78793));\n        int64_t ltid_x_75579 = sext_i32_i64(sext_i64_i32(ltid_pre_78794));\n        int32_t ltid_flat_75580 = local_tid_78789;\n        int64_t j_75585 = ltid_x_75579 + binop_x_75584;\n        int64_t gtid_75587 = binop_x_75332 + ltid_y_75581;\n        bool binop_x_75595 = slt64(j_75585, q_65346);\n        bool binop_y_75596 = slt64(gtid_75587, m_65343);\n        bool cond_75597 = binop_x_75595 && binop_y_75596;\n        float pre2d_75598;\n        \n        if (cond_75597) {\n            float x_75599;\n            \n            x_75599 = ((__global float *) mem_77348)[gtid_75587 * q_65346 +\n                                                     j_75585];\n            pre2d_75598 = x_75599;\n        } else {\n            pre2d_75598 = 0.0F;\n        }\n        ((__local float *) color_78159)[ltid_y_75581 * tile_sizze_75307 +\n                                        ltid_x_75579] = pre2d_75598;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t ltid_y_75606 = sext_i32_i64(sext_i64_i32(ltid_pre_78793));\n    ",
                   "    int64_t ltid_x_75604 = sext_i32_i64(sext_i64_i32(ltid_pre_78794));\n        int32_t ltid_flat_75605 = local_tid_78789;\n        int64_t gtid_75608 = binop_x_75332 + ltid_y_75606;\n        int64_t gtid_75610 = binop_x_75334 + ltid_x_75604;\n        float acc_75616;\n        \n        acc_75616 = mem_param_77373[(int64_t) 0];\n        \n        float acc_75617;\n        \n        acc_75617 = mem_param_77374[(int64_t) 0];\n        \n        float acc_75618;\n        \n        acc_75618 = mem_param_77375[(int64_t) 0];\n        \n        bool binop_x_75622 = slt64(gtid_75608, m_65343);\n        bool binop_y_75623 = slt64(gtid_75610, n_m_65352);\n        bool cond_75624 = binop_x_75622 && binop_y_75623;\n        float acc_75625;\n        float acc_75626;\n        float acc_75627;\n        \n        if (cond_75624) {\n            int64_t last_res_75611;\n            \n            last_res_75611 = color_78163[(int64_t) 0];\n            \n            int64_t min_res_75612;\n            \n            min_res_75612 = color_78162[(int64_t) 0];\n            \n            int64_t max_res_75613;\n            \n            max_res_75613 = color_78161[(int64_t) 0];\n            \n            float defunc_1_f_res_75614;\n            \n            defunc_1_f_res_75614 = color_78160[(int64_t) 0];\n            \n            float x_75628;\n            float x_75629;\n            float x_75630;\n            float redout_76858;\n            float redout_76859;\n            float redout_76860;\n            \n            redout_76858 = acc_75616;\n            redout_76859 = acc_75617;\n            redout_76860 = acc_75618;\n            for (int64_t i_76861 = 0; i_76861 < tile_sizze_75307; i_76861++) {\n                int64_t index_primexp_76957 = add64(binop_x_75584, i_76861);\n                float x_75641;\n                \n                x_75641 = ((__local float *) color_78159)[ltid_y_75606 *\n                                                          tile_sizze_75307 +\n                                                          i_76861",
                   "];\n                \n                bool cond_75642 = sle64(last_res_75611, index_primexp_76957);\n                int64_t defunc_0_f_res_75643;\n                \n                if (cond_75642) {\n                    defunc_0_f_res_75643 = (int64_t) 0;\n                } else {\n                    int64_t i_75644 = add64(max_res_75613, index_primexp_76957);\n                    int64_t defunc_0_add_arg_75645;\n                    \n                    defunc_0_add_arg_75645 = ((__global\n                                               int64_t *) mem_77324)[gtid_75608 *\n                                                                     n_65344 +\n                                                                     i_75644];\n                    \n                    int64_t defunc_1_add_res_75646 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_75645);\n                    \n                    defunc_0_f_res_75643 = defunc_1_add_res_75646;\n                }\n                \n                int64_t binop_p_75647 = sub64(defunc_0_f_res_75643,\n                                              min_res_75612);\n                float defunc_0_f_res_75648 = sitofp_i64_f32(binop_p_75647);\n                float abs_res_75649 = (float) fabs(defunc_0_f_res_75648);\n                float tmp1_75650 = abs_res_75649 / defunc_1_f_res_75614;\n                float x_75651 = tmp1_75650 * tmp1_75650;\n                float y_75652 = tmp1_75650 * x_75651;\n                float tmp2_75653 = 1.0F - y_75652;\n                float x_75654 = tmp2_75653 * tmp2_75653;\n                float tmp3_75655 = tmp2_75653 * x_75654;\n                float w_j_75656 = x_75641 * tmp3_75655;\n                float xw_j_75657 = defunc_0_f_res_75648 * w_j_75656;\n                float x2w_j_75658 = defunc_0_f_res_75648 * xw_j_75657;\n                float defunc_1_op_res_75637 = w_j_75656 + redout_76858;\n                float defunc_1_op_res_75638 = xw_j_75657 + redout_76859;\n    ",
                   "            float defunc_1_op_res_75639 = x2w_j_75658 + redout_76860;\n                float redout_tmp_78822 = defunc_1_op_res_75637;\n                float redout_tmp_78823 = defunc_1_op_res_75638;\n                float redout_tmp_78824 = defunc_1_op_res_75639;\n                \n                redout_76858 = redout_tmp_78822;\n                redout_76859 = redout_tmp_78823;\n                redout_76860 = redout_tmp_78824;\n            }\n            x_75628 = redout_76858;\n            x_75629 = redout_76859;\n            x_75630 = redout_76860;\n            acc_75625 = x_75628;\n            acc_75626 = x_75629;\n            acc_75627 = x_75630;\n        } else {\n            acc_75625 = acc_75616;\n            acc_75626 = acc_75617;\n            acc_75627 = acc_75618;\n        }\n        mem_param_out_78085[(int64_t) 0] = acc_75625;\n        mem_param_out_78090[(int64_t) 0] = acc_75626;\n        mem_param_out_78095[(int64_t) 0] = acc_75627;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        float mem_param_tmp_78813[1];\n        \n        for (int32_t i_7 = 0; i_7 < 1; i_7++)\n            mem_param_tmp_78813[i_7] = mem_param_out_78085[i_7];\n        \n        float mem_param_out_tmp_78814[1];\n        \n        for (int32_t i_8 = 0; i_8 < 1; i_8++)\n            mem_param_out_tmp_78814[i_8] = mem_param_77373[i_8];\n        \n        float mem_param_tmp_78815[1];\n        \n        for (int32_t i_9 = 0; i_9 < 1; i_9++)\n            mem_param_tmp_78815[i_9] = mem_param_out_78090[i_9];\n        \n        float mem_param_out_tmp_78816[1];\n        \n        for (int32_t i_10 = 0; i_10 < 1; i_10++)\n            mem_param_out_tmp_78816[i_10] = mem_param_77374[i_10];\n        \n        float mem_param_tmp_78817[1];\n        \n        for (int32_t i_11 = 0; i_11 < 1; i_11++)\n            mem_param_tmp_78817[i_11] = mem_param_out_78095[i_11];\n        \n        float mem_param_out_tmp_78818[1];\n        \n        for (int32_t i_12 = 0; i_12 < 1; i_12++)\n            mem_param_out_tmp_78818[i_12] = mem_param_77375",
                   "[i_12];\n        for (int32_t i_13 = 0; i_13 < 1; i_13++)\n            mem_param_77373[i_13] = mem_param_tmp_78813[i_13];\n        for (int32_t i_14 = 0; i_14 < 1; i_14++)\n            mem_param_out_78085[i_14] = mem_param_out_tmp_78814[i_14];\n        for (int32_t i_15 = 0; i_15 < 1; i_15++)\n            mem_param_77374[i_15] = mem_param_tmp_78815[i_15];\n        for (int32_t i_16 = 0; i_16 < 1; i_16++)\n            mem_param_out_78090[i_16] = mem_param_out_tmp_78816[i_16];\n        for (int32_t i_17 = 0; i_17 < 1; i_17++)\n            mem_param_77375[i_17] = mem_param_tmp_78817[i_17];\n        for (int32_t i_18 = 0; i_18 < 1; i_18++)\n            mem_param_out_78095[i_18] = mem_param_out_tmp_78818[i_18];\n    }\n    for (int32_t i_19 = 0; i_19 < 1; i_19++)\n        ext_mem_77393[i_19] = mem_param_77373[i_19];\n    for (int32_t i_20 = 0; i_20 < 1; i_20++)\n        ext_mem_unused_78084[i_20] = mem_param_out_78085[i_20];\n    for (int32_t i_21 = 0; i_21 < 1; i_21++)\n        ext_mem_77392[i_21] = mem_param_77374[i_21];\n    for (int32_t i_22 = 0; i_22 < 1; i_22++)\n        ext_mem_unused_78089[i_22] = mem_param_out_78090[i_22];\n    for (int32_t i_23 = 0; i_23 < 1; i_23++)\n        ext_mem_77391[i_23] = mem_param_77375[i_23];\n    for (int32_t i_24 = 0; i_24 < 1; i_24++)\n        ext_mem_unused_78094[i_24] = mem_param_out_78095[i_24];\n    if (cond_75691) {\n        float tmp_78825;\n        \n        tmp_78825 = ext_mem_77393[(int64_t) 0];\n        color_78153[(int64_t) 0] = tmp_78825;\n        \n        float tmp_78826;\n        \n        tmp_78826 = ext_mem_77392[(int64_t) 0];\n        color_78154[(int64_t) 0] = tmp_78826;\n        \n        float tmp_78827;\n        \n        tmp_78827 = ext_mem_77391[(int64_t) 0];\n        color_78155[(int64_t) 0] = tmp_78827;\n    } else {\n        int64_t binop_x_75815 = tile_sizze_75307 * num_whole_tiles_75442;\n        int64_t ltid_y_75812 = sext_i32_i64(sext_i64_i32(ltid_pre_78793));\n        int64_t ltid_x_75810 = sext_i32_i64(sext_i64_i32(ltid_pre_78794));\n        ",
                   "int32_t ltid_flat_75811 = local_tid_78789;\n        int64_t j_75816 = ltid_x_75810 + binop_x_75815;\n        int64_t gtid_75818 = binop_x_75332 + ltid_y_75812;\n        bool binop_x_75826 = slt64(j_75816, q_65346);\n        bool binop_y_75827 = slt64(gtid_75818, m_65343);\n        bool cond_75828 = binop_x_75826 && binop_y_75827;\n        float pre2d_75829;\n        \n        if (cond_75828) {\n            float x_75830;\n            \n            x_75830 = ((__global float *) mem_77348)[gtid_75818 * q_65346 +\n                                                     j_75816];\n            pre2d_75829 = x_75830;\n        } else {\n            pre2d_75829 = 0.0F;\n        }\n        ((__local float *) color_78159)[ltid_y_75812 * tile_sizze_75307 +\n                                        ltid_x_75810] = pre2d_75829;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t ltid_y_75838 = sext_i32_i64(sext_i64_i32(ltid_pre_78793));\n        int64_t ltid_x_75836 = sext_i32_i64(sext_i64_i32(ltid_pre_78794));\n        int32_t ltid_flat_75837 = local_tid_78789;\n        int64_t gtid_75840 = binop_x_75332 + ltid_y_75838;\n        int64_t gtid_75842 = binop_x_75334 + ltid_x_75836;\n        float acc_75848;\n        \n        acc_75848 = ext_mem_77393[(int64_t) 0];\n        \n        float acc_75849;\n        \n        acc_75849 = ext_mem_77392[(int64_t) 0];\n        \n        float acc_75850;\n        \n        acc_75850 = ext_mem_77391[(int64_t) 0];\n        \n        bool binop_x_75854 = slt64(gtid_75840, m_65343);\n        bool binop_y_75855 = slt64(gtid_75842, n_m_65352);\n        bool cond_75856 = binop_x_75854 && binop_y_75855;\n        float acc_75857;\n        float acc_75858;\n        float acc_75859;\n        \n        if (cond_75856) {\n            int64_t last_res_75843;\n            \n            last_res_75843 = color_78163[(int64_t) 0];\n            \n            int64_t min_res_75844;\n            \n            min_res_75844 = color_78162[(int64_t) 0];\n            \n            int64_t max_res_75845;\n     ",
                   "       \n            max_res_75845 = color_78161[(int64_t) 0];\n            \n            float defunc_1_f_res_75846;\n            \n            defunc_1_f_res_75846 = color_78160[(int64_t) 0];\n            \n            float x_75860;\n            float x_75861;\n            float x_75862;\n            float redout_76862;\n            float redout_76863;\n            float redout_76864;\n            \n            redout_76862 = acc_75848;\n            redout_76863 = acc_75849;\n            redout_76864 = acc_75850;\n            for (int64_t i_76865 = 0; i_76865 < residual_input_75690;\n                 i_76865++) {\n                int64_t index_primexp_76955 = add64(binop_x_75815, i_76865);\n                float x_75873;\n                \n                x_75873 = ((__local float *) color_78159)[ltid_y_75838 *\n                                                          tile_sizze_75307 +\n                                                          i_76865];\n                \n                bool cond_75874 = sle64(last_res_75843, index_primexp_76955);\n                int64_t defunc_0_f_res_75875;\n                \n                if (cond_75874) {\n                    defunc_0_f_res_75875 = (int64_t) 0;\n                } else {\n                    int64_t i_75876 = add64(max_res_75845, index_primexp_76955);\n                    int64_t defunc_0_add_arg_75877;\n                    \n                    defunc_0_add_arg_75877 = ((__global\n                                               int64_t *) mem_77324)[gtid_75840 *\n                                                                     n_65344 +\n                                                                     i_75876];\n                    \n                    int64_t defunc_1_add_res_75878 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_75877);\n                    \n                    defunc_0_f_res_75875 = defunc_1_add_res_75878;\n                }\n                \n                int64_t bino",
                   "p_p_75879 = sub64(defunc_0_f_res_75875,\n                                              min_res_75844);\n                float defunc_0_f_res_75880 = sitofp_i64_f32(binop_p_75879);\n                float abs_res_75881 = (float) fabs(defunc_0_f_res_75880);\n                float tmp1_75882 = abs_res_75881 / defunc_1_f_res_75846;\n                float x_75883 = tmp1_75882 * tmp1_75882;\n                float y_75884 = tmp1_75882 * x_75883;\n                float tmp2_75885 = 1.0F - y_75884;\n                float x_75886 = tmp2_75885 * tmp2_75885;\n                float tmp3_75887 = tmp2_75885 * x_75886;\n                float w_j_75888 = x_75873 * tmp3_75887;\n                float xw_j_75889 = defunc_0_f_res_75880 * w_j_75888;\n                float x2w_j_75890 = defunc_0_f_res_75880 * xw_j_75889;\n                float defunc_1_op_res_75869 = w_j_75888 + redout_76862;\n                float defunc_1_op_res_75870 = xw_j_75889 + redout_76863;\n                float defunc_1_op_res_75871 = x2w_j_75890 + redout_76864;\n                float redout_tmp_78828 = defunc_1_op_res_75869;\n                float redout_tmp_78829 = defunc_1_op_res_75870;\n                float redout_tmp_78830 = defunc_1_op_res_75871;\n                \n                redout_76862 = redout_tmp_78828;\n                redout_76863 = redout_tmp_78829;\n                redout_76864 = redout_tmp_78830;\n            }\n            x_75860 = redout_76862;\n            x_75861 = redout_76863;\n            x_75862 = redout_76864;\n            acc_75857 = x_75860;\n            acc_75858 = x_75861;\n            acc_75859 = x_75862;\n        } else {\n            acc_75857 = acc_75848;\n            acc_75858 = acc_75849;\n            acc_75859 = acc_75850;\n        }\n        color_78158[(int64_t) 0] = acc_75857;\n        color_78157[(int64_t) 0] = acc_75858;\n        color_78156[(int64_t) 0] = acc_75859;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        float tmp_78831;\n        \n        tmp_78831 = color_78158[(int64_t) 0];\n        co",
                   "lor_78153[(int64_t) 0] = tmp_78831;\n        \n        float tmp_78832;\n        \n        tmp_78832 = color_78157[(int64_t) 0];\n        color_78154[(int64_t) 0] = tmp_78832;\n        \n        float tmp_78833;\n        \n        tmp_78833 = color_78156[(int64_t) 0];\n        color_78155[(int64_t) 0] = tmp_78833;\n    }\n    \n    int64_t ltid_y_75908 = sext_i32_i64(sext_i64_i32(ltid_pre_78793));\n    int64_t ltid_x_75906 = sext_i32_i64(sext_i64_i32(ltid_pre_78794));\n    int32_t ltid_flat_75907 = local_tid_78789;\n    \n    if (slt64(ltid_y_75908, tile_sizze_75307) && slt64(ltid_x_75906,\n                                                       tile_sizze_75307)) {\n        int64_t gtid_75910 = binop_x_75332 + ltid_y_75908;\n        int64_t gtid_75912 = binop_x_75334 + ltid_x_75906;\n        bool binop_x_75916 = slt64(gtid_75910, m_65343);\n        bool binop_y_75917 = slt64(gtid_75912, n_m_65352);\n        bool cond_75918 = binop_x_75916 && binop_y_75917;\n        float postlude_75919;\n        float postlude_75920;\n        \n        if (cond_75918) {\n            float defunc_2_reduce_res_75913;\n            \n            defunc_2_reduce_res_75913 = color_78153[(int64_t) 0];\n            \n            float defunc_2_reduce_res_75914;\n            \n            defunc_2_reduce_res_75914 = color_78154[(int64_t) 0];\n            \n            float defunc_2_reduce_res_75915;\n            \n            defunc_2_reduce_res_75915 = color_78155[(int64_t) 0];\n            \n            int64_t last_res_75921;\n            \n            last_res_75921 = color_78163[(int64_t) 0];\n            \n            int64_t min_res_75922;\n            \n            min_res_75922 = color_78162[(int64_t) 0];\n            \n            int64_t max_res_75923;\n            \n            max_res_75923 = color_78161[(int64_t) 0];\n            \n            float defunc_1_f_res_75924;\n            \n            defunc_1_f_res_75924 = color_78160[(int64_t) 0];\n            \n            float x_75926 = defunc_2_reduce_res_75913 *\n                ",
                   "  defunc_2_reduce_res_75915;\n            float y_75927 = defunc_2_reduce_res_75914 *\n                  defunc_2_reduce_res_75914;\n            float y_75928 = x_75926 - y_75927;\n            float det1_75929 = 1.0F / y_75928;\n            float a11_75930 = defunc_2_reduce_res_75915 * det1_75929;\n            float x_75931 = 0.0F - defunc_2_reduce_res_75914;\n            float b11_75932 = det1_75929 * x_75931;\n            float c11_75933 = defunc_2_reduce_res_75913 * det1_75929;\n            float defunc_2_reduce_res_75934;\n            float defunc_2_reduce_res_75935;\n            float redout_76866;\n            float redout_76867;\n            \n            redout_76866 = 0.0F;\n            redout_76867 = 0.0F;\n            for (int64_t i_76868 = 0; i_76868 < q_65346; i_76868++) {\n                float x_75943;\n                \n                x_75943 = ((__global float *) mem_77348)[gtid_75910 * q_65346 +\n                                                         i_76868];\n                \n                bool cond_75944 = sle64(last_res_75921, i_76868);\n                int64_t defunc_0_f_res_75945;\n                \n                if (cond_75944) {\n                    defunc_0_f_res_75945 = (int64_t) 0;\n                } else {\n                    int64_t i_75946 = add64(max_res_75923, i_76868);\n                    int64_t defunc_0_add_arg_75947;\n                    \n                    defunc_0_add_arg_75947 = ((__global\n                                               int64_t *) mem_77324)[gtid_75910 *\n                                                                     n_65344 +\n                                                                     i_75946];\n                    \n                    int64_t defunc_1_add_res_75948 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_75947);\n                    \n                    defunc_0_f_res_75945 = defunc_1_add_res_75948;\n                }\n                \n                int64_t b",
                   "inop_p_75949 = sub64(defunc_0_f_res_75945,\n                                              min_res_75922);\n                float defunc_0_f_res_75950 = sitofp_i64_f32(binop_p_75949);\n                float abs_res_75951 = (float) fabs(defunc_0_f_res_75950);\n                float tmp1_75952 = abs_res_75951 / defunc_1_f_res_75924;\n                float x_75953 = tmp1_75952 * tmp1_75952;\n                float y_75954 = tmp1_75952 * x_75953;\n                float tmp2_75955 = 1.0F - y_75954;\n                float x_75956 = tmp2_75955 * tmp2_75955;\n                float tmp3_75957 = tmp2_75955 * x_75956;\n                float tmp4_75958 = x_75943 * tmp3_75957;\n                float defunc_1_f_res_75959 = defunc_0_f_res_75950 * tmp4_75958;\n                float defunc_0_f_res_75960;\n                \n                if (cond_75944) {\n                    defunc_0_f_res_75960 = 0.0F;\n                } else {\n                    int64_t i_75961 = add64(max_res_75923, i_76868);\n                    float defunc_0_add_arg_75962;\n                    \n                    defunc_0_add_arg_75962 = ((__global\n                                               float *) mem_77320)[gtid_75910 *\n                                                                   n_65344 +\n                                                                   i_75961];\n                    defunc_0_f_res_75960 = defunc_0_add_arg_75962;\n                }\n                \n                float x_75963 = a11_75930 * tmp4_75958;\n                float y_75964 = b11_75932 * defunc_1_f_res_75959;\n                float x_75965 = x_75963 + y_75964;\n                float defunc_9_fit_fun_res_75966 = defunc_0_f_res_75960 *\n                      x_75965;\n                float x_75967 = b11_75932 * tmp4_75958;\n                float y_75968 = c11_75933 * defunc_1_f_res_75959;\n                float x_75969 = x_75967 + y_75968;\n                float defunc_9_slope_fun_res_75970 = defunc_0_f_res_75960 *\n                      x_75969;\n",
                   "                float defunc_1_op_res_75938 = defunc_9_fit_fun_res_75966 +\n                      redout_76866;\n                float defunc_1_op_res_75941 = defunc_9_slope_fun_res_75970 +\n                      redout_76867;\n                float redout_tmp_78834 = defunc_1_op_res_75938;\n                float redout_tmp_78835 = defunc_1_op_res_75941;\n                \n                redout_76866 = redout_tmp_78834;\n                redout_76867 = redout_tmp_78835;\n            }\n            defunc_2_reduce_res_75934 = redout_76866;\n            defunc_2_reduce_res_75935 = redout_76867;\n            postlude_75919 = defunc_2_reduce_res_75934;\n            postlude_75920 = defunc_2_reduce_res_75935;\n        } else {\n            postlude_75919 = 0.0F;\n            postlude_75920 = 0.0F;\n        }\n        color_78157[(int64_t) 0] = postlude_75919;\n        color_78156[(int64_t) 0] = postlude_75920;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t thread_out_index_78836 = gid_x_75304 * tile_sizze_75307 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_78793));\n    int64_t thread_out_index_78837 = gid_y_75305 * tile_sizze_75307 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_78794));\n    \n    if (slt64(thread_out_index_78836, m_65343) && slt64(thread_out_index_78837,\n                                                        n_m_65352)) {\n        float tmp_78838;\n        \n        tmp_78838 = color_78157[(int64_t) 0];\n        ((__global float *) mem_77422)[thread_out_index_78836 * n_m_65352 +\n                                       thread_out_index_78837] = tmp_78838;\n    }\n    \n    int64_t thread_out_index_78839 = gid_x_75304 * tile_sizze_75307 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_78793));\n    int64_t thread_out_index_78840 = gid_y_75305 * tile_sizze_75307 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_78794));\n    \n    if (slt64(thread_out_index_78839, m_65343) && slt64(thread_out_index_78840,\n                                                        n_m_65352)) ",
                   "{\n        float tmp_78841;\n        \n        tmp_78841 = color_78156[(int64_t) 0];\n        ((__global float *) mem_77426)[thread_out_index_78839 * n_m_65352 +\n                                       thread_out_index_78840] = tmp_78841;\n    }\n    \n  error_7:\n    return;\n    #undef tile_sizze_75307\n}\n__kernel void mainzisegmap_intragroup_75983(__global int *global_failure,\n                                            int failure_is_an_option, __global\n                                            int64_t *global_failure_args,\n                                            __local volatile\n                                            int64_t *color_78189_backing_aligned_0,\n                                            int64_t m_65343, int64_t n_65344,\n                                            int64_t q_65346, int64_t jump_65348,\n                                            int64_t n_m_65352, int64_t i_65358,\n                                            unsigned char x_65359_bits,\n                                            int64_t min_res_65364,\n                                            unsigned char loop_cond_65369_bits,\n                                            int64_t num_groups_x_75980,\n                                            int64_t num_groups_y_75981,\n                                            int64_t num_whole_tiles_76113,\n                                            int64_t residual_input_76413,\n                                            unsigned char cond_76414_bits,\n                                            __global unsigned char *mem_77608,\n                                            __global unsigned char *mem_77612,\n                                            __global unsigned char *mem_77616,\n                                            __global unsigned char *mem_77622,\n                                            __global unsigned char *mem_77626,\n                                            __global unsigned char *mem_77629,\n                              ",
                   "              __global unsigned char *mem_77632,\n                                            __global unsigned char *mem_77635,\n                                            __global unsigned char *mem_77640,\n                                            __global unsigned char *mem_77738,\n                                            __global unsigned char *mem_77742)\n{\n    bool x_65359 = x_65359_bits;\n    bool loop_cond_65369 = loop_cond_65369_bits;\n    bool cond_76414 = cond_76414_bits;\n    \n    #define tile_sizze_75978 (mainzitile_sizze_75977)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict color_78189_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) color_78189_backing_aligned_0;\n    volatile __local bool local_failure;\n    \n    if (failure_is_an_option) {\n        int failed = *global_failure >= 0;\n        \n        if (failed)\n            return;\n    }\n    local_failure = false;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t global_tid_79205;\n    int32_t local_tid_79206;\n    int64_t group_sizze_79209;\n    int32_t wave_sizze_79208;\n    int32_t group_tid_79207;\n    \n    global_tid_79205 = get_global_id(0);\n    local_tid_79206 = get_local_id(0);\n    group_sizze_79209 = get_local_size(0);\n    wave_sizze_79208 = LOCKSTEP_WIDTH;\n    group_tid_79207 = get_group_id(0);\n    \n    int32_t gid_flat_75983 = group_tid_79207;\n    int64_t slice_79212 = tile_sizze_75978;\n    int64_t slice_79213 = tile_sizze_75978 * slice_79212;\n    int64_t ltid_pre_79210 = squot64(sext_i32_i64(local_tid_79206),\n                                     slice_79212);\n    int64_t remnant_79214 = sext_i32_i64(local_tid_79206) - ltid_pre_79210 *\n            slice_79212;\n    int64_t ltid_pre_79211 = remnant_79214;\n    int64_t remnant_79215 = remnant_79214 - ltid_pre_79211;\n    int64_t slice_79216 = num_groups_y_75981;\n    int64_t slice_79217 = num_g",
                   "roups_x_75980 * slice_79216;\n    int64_t gid_x_75975 = squot64(sext_i32_i64(group_tid_79207), slice_79216);\n    int64_t remnant_79218 = sext_i32_i64(group_tid_79207) - gid_x_75975 *\n            slice_79216;\n    int64_t gid_y_75976 = remnant_79218;\n    int64_t remnant_79219 = remnant_79218 - gid_y_75976;\n    float color_78179[1];\n    float color_78180[1];\n    float color_78181[1];\n    float color_78182[1];\n    float color_78183[1];\n    float color_78184[1];\n    float color_78185[1];\n    float color_78186[1];\n    float color_78187[1];\n    float color_78188[1];\n    __local unsigned char *color_78189;\n    \n    color_78189 = (__local unsigned char *) color_78189_backing_0;\n    \n    float color_78190[1];\n    int64_t color_78191[1];\n    int64_t color_78192[1];\n    int64_t color_78193[1];\n    int64_t binop_x_76003 = gid_x_75975 * tile_sizze_75978;\n    int64_t binop_x_76005 = gid_y_75976 * tile_sizze_75978;\n    int64_t ltid_y_76002 = sext_i32_i64(sext_i64_i32(ltid_pre_79210));\n    int64_t ltid_x_76000 = sext_i32_i64(sext_i64_i32(ltid_pre_79211));\n    int32_t ltid_flat_76001 = local_tid_79206;\n    \n    if (slt64(ltid_y_76002, tile_sizze_75978) && slt64(ltid_x_76000,\n                                                       tile_sizze_75978)) {\n        int64_t gtid_76004 = ltid_y_76002 + binop_x_76003;\n        int64_t gtid_76006 = ltid_x_76000 + binop_x_76005;\n        bool binop_x_76007 = slt64(gtid_76004, m_65343);\n        bool binop_y_76008 = slt64(gtid_76006, n_m_65352);\n        bool cond_76009 = binop_x_76007 && binop_y_76008;\n        int64_t pre_76010;\n        int64_t pre_76011;\n        int64_t pre_76012;\n        float pre_76013;\n        \n        if (cond_76009) {\n            int64_t last_res_76014;\n            \n            last_res_76014 = ((__global int64_t *) mem_77608)[gtid_76004 *\n                                                              n_65344 +\n                                                              i_65358];\n            \n            int64_t min_arg_76015;\n",
                   "            \n            min_arg_76015 = ((__global int64_t *) mem_77626)[gtid_76004];\n            \n            int64_t min_arg_76016;\n            \n            min_arg_76016 = ((__global int64_t *) mem_77629)[gtid_76004];\n            \n            int64_t min_res_76017;\n            \n            min_res_76017 = ((__global int64_t *) mem_77632)[gtid_76004];\n            \n            float max_res_76018;\n            \n            max_res_76018 = ((__global float *) mem_77635)[gtid_76004];\n            \n            int64_t min_arg_76019 = mul64(jump_65348, gtid_76006);\n            int64_t min_res_76020 = smin64(i_65358, min_arg_76019);\n            int64_t defunc_0_g_res_76021 = add64((int64_t) 1, min_res_76020);\n            bool init_idx_76022;\n            int64_t init_idx_76023;\n            int64_t init_idx_76024;\n            bool loop_while_76025;\n            int64_t low_76026;\n            int64_t high_76027;\n            \n            loop_while_76025 = x_65359;\n            low_76026 = (int64_t) 0;\n            high_76027 = i_65358;\n            while (loop_while_76025) {\n                int64_t x_76028 = add64(low_76026, high_76027);\n                int64_t mid_76029 = sdiv64(x_76028, (int64_t) 2);\n                bool x_76030 = sle64((int64_t) 0, mid_76029);\n                bool y_76031 = slt64(mid_76029, n_65344);\n                bool bounds_check_76032 = x_76030 && y_76031;\n                bool index_certs_76033;\n                \n                if (!bounds_check_76032) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 35) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) mid_76029;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t mid_",
                   "id_76034;\n                \n                mid_id_76034 = ((__global int64_t *) mem_77622)[gtid_76004 *\n                                                                n_65344 +\n                                                                mid_76029];\n                \n                bool cond_76035 = slt64(mid_id_76034, (int64_t) 0);\n                int64_t mid_idx_76036;\n                \n                if (cond_76035) {\n                    mid_idx_76036 = (int64_t) 9223372036854775807;\n                } else {\n                    mid_idx_76036 = mid_id_76034;\n                }\n                \n                bool cond_76037 = sle64(defunc_0_g_res_76021, mid_idx_76036);\n                int64_t loopres_76038;\n                int64_t loopres_76039;\n                \n                if (cond_76037) {\n                    int64_t loopres_t_res_76040 = sub64(mid_76029, (int64_t) 1);\n                    \n                    loopres_76038 = low_76026;\n                    loopres_76039 = loopres_t_res_76040;\n                } else {\n                    int64_t loopres_f_res_76041 = add64((int64_t) 1, mid_76029);\n                    \n                    loopres_76038 = loopres_f_res_76041;\n                    loopres_76039 = high_76027;\n                }\n                \n                bool loop_cond_76042 = sle64(loopres_76038, loopres_76039);\n                bool loop_while_tmp_79220 = loop_cond_76042;\n                int64_t low_tmp_79221 = loopres_76038;\n                int64_t high_tmp_79222 = loopres_76039;\n                \n                loop_while_76025 = loop_while_tmp_79220;\n                low_76026 = low_tmp_79221;\n                high_76027 = high_tmp_79222;\n            }\n            init_idx_76022 = loop_while_76025;\n            init_idx_76023 = low_76026;\n            init_idx_76024 = high_76027;\n            \n            bool idx_76043;\n            int64_t idx_76044;\n            int64_t idx_76045;\n            int64_t idx_76046;\n            bool loop_while_",
                   "76047;\n            int64_t l_idx_76048;\n            int64_t r_idx_76049;\n            int64_t span_76050;\n            \n            loop_while_76047 = loop_cond_65369;\n            l_idx_76048 = init_idx_76023;\n            r_idx_76049 = init_idx_76023;\n            span_76050 = (int64_t) 1;\n            while (loop_while_76047) {\n                int64_t max_arg_76051 = sub64(l_idx_76048, (int64_t) 1);\n                int64_t max_res_76052 = smax64((int64_t) 0, max_arg_76051);\n                int64_t min_arg_76053 = add64((int64_t) 1, r_idx_76049);\n                int64_t min_res_76054 = smin64(min_arg_76015, min_arg_76053);\n                bool x_76055 = sle64((int64_t) 0, max_res_76052);\n                bool y_76056 = slt64(max_res_76052, n_65344);\n                bool bounds_check_76057 = x_76055 && y_76056;\n                bool index_certs_76058;\n                \n                if (!bounds_check_76057) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 36) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) max_res_76052;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_76059;\n                \n                x_76059 = ((__global int64_t *) mem_77622)[gtid_76004 *\n                                                           n_65344 +\n                                                           max_res_76052];\n                \n                int64_t abs_arg_76060 = sub64(x_76059, defunc_0_g_res_76021);\n                int64_t abs_res_76061 = abs64(abs_arg_76060);\n                bool x_76062 = sle64((int64_t) 0, min_res_76054);\n                bool y_76063 = slt64(min_res_76054, n_65344);\n                bool bounds_check_76064 = x_7606",
                   "2 && y_76063;\n                bool index_certs_76065;\n                \n                if (!bounds_check_76064) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 37) ==\n                            -1) {\n                            global_failure_args[0] = (int64_t) min_res_76054;\n                            global_failure_args[1] = (int64_t) n_65344;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_76066;\n                \n                x_76066 = ((__global int64_t *) mem_77622)[gtid_76004 *\n                                                           n_65344 +\n                                                           min_res_76054];\n                \n                int64_t abs_arg_76067 = sub64(x_76066, defunc_0_g_res_76021);\n                int64_t abs_res_76068 = abs64(abs_arg_76067);\n                bool cond_76069 = max_res_76052 == l_idx_76048;\n                int64_t loopres_76070;\n                int64_t loopres_76071;\n                int64_t loopres_76072;\n                \n                if (cond_76069) {\n                    loopres_76070 = l_idx_76048;\n                    loopres_76071 = r_idx_76049;\n                    loopres_76072 = min_res_65364;\n                } else {\n                    bool cond_76073 = slt64(abs_res_76061, abs_res_76068);\n                    bool cond_f_res_76074 = min_res_76054 == r_idx_76049;\n                    bool x_76075 = !cond_76073;\n                    bool y_76076 = cond_f_res_76074 && x_76075;\n                    bool cond_76077 = cond_76073 || y_76076;\n                    int64_t loopres_f_res_76078;\n                    \n                    if (cond_76077) {\n                        loopres_f_res_76078 = max_res_76052;\n                    } else {\n                        loopres_f_res_76078 = l_idx_7",
                   "6048;\n                    }\n                    \n                    int64_t loopres_f_res_76079;\n                    \n                    if (cond_76077) {\n                        loopres_f_res_76079 = r_idx_76049;\n                    } else {\n                        loopres_f_res_76079 = min_res_76054;\n                    }\n                    \n                    int64_t loopres_f_res_76080;\n                    \n                    if (cond_76077) {\n                        int64_t loopres_f_res_t_res_76081 = add64((int64_t) 1,\n                                                                  span_76050);\n                        \n                        loopres_f_res_76080 = loopres_f_res_t_res_76081;\n                    } else {\n                        int64_t loopres_f_res_f_res_76082 = add64((int64_t) 1,\n                                                                  span_76050);\n                        \n                        loopres_f_res_76080 = loopres_f_res_f_res_76082;\n                    }\n                    loopres_76070 = loopres_f_res_76078;\n                    loopres_76071 = loopres_f_res_76079;\n                    loopres_76072 = loopres_f_res_76080;\n                }\n                \n                bool loop_cond_76083 = slt64(loopres_76072, min_res_65364);\n                bool loop_while_tmp_79223 = loop_cond_76083;\n                int64_t l_idx_tmp_79224 = loopres_76070;\n                int64_t r_idx_tmp_79225 = loopres_76071;\n                int64_t span_tmp_79226 = loopres_76072;\n                \n                loop_while_76047 = loop_while_tmp_79223;\n                l_idx_76048 = l_idx_tmp_79224;\n                r_idx_76049 = r_idx_tmp_79225;\n                span_76050 = span_tmp_79226;\n            }\n            idx_76043 = loop_while_76047;\n            idx_76044 = l_idx_76048;\n            idx_76045 = r_idx_76049;\n            idx_76046 = span_76050;\n            \n            int64_t min_res_76084 = smin64(min_arg_76016, idx_76044);\n     ",
                   "       int64_t max_res_76085 = smax64((int64_t) 0, min_res_76084);\n            int64_t x_76086 = add64(min_res_76017, max_res_76085);\n            int64_t r_76087 = sub64(x_76086, (int64_t) 1);\n            bool x_76088 = sle64((int64_t) 0, r_76087);\n            bool y_76089 = slt64(r_76087, n_65344);\n            bool bounds_check_76090 = x_76088 && y_76089;\n            bool index_certs_76091;\n            \n            if (!bounds_check_76090) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 38) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) r_76087;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_0;\n                }\n            }\n            \n            int64_t x_76092;\n            \n            x_76092 = ((__global int64_t *) mem_77616)[gtid_76004 * n_65344 +\n                                                       r_76087];\n            \n            int64_t abs_arg_76093 = sub64(x_76092, min_res_76020);\n            int64_t abs_res_76094 = abs64(abs_arg_76093);\n            bool x_76095 = sle64((int64_t) 0, max_res_76085);\n            bool y_76096 = slt64(max_res_76085, n_65344);\n            bool bounds_check_76097 = x_76095 && y_76096;\n            bool index_certs_76098;\n            \n            if (!bounds_check_76097) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 39) ==\n                        -1) {\n                        global_failure_args[0] = (int64_t) max_res_76085;\n                        global_failure_args[1] = (int64_t) n_65344;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_0;\n                }\n            }\n            \n            int64_t x_76099;\n            \n            x_76099 = ((__global int64_t *) mem_77616)[g",
                   "tid_76004 * n_65344 +\n                                                       max_res_76085];\n            \n            int64_t abs_arg_76100 = sub64(x_76099, min_res_76020);\n            int64_t abs_res_76101 = abs64(abs_arg_76100);\n            int64_t max_res_76102 = smax64(abs_res_76094, abs_res_76101);\n            float defunc_0_f_res_76103 = sitofp_i64_f32(max_res_76102);\n            float defunc_1_f_res_76104 = max_res_76018 + defunc_0_f_res_76103;\n            \n            pre_76010 = last_res_76014;\n            pre_76011 = min_res_76020;\n            pre_76012 = max_res_76085;\n            pre_76013 = defunc_1_f_res_76104;\n        } else {\n            pre_76010 = (int64_t) 0;\n            pre_76011 = (int64_t) 0;\n            pre_76012 = (int64_t) 0;\n            pre_76013 = 0.0F;\n        }\n        color_78193[(int64_t) 0] = pre_76010;\n        color_78192[(int64_t) 0] = pre_76011;\n        color_78191[(int64_t) 0] = pre_76012;\n        color_78190[(int64_t) 0] = pre_76013;\n    }\n    \n  error_0:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t ltid_y_76121 = sext_i32_i64(sext_i64_i32(ltid_pre_79210));\n    int64_t ltid_x_76119 = sext_i32_i64(sext_i64_i32(ltid_pre_79211));\n    int32_t ltid_flat_76120 = local_tid_79206;\n    \n    if (slt64(ltid_y_76121, tile_sizze_75978) && slt64(ltid_x_76119,\n                                                       tile_sizze_75978)) {\n        color_78182[(int64_t) 0] = 0.0F;\n        color_78181[(int64_t) 0] = 0.0F;\n        color_78180[(int64_t) 0] = 0.0F;\n        color_78179[(int64_t) 0] = 0.0F;\n        color_78184[(int64_t) 0] = 0.0F;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    float tmp_79227;\n    \n    tmp_79227 = color_78182[(int64_t) 0];\n    color_78183[(int64_t) 0] = tmp_79227;\n    \n    float tmp_79228;\n    \n    tmp_79228 = color_78181[(int64_t) 0];\n    color_78182[(int64_t) 0] = tmp_79228;\n    \n    float tmp_79229;\n    \n    tmp_79229 = color_78180[(int64_t",
                   ") 0];\n    color_78181[(int64_t) 0] = tmp_79229;\n    \n    float tmp_79230;\n    \n    tmp_79230 = color_78179[(int64_t) 0];\n    color_78180[(int64_t) 0] = tmp_79230;\n    \n    float tmp_79231;\n    \n    tmp_79231 = color_78184[(int64_t) 0];\n    color_78179[(int64_t) 0] = tmp_79231;\n    \n    float ext_mem_77701[1];\n    float ext_mem_unused_78102[1];\n    float ext_mem_77700[1];\n    float ext_mem_unused_78107[1];\n    float ext_mem_77699[1];\n    float ext_mem_unused_78112[1];\n    float ext_mem_77698[1];\n    float ext_mem_unused_78117[1];\n    float ext_mem_77697[1];\n    float ext_mem_unused_78122[1];\n    float mem_param_77671[1];\n    float mem_param_77672[1];\n    float mem_param_77673[1];\n    float mem_param_77674[1];\n    float mem_param_77675[1];\n    float mem_param_out_78103[1];\n    float mem_param_out_78108[1];\n    float mem_param_out_78113[1];\n    float mem_param_out_78118[1];\n    float mem_param_out_78123[1];\n    \n    for (int32_t i_1 = 0; i_1 < 1; i_1++)\n        mem_param_77671[i_1] = color_78183[i_1];\n    for (int32_t i_2 = 0; i_2 < 1; i_2++)\n        mem_param_out_78103[i_2] = color_78188[i_2];\n    for (int32_t i_3 = 0; i_3 < 1; i_3++)\n        mem_param_77672[i_3] = color_78182[i_3];\n    for (int32_t i_4 = 0; i_4 < 1; i_4++)\n        mem_param_out_78108[i_4] = color_78187[i_4];\n    for (int32_t i_5 = 0; i_5 < 1; i_5++)\n        mem_param_77673[i_5] = color_78181[i_5];\n    for (int32_t i_6 = 0; i_6 < 1; i_6++)\n        mem_param_out_78113[i_6] = color_78186[i_6];\n    for (int32_t i_7 = 0; i_7 < 1; i_7++)\n        mem_param_77674[i_7] = color_78180[i_7];\n    for (int32_t i_8 = 0; i_8 < 1; i_8++)\n        mem_param_out_78118[i_8] = color_78185[i_8];\n    for (int32_t i_9 = 0; i_9 < 1; i_9++)\n        mem_param_77675[i_9] = color_78179[i_9];\n    for (int32_t i_10 = 0; i_10 < 1; i_10++)\n        mem_param_out_78123[i_10] = color_78184[i_10];\n    for (int64_t tile_id_76136 = 0; tile_id_76136 < num_whole_tiles_76113;\n         tile_id_76136++) {\n        int64_t binop_x_76281 = tile_si",
                   "zze_75978 * tile_id_76136;\n        int64_t ltid_y_76278 = sext_i32_i64(sext_i64_i32(ltid_pre_79210));\n        int64_t ltid_x_76276 = sext_i32_i64(sext_i64_i32(ltid_pre_79211));\n        int32_t ltid_flat_76277 = local_tid_79206;\n        int64_t j_76282 = ltid_x_76276 + binop_x_76281;\n        int64_t gtid_76284 = binop_x_76003 + ltid_y_76278;\n        bool binop_x_76292 = slt64(j_76282, q_65346);\n        bool binop_y_76293 = slt64(gtid_76284, m_65343);\n        bool cond_76294 = binop_x_76292 && binop_y_76293;\n        float pre2d_76295;\n        \n        if (cond_76294) {\n            float x_76296;\n            \n            x_76296 = ((__global float *) mem_77640)[gtid_76284 * q_65346 +\n                                                     j_76282];\n            pre2d_76295 = x_76296;\n        } else {\n            pre2d_76295 = 0.0F;\n        }\n        ((__local float *) color_78189)[ltid_y_76278 * tile_sizze_75978 +\n                                        ltid_x_76276] = pre2d_76295;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t ltid_y_76305 = sext_i32_i64(sext_i64_i32(ltid_pre_79210));\n        int64_t ltid_x_76303 = sext_i32_i64(sext_i64_i32(ltid_pre_79211));\n        int32_t ltid_flat_76304 = local_tid_79206;\n        int64_t gtid_76307 = binop_x_76003 + ltid_y_76305;\n        int64_t gtid_76309 = binop_x_76005 + ltid_x_76303;\n        float acc_76315;\n        \n        acc_76315 = mem_param_77671[(int64_t) 0];\n        \n        float acc_76316;\n        \n        acc_76316 = mem_param_77672[(int64_t) 0];\n        \n        float acc_76317;\n        \n        acc_76317 = mem_param_77673[(int64_t) 0];\n        \n        float acc_76318;\n        \n        acc_76318 = mem_param_77674[(int64_t) 0];\n        \n        float acc_76319;\n        \n        acc_76319 = mem_param_77675[(int64_t) 0];\n        \n        bool binop_x_76323 = slt64(gtid_76307, m_65343);\n        bool binop_y_76324 = slt64(gtid_76309, n_m_65352);\n        bool cond_76325 = binop_x_76323 && binop_y_76324;\n     ",
                   "   float acc_76326;\n        float acc_76327;\n        float acc_76328;\n        float acc_76329;\n        float acc_76330;\n        \n        if (cond_76325) {\n            int64_t last_res_76310;\n            \n            last_res_76310 = color_78193[(int64_t) 0];\n            \n            int64_t min_res_76311;\n            \n            min_res_76311 = color_78192[(int64_t) 0];\n            \n            int64_t max_res_76312;\n            \n            max_res_76312 = color_78191[(int64_t) 0];\n            \n            float defunc_1_f_res_76313;\n            \n            defunc_1_f_res_76313 = color_78190[(int64_t) 0];\n            \n            float x_76331;\n            float x_76332;\n            float x_76333;\n            float x_76334;\n            float x_76335;\n            float redout_76907;\n            float redout_76908;\n            float redout_76909;\n            float redout_76910;\n            float redout_76911;\n            \n            redout_76907 = acc_76315;\n            redout_76908 = acc_76316;\n            redout_76909 = acc_76317;\n            redout_76910 = acc_76318;\n            redout_76911 = acc_76319;\n            for (int64_t i_76912 = 0; i_76912 < tile_sizze_75978; i_76912++) {\n                int64_t index_primexp_76975 = add64(binop_x_76281, i_76912);\n                float x_76352;\n                \n                x_76352 = ((__local float *) color_78189)[ltid_y_76305 *\n                                                          tile_sizze_75978 +\n                                                          i_76912];\n                \n                bool cond_76353 = sle64(last_res_76310, index_primexp_76975);\n                int64_t defunc_0_f_res_76354;\n                \n                if (cond_76353) {\n                    defunc_0_f_res_76354 = (int64_t) 0;\n                } else {\n                    int64_t i_76355 = add64(max_res_76312, index_primexp_76975);\n                    int64_t defunc_0_add_arg_76356;\n                    \n                    defu",
                   "nc_0_add_arg_76356 = ((__global\n                                               int64_t *) mem_77616)[gtid_76307 *\n                                                                     n_65344 +\n                                                                     i_76355];\n                    \n                    int64_t defunc_1_add_res_76357 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_76356);\n                    \n                    defunc_0_f_res_76354 = defunc_1_add_res_76357;\n                }\n                \n                int64_t binop_p_76358 = sub64(defunc_0_f_res_76354,\n                                              min_res_76311);\n                float defunc_0_f_res_76359 = sitofp_i64_f32(binop_p_76358);\n                float abs_res_76360 = (float) fabs(defunc_0_f_res_76359);\n                float tmp1_76361 = abs_res_76360 / defunc_1_f_res_76313;\n                float x_76362 = tmp1_76361 * tmp1_76361;\n                float y_76363 = tmp1_76361 * x_76362;\n                float tmp2_76364 = 1.0F - y_76363;\n                float x_76365 = tmp2_76364 * tmp2_76364;\n                float tmp3_76366 = tmp2_76364 * x_76365;\n                float w_j_76367 = x_76352 * tmp3_76366;\n                float xw_j_76368 = defunc_0_f_res_76359 * w_j_76367;\n                float x2w_j_76369 = defunc_0_f_res_76359 * xw_j_76368;\n                float x3w_j_76370 = defunc_0_f_res_76359 * x2w_j_76369;\n                float x4w_j_76371 = defunc_0_f_res_76359 * x3w_j_76370;\n                float defunc_1_op_res_76346 = w_j_76367 + redout_76907;\n                float defunc_1_op_res_76347 = xw_j_76368 + redout_76908;\n                float defunc_1_op_res_76348 = x2w_j_76369 + redout_76909;\n                float defunc_1_op_res_76349 = x3w_j_76370 + redout_76910;\n                float defunc_1_op_res_76350 = x4w_j_76371 + redout_76911;\n                float redout_tmp_79247 = defunc_1_op_res_76346;\n                float redout",
                   "_tmp_79248 = defunc_1_op_res_76347;\n                float redout_tmp_79249 = defunc_1_op_res_76348;\n                float redout_tmp_79250 = defunc_1_op_res_76349;\n                float redout_tmp_79251 = defunc_1_op_res_76350;\n                \n                redout_76907 = redout_tmp_79247;\n                redout_76908 = redout_tmp_79248;\n                redout_76909 = redout_tmp_79249;\n                redout_76910 = redout_tmp_79250;\n                redout_76911 = redout_tmp_79251;\n            }\n            x_76331 = redout_76907;\n            x_76332 = redout_76908;\n            x_76333 = redout_76909;\n            x_76334 = redout_76910;\n            x_76335 = redout_76911;\n            acc_76326 = x_76331;\n            acc_76327 = x_76332;\n            acc_76328 = x_76333;\n            acc_76329 = x_76334;\n            acc_76330 = x_76335;\n        } else {\n            acc_76326 = acc_76315;\n            acc_76327 = acc_76316;\n            acc_76328 = acc_76317;\n            acc_76329 = acc_76318;\n            acc_76330 = acc_76319;\n        }\n        mem_param_out_78103[(int64_t) 0] = acc_76326;\n        mem_param_out_78108[(int64_t) 0] = acc_76327;\n        mem_param_out_78113[(int64_t) 0] = acc_76328;\n        mem_param_out_78118[(int64_t) 0] = acc_76329;\n        mem_param_out_78123[(int64_t) 0] = acc_76330;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        float mem_param_tmp_79232[1];\n        \n        for (int32_t i_11 = 0; i_11 < 1; i_11++)\n            mem_param_tmp_79232[i_11] = mem_param_out_78103[i_11];\n        \n        float mem_param_out_tmp_79233[1];\n        \n        for (int32_t i_12 = 0; i_12 < 1; i_12++)\n            mem_param_out_tmp_79233[i_12] = mem_param_77671[i_12];\n        \n        float mem_param_tmp_79234[1];\n        \n        for (int32_t i_13 = 0; i_13 < 1; i_13++)\n            mem_param_tmp_79234[i_13] = mem_param_out_78108[i_13];\n        \n        float mem_param_out_tmp_79235[1];\n        \n        for (int32_t i_14 = 0; i_14 < 1; i_14++)\n            ",
                   "mem_param_out_tmp_79235[i_14] = mem_param_77672[i_14];\n        \n        float mem_param_tmp_79236[1];\n        \n        for (int32_t i_15 = 0; i_15 < 1; i_15++)\n            mem_param_tmp_79236[i_15] = mem_param_out_78113[i_15];\n        \n        float mem_param_out_tmp_79237[1];\n        \n        for (int32_t i_16 = 0; i_16 < 1; i_16++)\n            mem_param_out_tmp_79237[i_16] = mem_param_77673[i_16];\n        \n        float mem_param_tmp_79238[1];\n        \n        for (int32_t i_17 = 0; i_17 < 1; i_17++)\n            mem_param_tmp_79238[i_17] = mem_param_out_78118[i_17];\n        \n        float mem_param_out_tmp_79239[1];\n        \n        for (int32_t i_18 = 0; i_18 < 1; i_18++)\n            mem_param_out_tmp_79239[i_18] = mem_param_77674[i_18];\n        \n        float mem_param_tmp_79240[1];\n        \n        for (int32_t i_19 = 0; i_19 < 1; i_19++)\n            mem_param_tmp_79240[i_19] = mem_param_out_78123[i_19];\n        \n        float mem_param_out_tmp_79241[1];\n        \n        for (int32_t i_20 = 0; i_20 < 1; i_20++)\n            mem_param_out_tmp_79241[i_20] = mem_param_77675[i_20];\n        for (int32_t i_21 = 0; i_21 < 1; i_21++)\n            mem_param_77671[i_21] = mem_param_tmp_79232[i_21];\n        for (int32_t i_22 = 0; i_22 < 1; i_22++)\n            mem_param_out_78103[i_22] = mem_param_out_tmp_79233[i_22];\n        for (int32_t i_23 = 0; i_23 < 1; i_23++)\n            mem_param_77672[i_23] = mem_param_tmp_79234[i_23];\n        for (int32_t i_24 = 0; i_24 < 1; i_24++)\n            mem_param_out_78108[i_24] = mem_param_out_tmp_79235[i_24];\n        for (int32_t i_25 = 0; i_25 < 1; i_25++)\n            mem_param_77673[i_25] = mem_param_tmp_79236[i_25];\n        for (int32_t i_26 = 0; i_26 < 1; i_26++)\n            mem_param_out_78113[i_26] = mem_param_out_tmp_79237[i_26];\n        for (int32_t i_27 = 0; i_27 < 1; i_27++)\n            mem_param_77674[i_27] = mem_param_tmp_79238[i_27];\n        for (int32_t i_28 = 0; i_28 < 1; i_28++)\n            mem_param_out_78118[i_28] = mem_",
                   "param_out_tmp_79239[i_28];\n        for (int32_t i_29 = 0; i_29 < 1; i_29++)\n            mem_param_77675[i_29] = mem_param_tmp_79240[i_29];\n        for (int32_t i_30 = 0; i_30 < 1; i_30++)\n            mem_param_out_78123[i_30] = mem_param_out_tmp_79241[i_30];\n    }\n    for (int32_t i_31 = 0; i_31 < 1; i_31++)\n        ext_mem_77701[i_31] = mem_param_77671[i_31];\n    for (int32_t i_32 = 0; i_32 < 1; i_32++)\n        ext_mem_unused_78102[i_32] = mem_param_out_78103[i_32];\n    for (int32_t i_33 = 0; i_33 < 1; i_33++)\n        ext_mem_77700[i_33] = mem_param_77672[i_33];\n    for (int32_t i_34 = 0; i_34 < 1; i_34++)\n        ext_mem_unused_78107[i_34] = mem_param_out_78108[i_34];\n    for (int32_t i_35 = 0; i_35 < 1; i_35++)\n        ext_mem_77699[i_35] = mem_param_77673[i_35];\n    for (int32_t i_36 = 0; i_36 < 1; i_36++)\n        ext_mem_unused_78112[i_36] = mem_param_out_78113[i_36];\n    for (int32_t i_37 = 0; i_37 < 1; i_37++)\n        ext_mem_77698[i_37] = mem_param_77674[i_37];\n    for (int32_t i_38 = 0; i_38 < 1; i_38++)\n        ext_mem_unused_78117[i_38] = mem_param_out_78118[i_38];\n    for (int32_t i_39 = 0; i_39 < 1; i_39++)\n        ext_mem_77697[i_39] = mem_param_77675[i_39];\n    for (int32_t i_40 = 0; i_40 < 1; i_40++)\n        ext_mem_unused_78122[i_40] = mem_param_out_78123[i_40];\n    if (cond_76414) {\n        float tmp_79252;\n        \n        tmp_79252 = ext_mem_77701[(int64_t) 0];\n        color_78179[(int64_t) 0] = tmp_79252;\n        \n        float tmp_79253;\n        \n        tmp_79253 = ext_mem_77700[(int64_t) 0];\n        color_78180[(int64_t) 0] = tmp_79253;\n        \n        float tmp_79254;\n        \n        tmp_79254 = ext_mem_77699[(int64_t) 0];\n        color_78181[(int64_t) 0] = tmp_79254;\n        \n        float tmp_79255;\n        \n        tmp_79255 = ext_mem_77698[(int64_t) 0];\n        color_78182[(int64_t) 0] = tmp_79255;\n        \n        float tmp_79256;\n        \n        tmp_79256 = ext_mem_77697[(int64_t) 0];\n        color_78183[(int64_t) 0] = tmp_79256;\n  ",
                   "  } else {\n        int64_t binop_x_76560 = tile_sizze_75978 * num_whole_tiles_76113;\n        int64_t ltid_y_76557 = sext_i32_i64(sext_i64_i32(ltid_pre_79210));\n        int64_t ltid_x_76555 = sext_i32_i64(sext_i64_i32(ltid_pre_79211));\n        int32_t ltid_flat_76556 = local_tid_79206;\n        int64_t j_76561 = ltid_x_76555 + binop_x_76560;\n        int64_t gtid_76563 = binop_x_76003 + ltid_y_76557;\n        bool binop_x_76571 = slt64(j_76561, q_65346);\n        bool binop_y_76572 = slt64(gtid_76563, m_65343);\n        bool cond_76573 = binop_x_76571 && binop_y_76572;\n        float pre2d_76574;\n        \n        if (cond_76573) {\n            float x_76575;\n            \n            x_76575 = ((__global float *) mem_77640)[gtid_76563 * q_65346 +\n                                                     j_76561];\n            pre2d_76574 = x_76575;\n        } else {\n            pre2d_76574 = 0.0F;\n        }\n        ((__local float *) color_78189)[ltid_y_76557 * tile_sizze_75978 +\n                                        ltid_x_76555] = pre2d_76574;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t ltid_y_76585 = sext_i32_i64(sext_i64_i32(ltid_pre_79210));\n        int64_t ltid_x_76583 = sext_i32_i64(sext_i64_i32(ltid_pre_79211));\n        int32_t ltid_flat_76584 = local_tid_79206;\n        int64_t gtid_76587 = binop_x_76003 + ltid_y_76585;\n        int64_t gtid_76589 = binop_x_76005 + ltid_x_76583;\n        float acc_76595;\n        \n        acc_76595 = ext_mem_77701[(int64_t) 0];\n        \n        float acc_76596;\n        \n        acc_76596 = ext_mem_77700[(int64_t) 0];\n        \n        float acc_76597;\n        \n        acc_76597 = ext_mem_77699[(int64_t) 0];\n        \n        float acc_76598;\n        \n        acc_76598 = ext_mem_77698[(int64_t) 0];\n        \n        float acc_76599;\n        \n        acc_76599 = ext_mem_77697[(int64_t) 0];\n        \n        bool binop_x_76603 = slt64(gtid_76587, m_65343);\n        bool binop_y_76604 = slt64(gtid_76589, n_m_65352);\n        bool co",
                   "nd_76605 = binop_x_76603 && binop_y_76604;\n        float acc_76606;\n        float acc_76607;\n        float acc_76608;\n        float acc_76609;\n        float acc_76610;\n        \n        if (cond_76605) {\n            int64_t last_res_76590;\n            \n            last_res_76590 = color_78193[(int64_t) 0];\n            \n            int64_t min_res_76591;\n            \n            min_res_76591 = color_78192[(int64_t) 0];\n            \n            int64_t max_res_76592;\n            \n            max_res_76592 = color_78191[(int64_t) 0];\n            \n            float defunc_1_f_res_76593;\n            \n            defunc_1_f_res_76593 = color_78190[(int64_t) 0];\n            \n            float x_76611;\n            float x_76612;\n            float x_76613;\n            float x_76614;\n            float x_76615;\n            float redout_76913;\n            float redout_76914;\n            float redout_76915;\n            float redout_76916;\n            float redout_76917;\n            \n            redout_76913 = acc_76595;\n            redout_76914 = acc_76596;\n            redout_76915 = acc_76597;\n            redout_76916 = acc_76598;\n            redout_76917 = acc_76599;\n            for (int64_t i_76918 = 0; i_76918 < residual_input_76413;\n                 i_76918++) {\n                int64_t index_primexp_76973 = add64(binop_x_76560, i_76918);\n                float x_76632;\n                \n                x_76632 = ((__local float *) color_78189)[ltid_y_76585 *\n                                                          tile_sizze_75978 +\n                                                          i_76918];\n                \n                bool cond_76633 = sle64(last_res_76590, index_primexp_76973);\n                int64_t defunc_0_f_res_76634;\n                \n                if (cond_76633) {\n                    defunc_0_f_res_76634 = (int64_t) 0;\n                } else {\n                    int64_t i_76635 = add64(max_res_76592, index_primexp_76973);\n                    int64_t ",
                   "defunc_0_add_arg_76636;\n                    \n                    defunc_0_add_arg_76636 = ((__global\n                                               int64_t *) mem_77616)[gtid_76587 *\n                                                                     n_65344 +\n                                                                     i_76635];\n                    \n                    int64_t defunc_1_add_res_76637 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_76636);\n                    \n                    defunc_0_f_res_76634 = defunc_1_add_res_76637;\n                }\n                \n                int64_t binop_p_76638 = sub64(defunc_0_f_res_76634,\n                                              min_res_76591);\n                float defunc_0_f_res_76639 = sitofp_i64_f32(binop_p_76638);\n                float abs_res_76640 = (float) fabs(defunc_0_f_res_76639);\n                float tmp1_76641 = abs_res_76640 / defunc_1_f_res_76593;\n                float x_76642 = tmp1_76641 * tmp1_76641;\n                float y_76643 = tmp1_76641 * x_76642;\n                float tmp2_76644 = 1.0F - y_76643;\n                float x_76645 = tmp2_76644 * tmp2_76644;\n                float tmp3_76646 = tmp2_76644 * x_76645;\n                float w_j_76647 = x_76632 * tmp3_76646;\n                float xw_j_76648 = defunc_0_f_res_76639 * w_j_76647;\n                float x2w_j_76649 = defunc_0_f_res_76639 * xw_j_76648;\n                float x3w_j_76650 = defunc_0_f_res_76639 * x2w_j_76649;\n                float x4w_j_76651 = defunc_0_f_res_76639 * x3w_j_76650;\n                float defunc_1_op_res_76626 = w_j_76647 + redout_76913;\n                float defunc_1_op_res_76627 = xw_j_76648 + redout_76914;\n                float defunc_1_op_res_76628 = x2w_j_76649 + redout_76915;\n                float defunc_1_op_res_76629 = x3w_j_76650 + redout_76916;\n                float defunc_1_op_res_76630 = x4w_j_76651 + redout_76917;\n                float r",
                   "edout_tmp_79257 = defunc_1_op_res_76626;\n                float redout_tmp_79258 = defunc_1_op_res_76627;\n                float redout_tmp_79259 = defunc_1_op_res_76628;\n                float redout_tmp_79260 = defunc_1_op_res_76629;\n                float redout_tmp_79261 = defunc_1_op_res_76630;\n                \n                redout_76913 = redout_tmp_79257;\n                redout_76914 = redout_tmp_79258;\n                redout_76915 = redout_tmp_79259;\n                redout_76916 = redout_tmp_79260;\n                redout_76917 = redout_tmp_79261;\n            }\n            x_76611 = redout_76913;\n            x_76612 = redout_76914;\n            x_76613 = redout_76915;\n            x_76614 = redout_76916;\n            x_76615 = redout_76917;\n            acc_76606 = x_76611;\n            acc_76607 = x_76612;\n            acc_76608 = x_76613;\n            acc_76609 = x_76614;\n            acc_76610 = x_76615;\n        } else {\n            acc_76606 = acc_76595;\n            acc_76607 = acc_76596;\n            acc_76608 = acc_76597;\n            acc_76609 = acc_76598;\n            acc_76610 = acc_76599;\n        }\n        color_78188[(int64_t) 0] = acc_76606;\n        color_78187[(int64_t) 0] = acc_76607;\n        color_78186[(int64_t) 0] = acc_76608;\n        color_78185[(int64_t) 0] = acc_76609;\n        color_78184[(int64_t) 0] = acc_76610;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        float tmp_79262;\n        \n        tmp_79262 = color_78188[(int64_t) 0];\n        color_78179[(int64_t) 0] = tmp_79262;\n        \n        float tmp_79263;\n        \n        tmp_79263 = color_78187[(int64_t) 0];\n        color_78180[(int64_t) 0] = tmp_79263;\n        \n        float tmp_79264;\n        \n        tmp_79264 = color_78186[(int64_t) 0];\n        color_78181[(int64_t) 0] = tmp_79264;\n        \n        float tmp_79265;\n        \n        tmp_79265 = color_78185[(int64_t) 0];\n        color_78182[(int64_t) 0] = tmp_79265;\n        \n        float tmp_79266;\n        \n        tmp_79266 = color_781",
                   "84[(int64_t) 0];\n        color_78183[(int64_t) 0] = tmp_79266;\n    }\n    \n    int64_t ltid_y_76671 = sext_i32_i64(sext_i64_i32(ltid_pre_79210));\n    int64_t ltid_x_76669 = sext_i32_i64(sext_i64_i32(ltid_pre_79211));\n    int32_t ltid_flat_76670 = local_tid_79206;\n    \n    if (slt64(ltid_y_76671, tile_sizze_75978) && slt64(ltid_x_76669,\n                                                       tile_sizze_75978)) {\n        int64_t gtid_76673 = binop_x_76003 + ltid_y_76671;\n        int64_t gtid_76675 = binop_x_76005 + ltid_x_76669;\n        bool binop_x_76681 = slt64(gtid_76673, m_65343);\n        bool binop_y_76682 = slt64(gtid_76675, n_m_65352);\n        bool cond_76683 = binop_x_76681 && binop_y_76682;\n        float postlude_76684;\n        float postlude_76685;\n        \n        if (cond_76683) {\n            float defunc_2_reduce_res_76676;\n            \n            defunc_2_reduce_res_76676 = color_78179[(int64_t) 0];\n            \n            float defunc_2_reduce_res_76677;\n            \n            defunc_2_reduce_res_76677 = color_78180[(int64_t) 0];\n            \n            float defunc_2_reduce_res_76678;\n            \n            defunc_2_reduce_res_76678 = color_78181[(int64_t) 0];\n            \n            float defunc_2_reduce_res_76679;\n            \n            defunc_2_reduce_res_76679 = color_78182[(int64_t) 0];\n            \n            float defunc_2_reduce_res_76680;\n            \n            defunc_2_reduce_res_76680 = color_78183[(int64_t) 0];\n            \n            int64_t last_res_76686;\n            \n            last_res_76686 = color_78193[(int64_t) 0];\n            \n            int64_t min_res_76687;\n            \n            min_res_76687 = color_78192[(int64_t) 0];\n            \n            int64_t max_res_76688;\n            \n            max_res_76688 = color_78191[(int64_t) 0];\n            \n            float defunc_1_f_res_76689;\n            \n            defunc_1_f_res_76689 = color_78190[(int64_t) 0];\n            \n            float x_76691 = defunc_2_redu",
                   "ce_res_76678 *\n                  defunc_2_reduce_res_76680;\n            float y_76692 = defunc_2_reduce_res_76679 *\n                  defunc_2_reduce_res_76679;\n            float a12_76693 = x_76691 - y_76692;\n            float x_76694 = defunc_2_reduce_res_76678 *\n                  defunc_2_reduce_res_76679;\n            float y_76695 = defunc_2_reduce_res_76677 *\n                  defunc_2_reduce_res_76680;\n            float b12_76696 = x_76694 - y_76695;\n            float x_76697 = defunc_2_reduce_res_76677 *\n                  defunc_2_reduce_res_76679;\n            float y_76698 = defunc_2_reduce_res_76678 *\n                  defunc_2_reduce_res_76678;\n            float c12_76699 = x_76697 - y_76698;\n            float x_76700 = defunc_2_reduce_res_76676 *\n                  defunc_2_reduce_res_76680;\n            float b2_76701 = x_76700 - y_76698;\n            float x_76702 = defunc_2_reduce_res_76677 *\n                  defunc_2_reduce_res_76678;\n            float y_76703 = defunc_2_reduce_res_76676 *\n                  defunc_2_reduce_res_76679;\n            float c2_76704 = x_76702 - y_76703;\n            float x_76705 = defunc_2_reduce_res_76676 * a12_76693;\n            float y_76706 = defunc_2_reduce_res_76677 * b12_76696;\n            float x_76707 = x_76705 + y_76706;\n            float y_76708 = defunc_2_reduce_res_76678 * c12_76699;\n            float y_76709 = x_76707 + y_76708;\n            float det_76710 = 1.0F / y_76709;\n            float a12_76711 = a12_76693 * det_76710;\n            float b12_76712 = b12_76696 * det_76710;\n            float c12_76713 = c12_76699 * det_76710;\n            float b2_76714 = b2_76701 * det_76710;\n            float c2_76715 = c2_76704 * det_76710;\n            float defunc_2_reduce_res_76716;\n            float defunc_2_reduce_res_76717;\n            float redout_76919;\n            float redout_76920;\n            \n            redout_76919 = 0.0F;\n            redout_76920 = 0.0F;\n            for (int64_t i_76921 = 0; i_76921 < q_6534",
                   "6; i_76921++) {\n                float x_76725;\n                \n                x_76725 = ((__global float *) mem_77640)[gtid_76673 * q_65346 +\n                                                         i_76921];\n                \n                bool cond_76726 = sle64(last_res_76686, i_76921);\n                int64_t defunc_0_f_res_76727;\n                \n                if (cond_76726) {\n                    defunc_0_f_res_76727 = (int64_t) 0;\n                } else {\n                    int64_t i_76728 = add64(max_res_76688, i_76921);\n                    int64_t defunc_0_add_arg_76729;\n                    \n                    defunc_0_add_arg_76729 = ((__global\n                                               int64_t *) mem_77616)[gtid_76673 *\n                                                                     n_65344 +\n                                                                     i_76728];\n                    \n                    int64_t defunc_1_add_res_76730 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_76729);\n                    \n                    defunc_0_f_res_76727 = defunc_1_add_res_76730;\n                }\n                \n                int64_t binop_p_76731 = sub64(defunc_0_f_res_76727,\n                                              min_res_76687);\n                float defunc_0_f_res_76732 = sitofp_i64_f32(binop_p_76731);\n                float abs_res_76733 = (float) fabs(defunc_0_f_res_76732);\n                float tmp1_76734 = abs_res_76733 / defunc_1_f_res_76689;\n                float x_76735 = tmp1_76734 * tmp1_76734;\n                float y_76736 = tmp1_76734 * x_76735;\n                float tmp2_76737 = 1.0F - y_76736;\n                float x_76738 = tmp2_76737 * tmp2_76737;\n                float tmp3_76739 = tmp2_76737 * x_76738;\n                float tmp4_76740 = x_76725 * tmp3_76739;\n                float defunc_1_f_res_76741 = defunc_0_f_res_76732 * tmp4_76740;\n                float de",
                   "func_1_f_res_76742 = defunc_0_f_res_76732 *\n                      defunc_1_f_res_76741;\n                float defunc_0_f_res_76743;\n                \n                if (cond_76726) {\n                    defunc_0_f_res_76743 = 0.0F;\n                } else {\n                    int64_t i_76744 = add64(max_res_76688, i_76921);\n                    float defunc_0_add_arg_76745;\n                    \n                    defunc_0_add_arg_76745 = ((__global\n                                               float *) mem_77612)[gtid_76673 *\n                                                                   n_65344 +\n                                                                   i_76744];\n                    defunc_0_f_res_76743 = defunc_0_add_arg_76745;\n                }\n                \n                float x_76746 = a12_76711 * tmp4_76740;\n                float y_76747 = b12_76712 * defunc_1_f_res_76741;\n                float x_76748 = x_76746 + y_76747;\n                float y_76749 = c12_76713 * defunc_1_f_res_76742;\n                float x_76750 = x_76748 + y_76749;\n                float defunc_9_fit_fun_res_76751 = defunc_0_f_res_76743 *\n                      x_76750;\n                float x_76752 = b12_76712 * tmp4_76740;\n                float y_76753 = b2_76714 * defunc_1_f_res_76741;\n                float x_76754 = x_76752 + y_76753;\n                float y_76755 = c2_76715 * defunc_1_f_res_76742;\n                float x_76756 = x_76754 + y_76755;\n                float defunc_9_slope_fun_res_76757 = defunc_0_f_res_76743 *\n                      x_76756;\n                float defunc_1_op_res_76720 = defunc_9_fit_fun_res_76751 +\n                      redout_76919;\n                float defunc_1_op_res_76723 = defunc_9_slope_fun_res_76757 +\n                      redout_76920;\n                float redout_tmp_79267 = defunc_1_op_res_76720;\n                float redout_tmp_79268 = defunc_1_op_res_76723;\n                \n                redout_76919 = redout_tmp_79267;\n   ",
                   "             redout_76920 = redout_tmp_79268;\n            }\n            defunc_2_reduce_res_76716 = redout_76919;\n            defunc_2_reduce_res_76717 = redout_76920;\n            postlude_76684 = defunc_2_reduce_res_76716;\n            postlude_76685 = defunc_2_reduce_res_76717;\n        } else {\n            postlude_76684 = 0.0F;\n            postlude_76685 = 0.0F;\n        }\n        color_78185[(int64_t) 0] = postlude_76684;\n        color_78184[(int64_t) 0] = postlude_76685;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t thread_out_index_79269 = gid_x_75975 * tile_sizze_75978 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_79210));\n    int64_t thread_out_index_79270 = gid_y_75976 * tile_sizze_75978 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_79211));\n    \n    if (slt64(thread_out_index_79269, m_65343) && slt64(thread_out_index_79270,\n                                                        n_m_65352)) {\n        float tmp_79271;\n        \n        tmp_79271 = color_78185[(int64_t) 0];\n        ((__global float *) mem_77738)[thread_out_index_79269 * n_m_65352 +\n                                       thread_out_index_79270] = tmp_79271;\n    }\n    \n    int64_t thread_out_index_79272 = gid_x_75975 * tile_sizze_75978 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_79210));\n    int64_t thread_out_index_79273 = gid_y_75976 * tile_sizze_75978 +\n            sext_i32_i64(sext_i64_i32(ltid_pre_79211));\n    \n    if (slt64(thread_out_index_79272, m_65343) && slt64(thread_out_index_79273,\n                                                        n_m_65352)) {\n        float tmp_79274;\n        \n        tmp_79274 = color_78184[(int64_t) 0];\n        ((__global float *) mem_77742)[thread_out_index_79272 * n_m_65352 +\n                                       thread_out_index_79273] = tmp_79274;\n    }\n    \n  error_7:\n    return;\n    #undef tile_sizze_75978\n}\n__kernel void mainzisegred_large_68229(__global int *global_failure,\n                                       __local volatil",
                   "e\n                                       int64_t *sync_arr_mem_78531_backing_aligned_0,\n                                       __local volatile\n                                       int64_t *red_arr_mem_78529_backing_aligned_1,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_68223,\n                                       int64_t groups_per_segment_78515,\n                                       int64_t elements_per_thread_78516,\n                                       int64_t virt_num_groups_78517,\n                                       int64_t threads_per_segment_78519,\n                                       __global unsigned char *mem_77082,\n                                       __global unsigned char *mem_77090,\n                                       __global unsigned char *mem_77114,\n                                       __global unsigned char *mem_77170,\n                                       __global unsigned char *mem_77174,\n                                       __global unsigned char *mem_77179,\n                                       __global\n                                       unsigned char *segred_tmp_mem_78520,\n                                       __global\n                                       unsigned char *mainzicounter_mem_78522)\n{\n    #define segred_group_sizze_68222 (mainzisegred_group_sizze_67302)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_78531_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_78531_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_78529_backing_0 =\n                                  ",
                   " (__local volatile\n                                    unsigned char *) red_arr_mem_78529_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78524;\n    int32_t local_tid_78525;\n    int64_t group_sizze_78528;\n    int32_t wave_sizze_78527;\n    int32_t group_tid_78526;\n    \n    global_tid_78524 = get_global_id(0);\n    local_tid_78525 = get_local_id(0);\n    group_sizze_78528 = get_local_size(0);\n    wave_sizze_78527 = LOCKSTEP_WIDTH;\n    group_tid_78526 = get_group_id(0);\n    \n    int32_t phys_tid_68229 = global_tid_78524;\n    __local unsigned char *red_arr_mem_78529;\n    \n    red_arr_mem_78529 = (__local unsigned char *) red_arr_mem_78529_backing_0;\n    \n    __local unsigned char *sync_arr_mem_78531;\n    \n    sync_arr_mem_78531 = (__local unsigned char *) sync_arr_mem_78531_backing_1;\n    \n    int32_t phys_group_id_78533;\n    \n    phys_group_id_78533 = get_group_id(0);\n    for (int32_t i_78534 = 0; i_78534 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_78517) - phys_group_id_78533,\n                   sext_i64_i32(num_groups_68223)); i_78534++) {\n        int32_t virt_group_id_78535 = phys_group_id_78533 + i_78534 *\n                sext_i64_i32(num_groups_68223);\n        int32_t flat_segment_id_78536 = squot32(virt_group_id_78535,\n                                                sext_i64_i32(groups_per_segment_78515));\n        int64_t global_tid_78537 = srem64(sext_i32_i64(virt_group_id_78535) *\n                                          segred_group_sizze_68222 +\n                                          sext_i32_i64(local_tid_78525),\n                                          segred_group_sizze_68222 *\n                                          groups_per_segment_78515);\n        int64_t slice_78538 = n_m_65352;\n        int64_t slice_78539 = m_65343 * slice_78538;\n        int64_t gtid_68226 = squot64(sext_i32_i64(flat_segment_id_78536),\n                                     slice_78538);\n        int64_t remnant_78540 = sext_i",
                   "32_i64(flat_segment_id_78536) -\n                gtid_68226 * slice_78538;\n        int64_t gtid_68227 = remnant_78540;\n        int64_t remnant_78541 = remnant_78540 - gtid_68227;\n        int64_t gtid_68228;\n        float x_acc_78542;\n        int64_t chunk_sizze_78543 = smin64(elements_per_thread_78516,\n                                           sdiv_up64(q_65346 - global_tid_78537,\n                                                     threads_per_segment_78519));\n        float x_68230;\n        float x_68231;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_78542 = 0.0F;\n        }\n        for (int64_t i_78547 = 0; i_78547 < chunk_sizze_78543; i_78547++) {\n            gtid_68228 = global_tid_78537 + threads_per_segment_78519 * i_78547;\n            // apply map function\n            {\n                int64_t last_res_68233;\n                \n                last_res_68233 = ((__global int64_t *) mem_77082)[gtid_68226 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74680 = mul64(jump_65348, gtid_68227);\n                int64_t index_primexp_74681 = smin64(i_65358, binop_y_74680);\n                float defunc_1_f_res_68241;\n                \n                defunc_1_f_res_68241 = ((__global\n                                         float *) mem_77174)[gtid_68226 *\n                                                             n_m_65352 +\n                                                             gtid_68227];\n                \n                float x_68243;\n                \n                x_68243 = ((__global float *) mem_77114)[gtid_68226 * q_65346 +\n                                                         gtid_68228];\n                \n                bool cond_68244 = sle64(last_res_68233, gtid_68228);\n                int64_t defunc_0_f_res_68245;\n                \n                if (cond_",
                   "68244) {\n                    defunc_0_f_res_68245 = (int64_t) 0;\n                } else {\n                    int64_t max_res_68240;\n                    \n                    max_res_68240 = ((__global\n                                      int64_t *) mem_77170)[gtid_68226 *\n                                                            n_m_65352 +\n                                                            gtid_68227];\n                    \n                    int64_t i_68246 = add64(gtid_68228, max_res_68240);\n                    int64_t defunc_0_add_arg_68247;\n                    \n                    defunc_0_add_arg_68247 = ((__global\n                                               int64_t *) mem_77090)[gtid_68226 *\n                                                                     n_65344 +\n                                                                     i_68246];\n                    \n                    int64_t defunc_1_add_res_68248 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_68247);\n                    \n                    defunc_0_f_res_68245 = defunc_1_add_res_68248;\n                }\n                \n                int64_t binop_p_68249 = sub64(defunc_0_f_res_68245,\n                                              index_primexp_74681);\n                float defunc_0_f_res_68250 = sitofp_i64_f32(binop_p_68249);\n                float abs_res_68251 = (float) fabs(defunc_0_f_res_68250);\n                float tmp1_68252 = abs_res_68251 / defunc_1_f_res_68241;\n                float x_68253 = tmp1_68252 * tmp1_68252;\n                float y_68254 = tmp1_68252 * x_68253;\n                float tmp2_68255 = 1.0F - y_68254;\n                float x_68256 = tmp2_68255 * tmp2_68255;\n                float tmp3_68257 = tmp2_68255 * x_68256;\n                float w_j_68258 = x_68243 * tmp3_68257;\n                \n                // save map-out results\n                { }\n                // load accumulator\n               ",
                   " {\n                    x_68230 = x_acc_78542;\n                }\n                // load new values\n                {\n                    x_68231 = w_j_68258;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_68232 = x_68230 + x_68231;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_78542 = defunc_1_op_res_68232;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_68230 = x_acc_78542;\n            ((__local\n              float *) red_arr_mem_78529)[sext_i32_i64(local_tid_78525)] =\n                x_68230;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_78548;\n        int32_t skip_waves_78549 = 1;\n        float x_78544;\n        float x_78545;\n        \n        offset_78548 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_78525,\n                      sext_i64_i32(segred_group_sizze_68222))) {\n                x_78544 = ((__local\n                            float *) red_arr_mem_78529)[sext_i32_i64(local_tid_78525 +\n                                                        offset_78548)];\n            }\n        }\n        offset_78548 = 1;\n        while (slt32(offset_78548, wave_sizze_78527)) {\n            if (slt32(local_tid_78525 + offset_78548,\n                      sext_i64_i32(segred_group_sizze_68222)) &&\n                ((local_tid_78525 - squot32(local_tid_78525, wave_sizze_78527) *\n                  wave_sizze_78527) & (2 * offset_78548 - 1)) == 0) {\n                // read array element\n                {\n                    x_78545 = ((volatile __local\n                                float *) red_arr_mem_78529)[sext_i32_i64(local_tid_78525 +\n                                                            offset_78548)];\n                }\n      ",
                   "          // apply reduction operation\n                {\n                    float defunc_1_op_res_78546 = x_78544 + x_78545;\n                    \n                    x_78544 = defunc_1_op_res_78546;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_78529)[sext_i32_i64(local_tid_78525)] =\n                        x_78544;\n                }\n            }\n            offset_78548 *= 2;\n        }\n        while (slt32(skip_waves_78549,\n                     squot32(sext_i64_i32(segred_group_sizze_68222) +\n                             wave_sizze_78527 - 1, wave_sizze_78527))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_78548 = skip_waves_78549 * wave_sizze_78527;\n            if (slt32(local_tid_78525 + offset_78548,\n                      sext_i64_i32(segred_group_sizze_68222)) &&\n                ((local_tid_78525 - squot32(local_tid_78525, wave_sizze_78527) *\n                  wave_sizze_78527) == 0 && (squot32(local_tid_78525,\n                                                     wave_sizze_78527) & (2 *\n                                                                          skip_waves_78549 -\n                                                                          1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_78545 = ((__local\n                                float *) red_arr_mem_78529)[sext_i32_i64(local_tid_78525 +\n                                                            offset_78548)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_78546 = x_78544 + x_78545;\n                    \n                    x_78544 = defunc_1_op_res_78546;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_78529)[sext_i32_i",
                   "64(local_tid_78525)] =\n                        x_78544;\n                }\n            }\n            skip_waves_78549 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_78525) == (int64_t) 0) {\n                x_acc_78542 = x_78544;\n            }\n        }\n        if (groups_per_segment_78515 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_78525 == 0) {\n                    ((__global float *) mem_77179)[gtid_68226 * n_m_65352 +\n                                                   gtid_68227] = x_acc_78542;\n                }\n            }\n        } else {\n            int32_t old_counter_78550;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_78525 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_78520)[sext_i32_i64(virt_group_id_78535)] =\n                        x_acc_78542;\n                    mem_fence_global();\n                    old_counter_78550 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_78522)[sext_i32_i64(srem32(flat_segment_id_78536,\n                                                                                                     10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_78531)[(int64_t) 0] =\n                        old_counter_78550 == groups_per_segment_78515 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_78551;\n            \n            is_last_group_78551 = ((__local\n                                    bool *) sync_arr_mem_78531)[(int64_t) 0];\n          ",
                   "  if (is_last_group_78551) {\n                if (local_tid_78525 == 0) {\n                    old_counter_78550 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_78522)[sext_i32_i64(srem32(flat_segment_id_78536,\n                                                                                                     10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_78515));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_78552 =\n                            sdiv_up64(groups_per_segment_78515,\n                                      segred_group_sizze_68222);\n                    \n                    x_68230 = 0.0F;\n                    for (int64_t i_78553 = 0; i_78553 < read_per_thread_78552;\n                         i_78553++) {\n                        int64_t group_res_id_78554 =\n                                sext_i32_i64(local_tid_78525) *\n                                read_per_thread_78552 + i_78553;\n                        int64_t index_of_group_res_78555 =\n                                sext_i32_i64(flat_segment_id_78536) *\n                                groups_per_segment_78515 + group_res_id_78554;\n                        \n                        if (slt64(group_res_id_78554,\n                                  groups_per_segment_78515)) {\n                            x_68231 = ((__global\n                                        float *) segred_tmp_mem_78520)[index_of_group_res_78555];\n                            \n                            float defunc_1_op_res_68232 = x_68230 + x_68231;\n                            \n                            x_68230 = defunc_1_op_res_68232;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red",
                   "_arr_mem_78529)[sext_i32_i64(local_tid_78525)] =\n                    x_68230;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_78556;\n                    int32_t skip_waves_78557 = 1;\n                    float x_78544;\n                    float x_78545;\n                    \n                    offset_78556 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_78525,\n                                  sext_i64_i32(segred_group_sizze_68222))) {\n                            x_78544 = ((__local\n                                        float *) red_arr_mem_78529)[sext_i32_i64(local_tid_78525 +\n                                                                    offset_78556)];\n                        }\n                    }\n                    offset_78556 = 1;\n                    while (slt32(offset_78556, wave_sizze_78527)) {\n                        if (slt32(local_tid_78525 + offset_78556,\n                                  sext_i64_i32(segred_group_sizze_68222)) &&\n                            ((local_tid_78525 - squot32(local_tid_78525,\n                                                        wave_sizze_78527) *\n                              wave_sizze_78527) & (2 * offset_78556 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_78545 = ((volatile __local\n                                            float *) red_arr_mem_78529)[sext_i32_i64(local_tid_78525 +\n                                                                        offset_78556)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_78546 = x_78544 + x_78545;\n                                \n                   ",
                   "             x_78544 = defunc_1_op_res_78546;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_78529)[sext_i32_i64(local_tid_78525)] =\n                                    x_78544;\n                            }\n                        }\n                        offset_78556 *= 2;\n                    }\n                    while (slt32(skip_waves_78557,\n                                 squot32(sext_i64_i32(segred_group_sizze_68222) +\n                                         wave_sizze_78527 - 1,\n                                         wave_sizze_78527))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_78556 = skip_waves_78557 * wave_sizze_78527;\n                        if (slt32(local_tid_78525 + offset_78556,\n                                  sext_i64_i32(segred_group_sizze_68222)) &&\n                            ((local_tid_78525 - squot32(local_tid_78525,\n                                                        wave_sizze_78527) *\n                              wave_sizze_78527) == 0 &&\n                             (squot32(local_tid_78525, wave_sizze_78527) & (2 *\n                                                                            skip_waves_78557 -\n                                                                            1)) ==\n                             0)) {\n                            // read array element\n                            {\n                                x_78545 = ((__local\n                                            float *) red_arr_mem_78529)[sext_i32_i64(local_tid_78525 +\n                                                                        offset_78556)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_7",
                   "8546 = x_78544 + x_78545;\n                                \n                                x_78544 = defunc_1_op_res_78546;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_78529)[sext_i32_i64(local_tid_78525)] =\n                                    x_78544;\n                            }\n                        }\n                        skip_waves_78557 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_78525 == 0) {\n                            ((__global float *) mem_77179)[gtid_68226 *\n                                                           n_m_65352 +\n                                                           gtid_68227] =\n                                x_78544;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_68222\n}\n__kernel void mainzisegred_large_68279(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *sync_arr_mem_78613_backing_aligned_0,\n                                       __local volatile\n                                       int64_t *red_arr_mem_78611_backing_aligned_1,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_68273,\n                                       int64_t groups_per_segment_78597,\n                                       int64_t elements_per_thread_78598,\n                                       int64_t",
                   " virt_num_groups_78599,\n                                       int64_t threads_per_segment_78601,\n                                       __global unsigned char *mem_77082,\n                                       __global unsigned char *mem_77086,\n                                       __global unsigned char *mem_77090,\n                                       __global unsigned char *mem_77114,\n                                       __global unsigned char *mem_77170,\n                                       __global unsigned char *mem_77174,\n                                       __global unsigned char *mem_77184,\n                                       __global unsigned char *mem_77189,\n                                       __global\n                                       unsigned char *segred_tmp_mem_78602,\n                                       __global\n                                       unsigned char *mainzicounter_mem_78604)\n{\n    #define segred_group_sizze_68272 (mainzisegred_group_sizze_67234)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_78613_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_78613_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_78611_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_78611_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78606;\n    int32_t local_tid_78607;\n    int64_t group_sizze_78610;\n    int32_t wave_sizze_78609;\n    int32_t group_tid_78608;\n    \n    global_tid_78606 = get_global_id(0);\n    local_tid_78607 = get_local_id(0);\n    group_sizze_78610 = get_local_size(0);\n    wave_sizze_78609 = LOCKSTEP_WIDTH;\n    group_tid_78608 = get_group_id(0);\n    \n    int32_t phys_tid_68279 = global_ti",
                   "d_78606;\n    __local unsigned char *red_arr_mem_78611;\n    \n    red_arr_mem_78611 = (__local unsigned char *) red_arr_mem_78611_backing_0;\n    \n    __local unsigned char *sync_arr_mem_78613;\n    \n    sync_arr_mem_78613 = (__local unsigned char *) sync_arr_mem_78613_backing_1;\n    \n    int32_t phys_group_id_78615;\n    \n    phys_group_id_78615 = get_group_id(0);\n    for (int32_t i_78616 = 0; i_78616 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_78599) - phys_group_id_78615,\n                   sext_i64_i32(num_groups_68273)); i_78616++) {\n        int32_t virt_group_id_78617 = phys_group_id_78615 + i_78616 *\n                sext_i64_i32(num_groups_68273);\n        int32_t flat_segment_id_78618 = squot32(virt_group_id_78617,\n                                                sext_i64_i32(groups_per_segment_78597));\n        int64_t global_tid_78619 = srem64(sext_i32_i64(virt_group_id_78617) *\n                                          segred_group_sizze_68272 +\n                                          sext_i32_i64(local_tid_78607),\n                                          segred_group_sizze_68272 *\n                                          groups_per_segment_78597);\n        int64_t slice_78620 = n_m_65352;\n        int64_t slice_78621 = m_65343 * slice_78620;\n        int64_t gtid_68276 = squot64(sext_i32_i64(flat_segment_id_78618),\n                                     slice_78620);\n        int64_t remnant_78622 = sext_i32_i64(flat_segment_id_78618) -\n                gtid_68276 * slice_78620;\n        int64_t gtid_68277 = remnant_78622;\n        int64_t remnant_78623 = remnant_78622 - gtid_68277;\n        int64_t gtid_68278;\n        float x_acc_78624;\n        int64_t chunk_sizze_78625 = smin64(elements_per_thread_78598,\n                                           sdiv_up64(q_65346 - global_tid_78619,\n                                                     threads_per_segment_78601));\n        float x_68280;\n        float x_68281;\n        \n        // neutral-initialise the accumula",
                   "tors\n        {\n            x_acc_78624 = 0.0F;\n        }\n        for (int64_t i_78629 = 0; i_78629 < chunk_sizze_78625; i_78629++) {\n            gtid_68278 = global_tid_78619 + threads_per_segment_78601 * i_78629;\n            // apply map function\n            {\n                int64_t last_res_68283;\n                \n                last_res_68283 = ((__global int64_t *) mem_77082)[gtid_68276 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74676 = mul64(jump_65348, gtid_68277);\n                int64_t index_primexp_74677 = smin64(i_65358, binop_y_74676);\n                int64_t max_res_68292;\n                \n                max_res_68292 = ((__global int64_t *) mem_77170)[gtid_68276 *\n                                                                 n_m_65352 +\n                                                                 gtid_68277];\n                \n                float defunc_1_f_res_68293;\n                \n                defunc_1_f_res_68293 = ((__global\n                                         float *) mem_77174)[gtid_68276 *\n                                                             n_m_65352 +\n                                                             gtid_68277];\n                \n                float a0_68294;\n                \n                a0_68294 = ((__global float *) mem_77184)[gtid_68276 *\n                                                          n_m_65352 +\n                                                          gtid_68277];\n                \n                float x_68296;\n                \n                x_68296 = ((__global float *) mem_77114)[gtid_68276 * q_65346 +\n                                                         gtid_68278];\n                \n                bool cond_68297 = sle64(last_res_68283, gtid_68278);\n                int64_t defunc_0_f_res_68298;\n                \n    ",
                   "            if (cond_68297) {\n                    defunc_0_f_res_68298 = (int64_t) 0;\n                } else {\n                    int64_t i_68299 = add64(gtid_68278, max_res_68292);\n                    int64_t defunc_0_add_arg_68300;\n                    \n                    defunc_0_add_arg_68300 = ((__global\n                                               int64_t *) mem_77090)[gtid_68276 *\n                                                                     n_65344 +\n                                                                     i_68299];\n                    \n                    int64_t defunc_1_add_res_68301 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_68300);\n                    \n                    defunc_0_f_res_68298 = defunc_1_add_res_68301;\n                }\n                \n                int64_t binop_p_68302 = sub64(defunc_0_f_res_68298,\n                                              index_primexp_74677);\n                float defunc_0_f_res_68303 = sitofp_i64_f32(binop_p_68302);\n                float abs_res_68304 = (float) fabs(defunc_0_f_res_68303);\n                float tmp1_68305 = abs_res_68304 / defunc_1_f_res_68293;\n                float x_68306 = tmp1_68305 * tmp1_68305;\n                float y_68307 = tmp1_68305 * x_68306;\n                float tmp2_68308 = 1.0F - y_68307;\n                float x_68309 = tmp2_68308 * tmp2_68308;\n                float tmp3_68310 = tmp2_68308 * x_68309;\n                float tmp4_68311 = x_68296 * tmp3_68310;\n                float defunc_0_f_res_68312;\n                \n                if (cond_68297) {\n                    defunc_0_f_res_68312 = 0.0F;\n                } else {\n                    int64_t i_68313 = add64(gtid_68278, max_res_68292);\n                    float defunc_0_add_arg_68314;\n                    \n                    defunc_0_add_arg_68314 = ((__global\n                                               float *) mem_77086)[gtid_68276 *\n        ",
                   "                                                           n_65344 +\n                                                                   i_68313];\n                    defunc_0_f_res_68312 = defunc_0_add_arg_68314;\n                }\n                \n                float x_68315 = a0_68294 * tmp4_68311;\n                float defunc_9_fit_fun_res_68316 = defunc_0_f_res_68312 *\n                      x_68315;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_68280 = x_acc_78624;\n                }\n                // load new values\n                {\n                    x_68281 = defunc_9_fit_fun_res_68316;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_68282 = x_68280 + x_68281;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_78624 = defunc_1_op_res_68282;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_68280 = x_acc_78624;\n            ((__local\n              float *) red_arr_mem_78611)[sext_i32_i64(local_tid_78607)] =\n                x_68280;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_78630;\n        int32_t skip_waves_78631 = 1;\n        float x_78626;\n        float x_78627;\n        \n        offset_78630 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_78607,\n                      sext_i64_i32(segred_group_sizze_68272))) {\n                x_78626 = ((__local\n                            float *) red_arr_mem_78611)[sext_i32_i64(local_tid_78607 +\n                                                        offset_78630)];\n            }\n        }\n        offset_78630 = 1;\n        while (slt32(offset_78630, wave_sizze_78609)) {\n            i",
                   "f (slt32(local_tid_78607 + offset_78630,\n                      sext_i64_i32(segred_group_sizze_68272)) &&\n                ((local_tid_78607 - squot32(local_tid_78607, wave_sizze_78609) *\n                  wave_sizze_78609) & (2 * offset_78630 - 1)) == 0) {\n                // read array element\n                {\n                    x_78627 = ((volatile __local\n                                float *) red_arr_mem_78611)[sext_i32_i64(local_tid_78607 +\n                                                            offset_78630)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_78628 = x_78626 + x_78627;\n                    \n                    x_78626 = defunc_1_op_res_78628;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_78611)[sext_i32_i64(local_tid_78607)] =\n                        x_78626;\n                }\n            }\n            offset_78630 *= 2;\n        }\n        while (slt32(skip_waves_78631,\n                     squot32(sext_i64_i32(segred_group_sizze_68272) +\n                             wave_sizze_78609 - 1, wave_sizze_78609))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_78630 = skip_waves_78631 * wave_sizze_78609;\n            if (slt32(local_tid_78607 + offset_78630,\n                      sext_i64_i32(segred_group_sizze_68272)) &&\n                ((local_tid_78607 - squot32(local_tid_78607, wave_sizze_78609) *\n                  wave_sizze_78609) == 0 && (squot32(local_tid_78607,\n                                                     wave_sizze_78609) & (2 *\n                                                                          skip_waves_78631 -\n                                                                          1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_78627 = ((__local\n         ",
                   "                       float *) red_arr_mem_78611)[sext_i32_i64(local_tid_78607 +\n                                                            offset_78630)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_78628 = x_78626 + x_78627;\n                    \n                    x_78626 = defunc_1_op_res_78628;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_78611)[sext_i32_i64(local_tid_78607)] =\n                        x_78626;\n                }\n            }\n            skip_waves_78631 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_78607) == (int64_t) 0) {\n                x_acc_78624 = x_78626;\n            }\n        }\n        if (groups_per_segment_78597 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_78607 == 0) {\n                    ((__global float *) mem_77189)[gtid_68276 * n_m_65352 +\n                                                   gtid_68277] = x_acc_78624;\n                }\n            }\n        } else {\n            int32_t old_counter_78632;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_78607 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_78602)[sext_i32_i64(virt_group_id_78617)] =\n                        x_acc_78624;\n                    mem_fence_global();\n                    old_counter_78632 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_78604)[sext_i32_i64(srem32(flat_segment_id_78618,\n                                                                                         ",
                   "            10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_78613)[(int64_t) 0] =\n                        old_counter_78632 == groups_per_segment_78597 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_78633;\n            \n            is_last_group_78633 = ((__local\n                                    bool *) sync_arr_mem_78613)[(int64_t) 0];\n            if (is_last_group_78633) {\n                if (local_tid_78607 == 0) {\n                    old_counter_78632 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_78604)[sext_i32_i64(srem32(flat_segment_id_78618,\n                                                                                                     10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_78597));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_78634 =\n                            sdiv_up64(groups_per_segment_78597,\n                                      segred_group_sizze_68272);\n                    \n                    x_68280 = 0.0F;\n                    for (int64_t i_78635 = 0; i_78635 < read_per_thread_78634;\n                         i_78635++) {\n                        int64_t group_res_id_78636 =\n                                sext_i32_i64(local_tid_78607) *\n                                read_per_thread_78634 + i_78635;\n                        int64_t index_of_group_res_78637 =\n                                sext_i32_i64(flat_segment_id_78618) *\n                                groups_per_segment_78597 + group_res_id_78636;\n                        \n                        if (s",
                   "lt64(group_res_id_78636,\n                                  groups_per_segment_78597)) {\n                            x_68281 = ((__global\n                                        float *) segred_tmp_mem_78602)[index_of_group_res_78637];\n                            \n                            float defunc_1_op_res_68282 = x_68280 + x_68281;\n                            \n                            x_68280 = defunc_1_op_res_68282;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_78611)[sext_i32_i64(local_tid_78607)] =\n                    x_68280;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_78638;\n                    int32_t skip_waves_78639 = 1;\n                    float x_78626;\n                    float x_78627;\n                    \n                    offset_78638 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_78607,\n                                  sext_i64_i32(segred_group_sizze_68272))) {\n                            x_78626 = ((__local\n                                        float *) red_arr_mem_78611)[sext_i32_i64(local_tid_78607 +\n                                                                    offset_78638)];\n                        }\n                    }\n                    offset_78638 = 1;\n                    while (slt32(offset_78638, wave_sizze_78609)) {\n                        if (slt32(local_tid_78607 + offset_78638,\n                                  sext_i64_i32(segred_group_sizze_68272)) &&\n                            ((local_tid_78607 - squot32(local_tid_78607,\n                                                        wave_sizze_78609) *\n                              wave_sizze_78609) & (2 * offset_78638 - 1)) ==\n                            0) {\n                            /",
                   "/ read array element\n                            {\n                                x_78627 = ((volatile __local\n                                            float *) red_arr_mem_78611)[sext_i32_i64(local_tid_78607 +\n                                                                        offset_78638)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_78628 = x_78626 + x_78627;\n                                \n                                x_78626 = defunc_1_op_res_78628;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_78611)[sext_i32_i64(local_tid_78607)] =\n                                    x_78626;\n                            }\n                        }\n                        offset_78638 *= 2;\n                    }\n                    while (slt32(skip_waves_78639,\n                                 squot32(sext_i64_i32(segred_group_sizze_68272) +\n                                         wave_sizze_78609 - 1,\n                                         wave_sizze_78609))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_78638 = skip_waves_78639 * wave_sizze_78609;\n                        if (slt32(local_tid_78607 + offset_78638,\n                                  sext_i64_i32(segred_group_sizze_68272)) &&\n                            ((local_tid_78607 - squot32(local_tid_78607,\n                                                        wave_sizze_78609) *\n                              wave_sizze_78609) == 0 &&\n                             (squot32(local_tid_78607, wave_sizze_78609) & (2 *\n                                                                            skip_waves_78639 -\n                                                            ",
                   "                1)) ==\n                             0)) {\n                            // read array element\n                            {\n                                x_78627 = ((__local\n                                            float *) red_arr_mem_78611)[sext_i32_i64(local_tid_78607 +\n                                                                        offset_78638)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_78628 = x_78626 + x_78627;\n                                \n                                x_78626 = defunc_1_op_res_78628;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_78611)[sext_i32_i64(local_tid_78607)] =\n                                    x_78626;\n                            }\n                        }\n                        skip_waves_78639 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_78607 == 0) {\n                            ((__global float *) mem_77189)[gtid_68276 *\n                                                           n_m_65352 +\n                                                           gtid_68277] =\n                                x_78626;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_68272\n}\n__kernel void mainzisegred_large_70052(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *sync_arr_mem_78924_backing_aligned_0,\n                                       __local volatile\n              ",
                   "                         int64_t *red_arr_mem_78922_backing_aligned_1,\n                                       __local volatile\n                                       int64_t *red_arr_mem_78920_backing_aligned_2,\n                                       __local volatile\n                                       int64_t *red_arr_mem_78918_backing_aligned_3,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_70044,\n                                       int64_t groups_per_segment_78900,\n                                       int64_t elements_per_thread_78901,\n                                       int64_t virt_num_groups_78902,\n                                       int64_t threads_per_segment_78904,\n                                       __global unsigned char *mem_77316,\n                                       __global unsigned char *mem_77324,\n                                       __global unsigned char *mem_77348,\n                                       __global unsigned char *mem_77435,\n                                       __global unsigned char *mem_77439,\n                                       __global unsigned char *mem_77444,\n                                       __global unsigned char *mem_77448,\n                                       __global unsigned char *mem_77452,\n                                       __global\n                                       unsigned char *segred_tmp_mem_78905,\n                                       __global\n                                       unsigned char *segred_tmp_mem_78907,\n                                       __global\n                                       unsigned char *segred_tmp_mem_78909,\n                                       __global\n                                       unsigned char *m",
                   "ainzicounter_mem_78911)\n{\n    #define segred_group_sizze_70043 (mainzisegred_group_sizze_69048)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_78924_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_78924_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_78922_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_78922_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_78920_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_78920_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_78918_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_78918_backing_aligned_3;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78913;\n    int32_t local_tid_78914;\n    int64_t group_sizze_78917;\n    int32_t wave_sizze_78916;\n    int32_t group_tid_78915;\n    \n    global_tid_78913 = get_global_id(0);\n    local_tid_78914 = get_local_id(0);\n    group_sizze_78917 = get_local_size(0);\n    wave_sizze_78916 = LOCKSTEP_WIDTH;\n    group_tid_78915 = get_group_id(0);\n    \n    int32_t phys_tid_70052 = global_tid_78913;\n    __local unsigned char *red_arr_mem_78918;\n    \n    red_arr_mem_78918 = (__local unsigned char *) red_arr_mem_78918_backing_0;\n    \n    __local unsigned char *red_arr_mem_78920;\n    \n    red_arr_mem_78920 = (__local unsigned char *) red_arr_mem_78920_backing_1;\n    \n    __local unsigned char *red_arr_mem_78922;\n    \n    red_arr_mem_78922 = (__local unsigned char *) red_arr_mem_78922_backing_2;\n    \n    __local unsigned char *sync_arr_mem_78924;\n    \n    sync_arr_me",
                   "m_78924 = (__local unsigned char *) sync_arr_mem_78924_backing_3;\n    \n    int32_t phys_group_id_78926;\n    \n    phys_group_id_78926 = get_group_id(0);\n    for (int32_t i_78927 = 0; i_78927 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_78902) - phys_group_id_78926,\n                   sext_i64_i32(num_groups_70044)); i_78927++) {\n        int32_t virt_group_id_78928 = phys_group_id_78926 + i_78927 *\n                sext_i64_i32(num_groups_70044);\n        int32_t flat_segment_id_78929 = squot32(virt_group_id_78928,\n                                                sext_i64_i32(groups_per_segment_78900));\n        int64_t global_tid_78930 = srem64(sext_i32_i64(virt_group_id_78928) *\n                                          segred_group_sizze_70043 +\n                                          sext_i32_i64(local_tid_78914),\n                                          segred_group_sizze_70043 *\n                                          groups_per_segment_78900);\n        int64_t slice_78931 = n_m_65352;\n        int64_t slice_78932 = m_65343 * slice_78931;\n        int64_t gtid_70049 = squot64(sext_i32_i64(flat_segment_id_78929),\n                                     slice_78931);\n        int64_t remnant_78933 = sext_i32_i64(flat_segment_id_78929) -\n                gtid_70049 * slice_78931;\n        int64_t gtid_70050 = remnant_78933;\n        int64_t remnant_78934 = remnant_78933 - gtid_70050;\n        int64_t gtid_70051;\n        float x_acc_78935;\n        float x_acc_78936;\n        float x_acc_78937;\n        int64_t chunk_sizze_78938 = smin64(elements_per_thread_78901,\n                                           sdiv_up64(q_65346 - global_tid_78930,\n                                                     threads_per_segment_78904));\n        float x_70053;\n        float x_70054;\n        float x_70055;\n        float x_70056;\n        float x_70057;\n        float x_70058;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_78935 = 0.0F;\n            x_acc_",
                   "78936 = 0.0F;\n            x_acc_78937 = 0.0F;\n        }\n        for (int64_t i_78948 = 0; i_78948 < chunk_sizze_78938; i_78948++) {\n            gtid_70051 = global_tid_78930 + threads_per_segment_78904 * i_78948;\n            // apply map function\n            {\n                int64_t last_res_70062;\n                \n                last_res_70062 = ((__global int64_t *) mem_77316)[gtid_70049 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74688 = mul64(jump_65348, gtid_70050);\n                int64_t index_primexp_74689 = smin64(i_65358, binop_y_74688);\n                float defunc_1_f_res_70070;\n                \n                defunc_1_f_res_70070 = ((__global\n                                         float *) mem_77439)[gtid_70049 *\n                                                             n_m_65352 +\n                                                             gtid_70050];\n                \n                float x_70072;\n                \n                x_70072 = ((__global float *) mem_77348)[gtid_70049 * q_65346 +\n                                                         gtid_70051];\n                \n                bool cond_70073 = sle64(last_res_70062, gtid_70051);\n                int64_t defunc_0_f_res_70074;\n                \n                if (cond_70073) {\n                    defunc_0_f_res_70074 = (int64_t) 0;\n                } else {\n                    int64_t max_res_70069;\n                    \n                    max_res_70069 = ((__global\n                                      int64_t *) mem_77435)[gtid_70049 *\n                                                            n_m_65352 +\n                                                            gtid_70050];\n                    \n                    int64_t i_70075 = add64(gtid_70051, max_res_70069);\n                    int64_t defunc_0_add_arg_70076;\n",
                   "                    \n                    defunc_0_add_arg_70076 = ((__global\n                                               int64_t *) mem_77324)[gtid_70049 *\n                                                                     n_65344 +\n                                                                     i_70075];\n                    \n                    int64_t defunc_1_add_res_70077 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_70076);\n                    \n                    defunc_0_f_res_70074 = defunc_1_add_res_70077;\n                }\n                \n                int64_t binop_p_70078 = sub64(defunc_0_f_res_70074,\n                                              index_primexp_74689);\n                float defunc_0_f_res_70079 = sitofp_i64_f32(binop_p_70078);\n                float abs_res_70080 = (float) fabs(defunc_0_f_res_70079);\n                float tmp1_70081 = abs_res_70080 / defunc_1_f_res_70070;\n                float x_70082 = tmp1_70081 * tmp1_70081;\n                float y_70083 = tmp1_70081 * x_70082;\n                float tmp2_70084 = 1.0F - y_70083;\n                float x_70085 = tmp2_70084 * tmp2_70084;\n                float tmp3_70086 = tmp2_70084 * x_70085;\n                float w_j_70087 = x_70072 * tmp3_70086;\n                float xw_j_70088 = defunc_0_f_res_70079 * w_j_70087;\n                float x2w_j_70089 = defunc_0_f_res_70079 * xw_j_70088;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_70053 = x_acc_78935;\n                    x_70054 = x_acc_78936;\n                    x_70055 = x_acc_78937;\n                }\n                // load new values\n                {\n                    x_70056 = w_j_70087;\n                    x_70057 = xw_j_70088;\n                    x_70058 = x2w_j_70089;\n                }\n                // apply reduction operator\n                {\n               ",
                   "     float defunc_1_op_res_70059 = x_70053 + x_70056;\n                    float defunc_1_op_res_70060 = x_70054 + x_70057;\n                    float defunc_1_op_res_70061 = x_70055 + x_70058;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_78935 = defunc_1_op_res_70059;\n                        x_acc_78936 = defunc_1_op_res_70060;\n                        x_acc_78937 = defunc_1_op_res_70061;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_70053 = x_acc_78935;\n            x_70054 = x_acc_78936;\n            x_70055 = x_acc_78937;\n            ((__local\n              float *) red_arr_mem_78918)[sext_i32_i64(local_tid_78914)] =\n                x_70053;\n            ((__local\n              float *) red_arr_mem_78920)[sext_i32_i64(local_tid_78914)] =\n                x_70054;\n            ((__local\n              float *) red_arr_mem_78922)[sext_i32_i64(local_tid_78914)] =\n                x_70055;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_78949;\n        int32_t skip_waves_78950 = 1;\n        float x_78939;\n        float x_78940;\n        float x_78941;\n        float x_78942;\n        float x_78943;\n        float x_78944;\n        \n        offset_78949 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_78914,\n                      sext_i64_i32(segred_group_sizze_70043))) {\n                x_78939 = ((__local\n                            float *) red_arr_mem_78918)[sext_i32_i64(local_tid_78914 +\n                                                        offset_78949)];\n                x_78940 = ((__local\n                            float *) red_arr_mem_78920)[sext_i32_i64(local_tid_78914 +\n                                                        offset_78949)];\n                x_78941 = ((__local\n                            ",
                   "float *) red_arr_mem_78922)[sext_i32_i64(local_tid_78914 +\n                                                        offset_78949)];\n            }\n        }\n        offset_78949 = 1;\n        while (slt32(offset_78949, wave_sizze_78916)) {\n            if (slt32(local_tid_78914 + offset_78949,\n                      sext_i64_i32(segred_group_sizze_70043)) &&\n                ((local_tid_78914 - squot32(local_tid_78914, wave_sizze_78916) *\n                  wave_sizze_78916) & (2 * offset_78949 - 1)) == 0) {\n                // read array element\n                {\n                    x_78942 = ((volatile __local\n                                float *) red_arr_mem_78918)[sext_i32_i64(local_tid_78914 +\n                                                            offset_78949)];\n                    x_78943 = ((volatile __local\n                                float *) red_arr_mem_78920)[sext_i32_i64(local_tid_78914 +\n                                                            offset_78949)];\n                    x_78944 = ((volatile __local\n                                float *) red_arr_mem_78922)[sext_i32_i64(local_tid_78914 +\n                                                            offset_78949)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_78945 = x_78939 + x_78942;\n                    float defunc_1_op_res_78946 = x_78940 + x_78943;\n                    float defunc_1_op_res_78947 = x_78941 + x_78944;\n                    \n                    x_78939 = defunc_1_op_res_78945;\n                    x_78940 = defunc_1_op_res_78946;\n                    x_78941 = defunc_1_op_res_78947;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_78918)[sext_i32_i64(local_tid_78914)] =\n                        x_78939;\n                    ((volatile __local\n                      float *) red_arr_mem_789",
                   "20)[sext_i32_i64(local_tid_78914)] =\n                        x_78940;\n                    ((volatile __local\n                      float *) red_arr_mem_78922)[sext_i32_i64(local_tid_78914)] =\n                        x_78941;\n                }\n            }\n            offset_78949 *= 2;\n        }\n        while (slt32(skip_waves_78950,\n                     squot32(sext_i64_i32(segred_group_sizze_70043) +\n                             wave_sizze_78916 - 1, wave_sizze_78916))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_78949 = skip_waves_78950 * wave_sizze_78916;\n            if (slt32(local_tid_78914 + offset_78949,\n                      sext_i64_i32(segred_group_sizze_70043)) &&\n                ((local_tid_78914 - squot32(local_tid_78914, wave_sizze_78916) *\n                  wave_sizze_78916) == 0 && (squot32(local_tid_78914,\n                                                     wave_sizze_78916) & (2 *\n                                                                          skip_waves_78950 -\n                                                                          1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_78942 = ((__local\n                                float *) red_arr_mem_78918)[sext_i32_i64(local_tid_78914 +\n                                                            offset_78949)];\n                    x_78943 = ((__local\n                                float *) red_arr_mem_78920)[sext_i32_i64(local_tid_78914 +\n                                                            offset_78949)];\n                    x_78944 = ((__local\n                                float *) red_arr_mem_78922)[sext_i32_i64(local_tid_78914 +\n                                                            offset_78949)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_78945 = x_78939 + x_78942;\n                    float defunc_1_op_res_",
                   "78946 = x_78940 + x_78943;\n                    float defunc_1_op_res_78947 = x_78941 + x_78944;\n                    \n                    x_78939 = defunc_1_op_res_78945;\n                    x_78940 = defunc_1_op_res_78946;\n                    x_78941 = defunc_1_op_res_78947;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_78918)[sext_i32_i64(local_tid_78914)] =\n                        x_78939;\n                    ((__local\n                      float *) red_arr_mem_78920)[sext_i32_i64(local_tid_78914)] =\n                        x_78940;\n                    ((__local\n                      float *) red_arr_mem_78922)[sext_i32_i64(local_tid_78914)] =\n                        x_78941;\n                }\n            }\n            skip_waves_78950 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_78914) == (int64_t) 0) {\n                x_acc_78935 = x_78939;\n                x_acc_78936 = x_78940;\n                x_acc_78937 = x_78941;\n            }\n        }\n        if (groups_per_segment_78900 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_78914 == 0) {\n                    ((__global float *) mem_77444)[gtid_70049 * n_m_65352 +\n                                                   gtid_70050] = x_acc_78935;\n                    ((__global float *) mem_77448)[gtid_70049 * n_m_65352 +\n                                                   gtid_70050] = x_acc_78936;\n                    ((__global float *) mem_77452)[gtid_70049 * n_m_65352 +\n                                                   gtid_70050] = x_acc_78937;\n                }\n            }\n        } else {\n            int32_t old_counter_78951;\n            \n            // first thread in group saves group result to global memory\n    ",
                   "        {\n                if (local_tid_78914 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_78905)[sext_i32_i64(virt_group_id_78928)] =\n                        x_acc_78935;\n                    ((__global\n                      float *) segred_tmp_mem_78907)[sext_i32_i64(virt_group_id_78928)] =\n                        x_acc_78936;\n                    ((__global\n                      float *) segred_tmp_mem_78909)[sext_i32_i64(virt_group_id_78928)] =\n                        x_acc_78937;\n                    mem_fence_global();\n                    old_counter_78951 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_78911)[sext_i32_i64(srem32(flat_segment_id_78929,\n                                                                                                     10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_78924)[(int64_t) 0] =\n                        old_counter_78951 == groups_per_segment_78900 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_78952;\n            \n            is_last_group_78952 = ((__local\n                                    bool *) sync_arr_mem_78924)[(int64_t) 0];\n            if (is_last_group_78952) {\n                if (local_tid_78914 == 0) {\n                    old_counter_78951 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_78911)[sext_i32_i64(srem32(flat_segment_id_78929,\n                                                                                                     10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_78900",
                   "));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_78953 =\n                            sdiv_up64(groups_per_segment_78900,\n                                      segred_group_sizze_70043);\n                    \n                    x_70053 = 0.0F;\n                    x_70054 = 0.0F;\n                    x_70055 = 0.0F;\n                    for (int64_t i_78954 = 0; i_78954 < read_per_thread_78953;\n                         i_78954++) {\n                        int64_t group_res_id_78955 =\n                                sext_i32_i64(local_tid_78914) *\n                                read_per_thread_78953 + i_78954;\n                        int64_t index_of_group_res_78956 =\n                                sext_i32_i64(flat_segment_id_78929) *\n                                groups_per_segment_78900 + group_res_id_78955;\n                        \n                        if (slt64(group_res_id_78955,\n                                  groups_per_segment_78900)) {\n                            x_70056 = ((__global\n                                        float *) segred_tmp_mem_78905)[index_of_group_res_78956];\n                            x_70057 = ((__global\n                                        float *) segred_tmp_mem_78907)[index_of_group_res_78956];\n                            x_70058 = ((__global\n                                        float *) segred_tmp_mem_78909)[index_of_group_res_78956];\n                            \n                            float defunc_1_op_res_70059 = x_70053 + x_70056;\n                            float defunc_1_op_res_70060 = x_70054 + x_70057;\n                            float defunc_1_op_res_70061 = x_70055 + x_70058;\n                            \n                            x_70053 = defunc_1_op_res_70059;\n                            x_70054 = defunc_1_op_res_70060;\n                            x_70055 = defunc_1_op_res_70061;\n                        }\n             ",
                   "       }\n                }\n                ((__local\n                  float *) red_arr_mem_78918)[sext_i32_i64(local_tid_78914)] =\n                    x_70053;\n                ((__local\n                  float *) red_arr_mem_78920)[sext_i32_i64(local_tid_78914)] =\n                    x_70054;\n                ((__local\n                  float *) red_arr_mem_78922)[sext_i32_i64(local_tid_78914)] =\n                    x_70055;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_78957;\n                    int32_t skip_waves_78958 = 1;\n                    float x_78939;\n                    float x_78940;\n                    float x_78941;\n                    float x_78942;\n                    float x_78943;\n                    float x_78944;\n                    \n                    offset_78957 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_78914,\n                                  sext_i64_i32(segred_group_sizze_70043))) {\n                            x_78939 = ((__local\n                                        float *) red_arr_mem_78918)[sext_i32_i64(local_tid_78914 +\n                                                                    offset_78957)];\n                            x_78940 = ((__local\n                                        float *) red_arr_mem_78920)[sext_i32_i64(local_tid_78914 +\n                                                                    offset_78957)];\n                            x_78941 = ((__local\n                                        float *) red_arr_mem_78922)[sext_i32_i64(local_tid_78914 +\n                                                                    offset_78957)];\n                        }\n                    }\n                    offset_78957 = 1;\n                    while (slt32(offset_78957, wave_sizze_78916)) {\n                        if (slt",
                   "32(local_tid_78914 + offset_78957,\n                                  sext_i64_i32(segred_group_sizze_70043)) &&\n                            ((local_tid_78914 - squot32(local_tid_78914,\n                                                        wave_sizze_78916) *\n                              wave_sizze_78916) & (2 * offset_78957 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_78942 = ((volatile __local\n                                            float *) red_arr_mem_78918)[sext_i32_i64(local_tid_78914 +\n                                                                        offset_78957)];\n                                x_78943 = ((volatile __local\n                                            float *) red_arr_mem_78920)[sext_i32_i64(local_tid_78914 +\n                                                                        offset_78957)];\n                                x_78944 = ((volatile __local\n                                            float *) red_arr_mem_78922)[sext_i32_i64(local_tid_78914 +\n                                                                        offset_78957)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_78945 = x_78939 + x_78942;\n                                float defunc_1_op_res_78946 = x_78940 + x_78943;\n                                float defunc_1_op_res_78947 = x_78941 + x_78944;\n                                \n                                x_78939 = defunc_1_op_res_78945;\n                                x_78940 = defunc_1_op_res_78946;\n                                x_78941 = defunc_1_op_res_78947;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  flo",
                   "at *) red_arr_mem_78918)[sext_i32_i64(local_tid_78914)] =\n                                    x_78939;\n                                ((volatile __local\n                                  float *) red_arr_mem_78920)[sext_i32_i64(local_tid_78914)] =\n                                    x_78940;\n                                ((volatile __local\n                                  float *) red_arr_mem_78922)[sext_i32_i64(local_tid_78914)] =\n                                    x_78941;\n                            }\n                        }\n                        offset_78957 *= 2;\n                    }\n                    while (slt32(skip_waves_78958,\n                                 squot32(sext_i64_i32(segred_group_sizze_70043) +\n                                         wave_sizze_78916 - 1,\n                                         wave_sizze_78916))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_78957 = skip_waves_78958 * wave_sizze_78916;\n                        if (slt32(local_tid_78914 + offset_78957,\n                                  sext_i64_i32(segred_group_sizze_70043)) &&\n                            ((local_tid_78914 - squot32(local_tid_78914,\n                                                        wave_sizze_78916) *\n                              wave_sizze_78916) == 0 &&\n                             (squot32(local_tid_78914, wave_sizze_78916) & (2 *\n                                                                            skip_waves_78958 -\n                                                                            1)) ==\n                             0)) {\n                            // read array element\n                            {\n                                x_78942 = ((__local\n                                            float *) red_arr_mem_78918)[sext_i32_i64(local_tid_78914 +\n                                                                        offset_78957)];\n                                x_78943 =",
                   " ((__local\n                                            float *) red_arr_mem_78920)[sext_i32_i64(local_tid_78914 +\n                                                                        offset_78957)];\n                                x_78944 = ((__local\n                                            float *) red_arr_mem_78922)[sext_i32_i64(local_tid_78914 +\n                                                                        offset_78957)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_78945 = x_78939 + x_78942;\n                                float defunc_1_op_res_78946 = x_78940 + x_78943;\n                                float defunc_1_op_res_78947 = x_78941 + x_78944;\n                                \n                                x_78939 = defunc_1_op_res_78945;\n                                x_78940 = defunc_1_op_res_78946;\n                                x_78941 = defunc_1_op_res_78947;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_78918)[sext_i32_i64(local_tid_78914)] =\n                                    x_78939;\n                                ((__local\n                                  float *) red_arr_mem_78920)[sext_i32_i64(local_tid_78914)] =\n                                    x_78940;\n                                ((__local\n                                  float *) red_arr_mem_78922)[sext_i32_i64(local_tid_78914)] =\n                                    x_78941;\n                            }\n                        }\n                        skip_waves_78958 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_78914 == 0) {\n                            ((__global fl",
                   "oat *) mem_77444)[gtid_70049 *\n                                                           n_m_65352 +\n                                                           gtid_70050] =\n                                x_78939;\n                            ((__global float *) mem_77448)[gtid_70049 *\n                                                           n_m_65352 +\n                                                           gtid_70050] =\n                                x_78940;\n                            ((__global float *) mem_77452)[gtid_70049 *\n                                                           n_m_65352 +\n                                                           gtid_70050] =\n                                x_78941;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_70043\n}\n__kernel void mainzisegred_large_70122(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *sync_arr_mem_79024_backing_aligned_0,\n                                       __local volatile\n                                       int64_t *red_arr_mem_79022_backing_aligned_1,\n                                       __local volatile\n                                       int64_t *red_arr_mem_79020_backing_aligned_2,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_70115,\n                                       int64_t groups_per_segment_79004,\n                                       int64_t elements_per_thread_79005,\n                                       int64_t virt_num_groups_79006,\n                                       int64_t t",
                   "hreads_per_segment_79008,\n                                       __global unsigned char *mem_77316,\n                                       __global unsigned char *mem_77320,\n                                       __global unsigned char *mem_77324,\n                                       __global unsigned char *mem_77348,\n                                       __global unsigned char *mem_77435,\n                                       __global unsigned char *mem_77439,\n                                       __global unsigned char *mem_77457,\n                                       __global unsigned char *mem_77461,\n                                       __global unsigned char *mem_77465,\n                                       __global unsigned char *mem_77470,\n                                       __global unsigned char *mem_77474,\n                                       __global\n                                       unsigned char *segred_tmp_mem_79009,\n                                       __global\n                                       unsigned char *segred_tmp_mem_79011,\n                                       __global\n                                       unsigned char *mainzicounter_mem_79013)\n{\n    #define segred_group_sizze_70114 (mainzisegred_group_sizze_68953)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_79024_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_79024_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_79022_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79022_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_79020_backing_0 =\n                                   (__local volatile\n                                    unsigned char *)",
                   " red_arr_mem_79020_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79015;\n    int32_t local_tid_79016;\n    int64_t group_sizze_79019;\n    int32_t wave_sizze_79018;\n    int32_t group_tid_79017;\n    \n    global_tid_79015 = get_global_id(0);\n    local_tid_79016 = get_local_id(0);\n    group_sizze_79019 = get_local_size(0);\n    wave_sizze_79018 = LOCKSTEP_WIDTH;\n    group_tid_79017 = get_group_id(0);\n    \n    int32_t phys_tid_70122 = global_tid_79015;\n    __local unsigned char *red_arr_mem_79020;\n    \n    red_arr_mem_79020 = (__local unsigned char *) red_arr_mem_79020_backing_0;\n    \n    __local unsigned char *red_arr_mem_79022;\n    \n    red_arr_mem_79022 = (__local unsigned char *) red_arr_mem_79022_backing_1;\n    \n    __local unsigned char *sync_arr_mem_79024;\n    \n    sync_arr_mem_79024 = (__local unsigned char *) sync_arr_mem_79024_backing_2;\n    \n    int32_t phys_group_id_79026;\n    \n    phys_group_id_79026 = get_group_id(0);\n    for (int32_t i_79027 = 0; i_79027 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_79006) - phys_group_id_79026,\n                   sext_i64_i32(num_groups_70115)); i_79027++) {\n        int32_t virt_group_id_79028 = phys_group_id_79026 + i_79027 *\n                sext_i64_i32(num_groups_70115);\n        int32_t flat_segment_id_79029 = squot32(virt_group_id_79028,\n                                                sext_i64_i32(groups_per_segment_79004));\n        int64_t global_tid_79030 = srem64(sext_i32_i64(virt_group_id_79028) *\n                                          segred_group_sizze_70114 +\n                                          sext_i32_i64(local_tid_79016),\n                                          segred_group_sizze_70114 *\n                                          groups_per_segment_79004);\n        int64_t slice_79031 = n_m_65352;\n        int64_t slice_79032 = m_65343 * slice_79031;\n        int64_t gtid_70119 = squot64(sext_i32_i64(flat_segment_id_79029),\n                         ",
                   "            slice_79031);\n        int64_t remnant_79033 = sext_i32_i64(flat_segment_id_79029) -\n                gtid_70119 * slice_79031;\n        int64_t gtid_70120 = remnant_79033;\n        int64_t remnant_79034 = remnant_79033 - gtid_70120;\n        int64_t gtid_70121;\n        float x_acc_79035;\n        float x_acc_79036;\n        int64_t chunk_sizze_79037 = smin64(elements_per_thread_79005,\n                                           sdiv_up64(q_65346 - global_tid_79030,\n                                                     threads_per_segment_79008));\n        float x_70123;\n        float x_70124;\n        float x_70125;\n        float x_70126;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_79035 = 0.0F;\n            x_acc_79036 = 0.0F;\n        }\n        for (int64_t i_79044 = 0; i_79044 < chunk_sizze_79037; i_79044++) {\n            gtid_70121 = global_tid_79030 + threads_per_segment_79008 * i_79044;\n            // apply map function\n            {\n                int64_t last_res_70129;\n                \n                last_res_70129 = ((__global int64_t *) mem_77316)[gtid_70119 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74684 = mul64(jump_65348, gtid_70120);\n                int64_t index_primexp_74685 = smin64(i_65358, binop_y_74684);\n                int64_t max_res_70140;\n                \n                max_res_70140 = ((__global int64_t *) mem_77435)[gtid_70119 *\n                                                                 n_m_65352 +\n                                                                 gtid_70120];\n                \n                float defunc_1_f_res_70141;\n                \n                defunc_1_f_res_70141 = ((__global\n                                         float *) mem_77439)[gtid_70119 *\n                                                             ",
                   "n_m_65352 +\n                                                             gtid_70120];\n                \n                float a11_70142;\n                \n                a11_70142 = ((__global float *) mem_77457)[gtid_70119 *\n                                                           n_m_65352 +\n                                                           gtid_70120];\n                \n                float b11_70143;\n                \n                b11_70143 = ((__global float *) mem_77461)[gtid_70119 *\n                                                           n_m_65352 +\n                                                           gtid_70120];\n                \n                float c11_70144;\n                \n                c11_70144 = ((__global float *) mem_77465)[gtid_70119 *\n                                                           n_m_65352 +\n                                                           gtid_70120];\n                \n                float x_70146;\n                \n                x_70146 = ((__global float *) mem_77348)[gtid_70119 * q_65346 +\n                                                         gtid_70121];\n                \n                bool cond_70147 = sle64(last_res_70129, gtid_70121);\n                int64_t defunc_0_f_res_70148;\n                \n                if (cond_70147) {\n                    defunc_0_f_res_70148 = (int64_t) 0;\n                } else {\n                    int64_t i_70149 = add64(gtid_70121, max_res_70140);\n                    int64_t defunc_0_add_arg_70150;\n                    \n                    defunc_0_add_arg_70150 = ((__global\n                                               int64_t *) mem_77324)[gtid_70119 *\n                                                                     n_65344 +\n                                                                     i_70149];\n                    \n                    int64_t defunc_1_add_res_70151 = add64((int64_t) 1,\n                                                       ",
                   "    defunc_0_add_arg_70150);\n                    \n                    defunc_0_f_res_70148 = defunc_1_add_res_70151;\n                }\n                \n                int64_t binop_p_70152 = sub64(defunc_0_f_res_70148,\n                                              index_primexp_74685);\n                float defunc_0_f_res_70153 = sitofp_i64_f32(binop_p_70152);\n                float abs_res_70154 = (float) fabs(defunc_0_f_res_70153);\n                float tmp1_70155 = abs_res_70154 / defunc_1_f_res_70141;\n                float x_70156 = tmp1_70155 * tmp1_70155;\n                float y_70157 = tmp1_70155 * x_70156;\n                float tmp2_70158 = 1.0F - y_70157;\n                float x_70159 = tmp2_70158 * tmp2_70158;\n                float tmp3_70160 = tmp2_70158 * x_70159;\n                float tmp4_70161 = x_70146 * tmp3_70160;\n                float defunc_1_f_res_70162 = defunc_0_f_res_70153 * tmp4_70161;\n                float defunc_0_f_res_70163;\n                \n                if (cond_70147) {\n                    defunc_0_f_res_70163 = 0.0F;\n                } else {\n                    int64_t i_70164 = add64(gtid_70121, max_res_70140);\n                    float defunc_0_add_arg_70165;\n                    \n                    defunc_0_add_arg_70165 = ((__global\n                                               float *) mem_77320)[gtid_70119 *\n                                                                   n_65344 +\n                                                                   i_70164];\n                    defunc_0_f_res_70163 = defunc_0_add_arg_70165;\n                }\n                \n                float x_70166 = a11_70142 * tmp4_70161;\n                float y_70167 = b11_70143 * defunc_1_f_res_70162;\n                float x_70168 = x_70166 + y_70167;\n                float defunc_9_fit_fun_res_70169 = defunc_0_f_res_70163 *\n                      x_70168;\n                float x_70170 = b11_70143 * tmp4_70161;\n                float y_70171 = c11_70",
                   "144 * defunc_1_f_res_70162;\n                float x_70172 = x_70170 + y_70171;\n                float defunc_9_slope_fun_res_70173 = defunc_0_f_res_70163 *\n                      x_70172;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_70123 = x_acc_79035;\n                    x_70124 = x_acc_79036;\n                }\n                // load new values\n                {\n                    x_70125 = defunc_9_fit_fun_res_70169;\n                    x_70126 = defunc_9_slope_fun_res_70173;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_70127 = x_70123 + x_70125;\n                    float defunc_1_op_res_70128 = x_70124 + x_70126;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_79035 = defunc_1_op_res_70127;\n                        x_acc_79036 = defunc_1_op_res_70128;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_70123 = x_acc_79035;\n            x_70124 = x_acc_79036;\n            ((__local\n              float *) red_arr_mem_79020)[sext_i32_i64(local_tid_79016)] =\n                x_70123;\n            ((__local\n              float *) red_arr_mem_79022)[sext_i32_i64(local_tid_79016)] =\n                x_70124;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_79045;\n        int32_t skip_waves_79046 = 1;\n        float x_79038;\n        float x_79039;\n        float x_79040;\n        float x_79041;\n        \n        offset_79045 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_79016,\n                      sext_i64_i32(segred_group_sizze_70114))) {\n                x_79038 = ((__local\n                            float *) red_arr_mem_79020)[sext_i32",
                   "_i64(local_tid_79016 +\n                                                        offset_79045)];\n                x_79039 = ((__local\n                            float *) red_arr_mem_79022)[sext_i32_i64(local_tid_79016 +\n                                                        offset_79045)];\n            }\n        }\n        offset_79045 = 1;\n        while (slt32(offset_79045, wave_sizze_79018)) {\n            if (slt32(local_tid_79016 + offset_79045,\n                      sext_i64_i32(segred_group_sizze_70114)) &&\n                ((local_tid_79016 - squot32(local_tid_79016, wave_sizze_79018) *\n                  wave_sizze_79018) & (2 * offset_79045 - 1)) == 0) {\n                // read array element\n                {\n                    x_79040 = ((volatile __local\n                                float *) red_arr_mem_79020)[sext_i32_i64(local_tid_79016 +\n                                                            offset_79045)];\n                    x_79041 = ((volatile __local\n                                float *) red_arr_mem_79022)[sext_i32_i64(local_tid_79016 +\n                                                            offset_79045)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_79042 = x_79038 + x_79040;\n                    float defunc_1_op_res_79043 = x_79039 + x_79041;\n                    \n                    x_79038 = defunc_1_op_res_79042;\n                    x_79039 = defunc_1_op_res_79043;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_79020)[sext_i32_i64(local_tid_79016)] =\n                        x_79038;\n                    ((volatile __local\n                      float *) red_arr_mem_79022)[sext_i32_i64(local_tid_79016)] =\n                        x_79039;\n                }\n            }\n            offset_79045 *= 2;\n        }\n        while (slt32(skip_waves_7904",
                   "6,\n                     squot32(sext_i64_i32(segred_group_sizze_70114) +\n                             wave_sizze_79018 - 1, wave_sizze_79018))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_79045 = skip_waves_79046 * wave_sizze_79018;\n            if (slt32(local_tid_79016 + offset_79045,\n                      sext_i64_i32(segred_group_sizze_70114)) &&\n                ((local_tid_79016 - squot32(local_tid_79016, wave_sizze_79018) *\n                  wave_sizze_79018) == 0 && (squot32(local_tid_79016,\n                                                     wave_sizze_79018) & (2 *\n                                                                          skip_waves_79046 -\n                                                                          1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_79040 = ((__local\n                                float *) red_arr_mem_79020)[sext_i32_i64(local_tid_79016 +\n                                                            offset_79045)];\n                    x_79041 = ((__local\n                                float *) red_arr_mem_79022)[sext_i32_i64(local_tid_79016 +\n                                                            offset_79045)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_79042 = x_79038 + x_79040;\n                    float defunc_1_op_res_79043 = x_79039 + x_79041;\n                    \n                    x_79038 = defunc_1_op_res_79042;\n                    x_79039 = defunc_1_op_res_79043;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_79020)[sext_i32_i64(local_tid_79016)] =\n                        x_79038;\n                    ((__local\n                      float *) red_arr_mem_79022)[sext_i32_i64(local_tid_79016)] =\n                        x_79039;\n              ",
                   "  }\n            }\n            skip_waves_79046 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_79016) == (int64_t) 0) {\n                x_acc_79035 = x_79038;\n                x_acc_79036 = x_79039;\n            }\n        }\n        if (groups_per_segment_79004 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_79016 == 0) {\n                    ((__global float *) mem_77470)[gtid_70119 * n_m_65352 +\n                                                   gtid_70120] = x_acc_79035;\n                    ((__global float *) mem_77474)[gtid_70119 * n_m_65352 +\n                                                   gtid_70120] = x_acc_79036;\n                }\n            }\n        } else {\n            int32_t old_counter_79047;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_79016 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_79009)[sext_i32_i64(virt_group_id_79028)] =\n                        x_acc_79035;\n                    ((__global\n                      float *) segred_tmp_mem_79011)[sext_i32_i64(virt_group_id_79028)] =\n                        x_acc_79036;\n                    mem_fence_global();\n                    old_counter_79047 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_79013)[sext_i32_i64(srem32(flat_segment_id_79029,\n                                                                                                     10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_79024)[(int64_t) 0] =\n                        old_counter_79047 == groups_per_segment_79004 -\n                        (int64_t) 1;\n            ",
                   "    }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_79048;\n            \n            is_last_group_79048 = ((__local\n                                    bool *) sync_arr_mem_79024)[(int64_t) 0];\n            if (is_last_group_79048) {\n                if (local_tid_79016 == 0) {\n                    old_counter_79047 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_79013)[sext_i32_i64(srem32(flat_segment_id_79029,\n                                                                                                     10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_79004));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_79049 =\n                            sdiv_up64(groups_per_segment_79004,\n                                      segred_group_sizze_70114);\n                    \n                    x_70123 = 0.0F;\n                    x_70124 = 0.0F;\n                    for (int64_t i_79050 = 0; i_79050 < read_per_thread_79049;\n                         i_79050++) {\n                        int64_t group_res_id_79051 =\n                                sext_i32_i64(local_tid_79016) *\n                                read_per_thread_79049 + i_79050;\n                        int64_t index_of_group_res_79052 =\n                                sext_i32_i64(flat_segment_id_79029) *\n                                groups_per_segment_79004 + group_res_id_79051;\n                        \n                        if (slt64(group_res_id_79051,\n                                  groups_per_segment_79004)) {\n                            x_70125 = ((__global\n                                        float *) segred_tmp_mem_79009)[index_of_group_res_79052];\n ",
                   "                           x_70126 = ((__global\n                                        float *) segred_tmp_mem_79011)[index_of_group_res_79052];\n                            \n                            float defunc_1_op_res_70127 = x_70123 + x_70125;\n                            float defunc_1_op_res_70128 = x_70124 + x_70126;\n                            \n                            x_70123 = defunc_1_op_res_70127;\n                            x_70124 = defunc_1_op_res_70128;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_79020)[sext_i32_i64(local_tid_79016)] =\n                    x_70123;\n                ((__local\n                  float *) red_arr_mem_79022)[sext_i32_i64(local_tid_79016)] =\n                    x_70124;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_79053;\n                    int32_t skip_waves_79054 = 1;\n                    float x_79038;\n                    float x_79039;\n                    float x_79040;\n                    float x_79041;\n                    \n                    offset_79053 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_79016,\n                                  sext_i64_i32(segred_group_sizze_70114))) {\n                            x_79038 = ((__local\n                                        float *) red_arr_mem_79020)[sext_i32_i64(local_tid_79016 +\n                                                                    offset_79053)];\n                            x_79039 = ((__local\n                                        float *) red_arr_mem_79022)[sext_i32_i64(local_tid_79016 +\n                                                                    offset_79053)];\n                        }\n                    }\n                    offset_79053 = 1;\n               ",
                   "     while (slt32(offset_79053, wave_sizze_79018)) {\n                        if (slt32(local_tid_79016 + offset_79053,\n                                  sext_i64_i32(segred_group_sizze_70114)) &&\n                            ((local_tid_79016 - squot32(local_tid_79016,\n                                                        wave_sizze_79018) *\n                              wave_sizze_79018) & (2 * offset_79053 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_79040 = ((volatile __local\n                                            float *) red_arr_mem_79020)[sext_i32_i64(local_tid_79016 +\n                                                                        offset_79053)];\n                                x_79041 = ((volatile __local\n                                            float *) red_arr_mem_79022)[sext_i32_i64(local_tid_79016 +\n                                                                        offset_79053)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_79042 = x_79038 + x_79040;\n                                float defunc_1_op_res_79043 = x_79039 + x_79041;\n                                \n                                x_79038 = defunc_1_op_res_79042;\n                                x_79039 = defunc_1_op_res_79043;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_79020)[sext_i32_i64(local_tid_79016)] =\n                                    x_79038;\n                                ((volatile __local\n                                  float *) red_arr_mem_79022)[sext_i32_i64(local_tid_79016)] =\n                                    x_79039;\n                    ",
                   "        }\n                        }\n                        offset_79053 *= 2;\n                    }\n                    while (slt32(skip_waves_79054,\n                                 squot32(sext_i64_i32(segred_group_sizze_70114) +\n                                         wave_sizze_79018 - 1,\n                                         wave_sizze_79018))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_79053 = skip_waves_79054 * wave_sizze_79018;\n                        if (slt32(local_tid_79016 + offset_79053,\n                                  sext_i64_i32(segred_group_sizze_70114)) &&\n                            ((local_tid_79016 - squot32(local_tid_79016,\n                                                        wave_sizze_79018) *\n                              wave_sizze_79018) == 0 &&\n                             (squot32(local_tid_79016, wave_sizze_79018) & (2 *\n                                                                            skip_waves_79054 -\n                                                                            1)) ==\n                             0)) {\n                            // read array element\n                            {\n                                x_79040 = ((__local\n                                            float *) red_arr_mem_79020)[sext_i32_i64(local_tid_79016 +\n                                                                        offset_79053)];\n                                x_79041 = ((__local\n                                            float *) red_arr_mem_79022)[sext_i32_i64(local_tid_79016 +\n                                                                        offset_79053)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_79042 = x_79038 + x_79040;\n                                float defunc_1_op_res_79043 = x_79039 + x_79041;\n                        ",
                   "        \n                                x_79038 = defunc_1_op_res_79042;\n                                x_79039 = defunc_1_op_res_79043;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_79020)[sext_i32_i64(local_tid_79016)] =\n                                    x_79038;\n                                ((__local\n                                  float *) red_arr_mem_79022)[sext_i32_i64(local_tid_79016)] =\n                                    x_79039;\n                            }\n                        }\n                        skip_waves_79054 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_79016 == 0) {\n                            ((__global float *) mem_77470)[gtid_70119 *\n                                                           n_m_65352 +\n                                                           gtid_70120] =\n                                x_79038;\n                            ((__global float *) mem_77474)[gtid_70119 *\n                                                           n_m_65352 +\n                                                           gtid_70120] =\n                                x_79039;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_70114\n}\n__kernel void mainzisegred_large_72125(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *sync_arr_mem_79377_backing_aligned_0,\n                                       __local volatile\n                                       int64_t *red_arr_mem_79375_backing_aligned_1,\n                            ",
                   "           __local volatile\n                                       int64_t *red_arr_mem_79373_backing_aligned_2,\n                                       __local volatile\n                                       int64_t *red_arr_mem_79371_backing_aligned_3,\n                                       __local volatile\n                                       int64_t *red_arr_mem_79369_backing_aligned_4,\n                                       __local volatile\n                                       int64_t *red_arr_mem_79367_backing_aligned_5,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_72115,\n                                       int64_t groups_per_segment_79345,\n                                       int64_t elements_per_thread_79346,\n                                       int64_t virt_num_groups_79347,\n                                       int64_t threads_per_segment_79349,\n                                       __global unsigned char *mem_77608,\n                                       __global unsigned char *mem_77616,\n                                       __global unsigned char *mem_77640,\n                                       __global unsigned char *mem_77751,\n                                       __global unsigned char *mem_77755,\n                                       __global unsigned char *mem_77760,\n                                       __global unsigned char *mem_77764,\n                                       __global unsigned char *mem_77768,\n                                       __global unsigned char *mem_77772,\n                                       __global unsigned char *mem_77776,\n                                       __global\n                                       unsigned char *segred_tmp_mem_79350,\n                    ",
                   "                   __global\n                                       unsigned char *segred_tmp_mem_79352,\n                                       __global\n                                       unsigned char *segred_tmp_mem_79354,\n                                       __global\n                                       unsigned char *segred_tmp_mem_79356,\n                                       __global\n                                       unsigned char *segred_tmp_mem_79358,\n                                       __global\n                                       unsigned char *mainzicounter_mem_79360)\n{\n    #define segred_group_sizze_72114 (mainzisegred_group_sizze_71039)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_79377_backing_5 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_79377_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_79375_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79375_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_79373_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79373_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_79371_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79371_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_79369_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79369_backing_aligned_4;\n    __local volatile unsigned char *restrict red_arr_mem_79367_backing_0 =\n                                   (__local volatile\n          ",
                   "                          unsigned char *) red_arr_mem_79367_backing_aligned_5;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79362;\n    int32_t local_tid_79363;\n    int64_t group_sizze_79366;\n    int32_t wave_sizze_79365;\n    int32_t group_tid_79364;\n    \n    global_tid_79362 = get_global_id(0);\n    local_tid_79363 = get_local_id(0);\n    group_sizze_79366 = get_local_size(0);\n    wave_sizze_79365 = LOCKSTEP_WIDTH;\n    group_tid_79364 = get_group_id(0);\n    \n    int32_t phys_tid_72125 = global_tid_79362;\n    __local unsigned char *red_arr_mem_79367;\n    \n    red_arr_mem_79367 = (__local unsigned char *) red_arr_mem_79367_backing_0;\n    \n    __local unsigned char *red_arr_mem_79369;\n    \n    red_arr_mem_79369 = (__local unsigned char *) red_arr_mem_79369_backing_1;\n    \n    __local unsigned char *red_arr_mem_79371;\n    \n    red_arr_mem_79371 = (__local unsigned char *) red_arr_mem_79371_backing_2;\n    \n    __local unsigned char *red_arr_mem_79373;\n    \n    red_arr_mem_79373 = (__local unsigned char *) red_arr_mem_79373_backing_3;\n    \n    __local unsigned char *red_arr_mem_79375;\n    \n    red_arr_mem_79375 = (__local unsigned char *) red_arr_mem_79375_backing_4;\n    \n    __local unsigned char *sync_arr_mem_79377;\n    \n    sync_arr_mem_79377 = (__local unsigned char *) sync_arr_mem_79377_backing_5;\n    \n    int32_t phys_group_id_79379;\n    \n    phys_group_id_79379 = get_group_id(0);\n    for (int32_t i_79380 = 0; i_79380 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_79347) - phys_group_id_79379,\n                   sext_i64_i32(num_groups_72115)); i_79380++) {\n        int32_t virt_group_id_79381 = phys_group_id_79379 + i_79380 *\n                sext_i64_i32(num_groups_72115);\n        int32_t flat_segment_id_79382 = squot32(virt_group_id_79381,\n                                                sext_i64_i32(groups_per_segment_79345));\n        int64_t global_tid_79383 = srem64(sext_i32_i64(virt_group_id_79381) *\n                          ",
                   "                segred_group_sizze_72114 +\n                                          sext_i32_i64(local_tid_79363),\n                                          segred_group_sizze_72114 *\n                                          groups_per_segment_79345);\n        int64_t slice_79384 = n_m_65352;\n        int64_t slice_79385 = m_65343 * slice_79384;\n        int64_t gtid_72122 = squot64(sext_i32_i64(flat_segment_id_79382),\n                                     slice_79384);\n        int64_t remnant_79386 = sext_i32_i64(flat_segment_id_79382) -\n                gtid_72122 * slice_79384;\n        int64_t gtid_72123 = remnant_79386;\n        int64_t remnant_79387 = remnant_79386 - gtid_72123;\n        int64_t gtid_72124;\n        float x_acc_79388;\n        float x_acc_79389;\n        float x_acc_79390;\n        float x_acc_79391;\n        float x_acc_79392;\n        int64_t chunk_sizze_79393 = smin64(elements_per_thread_79346,\n                                           sdiv_up64(q_65346 - global_tid_79383,\n                                                     threads_per_segment_79349));\n        float x_72126;\n        float x_72127;\n        float x_72128;\n        float x_72129;\n        float x_72130;\n        float x_72131;\n        float x_72132;\n        float x_72133;\n        float x_72134;\n        float x_72135;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_79388 = 0.0F;\n            x_acc_79389 = 0.0F;\n            x_acc_79390 = 0.0F;\n            x_acc_79391 = 0.0F;\n            x_acc_79392 = 0.0F;\n        }\n        for (int64_t i_79409 = 0; i_79409 < chunk_sizze_79393; i_79409++) {\n            gtid_72124 = global_tid_79383 + threads_per_segment_79349 * i_79409;\n            // apply map function\n            {\n                int64_t last_res_72141;\n                \n                last_res_72141 = ((__global int64_t *) mem_77608)[gtid_72122 *\n                                                                  n_65344 +\n                                ",
                   "                                  i_65358];\n                \n                int64_t binop_y_74696 = mul64(jump_65348, gtid_72123);\n                int64_t index_primexp_74697 = smin64(i_65358, binop_y_74696);\n                float defunc_1_f_res_72149;\n                \n                defunc_1_f_res_72149 = ((__global\n                                         float *) mem_77755)[gtid_72122 *\n                                                             n_m_65352 +\n                                                             gtid_72123];\n                \n                float x_72151;\n                \n                x_72151 = ((__global float *) mem_77640)[gtid_72122 * q_65346 +\n                                                         gtid_72124];\n                \n                bool cond_72152 = sle64(last_res_72141, gtid_72124);\n                int64_t defunc_0_f_res_72153;\n                \n                if (cond_72152) {\n                    defunc_0_f_res_72153 = (int64_t) 0;\n                } else {\n                    int64_t max_res_72148;\n                    \n                    max_res_72148 = ((__global\n                                      int64_t *) mem_77751)[gtid_72122 *\n                                                            n_m_65352 +\n                                                            gtid_72123];\n                    \n                    int64_t i_72154 = add64(gtid_72124, max_res_72148);\n                    int64_t defunc_0_add_arg_72155;\n                    \n                    defunc_0_add_arg_72155 = ((__global\n                                               int64_t *) mem_77616)[gtid_72122 *\n                                                                     n_65344 +\n                                                                     i_72154];\n                    \n                    int64_t defunc_1_add_res_72156 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_72155);\n           ",
                   "         \n                    defunc_0_f_res_72153 = defunc_1_add_res_72156;\n                }\n                \n                int64_t binop_p_72157 = sub64(defunc_0_f_res_72153,\n                                              index_primexp_74697);\n                float defunc_0_f_res_72158 = sitofp_i64_f32(binop_p_72157);\n                float abs_res_72159 = (float) fabs(defunc_0_f_res_72158);\n                float tmp1_72160 = abs_res_72159 / defunc_1_f_res_72149;\n                float x_72161 = tmp1_72160 * tmp1_72160;\n                float y_72162 = tmp1_72160 * x_72161;\n                float tmp2_72163 = 1.0F - y_72162;\n                float x_72164 = tmp2_72163 * tmp2_72163;\n                float tmp3_72165 = tmp2_72163 * x_72164;\n                float w_j_72166 = x_72151 * tmp3_72165;\n                float xw_j_72167 = defunc_0_f_res_72158 * w_j_72166;\n                float x2w_j_72168 = defunc_0_f_res_72158 * xw_j_72167;\n                float x3w_j_72169 = defunc_0_f_res_72158 * x2w_j_72168;\n                float x4w_j_72170 = defunc_0_f_res_72158 * x3w_j_72169;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_72126 = x_acc_79388;\n                    x_72127 = x_acc_79389;\n                    x_72128 = x_acc_79390;\n                    x_72129 = x_acc_79391;\n                    x_72130 = x_acc_79392;\n                }\n                // load new values\n                {\n                    x_72131 = w_j_72166;\n                    x_72132 = xw_j_72167;\n                    x_72133 = x2w_j_72168;\n                    x_72134 = x3w_j_72169;\n                    x_72135 = x4w_j_72170;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_72136 = x_72126 + x_72131;\n                    float defunc_1_op_res_72137 = x_72127 + x_72132;\n                    float defunc_1_op_res_72138 = x_72128 + x_7213",
                   "3;\n                    float defunc_1_op_res_72139 = x_72129 + x_72134;\n                    float defunc_1_op_res_72140 = x_72130 + x_72135;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_79388 = defunc_1_op_res_72136;\n                        x_acc_79389 = defunc_1_op_res_72137;\n                        x_acc_79390 = defunc_1_op_res_72138;\n                        x_acc_79391 = defunc_1_op_res_72139;\n                        x_acc_79392 = defunc_1_op_res_72140;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_72126 = x_acc_79388;\n            x_72127 = x_acc_79389;\n            x_72128 = x_acc_79390;\n            x_72129 = x_acc_79391;\n            x_72130 = x_acc_79392;\n            ((__local\n              float *) red_arr_mem_79367)[sext_i32_i64(local_tid_79363)] =\n                x_72126;\n            ((__local\n              float *) red_arr_mem_79369)[sext_i32_i64(local_tid_79363)] =\n                x_72127;\n            ((__local\n              float *) red_arr_mem_79371)[sext_i32_i64(local_tid_79363)] =\n                x_72128;\n            ((__local\n              float *) red_arr_mem_79373)[sext_i32_i64(local_tid_79363)] =\n                x_72129;\n            ((__local\n              float *) red_arr_mem_79375)[sext_i32_i64(local_tid_79363)] =\n                x_72130;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_79410;\n        int32_t skip_waves_79411 = 1;\n        float x_79394;\n        float x_79395;\n        float x_79396;\n        float x_79397;\n        float x_79398;\n        float x_79399;\n        float x_79400;\n        float x_79401;\n        float x_79402;\n        float x_79403;\n        \n        offset_79410 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_79363,\n                      sext_i64_i32(segred_",
                   "group_sizze_72114))) {\n                x_79394 = ((__local\n                            float *) red_arr_mem_79367)[sext_i32_i64(local_tid_79363 +\n                                                        offset_79410)];\n                x_79395 = ((__local\n                            float *) red_arr_mem_79369)[sext_i32_i64(local_tid_79363 +\n                                                        offset_79410)];\n                x_79396 = ((__local\n                            float *) red_arr_mem_79371)[sext_i32_i64(local_tid_79363 +\n                                                        offset_79410)];\n                x_79397 = ((__local\n                            float *) red_arr_mem_79373)[sext_i32_i64(local_tid_79363 +\n                                                        offset_79410)];\n                x_79398 = ((__local\n                            float *) red_arr_mem_79375)[sext_i32_i64(local_tid_79363 +\n                                                        offset_79410)];\n            }\n        }\n        offset_79410 = 1;\n        while (slt32(offset_79410, wave_sizze_79365)) {\n            if (slt32(local_tid_79363 + offset_79410,\n                      sext_i64_i32(segred_group_sizze_72114)) &&\n                ((local_tid_79363 - squot32(local_tid_79363, wave_sizze_79365) *\n                  wave_sizze_79365) & (2 * offset_79410 - 1)) == 0) {\n                // read array element\n                {\n                    x_79399 = ((volatile __local\n                                float *) red_arr_mem_79367)[sext_i32_i64(local_tid_79363 +\n                                                            offset_79410)];\n                    x_79400 = ((volatile __local\n                                float *) red_arr_mem_79369)[sext_i32_i64(local_tid_79363 +\n                                                            offset_79410)];\n                    x_79401 = ((volatile __local\n                                float *) red_arr_mem_79371)[sext_i32_i64(local_tid_79363 ",
                   "+\n                                                            offset_79410)];\n                    x_79402 = ((volatile __local\n                                float *) red_arr_mem_79373)[sext_i32_i64(local_tid_79363 +\n                                                            offset_79410)];\n                    x_79403 = ((volatile __local\n                                float *) red_arr_mem_79375)[sext_i32_i64(local_tid_79363 +\n                                                            offset_79410)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_79404 = x_79394 + x_79399;\n                    float defunc_1_op_res_79405 = x_79395 + x_79400;\n                    float defunc_1_op_res_79406 = x_79396 + x_79401;\n                    float defunc_1_op_res_79407 = x_79397 + x_79402;\n                    float defunc_1_op_res_79408 = x_79398 + x_79403;\n                    \n                    x_79394 = defunc_1_op_res_79404;\n                    x_79395 = defunc_1_op_res_79405;\n                    x_79396 = defunc_1_op_res_79406;\n                    x_79397 = defunc_1_op_res_79407;\n                    x_79398 = defunc_1_op_res_79408;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_79367)[sext_i32_i64(local_tid_79363)] =\n                        x_79394;\n                    ((volatile __local\n                      float *) red_arr_mem_79369)[sext_i32_i64(local_tid_79363)] =\n                        x_79395;\n                    ((volatile __local\n                      float *) red_arr_mem_79371)[sext_i32_i64(local_tid_79363)] =\n                        x_79396;\n                    ((volatile __local\n                      float *) red_arr_mem_79373)[sext_i32_i64(local_tid_79363)] =\n                        x_79397;\n                    ((volatile __local\n                      float *) red_arr",
                   "_mem_79375)[sext_i32_i64(local_tid_79363)] =\n                        x_79398;\n                }\n            }\n            offset_79410 *= 2;\n        }\n        while (slt32(skip_waves_79411,\n                     squot32(sext_i64_i32(segred_group_sizze_72114) +\n                             wave_sizze_79365 - 1, wave_sizze_79365))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_79410 = skip_waves_79411 * wave_sizze_79365;\n            if (slt32(local_tid_79363 + offset_79410,\n                      sext_i64_i32(segred_group_sizze_72114)) &&\n                ((local_tid_79363 - squot32(local_tid_79363, wave_sizze_79365) *\n                  wave_sizze_79365) == 0 && (squot32(local_tid_79363,\n                                                     wave_sizze_79365) & (2 *\n                                                                          skip_waves_79411 -\n                                                                          1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_79399 = ((__local\n                                float *) red_arr_mem_79367)[sext_i32_i64(local_tid_79363 +\n                                                            offset_79410)];\n                    x_79400 = ((__local\n                                float *) red_arr_mem_79369)[sext_i32_i64(local_tid_79363 +\n                                                            offset_79410)];\n                    x_79401 = ((__local\n                                float *) red_arr_mem_79371)[sext_i32_i64(local_tid_79363 +\n                                                            offset_79410)];\n                    x_79402 = ((__local\n                                float *) red_arr_mem_79373)[sext_i32_i64(local_tid_79363 +\n                                                            offset_79410)];\n                    x_79403 = ((__local\n                                float *) red_arr_mem_79375)[sext_i32_i64(local_tid_79363 +\n ",
                   "                                                           offset_79410)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_79404 = x_79394 + x_79399;\n                    float defunc_1_op_res_79405 = x_79395 + x_79400;\n                    float defunc_1_op_res_79406 = x_79396 + x_79401;\n                    float defunc_1_op_res_79407 = x_79397 + x_79402;\n                    float defunc_1_op_res_79408 = x_79398 + x_79403;\n                    \n                    x_79394 = defunc_1_op_res_79404;\n                    x_79395 = defunc_1_op_res_79405;\n                    x_79396 = defunc_1_op_res_79406;\n                    x_79397 = defunc_1_op_res_79407;\n                    x_79398 = defunc_1_op_res_79408;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_79367)[sext_i32_i64(local_tid_79363)] =\n                        x_79394;\n                    ((__local\n                      float *) red_arr_mem_79369)[sext_i32_i64(local_tid_79363)] =\n                        x_79395;\n                    ((__local\n                      float *) red_arr_mem_79371)[sext_i32_i64(local_tid_79363)] =\n                        x_79396;\n                    ((__local\n                      float *) red_arr_mem_79373)[sext_i32_i64(local_tid_79363)] =\n                        x_79397;\n                    ((__local\n                      float *) red_arr_mem_79375)[sext_i32_i64(local_tid_79363)] =\n                        x_79398;\n                }\n            }\n            skip_waves_79411 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_79363) == (int64_t) 0) {\n                x_acc_79388 = x_79394;\n                x_acc_79389 = x_79395;\n                x_acc_79390 = x_79396;\n                x_acc_79391 = x_79397;\n ",
                   "               x_acc_79392 = x_79398;\n            }\n        }\n        if (groups_per_segment_79345 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_79363 == 0) {\n                    ((__global float *) mem_77760)[gtid_72122 * n_m_65352 +\n                                                   gtid_72123] = x_acc_79388;\n                    ((__global float *) mem_77764)[gtid_72122 * n_m_65352 +\n                                                   gtid_72123] = x_acc_79389;\n                    ((__global float *) mem_77768)[gtid_72122 * n_m_65352 +\n                                                   gtid_72123] = x_acc_79390;\n                    ((__global float *) mem_77772)[gtid_72122 * n_m_65352 +\n                                                   gtid_72123] = x_acc_79391;\n                    ((__global float *) mem_77776)[gtid_72122 * n_m_65352 +\n                                                   gtid_72123] = x_acc_79392;\n                }\n            }\n        } else {\n            int32_t old_counter_79412;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_79363 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_79350)[sext_i32_i64(virt_group_id_79381)] =\n                        x_acc_79388;\n                    ((__global\n                      float *) segred_tmp_mem_79352)[sext_i32_i64(virt_group_id_79381)] =\n                        x_acc_79389;\n                    ((__global\n                      float *) segred_tmp_mem_79354)[sext_i32_i64(virt_group_id_79381)] =\n                        x_acc_79390;\n                    ((__global\n                      float *) segred_tmp_mem_79356)[sext_i32_i64(virt_group_id_79381)] =\n                        x_acc_79391;\n                    ((__global\n                      float *) segred_tmp_mem_79358)[sext_i32_i64(virt_group_id_79381)] =\n    ",
                   "                    x_acc_79392;\n                    mem_fence_global();\n                    old_counter_79412 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_79360)[sext_i32_i64(srem32(flat_segment_id_79382,\n                                                                                                     10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_79377)[(int64_t) 0] =\n                        old_counter_79412 == groups_per_segment_79345 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_79413;\n            \n            is_last_group_79413 = ((__local\n                                    bool *) sync_arr_mem_79377)[(int64_t) 0];\n            if (is_last_group_79413) {\n                if (local_tid_79363 == 0) {\n                    old_counter_79412 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_79360)[sext_i32_i64(srem32(flat_segment_id_79382,\n                                                                                                     10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_79345));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_79414 =\n                            sdiv_up64(groups_per_segment_79345,\n                                      segred_group_sizze_72114);\n                    \n                    x_72126 = 0.0F;\n                    x_72127 = 0.0F;\n                    x_72128 = 0.0F;\n                    x_72129 = 0.0F;\n                    x_72130 = 0.0F;\n                    for ",
                   "(int64_t i_79415 = 0; i_79415 < read_per_thread_79414;\n                         i_79415++) {\n                        int64_t group_res_id_79416 =\n                                sext_i32_i64(local_tid_79363) *\n                                read_per_thread_79414 + i_79415;\n                        int64_t index_of_group_res_79417 =\n                                sext_i32_i64(flat_segment_id_79382) *\n                                groups_per_segment_79345 + group_res_id_79416;\n                        \n                        if (slt64(group_res_id_79416,\n                                  groups_per_segment_79345)) {\n                            x_72131 = ((__global\n                                        float *) segred_tmp_mem_79350)[index_of_group_res_79417];\n                            x_72132 = ((__global\n                                        float *) segred_tmp_mem_79352)[index_of_group_res_79417];\n                            x_72133 = ((__global\n                                        float *) segred_tmp_mem_79354)[index_of_group_res_79417];\n                            x_72134 = ((__global\n                                        float *) segred_tmp_mem_79356)[index_of_group_res_79417];\n                            x_72135 = ((__global\n                                        float *) segred_tmp_mem_79358)[index_of_group_res_79417];\n                            \n                            float defunc_1_op_res_72136 = x_72126 + x_72131;\n                            float defunc_1_op_res_72137 = x_72127 + x_72132;\n                            float defunc_1_op_res_72138 = x_72128 + x_72133;\n                            float defunc_1_op_res_72139 = x_72129 + x_72134;\n                            float defunc_1_op_res_72140 = x_72130 + x_72135;\n                            \n                            x_72126 = defunc_1_op_res_72136;\n                            x_72127 = defunc_1_op_res_72137;\n                            x_72128 = defunc_1_op_res_72138;\n              ",
                   "              x_72129 = defunc_1_op_res_72139;\n                            x_72130 = defunc_1_op_res_72140;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_79367)[sext_i32_i64(local_tid_79363)] =\n                    x_72126;\n                ((__local\n                  float *) red_arr_mem_79369)[sext_i32_i64(local_tid_79363)] =\n                    x_72127;\n                ((__local\n                  float *) red_arr_mem_79371)[sext_i32_i64(local_tid_79363)] =\n                    x_72128;\n                ((__local\n                  float *) red_arr_mem_79373)[sext_i32_i64(local_tid_79363)] =\n                    x_72129;\n                ((__local\n                  float *) red_arr_mem_79375)[sext_i32_i64(local_tid_79363)] =\n                    x_72130;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_79418;\n                    int32_t skip_waves_79419 = 1;\n                    float x_79394;\n                    float x_79395;\n                    float x_79396;\n                    float x_79397;\n                    float x_79398;\n                    float x_79399;\n                    float x_79400;\n                    float x_79401;\n                    float x_79402;\n                    float x_79403;\n                    \n                    offset_79418 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_79363,\n                                  sext_i64_i32(segred_group_sizze_72114))) {\n                            x_79394 = ((__local\n                                        float *) red_arr_mem_79367)[sext_i32_i64(local_tid_79363 +\n                                                                    offset_79418)];\n                            x_79395 = ((__local\n                                        floa",
                   "t *) red_arr_mem_79369)[sext_i32_i64(local_tid_79363 +\n                                                                    offset_79418)];\n                            x_79396 = ((__local\n                                        float *) red_arr_mem_79371)[sext_i32_i64(local_tid_79363 +\n                                                                    offset_79418)];\n                            x_79397 = ((__local\n                                        float *) red_arr_mem_79373)[sext_i32_i64(local_tid_79363 +\n                                                                    offset_79418)];\n                            x_79398 = ((__local\n                                        float *) red_arr_mem_79375)[sext_i32_i64(local_tid_79363 +\n                                                                    offset_79418)];\n                        }\n                    }\n                    offset_79418 = 1;\n                    while (slt32(offset_79418, wave_sizze_79365)) {\n                        if (slt32(local_tid_79363 + offset_79418,\n                                  sext_i64_i32(segred_group_sizze_72114)) &&\n                            ((local_tid_79363 - squot32(local_tid_79363,\n                                                        wave_sizze_79365) *\n                              wave_sizze_79365) & (2 * offset_79418 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_79399 = ((volatile __local\n                                            float *) red_arr_mem_79367)[sext_i32_i64(local_tid_79363 +\n                                                                        offset_79418)];\n                                x_79400 = ((volatile __local\n                                            float *) red_arr_mem_79369)[sext_i32_i64(local_tid_79363 +\n                                                                        offset_79418)];\n                            ",
                   "    x_79401 = ((volatile __local\n                                            float *) red_arr_mem_79371)[sext_i32_i64(local_tid_79363 +\n                                                                        offset_79418)];\n                                x_79402 = ((volatile __local\n                                            float *) red_arr_mem_79373)[sext_i32_i64(local_tid_79363 +\n                                                                        offset_79418)];\n                                x_79403 = ((volatile __local\n                                            float *) red_arr_mem_79375)[sext_i32_i64(local_tid_79363 +\n                                                                        offset_79418)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_79404 = x_79394 + x_79399;\n                                float defunc_1_op_res_79405 = x_79395 + x_79400;\n                                float defunc_1_op_res_79406 = x_79396 + x_79401;\n                                float defunc_1_op_res_79407 = x_79397 + x_79402;\n                                float defunc_1_op_res_79408 = x_79398 + x_79403;\n                                \n                                x_79394 = defunc_1_op_res_79404;\n                                x_79395 = defunc_1_op_res_79405;\n                                x_79396 = defunc_1_op_res_79406;\n                                x_79397 = defunc_1_op_res_79407;\n                                x_79398 = defunc_1_op_res_79408;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_79367)[sext_i32_i64(local_tid_79363)] =\n                                    x_79394;\n                                ((volatile __local\n                                 ",
                   " float *) red_arr_mem_79369)[sext_i32_i64(local_tid_79363)] =\n                                    x_79395;\n                                ((volatile __local\n                                  float *) red_arr_mem_79371)[sext_i32_i64(local_tid_79363)] =\n                                    x_79396;\n                                ((volatile __local\n                                  float *) red_arr_mem_79373)[sext_i32_i64(local_tid_79363)] =\n                                    x_79397;\n                                ((volatile __local\n                                  float *) red_arr_mem_79375)[sext_i32_i64(local_tid_79363)] =\n                                    x_79398;\n                            }\n                        }\n                        offset_79418 *= 2;\n                    }\n                    while (slt32(skip_waves_79419,\n                                 squot32(sext_i64_i32(segred_group_sizze_72114) +\n                                         wave_sizze_79365 - 1,\n                                         wave_sizze_79365))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_79418 = skip_waves_79419 * wave_sizze_79365;\n                        if (slt32(local_tid_79363 + offset_79418,\n                                  sext_i64_i32(segred_group_sizze_72114)) &&\n                            ((local_tid_79363 - squot32(local_tid_79363,\n                                                        wave_sizze_79365) *\n                              wave_sizze_79365) == 0 &&\n                             (squot32(local_tid_79363, wave_sizze_79365) & (2 *\n                                                                            skip_waves_79419 -\n                                                                            1)) ==\n                             0)) {\n                            // read array element\n                            {\n                                x_79399 = ((__local\n                                     ",
                   "       float *) red_arr_mem_79367)[sext_i32_i64(local_tid_79363 +\n                                                                        offset_79418)];\n                                x_79400 = ((__local\n                                            float *) red_arr_mem_79369)[sext_i32_i64(local_tid_79363 +\n                                                                        offset_79418)];\n                                x_79401 = ((__local\n                                            float *) red_arr_mem_79371)[sext_i32_i64(local_tid_79363 +\n                                                                        offset_79418)];\n                                x_79402 = ((__local\n                                            float *) red_arr_mem_79373)[sext_i32_i64(local_tid_79363 +\n                                                                        offset_79418)];\n                                x_79403 = ((__local\n                                            float *) red_arr_mem_79375)[sext_i32_i64(local_tid_79363 +\n                                                                        offset_79418)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_79404 = x_79394 + x_79399;\n                                float defunc_1_op_res_79405 = x_79395 + x_79400;\n                                float defunc_1_op_res_79406 = x_79396 + x_79401;\n                                float defunc_1_op_res_79407 = x_79397 + x_79402;\n                                float defunc_1_op_res_79408 = x_79398 + x_79403;\n                                \n                                x_79394 = defunc_1_op_res_79404;\n                                x_79395 = defunc_1_op_res_79405;\n                                x_79396 = defunc_1_op_res_79406;\n                                x_79397 = defunc_1_op_res_79407;\n                                x_79398 = defunc_1_op_res_7",
                   "9408;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_79367)[sext_i32_i64(local_tid_79363)] =\n                                    x_79394;\n                                ((__local\n                                  float *) red_arr_mem_79369)[sext_i32_i64(local_tid_79363)] =\n                                    x_79395;\n                                ((__local\n                                  float *) red_arr_mem_79371)[sext_i32_i64(local_tid_79363)] =\n                                    x_79396;\n                                ((__local\n                                  float *) red_arr_mem_79373)[sext_i32_i64(local_tid_79363)] =\n                                    x_79397;\n                                ((__local\n                                  float *) red_arr_mem_79375)[sext_i32_i64(local_tid_79363)] =\n                                    x_79398;\n                            }\n                        }\n                        skip_waves_79419 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_79363 == 0) {\n                            ((__global float *) mem_77760)[gtid_72122 *\n                                                           n_m_65352 +\n                                                           gtid_72123] =\n                                x_79394;\n                            ((__global float *) mem_77764)[gtid_72122 *\n                                                           n_m_65352 +\n                                                           gtid_72123] =\n                                x_79395;\n                            ((__global float *) mem_77768)[gtid_72122 *\n                                                           n_m_65352 +\n                                               ",
                   "            gtid_72123] =\n                                x_79396;\n                            ((__global float *) mem_77772)[gtid_72122 *\n                                                           n_m_65352 +\n                                                           gtid_72123] =\n                                x_79397;\n                            ((__global float *) mem_77776)[gtid_72122 *\n                                                           n_m_65352 +\n                                                           gtid_72123] =\n                                x_79398;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_72114\n}\n__kernel void mainzisegred_large_72224(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *sync_arr_mem_79485_backing_aligned_0,\n                                       __local volatile\n                                       int64_t *red_arr_mem_79483_backing_aligned_1,\n                                       __local volatile\n                                       int64_t *red_arr_mem_79481_backing_aligned_2,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_72217,\n                                       int64_t groups_per_segment_79465,\n                                       int64_t elements_per_thread_79466,\n                                       int64_t virt_num_groups_79467,\n                                       int64_t threads_per_segment_79469,\n                                       __global unsigned char *mem_77608,\n                                       __global u",
                   "nsigned char *mem_77612,\n                                       __global unsigned char *mem_77616,\n                                       __global unsigned char *mem_77640,\n                                       __global unsigned char *mem_77751,\n                                       __global unsigned char *mem_77755,\n                                       __global unsigned char *mem_77781,\n                                       __global unsigned char *mem_77785,\n                                       __global unsigned char *mem_77789,\n                                       __global unsigned char *mem_77793,\n                                       __global unsigned char *mem_77797,\n                                       __global unsigned char *mem_77802,\n                                       __global unsigned char *mem_77806,\n                                       __global\n                                       unsigned char *segred_tmp_mem_79470,\n                                       __global\n                                       unsigned char *segred_tmp_mem_79472,\n                                       __global\n                                       unsigned char *mainzicounter_mem_79474)\n{\n    #define segred_group_sizze_72216 (mainzisegred_group_sizze_70912)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict sync_arr_mem_79485_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) sync_arr_mem_79485_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_79483_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79483_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_79481_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) ",
                   "red_arr_mem_79481_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79476;\n    int32_t local_tid_79477;\n    int64_t group_sizze_79480;\n    int32_t wave_sizze_79479;\n    int32_t group_tid_79478;\n    \n    global_tid_79476 = get_global_id(0);\n    local_tid_79477 = get_local_id(0);\n    group_sizze_79480 = get_local_size(0);\n    wave_sizze_79479 = LOCKSTEP_WIDTH;\n    group_tid_79478 = get_group_id(0);\n    \n    int32_t phys_tid_72224 = global_tid_79476;\n    __local unsigned char *red_arr_mem_79481;\n    \n    red_arr_mem_79481 = (__local unsigned char *) red_arr_mem_79481_backing_0;\n    \n    __local unsigned char *red_arr_mem_79483;\n    \n    red_arr_mem_79483 = (__local unsigned char *) red_arr_mem_79483_backing_1;\n    \n    __local unsigned char *sync_arr_mem_79485;\n    \n    sync_arr_mem_79485 = (__local unsigned char *) sync_arr_mem_79485_backing_2;\n    \n    int32_t phys_group_id_79487;\n    \n    phys_group_id_79487 = get_group_id(0);\n    for (int32_t i_79488 = 0; i_79488 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_79467) - phys_group_id_79487,\n                   sext_i64_i32(num_groups_72217)); i_79488++) {\n        int32_t virt_group_id_79489 = phys_group_id_79487 + i_79488 *\n                sext_i64_i32(num_groups_72217);\n        int32_t flat_segment_id_79490 = squot32(virt_group_id_79489,\n                                                sext_i64_i32(groups_per_segment_79465));\n        int64_t global_tid_79491 = srem64(sext_i32_i64(virt_group_id_79489) *\n                                          segred_group_sizze_72216 +\n                                          sext_i32_i64(local_tid_79477),\n                                          segred_group_sizze_72216 *\n                                          groups_per_segment_79465);\n        int64_t slice_79492 = n_m_65352;\n        int64_t slice_79493 = m_65343 * slice_79492;\n        int64_t gtid_72221 = squot64(sext_i32_i64(flat_segment_id_79490),\n                          ",
                   "           slice_79492);\n        int64_t remnant_79494 = sext_i32_i64(flat_segment_id_79490) -\n                gtid_72221 * slice_79492;\n        int64_t gtid_72222 = remnant_79494;\n        int64_t remnant_79495 = remnant_79494 - gtid_72222;\n        int64_t gtid_72223;\n        float x_acc_79496;\n        float x_acc_79497;\n        int64_t chunk_sizze_79498 = smin64(elements_per_thread_79466,\n                                           sdiv_up64(q_65346 - global_tid_79491,\n                                                     threads_per_segment_79469));\n        float x_72225;\n        float x_72226;\n        float x_72227;\n        float x_72228;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_79496 = 0.0F;\n            x_acc_79497 = 0.0F;\n        }\n        for (int64_t i_79505 = 0; i_79505 < chunk_sizze_79498; i_79505++) {\n            gtid_72223 = global_tid_79491 + threads_per_segment_79469 * i_79505;\n            // apply map function\n            {\n                int64_t last_res_72231;\n                \n                last_res_72231 = ((__global int64_t *) mem_77608)[gtid_72221 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74692 = mul64(jump_65348, gtid_72222);\n                int64_t index_primexp_74693 = smin64(i_65358, binop_y_74692);\n                int64_t max_res_72244;\n                \n                max_res_72244 = ((__global int64_t *) mem_77751)[gtid_72221 *\n                                                                 n_m_65352 +\n                                                                 gtid_72222];\n                \n                float defunc_1_f_res_72245;\n                \n                defunc_1_f_res_72245 = ((__global\n                                         float *) mem_77755)[gtid_72221 *\n                                                             n",
                   "_m_65352 +\n                                                             gtid_72222];\n                \n                float a12_72246;\n                \n                a12_72246 = ((__global float *) mem_77781)[gtid_72221 *\n                                                           n_m_65352 +\n                                                           gtid_72222];\n                \n                float b12_72247;\n                \n                b12_72247 = ((__global float *) mem_77785)[gtid_72221 *\n                                                           n_m_65352 +\n                                                           gtid_72222];\n                \n                float c12_72248;\n                \n                c12_72248 = ((__global float *) mem_77789)[gtid_72221 *\n                                                           n_m_65352 +\n                                                           gtid_72222];\n                \n                float b2_72249;\n                \n                b2_72249 = ((__global float *) mem_77793)[gtid_72221 *\n                                                          n_m_65352 +\n                                                          gtid_72222];\n                \n                float c2_72250;\n                \n                c2_72250 = ((__global float *) mem_77797)[gtid_72221 *\n                                                          n_m_65352 +\n                                                          gtid_72222];\n                \n                float x_72252;\n                \n                x_72252 = ((__global float *) mem_77640)[gtid_72221 * q_65346 +\n                                                         gtid_72223];\n                \n                bool cond_72253 = sle64(last_res_72231, gtid_72223);\n                int64_t defunc_0_f_res_72254;\n                \n                if (cond_72253) {\n                    defunc_0_f_res_72254 = (int64_t) 0;\n                } else {\n                    int64_t i_7225",
                   "5 = add64(gtid_72223, max_res_72244);\n                    int64_t defunc_0_add_arg_72256;\n                    \n                    defunc_0_add_arg_72256 = ((__global\n                                               int64_t *) mem_77616)[gtid_72221 *\n                                                                     n_65344 +\n                                                                     i_72255];\n                    \n                    int64_t defunc_1_add_res_72257 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_72256);\n                    \n                    defunc_0_f_res_72254 = defunc_1_add_res_72257;\n                }\n                \n                int64_t binop_p_72258 = sub64(defunc_0_f_res_72254,\n                                              index_primexp_74693);\n                float defunc_0_f_res_72259 = sitofp_i64_f32(binop_p_72258);\n                float abs_res_72260 = (float) fabs(defunc_0_f_res_72259);\n                float tmp1_72261 = abs_res_72260 / defunc_1_f_res_72245;\n                float x_72262 = tmp1_72261 * tmp1_72261;\n                float y_72263 = tmp1_72261 * x_72262;\n                float tmp2_72264 = 1.0F - y_72263;\n                float x_72265 = tmp2_72264 * tmp2_72264;\n                float tmp3_72266 = tmp2_72264 * x_72265;\n                float tmp4_72267 = x_72252 * tmp3_72266;\n                float defunc_1_f_res_72268 = defunc_0_f_res_72259 * tmp4_72267;\n                float defunc_1_f_res_72269 = defunc_0_f_res_72259 *\n                      defunc_1_f_res_72268;\n                float defunc_0_f_res_72270;\n                \n                if (cond_72253) {\n                    defunc_0_f_res_72270 = 0.0F;\n                } else {\n                    int64_t i_72271 = add64(gtid_72223, max_res_72244);\n                    float defunc_0_add_arg_72272;\n                    \n                    defunc_0_add_arg_72272 = ((__global\n                                         ",
                   "      float *) mem_77612)[gtid_72221 *\n                                                                   n_65344 +\n                                                                   i_72271];\n                    defunc_0_f_res_72270 = defunc_0_add_arg_72272;\n                }\n                \n                float x_72273 = a12_72246 * tmp4_72267;\n                float y_72274 = b12_72247 * defunc_1_f_res_72268;\n                float x_72275 = x_72273 + y_72274;\n                float y_72276 = c12_72248 * defunc_1_f_res_72269;\n                float x_72277 = x_72275 + y_72276;\n                float defunc_9_fit_fun_res_72278 = defunc_0_f_res_72270 *\n                      x_72277;\n                float x_72279 = b12_72247 * tmp4_72267;\n                float y_72280 = b2_72249 * defunc_1_f_res_72268;\n                float x_72281 = x_72279 + y_72280;\n                float y_72282 = c2_72250 * defunc_1_f_res_72269;\n                float x_72283 = x_72281 + y_72282;\n                float defunc_9_slope_fun_res_72284 = defunc_0_f_res_72270 *\n                      x_72283;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_72225 = x_acc_79496;\n                    x_72226 = x_acc_79497;\n                }\n                // load new values\n                {\n                    x_72227 = defunc_9_fit_fun_res_72278;\n                    x_72228 = defunc_9_slope_fun_res_72284;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_72229 = x_72225 + x_72227;\n                    float defunc_1_op_res_72230 = x_72226 + x_72228;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_79496 = defunc_1_op_res_72229;\n                        x_acc_79497 = defunc_1_op_res_72230;\n                    }\n                }\n            }\n        }\n        // to redu",
                   "ce current chunk, first store our result in memory\n        {\n            x_72225 = x_acc_79496;\n            x_72226 = x_acc_79497;\n            ((__local\n              float *) red_arr_mem_79481)[sext_i32_i64(local_tid_79477)] =\n                x_72225;\n            ((__local\n              float *) red_arr_mem_79483)[sext_i32_i64(local_tid_79477)] =\n                x_72226;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_79506;\n        int32_t skip_waves_79507 = 1;\n        float x_79499;\n        float x_79500;\n        float x_79501;\n        float x_79502;\n        \n        offset_79506 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_79477,\n                      sext_i64_i32(segred_group_sizze_72216))) {\n                x_79499 = ((__local\n                            float *) red_arr_mem_79481)[sext_i32_i64(local_tid_79477 +\n                                                        offset_79506)];\n                x_79500 = ((__local\n                            float *) red_arr_mem_79483)[sext_i32_i64(local_tid_79477 +\n                                                        offset_79506)];\n            }\n        }\n        offset_79506 = 1;\n        while (slt32(offset_79506, wave_sizze_79479)) {\n            if (slt32(local_tid_79477 + offset_79506,\n                      sext_i64_i32(segred_group_sizze_72216)) &&\n                ((local_tid_79477 - squot32(local_tid_79477, wave_sizze_79479) *\n                  wave_sizze_79479) & (2 * offset_79506 - 1)) == 0) {\n                // read array element\n                {\n                    x_79501 = ((volatile __local\n                                float *) red_arr_mem_79481)[sext_i32_i64(local_tid_79477 +\n                                                            offset_79506)];\n                    x_79502 = ((volatile __local\n                                float *) red_arr_mem_79483)[sext_i32_i64(local_tid_79477 +\n                       ",
                   "                                     offset_79506)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_79503 = x_79499 + x_79501;\n                    float defunc_1_op_res_79504 = x_79500 + x_79502;\n                    \n                    x_79499 = defunc_1_op_res_79503;\n                    x_79500 = defunc_1_op_res_79504;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_79481)[sext_i32_i64(local_tid_79477)] =\n                        x_79499;\n                    ((volatile __local\n                      float *) red_arr_mem_79483)[sext_i32_i64(local_tid_79477)] =\n                        x_79500;\n                }\n            }\n            offset_79506 *= 2;\n        }\n        while (slt32(skip_waves_79507,\n                     squot32(sext_i64_i32(segred_group_sizze_72216) +\n                             wave_sizze_79479 - 1, wave_sizze_79479))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_79506 = skip_waves_79507 * wave_sizze_79479;\n            if (slt32(local_tid_79477 + offset_79506,\n                      sext_i64_i32(segred_group_sizze_72216)) &&\n                ((local_tid_79477 - squot32(local_tid_79477, wave_sizze_79479) *\n                  wave_sizze_79479) == 0 && (squot32(local_tid_79477,\n                                                     wave_sizze_79479) & (2 *\n                                                                          skip_waves_79507 -\n                                                                          1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_79501 = ((__local\n                                float *) red_arr_mem_79481)[sext_i32_i64(local_tid_79477 +\n                                                            offset_79506)];\n                    x_79502 = ((__local\n ",
                   "                               float *) red_arr_mem_79483)[sext_i32_i64(local_tid_79477 +\n                                                            offset_79506)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_79503 = x_79499 + x_79501;\n                    float defunc_1_op_res_79504 = x_79500 + x_79502;\n                    \n                    x_79499 = defunc_1_op_res_79503;\n                    x_79500 = defunc_1_op_res_79504;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_79481)[sext_i32_i64(local_tid_79477)] =\n                        x_79499;\n                    ((__local\n                      float *) red_arr_mem_79483)[sext_i32_i64(local_tid_79477)] =\n                        x_79500;\n                }\n            }\n            skip_waves_79507 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_79477) == (int64_t) 0) {\n                x_acc_79496 = x_79499;\n                x_acc_79497 = x_79500;\n            }\n        }\n        if (groups_per_segment_79465 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_79477 == 0) {\n                    ((__global float *) mem_77802)[gtid_72221 * n_m_65352 +\n                                                   gtid_72222] = x_acc_79496;\n                    ((__global float *) mem_77806)[gtid_72221 * n_m_65352 +\n                                                   gtid_72222] = x_acc_79497;\n                }\n            }\n        } else {\n            int32_t old_counter_79508;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_79477 == 0) {\n                    ((__global\n                  ",
                   "    float *) segred_tmp_mem_79470)[sext_i32_i64(virt_group_id_79489)] =\n                        x_acc_79496;\n                    ((__global\n                      float *) segred_tmp_mem_79472)[sext_i32_i64(virt_group_id_79489)] =\n                        x_acc_79497;\n                    mem_fence_global();\n                    old_counter_79508 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_79474)[sext_i32_i64(srem32(flat_segment_id_79490,\n                                                                                                     10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_79485)[(int64_t) 0] =\n                        old_counter_79508 == groups_per_segment_79465 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_79509;\n            \n            is_last_group_79509 = ((__local\n                                    bool *) sync_arr_mem_79485)[(int64_t) 0];\n            if (is_last_group_79509) {\n                if (local_tid_79477 == 0) {\n                    old_counter_79508 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_79474)[sext_i32_i64(srem32(flat_segment_id_79490,\n                                                                                                     10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_79465));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_79510 =\n                            sdiv_up64(groups_per_segment_79465,\n                                      segred_group_sizze",
                   "_72216);\n                    \n                    x_72225 = 0.0F;\n                    x_72226 = 0.0F;\n                    for (int64_t i_79511 = 0; i_79511 < read_per_thread_79510;\n                         i_79511++) {\n                        int64_t group_res_id_79512 =\n                                sext_i32_i64(local_tid_79477) *\n                                read_per_thread_79510 + i_79511;\n                        int64_t index_of_group_res_79513 =\n                                sext_i32_i64(flat_segment_id_79490) *\n                                groups_per_segment_79465 + group_res_id_79512;\n                        \n                        if (slt64(group_res_id_79512,\n                                  groups_per_segment_79465)) {\n                            x_72227 = ((__global\n                                        float *) segred_tmp_mem_79470)[index_of_group_res_79513];\n                            x_72228 = ((__global\n                                        float *) segred_tmp_mem_79472)[index_of_group_res_79513];\n                            \n                            float defunc_1_op_res_72229 = x_72225 + x_72227;\n                            float defunc_1_op_res_72230 = x_72226 + x_72228;\n                            \n                            x_72225 = defunc_1_op_res_72229;\n                            x_72226 = defunc_1_op_res_72230;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_79481)[sext_i32_i64(local_tid_79477)] =\n                    x_72225;\n                ((__local\n                  float *) red_arr_mem_79483)[sext_i32_i64(local_tid_79477)] =\n                    x_72226;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_79514;\n                    int32_t skip_waves_79515 = 1;\n                    float x_79499;\n                    float x_79500;\n             ",
                   "       float x_79501;\n                    float x_79502;\n                    \n                    offset_79514 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_79477,\n                                  sext_i64_i32(segred_group_sizze_72216))) {\n                            x_79499 = ((__local\n                                        float *) red_arr_mem_79481)[sext_i32_i64(local_tid_79477 +\n                                                                    offset_79514)];\n                            x_79500 = ((__local\n                                        float *) red_arr_mem_79483)[sext_i32_i64(local_tid_79477 +\n                                                                    offset_79514)];\n                        }\n                    }\n                    offset_79514 = 1;\n                    while (slt32(offset_79514, wave_sizze_79479)) {\n                        if (slt32(local_tid_79477 + offset_79514,\n                                  sext_i64_i32(segred_group_sizze_72216)) &&\n                            ((local_tid_79477 - squot32(local_tid_79477,\n                                                        wave_sizze_79479) *\n                              wave_sizze_79479) & (2 * offset_79514 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_79501 = ((volatile __local\n                                            float *) red_arr_mem_79481)[sext_i32_i64(local_tid_79477 +\n                                                                        offset_79514)];\n                                x_79502 = ((volatile __local\n                                            float *) red_arr_mem_79483)[sext_i32_i64(local_tid_79477 +\n                                                                        offset_79514)];\n                            }\n                            // a",
                   "pply reduction operation\n                            {\n                                float defunc_1_op_res_79503 = x_79499 + x_79501;\n                                float defunc_1_op_res_79504 = x_79500 + x_79502;\n                                \n                                x_79499 = defunc_1_op_res_79503;\n                                x_79500 = defunc_1_op_res_79504;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_79481)[sext_i32_i64(local_tid_79477)] =\n                                    x_79499;\n                                ((volatile __local\n                                  float *) red_arr_mem_79483)[sext_i32_i64(local_tid_79477)] =\n                                    x_79500;\n                            }\n                        }\n                        offset_79514 *= 2;\n                    }\n                    while (slt32(skip_waves_79515,\n                                 squot32(sext_i64_i32(segred_group_sizze_72216) +\n                                         wave_sizze_79479 - 1,\n                                         wave_sizze_79479))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_79514 = skip_waves_79515 * wave_sizze_79479;\n                        if (slt32(local_tid_79477 + offset_79514,\n                                  sext_i64_i32(segred_group_sizze_72216)) &&\n                            ((local_tid_79477 - squot32(local_tid_79477,\n                                                        wave_sizze_79479) *\n                              wave_sizze_79479) == 0 &&\n                             (squot32(local_tid_79477, wave_sizze_79479) & (2 *\n                                                                            skip_waves_79515 -\n                                                                            1)) ==\n     ",
                   "                        0)) {\n                            // read array element\n                            {\n                                x_79501 = ((__local\n                                            float *) red_arr_mem_79481)[sext_i32_i64(local_tid_79477 +\n                                                                        offset_79514)];\n                                x_79502 = ((__local\n                                            float *) red_arr_mem_79483)[sext_i32_i64(local_tid_79477 +\n                                                                        offset_79514)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_79503 = x_79499 + x_79501;\n                                float defunc_1_op_res_79504 = x_79500 + x_79502;\n                                \n                                x_79499 = defunc_1_op_res_79503;\n                                x_79500 = defunc_1_op_res_79504;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_79481)[sext_i32_i64(local_tid_79477)] =\n                                    x_79499;\n                                ((__local\n                                  float *) red_arr_mem_79483)[sext_i32_i64(local_tid_79477)] =\n                                    x_79500;\n                            }\n                        }\n                        skip_waves_79515 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_79477 == 0) {\n                            ((__global float *) mem_77802)[gtid_72221 *\n                                                           n_m_65352 +\n                                                           gtid_72222] =\n  ",
                   "                              x_79499;\n                            ((__global float *) mem_77806)[gtid_72221 *\n                                                           n_m_65352 +\n                                                           gtid_72222] =\n                                x_79500;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_72216\n}\n__kernel void mainzisegred_small_68229(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *red_arr_mem_78493_backing_aligned_0,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_68223,\n                                       int64_t segment_sizze_nonzzero_78486,\n                                       __global unsigned char *mem_77082,\n                                       __global unsigned char *mem_77090,\n                                       __global unsigned char *mem_77114,\n                                       __global unsigned char *mem_77170,\n                                       __global unsigned char *mem_77174,\n                                       __global unsigned char *mem_77179)\n{\n    #define segred_group_sizze_68222 (mainzisegred_group_sizze_67302)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_78493_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_78493_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_t",
                   "id_78488;\n    int32_t local_tid_78489;\n    int64_t group_sizze_78492;\n    int32_t wave_sizze_78491;\n    int32_t group_tid_78490;\n    \n    global_tid_78488 = get_global_id(0);\n    local_tid_78489 = get_local_id(0);\n    group_sizze_78492 = get_local_size(0);\n    wave_sizze_78491 = LOCKSTEP_WIDTH;\n    group_tid_78490 = get_group_id(0);\n    \n    int32_t phys_tid_68229 = global_tid_78488;\n    __local unsigned char *red_arr_mem_78493;\n    \n    red_arr_mem_78493 = (__local unsigned char *) red_arr_mem_78493_backing_0;\n    \n    int32_t phys_group_id_78495;\n    \n    phys_group_id_78495 = get_group_id(0);\n    for (int32_t i_78496 = 0; i_78496 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_65343 * n_m_65352,\n                                          squot64(segred_group_sizze_68222,\n                                                  segment_sizze_nonzzero_78486))) -\n                   phys_group_id_78495, sext_i64_i32(num_groups_68223));\n         i_78496++) {\n        int32_t virt_group_id_78497 = phys_group_id_78495 + i_78496 *\n                sext_i64_i32(num_groups_68223);\n        int64_t slice_78498 = n_m_65352;\n        int64_t slice_78499 = m_65343 * slice_78498;\n        int64_t gtid_68226 = squot64(squot64(sext_i32_i64(local_tid_78489),\n                                             segment_sizze_nonzzero_78486) +\n                                     sext_i32_i64(virt_group_id_78497) *\n                                     squot64(segred_group_sizze_68222,\n                                             segment_sizze_nonzzero_78486),\n                                     slice_78498);\n        int64_t remnant_78500 = squot64(sext_i32_i64(local_tid_78489),\n                                        segment_sizze_nonzzero_78486) +\n                sext_i32_i64(virt_group_id_78497) *\n                squot64(segred_group_sizze_68222,\n                        segment_sizze_nonzzero_78486) - gtid_68226 *\n                slice_78498;\n        int64_t gtid_68227 = remnant_78500;\n        int64_t ",
                   "remnant_78501 = remnant_78500 - gtid_68227;\n        int64_t gtid_68228 = srem64(sext_i32_i64(local_tid_78489), q_65346);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_65346) && ((slt64(gtid_68226, m_65343) &&\n                                                 slt64(gtid_68227,\n                                                       n_m_65352)) &&\n                                                slt64(sext_i32_i64(local_tid_78489),\n                                                      q_65346 *\n                                                      squot64(segred_group_sizze_68222,\n                                                              segment_sizze_nonzzero_78486)))) {\n                int64_t last_res_68233;\n                \n                last_res_68233 = ((__global int64_t *) mem_77082)[gtid_68226 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74680 = mul64(jump_65348, gtid_68227);\n                int64_t index_primexp_74681 = smin64(i_65358, binop_y_74680);\n                float defunc_1_f_res_68241;\n                \n                defunc_1_f_res_68241 = ((__global\n                                         float *) mem_77174)[gtid_68226 *\n                                                             n_m_65352 +\n                                                             gtid_68227];\n                \n                float x_68243;\n                \n                x_68243 = ((__global float *) mem_77114)[gtid_68226 * q_65346 +\n                                                         gtid_68228];\n                \n                bool cond_68244 = sle64(last_res_68233, gtid_68228);\n                int64_t defunc_0_f_res_68245;\n                \n                if (cond_68244) {\n                    defunc_0_f_res_68245 = (int64_t) 0;\n                } else {\n  ",
                   "                  int64_t max_res_68240;\n                    \n                    max_res_68240 = ((__global\n                                      int64_t *) mem_77170)[gtid_68226 *\n                                                            n_m_65352 +\n                                                            gtid_68227];\n                    \n                    int64_t i_68246 = add64(gtid_68228, max_res_68240);\n                    int64_t defunc_0_add_arg_68247;\n                    \n                    defunc_0_add_arg_68247 = ((__global\n                                               int64_t *) mem_77090)[gtid_68226 *\n                                                                     n_65344 +\n                                                                     i_68246];\n                    \n                    int64_t defunc_1_add_res_68248 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_68247);\n                    \n                    defunc_0_f_res_68245 = defunc_1_add_res_68248;\n                }\n                \n                int64_t binop_p_68249 = sub64(defunc_0_f_res_68245,\n                                              index_primexp_74681);\n                float defunc_0_f_res_68250 = sitofp_i64_f32(binop_p_68249);\n                float abs_res_68251 = (float) fabs(defunc_0_f_res_68250);\n                float tmp1_68252 = abs_res_68251 / defunc_1_f_res_68241;\n                float x_68253 = tmp1_68252 * tmp1_68252;\n                float y_68254 = tmp1_68252 * x_68253;\n                float tmp2_68255 = 1.0F - y_68254;\n                float x_68256 = tmp2_68255 * tmp2_68255;\n                float tmp3_68257 = tmp2_68255 * x_68256;\n                float w_j_68258 = x_68243 * tmp3_68257;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_78493)",
                   "[sext_i32_i64(local_tid_78489)] =\n                        w_j_68258;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_78493)[sext_i32_i64(local_tid_78489)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_65346)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_68230;\n                float x_68231;\n                float x_78502;\n                float x_78503;\n                bool ltid_in_bounds_78505 = slt64(sext_i32_i64(local_tid_78489),\n                                                  q_65346 *\n                                                  squot64(segred_group_sizze_68222,\n                                                          segment_sizze_nonzzero_78486));\n                int32_t skip_threads_78506;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_78505) {\n                        x_68231 = ((volatile __local\n                                    float *) red_arr_mem_78493)[sext_i32_i64(local_tid_78489)];\n                        if ((local_tid_78489 - squot32(local_tid_78489, 32) *\n                             32) == 0) {\n                            x_68230 = x_68231;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_78506 = 1;\n                    while (slt32(skip_threads_78506, 32)) {\n                        bool thread_active_78507 = sle32(skip_threads_78506,\n                                                         local_tid_78489 -\n                                                         squot32(local_tid_78489,\n                                                                 32) * 32) &&\n                             ltid_in_bounds_78505;\n                        \n              ",
                   "          if (thread_active_78507) {\n                            // read operands\n                            {\n                                x_68230 = ((volatile __local\n                                            float *) red_arr_mem_78493)[sext_i32_i64(local_tid_78489) -\n                                                                        sext_i32_i64(skip_threads_78506)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_78508 =\n                                 slt64(srem64(sext_i32_i64(local_tid_78489),\n                                              q_65346),\n                                       sext_i32_i64(local_tid_78489) -\n                                       sext_i32_i64(local_tid_78489 -\n                                       skip_threads_78506));\n                            \n                            if (thread_active_78507 && inactive_78508) {\n                                x_68230 = x_68231;\n                            }\n                            if (thread_active_78507) {\n                                if (!inactive_78508) {\n                                    float defunc_1_op_res_68232 = x_68230 +\n                                          x_68231;\n                                    \n                                    x_68230 = defunc_1_op_res_68232;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_78491, skip_threads_78506)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_78507) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_78493)[sext_i32_i64(local_tid_78489)] =\n                                    x_68230;\n             ",
                   "                   x_68231 = x_68230;\n                            }\n                        }\n                        if (sle32(wave_sizze_78491, skip_threads_78506)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_78506 *= 2;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // last thread of block 'i' writes its result to offset 'i'\n                {\n                    if ((local_tid_78489 - squot32(local_tid_78489, 32) * 32) ==\n                        31 && ltid_in_bounds_78505) {\n                        ((volatile __local\n                          float *) red_arr_mem_78493)[sext_i32_i64(squot32(local_tid_78489,\n                                                                           32))] =\n                            x_68230;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_78509;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_78489, 32) == 0 &&\n                            ltid_in_bounds_78505) {\n                            x_78503 = ((volatile __local\n                                        float *) red_arr_mem_78493)[sext_i32_i64(local_tid_78489)];\n                            if ((local_tid_78489 - squot32(local_tid_78489,\n                                                           32) * 32) == 0) {\n                                x_78502 = x_78503;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_78509 = 1;\n                        while (slt32(skip_threads_78509, 32)) {\n                         ",
                   "   bool thread_active_78510 = sle32(skip_threads_78509,\n                                                             local_tid_78489 -\n                                                             squot32(local_tid_78489,\n                                                                     32) *\n                                                             32) &&\n                                 (squot32(local_tid_78489, 32) == 0 &&\n                                  ltid_in_bounds_78505);\n                            \n                            if (thread_active_78510) {\n                                // read operands\n                                {\n                                    x_78502 = ((volatile __local\n                                                float *) red_arr_mem_78493)[sext_i32_i64(local_tid_78489) -\n                                                                            sext_i32_i64(skip_threads_78509)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_78511 =\n                                     slt64(srem64(sext_i32_i64(local_tid_78489 *\n                                                  32 + 32 - 1), q_65346),\n                                           sext_i32_i64(local_tid_78489 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_78489 -\n                                                         skip_threads_78509) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_78510 && inactive_78511) {\n                                    x_78502 = x_78503;\n                                }\n                                if (thread_active_78510) {\n                                    if (!inactive_78511) {\n                                        floa",
                   "t defunc_1_op_res_78504 = x_78502 +\n                                              x_78503;\n                                        \n                                        x_78502 = defunc_1_op_res_78504;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_78491, skip_threads_78509)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_78510) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_78493)[sext_i32_i64(local_tid_78489)] =\n                                        x_78502;\n                                    x_78503 = x_78502;\n                                }\n                            }\n                            if (sle32(wave_sizze_78491, skip_threads_78509)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_78509 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_78512 = squot32(local_tid_78489, 32) == 0 ||\n                     !ltid_in_bounds_78505;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_78512) {\n                            x_68231 = x_68230;\n                            x_68230 = ((__local\n                                        float *) red_arr_mem_78493)[sext_i32_i64(squot32(local_tid_78489,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n    ",
                   "                    }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_78513 =\n                             slt64(srem64(sext_i32_i64(local_tid_78489),\n                                          q_65346),\n                                   sext_i32_i64(local_tid_78489) -\n                                   sext_i32_i64(squot32(local_tid_78489, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_78512) {\n                            if (inactive_78513) {\n                                x_68230 = x_68231;\n                            }\n                        }\n                        if (!no_carry_in_78512) {\n                            if (!inactive_78513) {\n                                float defunc_1_op_res_68232 = x_68230 + x_68231;\n                                \n                                x_68230 = defunc_1_op_res_68232;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_78512) {\n                            ((__local\n                              float *) red_arr_mem_78493)[sext_i32_i64(local_tid_78489)] =\n                                x_68230;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_78489, 32) == 0 &&\n                        ltid_in_bounds_78505) {\n                        ((__local\n                          float *) red_arr_mem_78493)[sext_i32_i64(local_tid_78489)] =\n                            x_68231;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n   ",
                   "         if (slt64(sext_i32_i64(virt_group_id_78497) *\n                      squot64(segred_group_sizze_68222,\n                              segment_sizze_nonzzero_78486) +\n                      sext_i32_i64(local_tid_78489), m_65343 * n_m_65352) &&\n                slt64(sext_i32_i64(local_tid_78489),\n                      squot64(segred_group_sizze_68222,\n                              segment_sizze_nonzzero_78486))) {\n                float tmp_78514;\n                \n                tmp_78514 = ((__local\n                              float *) red_arr_mem_78493)[(sext_i32_i64(local_tid_78489) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_78486 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77179)[squot64(sext_i32_i64(virt_group_id_78497) *\n                                              squot64(segred_group_sizze_68222,\n                                                      segment_sizze_nonzzero_78486) +\n                                              sext_i32_i64(local_tid_78489),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_78497) *\n                                       squot64(segred_group_sizze_68222,\n                                               segment_sizze_nonzzero_78486) +\n                                       sext_i32_i64(local_tid_78489) -\n                                       squot64(sext_i32_i64(virt_group_id_78497) *\n                                               squot64(segred_group_sizze_68222,\n                                                       segment_sizze_nonzzero_78486) +\n                                               sext_i32_i64(local_tid_78489),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_78514;\n        ",
                   "    }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_68222\n}\n__kernel void mainzisegred_small_68279(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *red_arr_mem_78575_backing_aligned_0,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_68273,\n                                       int64_t segment_sizze_nonzzero_78568,\n                                       __global unsigned char *mem_77082,\n                                       __global unsigned char *mem_77086,\n                                       __global unsigned char *mem_77090,\n                                       __global unsigned char *mem_77114,\n                                       __global unsigned char *mem_77170,\n                                       __global unsigned char *mem_77174,\n                                       __global unsigned char *mem_77184,\n                                       __global unsigned char *mem_77189)\n{\n    #define segred_group_sizze_68272 (mainzisegred_group_sizze_67234)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_78575_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_78575_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78570;\n    int32_t local_tid_78571;\n    int64_t group_sizze_78574;\n    int32_t wave_sizze_78573;\n    int32_t group_tid_78572;\n    \n    global_tid_78570 = get_global_id(0);\n    local",
                   "_tid_78571 = get_local_id(0);\n    group_sizze_78574 = get_local_size(0);\n    wave_sizze_78573 = LOCKSTEP_WIDTH;\n    group_tid_78572 = get_group_id(0);\n    \n    int32_t phys_tid_68279 = global_tid_78570;\n    __local unsigned char *red_arr_mem_78575;\n    \n    red_arr_mem_78575 = (__local unsigned char *) red_arr_mem_78575_backing_0;\n    \n    int32_t phys_group_id_78577;\n    \n    phys_group_id_78577 = get_group_id(0);\n    for (int32_t i_78578 = 0; i_78578 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_65343 * n_m_65352,\n                                          squot64(segred_group_sizze_68272,\n                                                  segment_sizze_nonzzero_78568))) -\n                   phys_group_id_78577, sext_i64_i32(num_groups_68273));\n         i_78578++) {\n        int32_t virt_group_id_78579 = phys_group_id_78577 + i_78578 *\n                sext_i64_i32(num_groups_68273);\n        int64_t slice_78580 = n_m_65352;\n        int64_t slice_78581 = m_65343 * slice_78580;\n        int64_t gtid_68276 = squot64(squot64(sext_i32_i64(local_tid_78571),\n                                             segment_sizze_nonzzero_78568) +\n                                     sext_i32_i64(virt_group_id_78579) *\n                                     squot64(segred_group_sizze_68272,\n                                             segment_sizze_nonzzero_78568),\n                                     slice_78580);\n        int64_t remnant_78582 = squot64(sext_i32_i64(local_tid_78571),\n                                        segment_sizze_nonzzero_78568) +\n                sext_i32_i64(virt_group_id_78579) *\n                squot64(segred_group_sizze_68272,\n                        segment_sizze_nonzzero_78568) - gtid_68276 *\n                slice_78580;\n        int64_t gtid_68277 = remnant_78582;\n        int64_t remnant_78583 = remnant_78582 - gtid_68277;\n        int64_t gtid_68278 = srem64(sext_i32_i64(local_tid_78571), q_65346);\n        \n        // apply map function if in bounds\n        {\n ",
                   "           if (slt64((int64_t) 0, q_65346) && ((slt64(gtid_68276, m_65343) &&\n                                                 slt64(gtid_68277,\n                                                       n_m_65352)) &&\n                                                slt64(sext_i32_i64(local_tid_78571),\n                                                      q_65346 *\n                                                      squot64(segred_group_sizze_68272,\n                                                              segment_sizze_nonzzero_78568)))) {\n                int64_t last_res_68283;\n                \n                last_res_68283 = ((__global int64_t *) mem_77082)[gtid_68276 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74676 = mul64(jump_65348, gtid_68277);\n                int64_t index_primexp_74677 = smin64(i_65358, binop_y_74676);\n                int64_t max_res_68292;\n                \n                max_res_68292 = ((__global int64_t *) mem_77170)[gtid_68276 *\n                                                                 n_m_65352 +\n                                                                 gtid_68277];\n                \n                float defunc_1_f_res_68293;\n                \n                defunc_1_f_res_68293 = ((__global\n                                         float *) mem_77174)[gtid_68276 *\n                                                             n_m_65352 +\n                                                             gtid_68277];\n                \n                float a0_68294;\n                \n                a0_68294 = ((__global float *) mem_77184)[gtid_68276 *\n                                                          n_m_65352 +\n                                                          gtid_68277];\n                \n                float x_68296;\n                \n                ",
                   "x_68296 = ((__global float *) mem_77114)[gtid_68276 * q_65346 +\n                                                         gtid_68278];\n                \n                bool cond_68297 = sle64(last_res_68283, gtid_68278);\n                int64_t defunc_0_f_res_68298;\n                \n                if (cond_68297) {\n                    defunc_0_f_res_68298 = (int64_t) 0;\n                } else {\n                    int64_t i_68299 = add64(gtid_68278, max_res_68292);\n                    int64_t defunc_0_add_arg_68300;\n                    \n                    defunc_0_add_arg_68300 = ((__global\n                                               int64_t *) mem_77090)[gtid_68276 *\n                                                                     n_65344 +\n                                                                     i_68299];\n                    \n                    int64_t defunc_1_add_res_68301 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_68300);\n                    \n                    defunc_0_f_res_68298 = defunc_1_add_res_68301;\n                }\n                \n                int64_t binop_p_68302 = sub64(defunc_0_f_res_68298,\n                                              index_primexp_74677);\n                float defunc_0_f_res_68303 = sitofp_i64_f32(binop_p_68302);\n                float abs_res_68304 = (float) fabs(defunc_0_f_res_68303);\n                float tmp1_68305 = abs_res_68304 / defunc_1_f_res_68293;\n                float x_68306 = tmp1_68305 * tmp1_68305;\n                float y_68307 = tmp1_68305 * x_68306;\n                float tmp2_68308 = 1.0F - y_68307;\n                float x_68309 = tmp2_68308 * tmp2_68308;\n                float tmp3_68310 = tmp2_68308 * x_68309;\n                float tmp4_68311 = x_68296 * tmp3_68310;\n                float defunc_0_f_res_68312;\n                \n                if (cond_68297) {\n                    defunc_0_f_res_68312 = 0.0F;\n                } else {\n",
                   "                    int64_t i_68313 = add64(gtid_68278, max_res_68292);\n                    float defunc_0_add_arg_68314;\n                    \n                    defunc_0_add_arg_68314 = ((__global\n                                               float *) mem_77086)[gtid_68276 *\n                                                                   n_65344 +\n                                                                   i_68313];\n                    defunc_0_f_res_68312 = defunc_0_add_arg_68314;\n                }\n                \n                float x_68315 = a0_68294 * tmp4_68311;\n                float defunc_9_fit_fun_res_68316 = defunc_0_f_res_68312 *\n                      x_68315;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_78575)[sext_i32_i64(local_tid_78571)] =\n                        defunc_9_fit_fun_res_68316;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_78575)[sext_i32_i64(local_tid_78571)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_65346)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_68280;\n                float x_68281;\n                float x_78584;\n                float x_78585;\n                bool ltid_in_bounds_78587 = slt64(sext_i32_i64(local_tid_78571),\n                                                  q_65346 *\n                                                  squot64(segred_group_sizze_68272,\n                                                          segment_sizze_nonzzero_78568));\n                int32_t skip_threads_78588;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_78587) {\n                        x_68281 = ((v",
                   "olatile __local\n                                    float *) red_arr_mem_78575)[sext_i32_i64(local_tid_78571)];\n                        if ((local_tid_78571 - squot32(local_tid_78571, 32) *\n                             32) == 0) {\n                            x_68280 = x_68281;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_78588 = 1;\n                    while (slt32(skip_threads_78588, 32)) {\n                        bool thread_active_78589 = sle32(skip_threads_78588,\n                                                         local_tid_78571 -\n                                                         squot32(local_tid_78571,\n                                                                 32) * 32) &&\n                             ltid_in_bounds_78587;\n                        \n                        if (thread_active_78589) {\n                            // read operands\n                            {\n                                x_68280 = ((volatile __local\n                                            float *) red_arr_mem_78575)[sext_i32_i64(local_tid_78571) -\n                                                                        sext_i32_i64(skip_threads_78588)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_78590 =\n                                 slt64(srem64(sext_i32_i64(local_tid_78571),\n                                              q_65346),\n                                       sext_i32_i64(local_tid_78571) -\n                                       sext_i32_i64(local_tid_78571 -\n                                       skip_threads_78588));\n                            \n                            if (thread_active_78589 && inactive_78590) {\n                                x_68280 = x_68281;\n                   ",
                   "         }\n                            if (thread_active_78589) {\n                                if (!inactive_78590) {\n                                    float defunc_1_op_res_68282 = x_68280 +\n                                          x_68281;\n                                    \n                                    x_68280 = defunc_1_op_res_68282;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_78573, skip_threads_78588)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_78589) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_78575)[sext_i32_i64(local_tid_78571)] =\n                                    x_68280;\n                                x_68281 = x_68280;\n                            }\n                        }\n                        if (sle32(wave_sizze_78573, skip_threads_78588)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_78588 *= 2;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // last thread of block 'i' writes its result to offset 'i'\n                {\n                    if ((local_tid_78571 - squot32(local_tid_78571, 32) * 32) ==\n                        31 && ltid_in_bounds_78587) {\n                        ((volatile __local\n                          float *) red_arr_mem_78575)[sext_i32_i64(squot32(local_tid_78571,\n                                                                           32))] =\n                            x_68280;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n            ",
                   "    {\n                    int32_t skip_threads_78591;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_78571, 32) == 0 &&\n                            ltid_in_bounds_78587) {\n                            x_78585 = ((volatile __local\n                                        float *) red_arr_mem_78575)[sext_i32_i64(local_tid_78571)];\n                            if ((local_tid_78571 - squot32(local_tid_78571,\n                                                           32) * 32) == 0) {\n                                x_78584 = x_78585;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_78591 = 1;\n                        while (slt32(skip_threads_78591, 32)) {\n                            bool thread_active_78592 = sle32(skip_threads_78591,\n                                                             local_tid_78571 -\n                                                             squot32(local_tid_78571,\n                                                                     32) *\n                                                             32) &&\n                                 (squot32(local_tid_78571, 32) == 0 &&\n                                  ltid_in_bounds_78587);\n                            \n                            if (thread_active_78592) {\n                                // read operands\n                                {\n                                    x_78584 = ((volatile __local\n                                                float *) red_arr_mem_78575)[sext_i32_i64(local_tid_78571) -\n                                                                            sext_i32_i64(skip_threads_78591)];\n                                }\n                            }\n                            // perform operation\n            ",
                   "                {\n                                bool inactive_78593 =\n                                     slt64(srem64(sext_i32_i64(local_tid_78571 *\n                                                  32 + 32 - 1), q_65346),\n                                           sext_i32_i64(local_tid_78571 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_78571 -\n                                                         skip_threads_78591) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_78592 && inactive_78593) {\n                                    x_78584 = x_78585;\n                                }\n                                if (thread_active_78592) {\n                                    if (!inactive_78593) {\n                                        float defunc_1_op_res_78586 = x_78584 +\n                                              x_78585;\n                                        \n                                        x_78584 = defunc_1_op_res_78586;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_78573, skip_threads_78591)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_78592) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_78575)[sext_i32_i64(local_tid_78571)] =\n                                        x_78584;\n                                    x_78585 = x_78584;\n                                }\n                            }\n                            if (sle32(wave_sizze_78573, skip_threads_78591)) {\n                                barrier(CLK_LOCAL_ME",
                   "M_FENCE);\n                            }\n                            skip_threads_78591 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_78594 = squot32(local_tid_78571, 32) == 0 ||\n                     !ltid_in_bounds_78587;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_78594) {\n                            x_68281 = x_68280;\n                            x_68280 = ((__local\n                                        float *) red_arr_mem_78575)[sext_i32_i64(squot32(local_tid_78571,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_78595 =\n                             slt64(srem64(sext_i32_i64(local_tid_78571),\n                                          q_65346),\n                                   sext_i32_i64(local_tid_78571) -\n                                   sext_i32_i64(squot32(local_tid_78571, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_78594) {\n                            if (inactive_78595) {\n                                x_68280 = x_68281;\n                            }\n                        }\n                        if (!no_carry_in_78594) {\n                            if (!inactive_78595) {\n                                float defunc_1_op_res_68282 = x_68280 + x_68281;\n                                \n                                x_68280 = defunc_1_op_res_68282;\n                            }\n                        }\n                    }\n         ",
                   "           // write final result\n                    {\n                        if (!no_carry_in_78594) {\n                            ((__local\n                              float *) red_arr_mem_78575)[sext_i32_i64(local_tid_78571)] =\n                                x_68280;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_78571, 32) == 0 &&\n                        ltid_in_bounds_78587) {\n                        ((__local\n                          float *) red_arr_mem_78575)[sext_i32_i64(local_tid_78571)] =\n                            x_68281;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_78579) *\n                      squot64(segred_group_sizze_68272,\n                              segment_sizze_nonzzero_78568) +\n                      sext_i32_i64(local_tid_78571), m_65343 * n_m_65352) &&\n                slt64(sext_i32_i64(local_tid_78571),\n                      squot64(segred_group_sizze_68272,\n                              segment_sizze_nonzzero_78568))) {\n                float tmp_78596;\n                \n                tmp_78596 = ((__local\n                              float *) red_arr_mem_78575)[(sext_i32_i64(local_tid_78571) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_78568 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77189)[squot64(sext_i32_i64(virt_group_id_78579) *\n                                              squot64(segred_group_sizze_68272,\n                                          ",
                   "            segment_sizze_nonzzero_78568) +\n                                              sext_i32_i64(local_tid_78571),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_78579) *\n                                       squot64(segred_group_sizze_68272,\n                                               segment_sizze_nonzzero_78568) +\n                                       sext_i32_i64(local_tid_78571) -\n                                       squot64(sext_i32_i64(virt_group_id_78579) *\n                                               squot64(segred_group_sizze_68272,\n                                                       segment_sizze_nonzzero_78568) +\n                                               sext_i32_i64(local_tid_78571),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_78596;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_68272\n}\n__kernel void mainzisegred_small_70052(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *red_arr_mem_78870_backing_aligned_0,\n                                       __local volatile\n                                       int64_t *red_arr_mem_78868_backing_aligned_1,\n                                       __local volatile\n                                       int64_t *red_arr_mem_78866_backing_aligned_2,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_70044,\n                                       int64_t segment_sizze_nonzzero_78859,\n                       ",
                   "                __global unsigned char *mem_77316,\n                                       __global unsigned char *mem_77324,\n                                       __global unsigned char *mem_77348,\n                                       __global unsigned char *mem_77435,\n                                       __global unsigned char *mem_77439,\n                                       __global unsigned char *mem_77444,\n                                       __global unsigned char *mem_77448,\n                                       __global unsigned char *mem_77452)\n{\n    #define segred_group_sizze_70043 (mainzisegred_group_sizze_69048)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_78870_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_78870_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_78868_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_78868_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_78866_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_78866_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78861;\n    int32_t local_tid_78862;\n    int64_t group_sizze_78865;\n    int32_t wave_sizze_78864;\n    int32_t group_tid_78863;\n    \n    global_tid_78861 = get_global_id(0);\n    local_tid_78862 = get_local_id(0);\n    group_sizze_78865 = get_local_size(0);\n    wave_sizze_78864 = LOCKSTEP_WIDTH;\n    group_tid_78863 = get_group_id(0);\n    \n    int32_t phys_tid_70052 = global_tid_78861;\n    __local unsigned char *red_arr_mem_78866;\n    \n    red_arr_mem_78866 = (__local unsigned char *) red_arr_mem_78866_backing_0;\n    \n    __local ",
                   "unsigned char *red_arr_mem_78868;\n    \n    red_arr_mem_78868 = (__local unsigned char *) red_arr_mem_78868_backing_1;\n    \n    __local unsigned char *red_arr_mem_78870;\n    \n    red_arr_mem_78870 = (__local unsigned char *) red_arr_mem_78870_backing_2;\n    \n    int32_t phys_group_id_78872;\n    \n    phys_group_id_78872 = get_group_id(0);\n    for (int32_t i_78873 = 0; i_78873 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_65343 * n_m_65352,\n                                          squot64(segred_group_sizze_70043,\n                                                  segment_sizze_nonzzero_78859))) -\n                   phys_group_id_78872, sext_i64_i32(num_groups_70044));\n         i_78873++) {\n        int32_t virt_group_id_78874 = phys_group_id_78872 + i_78873 *\n                sext_i64_i32(num_groups_70044);\n        int64_t slice_78875 = n_m_65352;\n        int64_t slice_78876 = m_65343 * slice_78875;\n        int64_t gtid_70049 = squot64(squot64(sext_i32_i64(local_tid_78862),\n                                             segment_sizze_nonzzero_78859) +\n                                     sext_i32_i64(virt_group_id_78874) *\n                                     squot64(segred_group_sizze_70043,\n                                             segment_sizze_nonzzero_78859),\n                                     slice_78875);\n        int64_t remnant_78877 = squot64(sext_i32_i64(local_tid_78862),\n                                        segment_sizze_nonzzero_78859) +\n                sext_i32_i64(virt_group_id_78874) *\n                squot64(segred_group_sizze_70043,\n                        segment_sizze_nonzzero_78859) - gtid_70049 *\n                slice_78875;\n        int64_t gtid_70050 = remnant_78877;\n        int64_t remnant_78878 = remnant_78877 - gtid_70050;\n        int64_t gtid_70051 = srem64(sext_i32_i64(local_tid_78862), q_65346);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_65346) && ((slt64(gtid_70049, m_65343) &&\n  ",
                   "                                               slt64(gtid_70050,\n                                                       n_m_65352)) &&\n                                                slt64(sext_i32_i64(local_tid_78862),\n                                                      q_65346 *\n                                                      squot64(segred_group_sizze_70043,\n                                                              segment_sizze_nonzzero_78859)))) {\n                int64_t last_res_70062;\n                \n                last_res_70062 = ((__global int64_t *) mem_77316)[gtid_70049 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74688 = mul64(jump_65348, gtid_70050);\n                int64_t index_primexp_74689 = smin64(i_65358, binop_y_74688);\n                float defunc_1_f_res_70070;\n                \n                defunc_1_f_res_70070 = ((__global\n                                         float *) mem_77439)[gtid_70049 *\n                                                             n_m_65352 +\n                                                             gtid_70050];\n                \n                float x_70072;\n                \n                x_70072 = ((__global float *) mem_77348)[gtid_70049 * q_65346 +\n                                                         gtid_70051];\n                \n                bool cond_70073 = sle64(last_res_70062, gtid_70051);\n                int64_t defunc_0_f_res_70074;\n                \n                if (cond_70073) {\n                    defunc_0_f_res_70074 = (int64_t) 0;\n                } else {\n                    int64_t max_res_70069;\n                    \n                    max_res_70069 = ((__global\n                                      int64_t *) mem_77435)[gtid_70049 *\n                                                            n_m_65352 +\n          ",
                   "                                                  gtid_70050];\n                    \n                    int64_t i_70075 = add64(gtid_70051, max_res_70069);\n                    int64_t defunc_0_add_arg_70076;\n                    \n                    defunc_0_add_arg_70076 = ((__global\n                                               int64_t *) mem_77324)[gtid_70049 *\n                                                                     n_65344 +\n                                                                     i_70075];\n                    \n                    int64_t defunc_1_add_res_70077 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_70076);\n                    \n                    defunc_0_f_res_70074 = defunc_1_add_res_70077;\n                }\n                \n                int64_t binop_p_70078 = sub64(defunc_0_f_res_70074,\n                                              index_primexp_74689);\n                float defunc_0_f_res_70079 = sitofp_i64_f32(binop_p_70078);\n                float abs_res_70080 = (float) fabs(defunc_0_f_res_70079);\n                float tmp1_70081 = abs_res_70080 / defunc_1_f_res_70070;\n                float x_70082 = tmp1_70081 * tmp1_70081;\n                float y_70083 = tmp1_70081 * x_70082;\n                float tmp2_70084 = 1.0F - y_70083;\n                float x_70085 = tmp2_70084 * tmp2_70084;\n                float tmp3_70086 = tmp2_70084 * x_70085;\n                float w_j_70087 = x_70072 * tmp3_70086;\n                float xw_j_70088 = defunc_0_f_res_70079 * w_j_70087;\n                float x2w_j_70089 = defunc_0_f_res_70079 * xw_j_70088;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_78866)[sext_i32_i64(local_tid_78862)] =\n                        w_j_70087;\n                    ((__local\n                      flo",
                   "at *) red_arr_mem_78868)[sext_i32_i64(local_tid_78862)] =\n                        xw_j_70088;\n                    ((__local\n                      float *) red_arr_mem_78870)[sext_i32_i64(local_tid_78862)] =\n                        x2w_j_70089;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_78866)[sext_i32_i64(local_tid_78862)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_78868)[sext_i32_i64(local_tid_78862)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_78870)[sext_i32_i64(local_tid_78862)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_65346)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_70053;\n                float x_70054;\n                float x_70055;\n                float x_70056;\n                float x_70057;\n                float x_70058;\n                float x_78879;\n                float x_78880;\n                float x_78881;\n                float x_78882;\n                float x_78883;\n                float x_78884;\n                bool ltid_in_bounds_78888 = slt64(sext_i32_i64(local_tid_78862),\n                                                  q_65346 *\n                                                  squot64(segred_group_sizze_70043,\n                                                          segment_sizze_nonzzero_78859));\n                int32_t skip_threads_78889;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_78888) {\n                        x_70056 = ((volatile __local\n                                    float *) red_arr_mem_78866)[sext_i32_i64(local_tid_78862)];\n                        x_70057 = ((volatile __local\n                                    float *) red_arr_mem_78868)[sext_i32_i64(local",
                   "_tid_78862)];\n                        x_70058 = ((volatile __local\n                                    float *) red_arr_mem_78870)[sext_i32_i64(local_tid_78862)];\n                        if ((local_tid_78862 - squot32(local_tid_78862, 32) *\n                             32) == 0) {\n                            x_70053 = x_70056;\n                            x_70054 = x_70057;\n                            x_70055 = x_70058;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_78889 = 1;\n                    while (slt32(skip_threads_78889, 32)) {\n                        bool thread_active_78890 = sle32(skip_threads_78889,\n                                                         local_tid_78862 -\n                                                         squot32(local_tid_78862,\n                                                                 32) * 32) &&\n                             ltid_in_bounds_78888;\n                        \n                        if (thread_active_78890) {\n                            // read operands\n                            {\n                                x_70053 = ((volatile __local\n                                            float *) red_arr_mem_78866)[sext_i32_i64(local_tid_78862) -\n                                                                        sext_i32_i64(skip_threads_78889)];\n                                x_70054 = ((volatile __local\n                                            float *) red_arr_mem_78868)[sext_i32_i64(local_tid_78862) -\n                                                                        sext_i32_i64(skip_threads_78889)];\n                                x_70055 = ((volatile __local\n                                            float *) red_arr_mem_78870)[sext_i32_i64(local_tid_78862) -\n                                                                        sext_i32_i64(skip_threads_7888",
                   "9)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_78891 =\n                                 slt64(srem64(sext_i32_i64(local_tid_78862),\n                                              q_65346),\n                                       sext_i32_i64(local_tid_78862) -\n                                       sext_i32_i64(local_tid_78862 -\n                                       skip_threads_78889));\n                            \n                            if (thread_active_78890 && inactive_78891) {\n                                x_70053 = x_70056;\n                                x_70054 = x_70057;\n                                x_70055 = x_70058;\n                            }\n                            if (thread_active_78890) {\n                                if (!inactive_78891) {\n                                    float defunc_1_op_res_70059 = x_70053 +\n                                          x_70056;\n                                    float defunc_1_op_res_70060 = x_70054 +\n                                          x_70057;\n                                    float defunc_1_op_res_70061 = x_70055 +\n                                          x_70058;\n                                    \n                                    x_70053 = defunc_1_op_res_70059;\n                                    x_70054 = defunc_1_op_res_70060;\n                                    x_70055 = defunc_1_op_res_70061;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_78864, skip_threads_78889)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_78890) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  floa",
                   "t *) red_arr_mem_78866)[sext_i32_i64(local_tid_78862)] =\n                                    x_70053;\n                                x_70056 = x_70053;\n                                ((volatile __local\n                                  float *) red_arr_mem_78868)[sext_i32_i64(local_tid_78862)] =\n                                    x_70054;\n                                x_70057 = x_70054;\n                                ((volatile __local\n                                  float *) red_arr_mem_78870)[sext_i32_i64(local_tid_78862)] =\n                                    x_70055;\n                                x_70058 = x_70055;\n                            }\n                        }\n                        if (sle32(wave_sizze_78864, skip_threads_78889)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_78889 *= 2;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // last thread of block 'i' writes its result to offset 'i'\n                {\n                    if ((local_tid_78862 - squot32(local_tid_78862, 32) * 32) ==\n                        31 && ltid_in_bounds_78888) {\n                        ((volatile __local\n                          float *) red_arr_mem_78866)[sext_i32_i64(squot32(local_tid_78862,\n                                                                           32))] =\n                            x_70053;\n                        ((volatile __local\n                          float *) red_arr_mem_78868)[sext_i32_i64(squot32(local_tid_78862,\n                                                                           32))] =\n                            x_70054;\n                        ((volatile __local\n                          float *) red_arr_mem_78870)[sext_i32_i64(squot32(local_tid_78862,\n                                                                           32))] =\n                            x_70055;\n                   ",
                   " }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_78892;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_78862, 32) == 0 &&\n                            ltid_in_bounds_78888) {\n                            x_78882 = ((volatile __local\n                                        float *) red_arr_mem_78866)[sext_i32_i64(local_tid_78862)];\n                            x_78883 = ((volatile __local\n                                        float *) red_arr_mem_78868)[sext_i32_i64(local_tid_78862)];\n                            x_78884 = ((volatile __local\n                                        float *) red_arr_mem_78870)[sext_i32_i64(local_tid_78862)];\n                            if ((local_tid_78862 - squot32(local_tid_78862,\n                                                           32) * 32) == 0) {\n                                x_78879 = x_78882;\n                                x_78880 = x_78883;\n                                x_78881 = x_78884;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_78892 = 1;\n                        while (slt32(skip_threads_78892, 32)) {\n                            bool thread_active_78893 = sle32(skip_threads_78892,\n                                                             local_tid_78862 -\n                                                             squot32(local_tid_78862,\n                                                                     32) *\n                                                             32) &&\n                                 (squot32(local_tid_78862, 32) == 0 &&\n                                  ltid_i",
                   "n_bounds_78888);\n                            \n                            if (thread_active_78893) {\n                                // read operands\n                                {\n                                    x_78879 = ((volatile __local\n                                                float *) red_arr_mem_78866)[sext_i32_i64(local_tid_78862) -\n                                                                            sext_i32_i64(skip_threads_78892)];\n                                    x_78880 = ((volatile __local\n                                                float *) red_arr_mem_78868)[sext_i32_i64(local_tid_78862) -\n                                                                            sext_i32_i64(skip_threads_78892)];\n                                    x_78881 = ((volatile __local\n                                                float *) red_arr_mem_78870)[sext_i32_i64(local_tid_78862) -\n                                                                            sext_i32_i64(skip_threads_78892)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_78894 =\n                                     slt64(srem64(sext_i32_i64(local_tid_78862 *\n                                                  32 + 32 - 1), q_65346),\n                                           sext_i32_i64(local_tid_78862 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_78862 -\n                                                         skip_threads_78892) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_78893 && inactive_78894) {\n                                    x_78879 = x_78882;\n                                    x_78880 = x_78883;\n                                    x_78881 = x_",
                   "78884;\n                                }\n                                if (thread_active_78893) {\n                                    if (!inactive_78894) {\n                                        float defunc_1_op_res_78885 = x_78879 +\n                                              x_78882;\n                                        float defunc_1_op_res_78886 = x_78880 +\n                                              x_78883;\n                                        float defunc_1_op_res_78887 = x_78881 +\n                                              x_78884;\n                                        \n                                        x_78879 = defunc_1_op_res_78885;\n                                        x_78880 = defunc_1_op_res_78886;\n                                        x_78881 = defunc_1_op_res_78887;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_78864, skip_threads_78892)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_78893) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_78866)[sext_i32_i64(local_tid_78862)] =\n                                        x_78879;\n                                    x_78882 = x_78879;\n                                    ((volatile __local\n                                      float *) red_arr_mem_78868)[sext_i32_i64(local_tid_78862)] =\n                                        x_78880;\n                                    x_78883 = x_78880;\n                                    ((volatile __local\n                                      float *) red_arr_mem_78870)[sext_i32_i64(local_tid_78862)] =\n                                        x_78881;\n                                    x_78884 = x",
                   "_78881;\n                                }\n                            }\n                            if (sle32(wave_sizze_78864, skip_threads_78892)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_78892 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_78895 = squot32(local_tid_78862, 32) == 0 ||\n                     !ltid_in_bounds_78888;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_78895) {\n                            x_70056 = x_70053;\n                            x_70057 = x_70054;\n                            x_70058 = x_70055;\n                            x_70053 = ((__local\n                                        float *) red_arr_mem_78866)[sext_i32_i64(squot32(local_tid_78862,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                            x_70054 = ((__local\n                                        float *) red_arr_mem_78868)[sext_i32_i64(squot32(local_tid_78862,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                            x_70055 = ((__local\n                                        float *) red_arr_mem_78870)[sext_i32_i64(squot32(local_tid_78862,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n",
                   "                        bool inactive_78896 =\n                             slt64(srem64(sext_i32_i64(local_tid_78862),\n                                          q_65346),\n                                   sext_i32_i64(local_tid_78862) -\n                                   sext_i32_i64(squot32(local_tid_78862, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_78895) {\n                            if (inactive_78896) {\n                                x_70053 = x_70056;\n                                x_70054 = x_70057;\n                                x_70055 = x_70058;\n                            }\n                        }\n                        if (!no_carry_in_78895) {\n                            if (!inactive_78896) {\n                                float defunc_1_op_res_70059 = x_70053 + x_70056;\n                                float defunc_1_op_res_70060 = x_70054 + x_70057;\n                                float defunc_1_op_res_70061 = x_70055 + x_70058;\n                                \n                                x_70053 = defunc_1_op_res_70059;\n                                x_70054 = defunc_1_op_res_70060;\n                                x_70055 = defunc_1_op_res_70061;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_78895) {\n                            ((__local\n                              float *) red_arr_mem_78866)[sext_i32_i64(local_tid_78862)] =\n                                x_70053;\n                            ((__local\n                              float *) red_arr_mem_78868)[sext_i32_i64(local_tid_78862)] =\n                                x_70054;\n                            ((__local\n                              float *) red_arr_mem_78870)[sext_i32_i64(local_tid_78862)] =\n                                x_70055;\n                        }\n    ",
                   "                }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_78862, 32) == 0 &&\n                        ltid_in_bounds_78888) {\n                        ((__local\n                          float *) red_arr_mem_78866)[sext_i32_i64(local_tid_78862)] =\n                            x_70056;\n                        ((__local\n                          float *) red_arr_mem_78868)[sext_i32_i64(local_tid_78862)] =\n                            x_70057;\n                        ((__local\n                          float *) red_arr_mem_78870)[sext_i32_i64(local_tid_78862)] =\n                            x_70058;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_78874) *\n                      squot64(segred_group_sizze_70043,\n                              segment_sizze_nonzzero_78859) +\n                      sext_i32_i64(local_tid_78862), m_65343 * n_m_65352) &&\n                slt64(sext_i32_i64(local_tid_78862),\n                      squot64(segred_group_sizze_70043,\n                              segment_sizze_nonzzero_78859))) {\n                float tmp_78897;\n                \n                tmp_78897 = ((__local\n                              float *) red_arr_mem_78866)[(sext_i32_i64(local_tid_78862) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_78859 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77444)[squot64(sext_i32_i64(virt_group_id_78874) *\n                                              squot64(segred_group_sizze_70043,\n                               ",
                   "                       segment_sizze_nonzzero_78859) +\n                                              sext_i32_i64(local_tid_78862),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_78874) *\n                                       squot64(segred_group_sizze_70043,\n                                               segment_sizze_nonzzero_78859) +\n                                       sext_i32_i64(local_tid_78862) -\n                                       squot64(sext_i32_i64(virt_group_id_78874) *\n                                               squot64(segred_group_sizze_70043,\n                                                       segment_sizze_nonzzero_78859) +\n                                               sext_i32_i64(local_tid_78862),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_78897;\n                \n                float tmp_78898;\n                \n                tmp_78898 = ((__local\n                              float *) red_arr_mem_78868)[(sext_i32_i64(local_tid_78862) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_78859 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77448)[squot64(sext_i32_i64(virt_group_id_78874) *\n                                              squot64(segred_group_sizze_70043,\n                                                      segment_sizze_nonzzero_78859) +\n                                              sext_i32_i64(local_tid_78862),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_78874) *\n                                       squot64(segred_group_sizze_70043,\n                                               segment_sizze_no",
                   "nzzero_78859) +\n                                       sext_i32_i64(local_tid_78862) -\n                                       squot64(sext_i32_i64(virt_group_id_78874) *\n                                               squot64(segred_group_sizze_70043,\n                                                       segment_sizze_nonzzero_78859) +\n                                               sext_i32_i64(local_tid_78862),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_78898;\n                \n                float tmp_78899;\n                \n                tmp_78899 = ((__local\n                              float *) red_arr_mem_78870)[(sext_i32_i64(local_tid_78862) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_78859 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77452)[squot64(sext_i32_i64(virt_group_id_78874) *\n                                              squot64(segred_group_sizze_70043,\n                                                      segment_sizze_nonzzero_78859) +\n                                              sext_i32_i64(local_tid_78862),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_78874) *\n                                       squot64(segred_group_sizze_70043,\n                                               segment_sizze_nonzzero_78859) +\n                                       sext_i32_i64(local_tid_78862) -\n                                       squot64(sext_i32_i64(virt_group_id_78874) *\n                                               squot64(segred_group_sizze_70043,\n                                                       segment_sizze_nonzzero_78859) +\n                                               sext_i32_i64(local_tid_78862)",
                   ",\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_78899;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_70043\n}\n__kernel void mainzisegred_small_70122(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *red_arr_mem_78978_backing_aligned_0,\n                                       __local volatile\n                                       int64_t *red_arr_mem_78976_backing_aligned_1,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_70115,\n                                       int64_t segment_sizze_nonzzero_78969,\n                                       __global unsigned char *mem_77316,\n                                       __global unsigned char *mem_77320,\n                                       __global unsigned char *mem_77324,\n                                       __global unsigned char *mem_77348,\n                                       __global unsigned char *mem_77435,\n                                       __global unsigned char *mem_77439,\n                                       __global unsigned char *mem_77457,\n                                       __global unsigned char *mem_77461,\n                                       __global unsigned char *mem_77465,\n                                       __global unsigned char *mem_77470,\n                                       __global unsigned char *mem_77474)\n{\n    #define segred_group_sizze_70114 (mainzisegred_group_sizze_68953)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n",
                   "    __local volatile unsigned char *restrict red_arr_mem_78978_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_78978_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_78976_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_78976_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_78971;\n    int32_t local_tid_78972;\n    int64_t group_sizze_78975;\n    int32_t wave_sizze_78974;\n    int32_t group_tid_78973;\n    \n    global_tid_78971 = get_global_id(0);\n    local_tid_78972 = get_local_id(0);\n    group_sizze_78975 = get_local_size(0);\n    wave_sizze_78974 = LOCKSTEP_WIDTH;\n    group_tid_78973 = get_group_id(0);\n    \n    int32_t phys_tid_70122 = global_tid_78971;\n    __local unsigned char *red_arr_mem_78976;\n    \n    red_arr_mem_78976 = (__local unsigned char *) red_arr_mem_78976_backing_0;\n    \n    __local unsigned char *red_arr_mem_78978;\n    \n    red_arr_mem_78978 = (__local unsigned char *) red_arr_mem_78978_backing_1;\n    \n    int32_t phys_group_id_78980;\n    \n    phys_group_id_78980 = get_group_id(0);\n    for (int32_t i_78981 = 0; i_78981 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_65343 * n_m_65352,\n                                          squot64(segred_group_sizze_70114,\n                                                  segment_sizze_nonzzero_78969))) -\n                   phys_group_id_78980, sext_i64_i32(num_groups_70115));\n         i_78981++) {\n        int32_t virt_group_id_78982 = phys_group_id_78980 + i_78981 *\n                sext_i64_i32(num_groups_70115);\n        int64_t slice_78983 = n_m_65352;\n        int64_t slice_78984 = m_65343 * slice_78983;\n        int64_t gtid_70119 = squot64(squot64(sext_i32_i64(local_tid_78972),\n                                             segment_sizze_nonzzero_78969) +\n                           ",
                   "          sext_i32_i64(virt_group_id_78982) *\n                                     squot64(segred_group_sizze_70114,\n                                             segment_sizze_nonzzero_78969),\n                                     slice_78983);\n        int64_t remnant_78985 = squot64(sext_i32_i64(local_tid_78972),\n                                        segment_sizze_nonzzero_78969) +\n                sext_i32_i64(virt_group_id_78982) *\n                squot64(segred_group_sizze_70114,\n                        segment_sizze_nonzzero_78969) - gtid_70119 *\n                slice_78983;\n        int64_t gtid_70120 = remnant_78985;\n        int64_t remnant_78986 = remnant_78985 - gtid_70120;\n        int64_t gtid_70121 = srem64(sext_i32_i64(local_tid_78972), q_65346);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_65346) && ((slt64(gtid_70119, m_65343) &&\n                                                 slt64(gtid_70120,\n                                                       n_m_65352)) &&\n                                                slt64(sext_i32_i64(local_tid_78972),\n                                                      q_65346 *\n                                                      squot64(segred_group_sizze_70114,\n                                                              segment_sizze_nonzzero_78969)))) {\n                int64_t last_res_70129;\n                \n                last_res_70129 = ((__global int64_t *) mem_77316)[gtid_70119 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74684 = mul64(jump_65348, gtid_70120);\n                int64_t index_primexp_74685 = smin64(i_65358, binop_y_74684);\n                int64_t max_res_70140;\n                \n                max_res_70140 = ((__global int64_t *) mem_77435)[gtid_70119 *\n                                ",
                   "                                 n_m_65352 +\n                                                                 gtid_70120];\n                \n                float defunc_1_f_res_70141;\n                \n                defunc_1_f_res_70141 = ((__global\n                                         float *) mem_77439)[gtid_70119 *\n                                                             n_m_65352 +\n                                                             gtid_70120];\n                \n                float a11_70142;\n                \n                a11_70142 = ((__global float *) mem_77457)[gtid_70119 *\n                                                           n_m_65352 +\n                                                           gtid_70120];\n                \n                float b11_70143;\n                \n                b11_70143 = ((__global float *) mem_77461)[gtid_70119 *\n                                                           n_m_65352 +\n                                                           gtid_70120];\n                \n                float c11_70144;\n                \n                c11_70144 = ((__global float *) mem_77465)[gtid_70119 *\n                                                           n_m_65352 +\n                                                           gtid_70120];\n                \n                float x_70146;\n                \n                x_70146 = ((__global float *) mem_77348)[gtid_70119 * q_65346 +\n                                                         gtid_70121];\n                \n                bool cond_70147 = sle64(last_res_70129, gtid_70121);\n                int64_t defunc_0_f_res_70148;\n                \n                if (cond_70147) {\n                    defunc_0_f_res_70148 = (int64_t) 0;\n                } else {\n                    int64_t i_70149 = add64(gtid_70121, max_res_70140);\n                    int64_t defunc_0_add_arg_70150;\n                    \n                    defunc_0_add_arg_70150 = ((__global\n  ",
                   "                                             int64_t *) mem_77324)[gtid_70119 *\n                                                                     n_65344 +\n                                                                     i_70149];\n                    \n                    int64_t defunc_1_add_res_70151 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_70150);\n                    \n                    defunc_0_f_res_70148 = defunc_1_add_res_70151;\n                }\n                \n                int64_t binop_p_70152 = sub64(defunc_0_f_res_70148,\n                                              index_primexp_74685);\n                float defunc_0_f_res_70153 = sitofp_i64_f32(binop_p_70152);\n                float abs_res_70154 = (float) fabs(defunc_0_f_res_70153);\n                float tmp1_70155 = abs_res_70154 / defunc_1_f_res_70141;\n                float x_70156 = tmp1_70155 * tmp1_70155;\n                float y_70157 = tmp1_70155 * x_70156;\n                float tmp2_70158 = 1.0F - y_70157;\n                float x_70159 = tmp2_70158 * tmp2_70158;\n                float tmp3_70160 = tmp2_70158 * x_70159;\n                float tmp4_70161 = x_70146 * tmp3_70160;\n                float defunc_1_f_res_70162 = defunc_0_f_res_70153 * tmp4_70161;\n                float defunc_0_f_res_70163;\n                \n                if (cond_70147) {\n                    defunc_0_f_res_70163 = 0.0F;\n                } else {\n                    int64_t i_70164 = add64(gtid_70121, max_res_70140);\n                    float defunc_0_add_arg_70165;\n                    \n                    defunc_0_add_arg_70165 = ((__global\n                                               float *) mem_77320)[gtid_70119 *\n                                                                   n_65344 +\n                                                                   i_70164];\n                    defunc_0_f_res_70163 = defunc_0_add_arg_70165;\n                }\n   ",
                   "             \n                float x_70166 = a11_70142 * tmp4_70161;\n                float y_70167 = b11_70143 * defunc_1_f_res_70162;\n                float x_70168 = x_70166 + y_70167;\n                float defunc_9_fit_fun_res_70169 = defunc_0_f_res_70163 *\n                      x_70168;\n                float x_70170 = b11_70143 * tmp4_70161;\n                float y_70171 = c11_70144 * defunc_1_f_res_70162;\n                float x_70172 = x_70170 + y_70171;\n                float defunc_9_slope_fun_res_70173 = defunc_0_f_res_70163 *\n                      x_70172;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_78976)[sext_i32_i64(local_tid_78972)] =\n                        defunc_9_fit_fun_res_70169;\n                    ((__local\n                      float *) red_arr_mem_78978)[sext_i32_i64(local_tid_78972)] =\n                        defunc_9_slope_fun_res_70173;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_78976)[sext_i32_i64(local_tid_78972)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_78978)[sext_i32_i64(local_tid_78972)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_65346)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_70123;\n                float x_70124;\n                float x_70125;\n                float x_70126;\n                float x_78987;\n                float x_78988;\n                float x_78989;\n                float x_78990;\n                bool ltid_in_bounds_78993 = slt64(sext_i32_i64(local_tid_78972),\n                                                  q_65346 *\n                                                  squot64(segred_group_sizze_70114,\n   ",
                   "                                                       segment_sizze_nonzzero_78969));\n                int32_t skip_threads_78994;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_78993) {\n                        x_70125 = ((volatile __local\n                                    float *) red_arr_mem_78976)[sext_i32_i64(local_tid_78972)];\n                        x_70126 = ((volatile __local\n                                    float *) red_arr_mem_78978)[sext_i32_i64(local_tid_78972)];\n                        if ((local_tid_78972 - squot32(local_tid_78972, 32) *\n                             32) == 0) {\n                            x_70123 = x_70125;\n                            x_70124 = x_70126;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_78994 = 1;\n                    while (slt32(skip_threads_78994, 32)) {\n                        bool thread_active_78995 = sle32(skip_threads_78994,\n                                                         local_tid_78972 -\n                                                         squot32(local_tid_78972,\n                                                                 32) * 32) &&\n                             ltid_in_bounds_78993;\n                        \n                        if (thread_active_78995) {\n                            // read operands\n                            {\n                                x_70123 = ((volatile __local\n                                            float *) red_arr_mem_78976)[sext_i32_i64(local_tid_78972) -\n                                                                        sext_i32_i64(skip_threads_78994)];\n                                x_70124 = ((volatile __local\n                                            float *) red_arr_mem_78978)[sext_i32_i64(local_tid_78972) -\n                        ",
                   "                                                sext_i32_i64(skip_threads_78994)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_78996 =\n                                 slt64(srem64(sext_i32_i64(local_tid_78972),\n                                              q_65346),\n                                       sext_i32_i64(local_tid_78972) -\n                                       sext_i32_i64(local_tid_78972 -\n                                       skip_threads_78994));\n                            \n                            if (thread_active_78995 && inactive_78996) {\n                                x_70123 = x_70125;\n                                x_70124 = x_70126;\n                            }\n                            if (thread_active_78995) {\n                                if (!inactive_78996) {\n                                    float defunc_1_op_res_70127 = x_70123 +\n                                          x_70125;\n                                    float defunc_1_op_res_70128 = x_70124 +\n                                          x_70126;\n                                    \n                                    x_70123 = defunc_1_op_res_70127;\n                                    x_70124 = defunc_1_op_res_70128;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_78974, skip_threads_78994)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_78995) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_78976)[sext_i32_i64(local_tid_78972)] =\n                                    x_70123;\n                                x_70125 = x_70123;\n                ",
                   "                ((volatile __local\n                                  float *) red_arr_mem_78978)[sext_i32_i64(local_tid_78972)] =\n                                    x_70124;\n                                x_70126 = x_70124;\n                            }\n                        }\n                        if (sle32(wave_sizze_78974, skip_threads_78994)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_78994 *= 2;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // last thread of block 'i' writes its result to offset 'i'\n                {\n                    if ((local_tid_78972 - squot32(local_tid_78972, 32) * 32) ==\n                        31 && ltid_in_bounds_78993) {\n                        ((volatile __local\n                          float *) red_arr_mem_78976)[sext_i32_i64(squot32(local_tid_78972,\n                                                                           32))] =\n                            x_70123;\n                        ((volatile __local\n                          float *) red_arr_mem_78978)[sext_i32_i64(squot32(local_tid_78972,\n                                                                           32))] =\n                            x_70124;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_78997;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_78972, 32) == 0 &&\n                            ltid_in_bounds_78993) {\n                            x_78989 = ((volatile __local\n                                        float *) red_arr_mem_78976)[sext_i32_i64(local_tid_78972)];\n                            x_78990 = ((volatile __local\n         ",
                   "                               float *) red_arr_mem_78978)[sext_i32_i64(local_tid_78972)];\n                            if ((local_tid_78972 - squot32(local_tid_78972,\n                                                           32) * 32) == 0) {\n                                x_78987 = x_78989;\n                                x_78988 = x_78990;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_78997 = 1;\n                        while (slt32(skip_threads_78997, 32)) {\n                            bool thread_active_78998 = sle32(skip_threads_78997,\n                                                             local_tid_78972 -\n                                                             squot32(local_tid_78972,\n                                                                     32) *\n                                                             32) &&\n                                 (squot32(local_tid_78972, 32) == 0 &&\n                                  ltid_in_bounds_78993);\n                            \n                            if (thread_active_78998) {\n                                // read operands\n                                {\n                                    x_78987 = ((volatile __local\n                                                float *) red_arr_mem_78976)[sext_i32_i64(local_tid_78972) -\n                                                                            sext_i32_i64(skip_threads_78997)];\n                                    x_78988 = ((volatile __local\n                                                float *) red_arr_mem_78978)[sext_i32_i64(local_tid_78972) -\n                                                                            sext_i32_i64(skip_threads_78997)];\n                                }\n                            }\n                            // perform operation\n         ",
                   "                   {\n                                bool inactive_78999 =\n                                     slt64(srem64(sext_i32_i64(local_tid_78972 *\n                                                  32 + 32 - 1), q_65346),\n                                           sext_i32_i64(local_tid_78972 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64((local_tid_78972 -\n                                                         skip_threads_78997) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_78998 && inactive_78999) {\n                                    x_78987 = x_78989;\n                                    x_78988 = x_78990;\n                                }\n                                if (thread_active_78998) {\n                                    if (!inactive_78999) {\n                                        float defunc_1_op_res_78991 = x_78987 +\n                                              x_78989;\n                                        float defunc_1_op_res_78992 = x_78988 +\n                                              x_78990;\n                                        \n                                        x_78987 = defunc_1_op_res_78991;\n                                        x_78988 = defunc_1_op_res_78992;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_78974, skip_threads_78997)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_78998) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_78976)[sext_i32_i64(local_tid_78972)] =\n                                 ",
                   "       x_78987;\n                                    x_78989 = x_78987;\n                                    ((volatile __local\n                                      float *) red_arr_mem_78978)[sext_i32_i64(local_tid_78972)] =\n                                        x_78988;\n                                    x_78990 = x_78988;\n                                }\n                            }\n                            if (sle32(wave_sizze_78974, skip_threads_78997)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_78997 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_79000 = squot32(local_tid_78972, 32) == 0 ||\n                     !ltid_in_bounds_78993;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_79000) {\n                            x_70125 = x_70123;\n                            x_70126 = x_70124;\n                            x_70123 = ((__local\n                                        float *) red_arr_mem_78976)[sext_i32_i64(squot32(local_tid_78972,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                            x_70124 = ((__local\n                                        float *) red_arr_mem_78978)[sext_i32_i64(squot32(local_tid_78972,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_79001 =\n            ",
                   "                 slt64(srem64(sext_i32_i64(local_tid_78972),\n                                          q_65346),\n                                   sext_i32_i64(local_tid_78972) -\n                                   sext_i32_i64(squot32(local_tid_78972, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_79000) {\n                            if (inactive_79001) {\n                                x_70123 = x_70125;\n                                x_70124 = x_70126;\n                            }\n                        }\n                        if (!no_carry_in_79000) {\n                            if (!inactive_79001) {\n                                float defunc_1_op_res_70127 = x_70123 + x_70125;\n                                float defunc_1_op_res_70128 = x_70124 + x_70126;\n                                \n                                x_70123 = defunc_1_op_res_70127;\n                                x_70124 = defunc_1_op_res_70128;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_79000) {\n                            ((__local\n                              float *) red_arr_mem_78976)[sext_i32_i64(local_tid_78972)] =\n                                x_70123;\n                            ((__local\n                              float *) red_arr_mem_78978)[sext_i32_i64(local_tid_78972)] =\n                                x_70124;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_78972, 32) == 0 &&\n                        ltid_in_bounds_78993) {\n                        ((__local\n                          float *) red_arr_mem_78976)[sext_i32_i64(local_tid_78972)] =\n                            x_70125;\n",
                   "                        ((__local\n                          float *) red_arr_mem_78978)[sext_i32_i64(local_tid_78972)] =\n                            x_70126;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_78982) *\n                      squot64(segred_group_sizze_70114,\n                              segment_sizze_nonzzero_78969) +\n                      sext_i32_i64(local_tid_78972), m_65343 * n_m_65352) &&\n                slt64(sext_i32_i64(local_tid_78972),\n                      squot64(segred_group_sizze_70114,\n                              segment_sizze_nonzzero_78969))) {\n                float tmp_79002;\n                \n                tmp_79002 = ((__local\n                              float *) red_arr_mem_78976)[(sext_i32_i64(local_tid_78972) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_78969 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77470)[squot64(sext_i32_i64(virt_group_id_78982) *\n                                              squot64(segred_group_sizze_70114,\n                                                      segment_sizze_nonzzero_78969) +\n                                              sext_i32_i64(local_tid_78972),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_78982) *\n                                       squot64(segred_group_sizze_70114,\n                                               segment_sizze_nonzzero_78969) +\n                                       sext_i32_i64(local_tid_78972) -\n                                       squot64(sext_i32_i64(virt_group_id_78982) *",
                   "\n                                               squot64(segred_group_sizze_70114,\n                                                       segment_sizze_nonzzero_78969) +\n                                               sext_i32_i64(local_tid_78972),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_79002;\n                \n                float tmp_79003;\n                \n                tmp_79003 = ((__local\n                              float *) red_arr_mem_78978)[(sext_i32_i64(local_tid_78972) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_78969 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77474)[squot64(sext_i32_i64(virt_group_id_78982) *\n                                              squot64(segred_group_sizze_70114,\n                                                      segment_sizze_nonzzero_78969) +\n                                              sext_i32_i64(local_tid_78972),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_78982) *\n                                       squot64(segred_group_sizze_70114,\n                                               segment_sizze_nonzzero_78969) +\n                                       sext_i32_i64(local_tid_78972) -\n                                       squot64(sext_i32_i64(virt_group_id_78982) *\n                                               squot64(segred_group_sizze_70114,\n                                                       segment_sizze_nonzzero_78969) +\n                                               sext_i32_i64(local_tid_78972),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_79003;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n",
                   "        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_70114\n}\n__kernel void mainzisegred_small_72125(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *red_arr_mem_79307_backing_aligned_0,\n                                       __local volatile\n                                       int64_t *red_arr_mem_79305_backing_aligned_1,\n                                       __local volatile\n                                       int64_t *red_arr_mem_79303_backing_aligned_2,\n                                       __local volatile\n                                       int64_t *red_arr_mem_79301_backing_aligned_3,\n                                       __local volatile\n                                       int64_t *red_arr_mem_79299_backing_aligned_4,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_72115,\n                                       int64_t segment_sizze_nonzzero_79292,\n                                       __global unsigned char *mem_77608,\n                                       __global unsigned char *mem_77616,\n                                       __global unsigned char *mem_77640,\n                                       __global unsigned char *mem_77751,\n                                       __global unsigned char *mem_77755,\n                                       __global unsigned char *mem_77760,\n                                       __global unsigned char *mem_77764,\n                                       __global unsigned char *mem_77768,\n                                       __global unsigned char *mem_77772,\n                                       __global unsigned char",
                   " *mem_77776)\n{\n    #define segred_group_sizze_72114 (mainzisegred_group_sizze_71039)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_79307_backing_4 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79307_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_79305_backing_3 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79305_backing_aligned_1;\n    __local volatile unsigned char *restrict red_arr_mem_79303_backing_2 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79303_backing_aligned_2;\n    __local volatile unsigned char *restrict red_arr_mem_79301_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79301_backing_aligned_3;\n    __local volatile unsigned char *restrict red_arr_mem_79299_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79299_backing_aligned_4;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79294;\n    int32_t local_tid_79295;\n    int64_t group_sizze_79298;\n    int32_t wave_sizze_79297;\n    int32_t group_tid_79296;\n    \n    global_tid_79294 = get_global_id(0);\n    local_tid_79295 = get_local_id(0);\n    group_sizze_79298 = get_local_size(0);\n    wave_sizze_79297 = LOCKSTEP_WIDTH;\n    group_tid_79296 = get_group_id(0);\n    \n    int32_t phys_tid_72125 = global_tid_79294;\n    __local unsigned char *red_arr_mem_79299;\n    \n    red_arr_mem_79299 = (__local unsigned char *) red_arr_mem_79299_backing_0;\n    \n    __local unsigned char *red_arr_mem_79301;\n    \n    red_arr_mem_79301 = (__local unsigned char *) red_arr_mem_79301_backing_1;\n  ",
                   "  \n    __local unsigned char *red_arr_mem_79303;\n    \n    red_arr_mem_79303 = (__local unsigned char *) red_arr_mem_79303_backing_2;\n    \n    __local unsigned char *red_arr_mem_79305;\n    \n    red_arr_mem_79305 = (__local unsigned char *) red_arr_mem_79305_backing_3;\n    \n    __local unsigned char *red_arr_mem_79307;\n    \n    red_arr_mem_79307 = (__local unsigned char *) red_arr_mem_79307_backing_4;\n    \n    int32_t phys_group_id_79309;\n    \n    phys_group_id_79309 = get_group_id(0);\n    for (int32_t i_79310 = 0; i_79310 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_65343 * n_m_65352,\n                                          squot64(segred_group_sizze_72114,\n                                                  segment_sizze_nonzzero_79292))) -\n                   phys_group_id_79309, sext_i64_i32(num_groups_72115));\n         i_79310++) {\n        int32_t virt_group_id_79311 = phys_group_id_79309 + i_79310 *\n                sext_i64_i32(num_groups_72115);\n        int64_t slice_79312 = n_m_65352;\n        int64_t slice_79313 = m_65343 * slice_79312;\n        int64_t gtid_72122 = squot64(squot64(sext_i32_i64(local_tid_79295),\n                                             segment_sizze_nonzzero_79292) +\n                                     sext_i32_i64(virt_group_id_79311) *\n                                     squot64(segred_group_sizze_72114,\n                                             segment_sizze_nonzzero_79292),\n                                     slice_79312);\n        int64_t remnant_79314 = squot64(sext_i32_i64(local_tid_79295),\n                                        segment_sizze_nonzzero_79292) +\n                sext_i32_i64(virt_group_id_79311) *\n                squot64(segred_group_sizze_72114,\n                        segment_sizze_nonzzero_79292) - gtid_72122 *\n                slice_79312;\n        int64_t gtid_72123 = remnant_79314;\n        int64_t remnant_79315 = remnant_79314 - gtid_72123;\n        int64_t gtid_72124 = srem64(sext_i32_i64(local_tid_79295), q_6",
                   "5346);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_65346) && ((slt64(gtid_72122, m_65343) &&\n                                                 slt64(gtid_72123,\n                                                       n_m_65352)) &&\n                                                slt64(sext_i32_i64(local_tid_79295),\n                                                      q_65346 *\n                                                      squot64(segred_group_sizze_72114,\n                                                              segment_sizze_nonzzero_79292)))) {\n                int64_t last_res_72141;\n                \n                last_res_72141 = ((__global int64_t *) mem_77608)[gtid_72122 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74696 = mul64(jump_65348, gtid_72123);\n                int64_t index_primexp_74697 = smin64(i_65358, binop_y_74696);\n                float defunc_1_f_res_72149;\n                \n                defunc_1_f_res_72149 = ((__global\n                                         float *) mem_77755)[gtid_72122 *\n                                                             n_m_65352 +\n                                                             gtid_72123];\n                \n                float x_72151;\n                \n                x_72151 = ((__global float *) mem_77640)[gtid_72122 * q_65346 +\n                                                         gtid_72124];\n                \n                bool cond_72152 = sle64(last_res_72141, gtid_72124);\n                int64_t defunc_0_f_res_72153;\n                \n                if (cond_72152) {\n                    defunc_0_f_res_72153 = (int64_t) 0;\n                } else {\n                    int64_t max_res_72148;\n                    \n                    max_res_72148 = ((__global\n     ",
                   "                                 int64_t *) mem_77751)[gtid_72122 *\n                                                            n_m_65352 +\n                                                            gtid_72123];\n                    \n                    int64_t i_72154 = add64(gtid_72124, max_res_72148);\n                    int64_t defunc_0_add_arg_72155;\n                    \n                    defunc_0_add_arg_72155 = ((__global\n                                               int64_t *) mem_77616)[gtid_72122 *\n                                                                     n_65344 +\n                                                                     i_72154];\n                    \n                    int64_t defunc_1_add_res_72156 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_72155);\n                    \n                    defunc_0_f_res_72153 = defunc_1_add_res_72156;\n                }\n                \n                int64_t binop_p_72157 = sub64(defunc_0_f_res_72153,\n                                              index_primexp_74697);\n                float defunc_0_f_res_72158 = sitofp_i64_f32(binop_p_72157);\n                float abs_res_72159 = (float) fabs(defunc_0_f_res_72158);\n                float tmp1_72160 = abs_res_72159 / defunc_1_f_res_72149;\n                float x_72161 = tmp1_72160 * tmp1_72160;\n                float y_72162 = tmp1_72160 * x_72161;\n                float tmp2_72163 = 1.0F - y_72162;\n                float x_72164 = tmp2_72163 * tmp2_72163;\n                float tmp3_72165 = tmp2_72163 * x_72164;\n                float w_j_72166 = x_72151 * tmp3_72165;\n                float xw_j_72167 = defunc_0_f_res_72158 * w_j_72166;\n                float x2w_j_72168 = defunc_0_f_res_72158 * xw_j_72167;\n                float x3w_j_72169 = defunc_0_f_res_72158 * x2w_j_72168;\n                float x4w_j_72170 = defunc_0_f_res_72158 * x3w_j_72169;\n                \n                // save map-out r",
                   "esults\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_79299)[sext_i32_i64(local_tid_79295)] =\n                        w_j_72166;\n                    ((__local\n                      float *) red_arr_mem_79301)[sext_i32_i64(local_tid_79295)] =\n                        xw_j_72167;\n                    ((__local\n                      float *) red_arr_mem_79303)[sext_i32_i64(local_tid_79295)] =\n                        x2w_j_72168;\n                    ((__local\n                      float *) red_arr_mem_79305)[sext_i32_i64(local_tid_79295)] =\n                        x3w_j_72169;\n                    ((__local\n                      float *) red_arr_mem_79307)[sext_i32_i64(local_tid_79295)] =\n                        x4w_j_72170;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_79299)[sext_i32_i64(local_tid_79295)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_79301)[sext_i32_i64(local_tid_79295)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_79303)[sext_i32_i64(local_tid_79295)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_79305)[sext_i32_i64(local_tid_79295)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_79307)[sext_i32_i64(local_tid_79295)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_65346)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_72126;\n                float x_72127;\n                float x_72128;\n                float x_72129;\n                float x_72130;\n                float x_72131;\n                float x_72132;\n                float x_72133;\n                float x_72134;\n           ",
                   "     float x_72135;\n                float x_79316;\n                float x_79317;\n                float x_79318;\n                float x_79319;\n                float x_79320;\n                float x_79321;\n                float x_79322;\n                float x_79323;\n                float x_79324;\n                float x_79325;\n                bool ltid_in_bounds_79331 = slt64(sext_i32_i64(local_tid_79295),\n                                                  q_65346 *\n                                                  squot64(segred_group_sizze_72114,\n                                                          segment_sizze_nonzzero_79292));\n                int32_t skip_threads_79332;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_79331) {\n                        x_72131 = ((volatile __local\n                                    float *) red_arr_mem_79299)[sext_i32_i64(local_tid_79295)];\n                        x_72132 = ((volatile __local\n                                    float *) red_arr_mem_79301)[sext_i32_i64(local_tid_79295)];\n                        x_72133 = ((volatile __local\n                                    float *) red_arr_mem_79303)[sext_i32_i64(local_tid_79295)];\n                        x_72134 = ((volatile __local\n                                    float *) red_arr_mem_79305)[sext_i32_i64(local_tid_79295)];\n                        x_72135 = ((volatile __local\n                                    float *) red_arr_mem_79307)[sext_i32_i64(local_tid_79295)];\n                        if ((local_tid_79295 - squot32(local_tid_79295, 32) *\n                             32) == 0) {\n                            x_72126 = x_72131;\n                            x_72127 = x_72132;\n                            x_72128 = x_72133;\n                            x_72129 = x_72134;\n                            x_72130 = x_72135;\n                        }\n                    }\n                }\n               ",
                   " // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_79332 = 1;\n                    while (slt32(skip_threads_79332, 32)) {\n                        bool thread_active_79333 = sle32(skip_threads_79332,\n                                                         local_tid_79295 -\n                                                         squot32(local_tid_79295,\n                                                                 32) * 32) &&\n                             ltid_in_bounds_79331;\n                        \n                        if (thread_active_79333) {\n                            // read operands\n                            {\n                                x_72126 = ((volatile __local\n                                            float *) red_arr_mem_79299)[sext_i32_i64(local_tid_79295) -\n                                                                        sext_i32_i64(skip_threads_79332)];\n                                x_72127 = ((volatile __local\n                                            float *) red_arr_mem_79301)[sext_i32_i64(local_tid_79295) -\n                                                                        sext_i32_i64(skip_threads_79332)];\n                                x_72128 = ((volatile __local\n                                            float *) red_arr_mem_79303)[sext_i32_i64(local_tid_79295) -\n                                                                        sext_i32_i64(skip_threads_79332)];\n                                x_72129 = ((volatile __local\n                                            float *) red_arr_mem_79305)[sext_i32_i64(local_tid_79295) -\n                                                                        sext_i32_i64(skip_threads_79332)];\n                                x_72130 = ((volatile __local\n                                            float *) red_arr_mem_79307)[sext_i32_i64(local_tid_79295) -\n                                                              ",
                   "          sext_i32_i64(skip_threads_79332)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_79334 =\n                                 slt64(srem64(sext_i32_i64(local_tid_79295),\n                                              q_65346),\n                                       sext_i32_i64(local_tid_79295) -\n                                       sext_i32_i64(local_tid_79295 -\n                                       skip_threads_79332));\n                            \n                            if (thread_active_79333 && inactive_79334) {\n                                x_72126 = x_72131;\n                                x_72127 = x_72132;\n                                x_72128 = x_72133;\n                                x_72129 = x_72134;\n                                x_72130 = x_72135;\n                            }\n                            if (thread_active_79333) {\n                                if (!inactive_79334) {\n                                    float defunc_1_op_res_72136 = x_72126 +\n                                          x_72131;\n                                    float defunc_1_op_res_72137 = x_72127 +\n                                          x_72132;\n                                    float defunc_1_op_res_72138 = x_72128 +\n                                          x_72133;\n                                    float defunc_1_op_res_72139 = x_72129 +\n                                          x_72134;\n                                    float defunc_1_op_res_72140 = x_72130 +\n                                          x_72135;\n                                    \n                                    x_72126 = defunc_1_op_res_72136;\n                                    x_72127 = defunc_1_op_res_72137;\n                                    x_72128 = defunc_1_op_res_72138;\n                                    x_72129 = defunc_1_op_res_72139",
                   ";\n                                    x_72130 = defunc_1_op_res_72140;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_79297, skip_threads_79332)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_79333) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_79299)[sext_i32_i64(local_tid_79295)] =\n                                    x_72126;\n                                x_72131 = x_72126;\n                                ((volatile __local\n                                  float *) red_arr_mem_79301)[sext_i32_i64(local_tid_79295)] =\n                                    x_72127;\n                                x_72132 = x_72127;\n                                ((volatile __local\n                                  float *) red_arr_mem_79303)[sext_i32_i64(local_tid_79295)] =\n                                    x_72128;\n                                x_72133 = x_72128;\n                                ((volatile __local\n                                  float *) red_arr_mem_79305)[sext_i32_i64(local_tid_79295)] =\n                                    x_72129;\n                                x_72134 = x_72129;\n                                ((volatile __local\n                                  float *) red_arr_mem_79307)[sext_i32_i64(local_tid_79295)] =\n                                    x_72130;\n                                x_72135 = x_72130;\n                            }\n                        }\n                        if (sle32(wave_sizze_79297, skip_threads_79332)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_79332 *= 2;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FEN",
                   "CE);\n                // last thread of block 'i' writes its result to offset 'i'\n                {\n                    if ((local_tid_79295 - squot32(local_tid_79295, 32) * 32) ==\n                        31 && ltid_in_bounds_79331) {\n                        ((volatile __local\n                          float *) red_arr_mem_79299)[sext_i32_i64(squot32(local_tid_79295,\n                                                                           32))] =\n                            x_72126;\n                        ((volatile __local\n                          float *) red_arr_mem_79301)[sext_i32_i64(squot32(local_tid_79295,\n                                                                           32))] =\n                            x_72127;\n                        ((volatile __local\n                          float *) red_arr_mem_79303)[sext_i32_i64(squot32(local_tid_79295,\n                                                                           32))] =\n                            x_72128;\n                        ((volatile __local\n                          float *) red_arr_mem_79305)[sext_i32_i64(squot32(local_tid_79295,\n                                                                           32))] =\n                            x_72129;\n                        ((volatile __local\n                          float *) red_arr_mem_79307)[sext_i32_i64(squot32(local_tid_79295,\n                                                                           32))] =\n                            x_72130;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_79335;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_79295, 32) == 0 &&\n                            ltid_in_bounds_79331) {\n                            x",
                   "_79321 = ((volatile __local\n                                        float *) red_arr_mem_79299)[sext_i32_i64(local_tid_79295)];\n                            x_79322 = ((volatile __local\n                                        float *) red_arr_mem_79301)[sext_i32_i64(local_tid_79295)];\n                            x_79323 = ((volatile __local\n                                        float *) red_arr_mem_79303)[sext_i32_i64(local_tid_79295)];\n                            x_79324 = ((volatile __local\n                                        float *) red_arr_mem_79305)[sext_i32_i64(local_tid_79295)];\n                            x_79325 = ((volatile __local\n                                        float *) red_arr_mem_79307)[sext_i32_i64(local_tid_79295)];\n                            if ((local_tid_79295 - squot32(local_tid_79295,\n                                                           32) * 32) == 0) {\n                                x_79316 = x_79321;\n                                x_79317 = x_79322;\n                                x_79318 = x_79323;\n                                x_79319 = x_79324;\n                                x_79320 = x_79325;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_79335 = 1;\n                        while (slt32(skip_threads_79335, 32)) {\n                            bool thread_active_79336 = sle32(skip_threads_79335,\n                                                             local_tid_79295 -\n                                                             squot32(local_tid_79295,\n                                                                     32) *\n                                                             32) &&\n                                 (squot32(local_tid_79295, 32) == 0 &&\n                                  ltid_in_bounds_79331);\n                            \n          ",
                   "                  if (thread_active_79336) {\n                                // read operands\n                                {\n                                    x_79316 = ((volatile __local\n                                                float *) red_arr_mem_79299)[sext_i32_i64(local_tid_79295) -\n                                                                            sext_i32_i64(skip_threads_79335)];\n                                    x_79317 = ((volatile __local\n                                                float *) red_arr_mem_79301)[sext_i32_i64(local_tid_79295) -\n                                                                            sext_i32_i64(skip_threads_79335)];\n                                    x_79318 = ((volatile __local\n                                                float *) red_arr_mem_79303)[sext_i32_i64(local_tid_79295) -\n                                                                            sext_i32_i64(skip_threads_79335)];\n                                    x_79319 = ((volatile __local\n                                                float *) red_arr_mem_79305)[sext_i32_i64(local_tid_79295) -\n                                                                            sext_i32_i64(skip_threads_79335)];\n                                    x_79320 = ((volatile __local\n                                                float *) red_arr_mem_79307)[sext_i32_i64(local_tid_79295) -\n                                                                            sext_i32_i64(skip_threads_79335)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_79337 =\n                                     slt64(srem64(sext_i32_i64(local_tid_79295 *\n                                                  32 + 32 - 1), q_65346),\n                                           sext_i32_i64(local_tid_79295 * 32 +\n                     ",
                   "                      32 - 1) -\n                                           sext_i32_i64((local_tid_79295 -\n                                                         skip_threads_79335) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_79336 && inactive_79337) {\n                                    x_79316 = x_79321;\n                                    x_79317 = x_79322;\n                                    x_79318 = x_79323;\n                                    x_79319 = x_79324;\n                                    x_79320 = x_79325;\n                                }\n                                if (thread_active_79336) {\n                                    if (!inactive_79337) {\n                                        float defunc_1_op_res_79326 = x_79316 +\n                                              x_79321;\n                                        float defunc_1_op_res_79327 = x_79317 +\n                                              x_79322;\n                                        float defunc_1_op_res_79328 = x_79318 +\n                                              x_79323;\n                                        float defunc_1_op_res_79329 = x_79319 +\n                                              x_79324;\n                                        float defunc_1_op_res_79330 = x_79320 +\n                                              x_79325;\n                                        \n                                        x_79316 = defunc_1_op_res_79326;\n                                        x_79317 = defunc_1_op_res_79327;\n                                        x_79318 = defunc_1_op_res_79328;\n                                        x_79319 = defunc_1_op_res_79329;\n                                        x_79320 = defunc_1_op_res_79330;\n                                    }\n                                }\n                            }\n                            if (sle3",
                   "2(wave_sizze_79297, skip_threads_79335)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_79336) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_79299)[sext_i32_i64(local_tid_79295)] =\n                                        x_79316;\n                                    x_79321 = x_79316;\n                                    ((volatile __local\n                                      float *) red_arr_mem_79301)[sext_i32_i64(local_tid_79295)] =\n                                        x_79317;\n                                    x_79322 = x_79317;\n                                    ((volatile __local\n                                      float *) red_arr_mem_79303)[sext_i32_i64(local_tid_79295)] =\n                                        x_79318;\n                                    x_79323 = x_79318;\n                                    ((volatile __local\n                                      float *) red_arr_mem_79305)[sext_i32_i64(local_tid_79295)] =\n                                        x_79319;\n                                    x_79324 = x_79319;\n                                    ((volatile __local\n                                      float *) red_arr_mem_79307)[sext_i32_i64(local_tid_79295)] =\n                                        x_79320;\n                                    x_79325 = x_79320;\n                                }\n                            }\n                            if (sle32(wave_sizze_79297, skip_threads_79335)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_79335 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool ",
                   "no_carry_in_79338 = squot32(local_tid_79295, 32) == 0 ||\n                     !ltid_in_bounds_79331;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_79338) {\n                            x_72131 = x_72126;\n                            x_72132 = x_72127;\n                            x_72133 = x_72128;\n                            x_72134 = x_72129;\n                            x_72135 = x_72130;\n                            x_72126 = ((__local\n                                        float *) red_arr_mem_79299)[sext_i32_i64(squot32(local_tid_79295,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                            x_72127 = ((__local\n                                        float *) red_arr_mem_79301)[sext_i32_i64(squot32(local_tid_79295,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                            x_72128 = ((__local\n                                        float *) red_arr_mem_79303)[sext_i32_i64(squot32(local_tid_79295,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                            x_72129 = ((__local\n                                        float *) red_arr_mem_79305)[sext_i32_i64(squot32(local_tid_79295,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                            x_72130 = ((__local\n                                        float *) red_arr_mem_79307)[sext_i32_i64(sq",
                   "uot32(local_tid_79295,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_79339 =\n                             slt64(srem64(sext_i32_i64(local_tid_79295),\n                                          q_65346),\n                                   sext_i32_i64(local_tid_79295) -\n                                   sext_i32_i64(squot32(local_tid_79295, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_79338) {\n                            if (inactive_79339) {\n                                x_72126 = x_72131;\n                                x_72127 = x_72132;\n                                x_72128 = x_72133;\n                                x_72129 = x_72134;\n                                x_72130 = x_72135;\n                            }\n                        }\n                        if (!no_carry_in_79338) {\n                            if (!inactive_79339) {\n                                float defunc_1_op_res_72136 = x_72126 + x_72131;\n                                float defunc_1_op_res_72137 = x_72127 + x_72132;\n                                float defunc_1_op_res_72138 = x_72128 + x_72133;\n                                float defunc_1_op_res_72139 = x_72129 + x_72134;\n                                float defunc_1_op_res_72140 = x_72130 + x_72135;\n                                \n                                x_72126 = defunc_1_op_res_72136;\n                                x_72127 = defunc_1_op_res_72137;\n                                x_72128 = defunc_1_op_res_72138;\n                                x_72129 = defunc_1_op_res_72139;\n                                x_72130 = defunc_1_op_res_72140;\n                          ",
                   "  }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_79338) {\n                            ((__local\n                              float *) red_arr_mem_79299)[sext_i32_i64(local_tid_79295)] =\n                                x_72126;\n                            ((__local\n                              float *) red_arr_mem_79301)[sext_i32_i64(local_tid_79295)] =\n                                x_72127;\n                            ((__local\n                              float *) red_arr_mem_79303)[sext_i32_i64(local_tid_79295)] =\n                                x_72128;\n                            ((__local\n                              float *) red_arr_mem_79305)[sext_i32_i64(local_tid_79295)] =\n                                x_72129;\n                            ((__local\n                              float *) red_arr_mem_79307)[sext_i32_i64(local_tid_79295)] =\n                                x_72130;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_79295, 32) == 0 &&\n                        ltid_in_bounds_79331) {\n                        ((__local\n                          float *) red_arr_mem_79299)[sext_i32_i64(local_tid_79295)] =\n                            x_72131;\n                        ((__local\n                          float *) red_arr_mem_79301)[sext_i32_i64(local_tid_79295)] =\n                            x_72132;\n                        ((__local\n                          float *) red_arr_mem_79303)[sext_i32_i64(local_tid_79295)] =\n                            x_72133;\n                        ((__local\n                          float *) red_arr_mem_79305)[sext_i32_i64(local_tid_79295)] =\n                            x_72134;\n                        ((__local\n                     ",
                   "     float *) red_arr_mem_79307)[sext_i32_i64(local_tid_79295)] =\n                            x_72135;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_79311) *\n                      squot64(segred_group_sizze_72114,\n                              segment_sizze_nonzzero_79292) +\n                      sext_i32_i64(local_tid_79295), m_65343 * n_m_65352) &&\n                slt64(sext_i32_i64(local_tid_79295),\n                      squot64(segred_group_sizze_72114,\n                              segment_sizze_nonzzero_79292))) {\n                float tmp_79340;\n                \n                tmp_79340 = ((__local\n                              float *) red_arr_mem_79299)[(sext_i32_i64(local_tid_79295) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_79292 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77760)[squot64(sext_i32_i64(virt_group_id_79311) *\n                                              squot64(segred_group_sizze_72114,\n                                                      segment_sizze_nonzzero_79292) +\n                                              sext_i32_i64(local_tid_79295),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_79311) *\n                                       squot64(segred_group_sizze_72114,\n                                               segment_sizze_nonzzero_79292) +\n                                       sext_i32_i64(local_tid_79295) -\n                                       squot64(sext_i32_i64(virt_group_id_79311) *\n                                               squot64",
                   "(segred_group_sizze_72114,\n                                                       segment_sizze_nonzzero_79292) +\n                                               sext_i32_i64(local_tid_79295),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_79340;\n                \n                float tmp_79341;\n                \n                tmp_79341 = ((__local\n                              float *) red_arr_mem_79301)[(sext_i32_i64(local_tid_79295) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_79292 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77764)[squot64(sext_i32_i64(virt_group_id_79311) *\n                                              squot64(segred_group_sizze_72114,\n                                                      segment_sizze_nonzzero_79292) +\n                                              sext_i32_i64(local_tid_79295),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_79311) *\n                                       squot64(segred_group_sizze_72114,\n                                               segment_sizze_nonzzero_79292) +\n                                       sext_i32_i64(local_tid_79295) -\n                                       squot64(sext_i32_i64(virt_group_id_79311) *\n                                               squot64(segred_group_sizze_72114,\n                                                       segment_sizze_nonzzero_79292) +\n                                               sext_i32_i64(local_tid_79295),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_79341;\n                \n                float tmp_79342;\n                \n                tmp_79342 = ((__local\n            ",
                   "                  float *) red_arr_mem_79303)[(sext_i32_i64(local_tid_79295) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_79292 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77768)[squot64(sext_i32_i64(virt_group_id_79311) *\n                                              squot64(segred_group_sizze_72114,\n                                                      segment_sizze_nonzzero_79292) +\n                                              sext_i32_i64(local_tid_79295),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_79311) *\n                                       squot64(segred_group_sizze_72114,\n                                               segment_sizze_nonzzero_79292) +\n                                       sext_i32_i64(local_tid_79295) -\n                                       squot64(sext_i32_i64(virt_group_id_79311) *\n                                               squot64(segred_group_sizze_72114,\n                                                       segment_sizze_nonzzero_79292) +\n                                               sext_i32_i64(local_tid_79295),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_79342;\n                \n                float tmp_79343;\n                \n                tmp_79343 = ((__local\n                              float *) red_arr_mem_79305)[(sext_i32_i64(local_tid_79295) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_79292 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77772)[squot64(sext_i32_i64(virt_group_id_",
                   "79311) *\n                                              squot64(segred_group_sizze_72114,\n                                                      segment_sizze_nonzzero_79292) +\n                                              sext_i32_i64(local_tid_79295),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_79311) *\n                                       squot64(segred_group_sizze_72114,\n                                               segment_sizze_nonzzero_79292) +\n                                       sext_i32_i64(local_tid_79295) -\n                                       squot64(sext_i32_i64(virt_group_id_79311) *\n                                               squot64(segred_group_sizze_72114,\n                                                       segment_sizze_nonzzero_79292) +\n                                               sext_i32_i64(local_tid_79295),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_79343;\n                \n                float tmp_79344;\n                \n                tmp_79344 = ((__local\n                              float *) red_arr_mem_79307)[(sext_i32_i64(local_tid_79295) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_79292 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77776)[squot64(sext_i32_i64(virt_group_id_79311) *\n                                              squot64(segred_group_sizze_72114,\n                                                      segment_sizze_nonzzero_79292) +\n                                              sext_i32_i64(local_tid_79295),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_79311) *\n                ",
                   "                       squot64(segred_group_sizze_72114,\n                                               segment_sizze_nonzzero_79292) +\n                                       sext_i32_i64(local_tid_79295) -\n                                       squot64(sext_i32_i64(virt_group_id_79311) *\n                                               squot64(segred_group_sizze_72114,\n                                                       segment_sizze_nonzzero_79292) +\n                                               sext_i32_i64(local_tid_79295),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_79344;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_72114\n}\n__kernel void mainzisegred_small_72224(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *red_arr_mem_79439_backing_aligned_0,\n                                       __local volatile\n                                       int64_t *red_arr_mem_79437_backing_aligned_1,\n                                       int64_t m_65343, int64_t n_65344,\n                                       int64_t q_65346, int64_t jump_65348,\n                                       int64_t n_m_65352, int64_t i_65358,\n                                       int64_t num_groups_72217,\n                                       int64_t segment_sizze_nonzzero_79430,\n                                       __global unsigned char *mem_77608,\n                                       __global unsigned char *mem_77612,\n                                       __global unsigned char *mem_77616,\n                                       __global unsigned char *mem_77640,\n                                       __global unsigned char *mem_77751,\n                                       __global unsigned char *mem_77755,\n   ",
                   "                                    __global unsigned char *mem_77781,\n                                       __global unsigned char *mem_77785,\n                                       __global unsigned char *mem_77789,\n                                       __global unsigned char *mem_77793,\n                                       __global unsigned char *mem_77797,\n                                       __global unsigned char *mem_77802,\n                                       __global unsigned char *mem_77806)\n{\n    #define segred_group_sizze_72216 (mainzisegred_group_sizze_70912)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile unsigned char *restrict red_arr_mem_79439_backing_1 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79439_backing_aligned_0;\n    __local volatile unsigned char *restrict red_arr_mem_79437_backing_0 =\n                                   (__local volatile\n                                    unsigned char *) red_arr_mem_79437_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_79432;\n    int32_t local_tid_79433;\n    int64_t group_sizze_79436;\n    int32_t wave_sizze_79435;\n    int32_t group_tid_79434;\n    \n    global_tid_79432 = get_global_id(0);\n    local_tid_79433 = get_local_id(0);\n    group_sizze_79436 = get_local_size(0);\n    wave_sizze_79435 = LOCKSTEP_WIDTH;\n    group_tid_79434 = get_group_id(0);\n    \n    int32_t phys_tid_72224 = global_tid_79432;\n    __local unsigned char *red_arr_mem_79437;\n    \n    red_arr_mem_79437 = (__local unsigned char *) red_arr_mem_79437_backing_0;\n    \n    __local unsigned char *red_arr_mem_79439;\n    \n    red_arr_mem_79439 = (__local unsigned char *) red_arr_mem_79439_backing_1;\n    \n    int32_t phys_group_id_79441;\n    \n    phys_group_id_79441 = get_group_id(0);\n    for (int32_t i_79442 = 0; i_79442 <\n         sdiv_up32(sext_i64_",
                   "i32(sdiv_up64(m_65343 * n_m_65352,\n                                          squot64(segred_group_sizze_72216,\n                                                  segment_sizze_nonzzero_79430))) -\n                   phys_group_id_79441, sext_i64_i32(num_groups_72217));\n         i_79442++) {\n        int32_t virt_group_id_79443 = phys_group_id_79441 + i_79442 *\n                sext_i64_i32(num_groups_72217);\n        int64_t slice_79444 = n_m_65352;\n        int64_t slice_79445 = m_65343 * slice_79444;\n        int64_t gtid_72221 = squot64(squot64(sext_i32_i64(local_tid_79433),\n                                             segment_sizze_nonzzero_79430) +\n                                     sext_i32_i64(virt_group_id_79443) *\n                                     squot64(segred_group_sizze_72216,\n                                             segment_sizze_nonzzero_79430),\n                                     slice_79444);\n        int64_t remnant_79446 = squot64(sext_i32_i64(local_tid_79433),\n                                        segment_sizze_nonzzero_79430) +\n                sext_i32_i64(virt_group_id_79443) *\n                squot64(segred_group_sizze_72216,\n                        segment_sizze_nonzzero_79430) - gtid_72221 *\n                slice_79444;\n        int64_t gtid_72222 = remnant_79446;\n        int64_t remnant_79447 = remnant_79446 - gtid_72222;\n        int64_t gtid_72223 = srem64(sext_i32_i64(local_tid_79433), q_65346);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, q_65346) && ((slt64(gtid_72221, m_65343) &&\n                                                 slt64(gtid_72222,\n                                                       n_m_65352)) &&\n                                                slt64(sext_i32_i64(local_tid_79433),\n                                                      q_65346 *\n                                                      squot64(segred_group_sizze_72216,\n                                   ",
                   "                           segment_sizze_nonzzero_79430)))) {\n                int64_t last_res_72231;\n                \n                last_res_72231 = ((__global int64_t *) mem_77608)[gtid_72221 *\n                                                                  n_65344 +\n                                                                  i_65358];\n                \n                int64_t binop_y_74692 = mul64(jump_65348, gtid_72222);\n                int64_t index_primexp_74693 = smin64(i_65358, binop_y_74692);\n                int64_t max_res_72244;\n                \n                max_res_72244 = ((__global int64_t *) mem_77751)[gtid_72221 *\n                                                                 n_m_65352 +\n                                                                 gtid_72222];\n                \n                float defunc_1_f_res_72245;\n                \n                defunc_1_f_res_72245 = ((__global\n                                         float *) mem_77755)[gtid_72221 *\n                                                             n_m_65352 +\n                                                             gtid_72222];\n                \n                float a12_72246;\n                \n                a12_72246 = ((__global float *) mem_77781)[gtid_72221 *\n                                                           n_m_65352 +\n                                                           gtid_72222];\n                \n                float b12_72247;\n                \n                b12_72247 = ((__global float *) mem_77785)[gtid_72221 *\n                                                           n_m_65352 +\n                                                           gtid_72222];\n                \n                float c12_72248;\n                \n                c12_72248 = ((__global float *) mem_77789)[gtid_72221 *\n                                                           n_m_65352 +\n                                                           gtid_72222];\n",
                   "                \n                float b2_72249;\n                \n                b2_72249 = ((__global float *) mem_77793)[gtid_72221 *\n                                                          n_m_65352 +\n                                                          gtid_72222];\n                \n                float c2_72250;\n                \n                c2_72250 = ((__global float *) mem_77797)[gtid_72221 *\n                                                          n_m_65352 +\n                                                          gtid_72222];\n                \n                float x_72252;\n                \n                x_72252 = ((__global float *) mem_77640)[gtid_72221 * q_65346 +\n                                                         gtid_72223];\n                \n                bool cond_72253 = sle64(last_res_72231, gtid_72223);\n                int64_t defunc_0_f_res_72254;\n                \n                if (cond_72253) {\n                    defunc_0_f_res_72254 = (int64_t) 0;\n                } else {\n                    int64_t i_72255 = add64(gtid_72223, max_res_72244);\n                    int64_t defunc_0_add_arg_72256;\n                    \n                    defunc_0_add_arg_72256 = ((__global\n                                               int64_t *) mem_77616)[gtid_72221 *\n                                                                     n_65344 +\n                                                                     i_72255];\n                    \n                    int64_t defunc_1_add_res_72257 = add64((int64_t) 1,\n                                                           defunc_0_add_arg_72256);\n                    \n                    defunc_0_f_res_72254 = defunc_1_add_res_72257;\n                }\n                \n                int64_t binop_p_72258 = sub64(defunc_0_f_res_72254,\n                                              index_primexp_74693);\n                float defunc_0_f_res_72259 = sitofp_i64_f32(binop_p_72258);\n            ",
                   "    float abs_res_72260 = (float) fabs(defunc_0_f_res_72259);\n                float tmp1_72261 = abs_res_72260 / defunc_1_f_res_72245;\n                float x_72262 = tmp1_72261 * tmp1_72261;\n                float y_72263 = tmp1_72261 * x_72262;\n                float tmp2_72264 = 1.0F - y_72263;\n                float x_72265 = tmp2_72264 * tmp2_72264;\n                float tmp3_72266 = tmp2_72264 * x_72265;\n                float tmp4_72267 = x_72252 * tmp3_72266;\n                float defunc_1_f_res_72268 = defunc_0_f_res_72259 * tmp4_72267;\n                float defunc_1_f_res_72269 = defunc_0_f_res_72259 *\n                      defunc_1_f_res_72268;\n                float defunc_0_f_res_72270;\n                \n                if (cond_72253) {\n                    defunc_0_f_res_72270 = 0.0F;\n                } else {\n                    int64_t i_72271 = add64(gtid_72223, max_res_72244);\n                    float defunc_0_add_arg_72272;\n                    \n                    defunc_0_add_arg_72272 = ((__global\n                                               float *) mem_77612)[gtid_72221 *\n                                                                   n_65344 +\n                                                                   i_72271];\n                    defunc_0_f_res_72270 = defunc_0_add_arg_72272;\n                }\n                \n                float x_72273 = a12_72246 * tmp4_72267;\n                float y_72274 = b12_72247 * defunc_1_f_res_72268;\n                float x_72275 = x_72273 + y_72274;\n                float y_72276 = c12_72248 * defunc_1_f_res_72269;\n                float x_72277 = x_72275 + y_72276;\n                float defunc_9_fit_fun_res_72278 = defunc_0_f_res_72270 *\n                      x_72277;\n                float x_72279 = b12_72247 * tmp4_72267;\n                float y_72280 = b2_72249 * defunc_1_f_res_72268;\n                float x_72281 = x_72279 + y_72280;\n                float y_72282 = c2_72250 * defunc_1_f_res_72269;\n    ",
                   "            float x_72283 = x_72281 + y_72282;\n                float defunc_9_slope_fun_res_72284 = defunc_0_f_res_72270 *\n                      x_72283;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_79437)[sext_i32_i64(local_tid_79433)] =\n                        defunc_9_fit_fun_res_72278;\n                    ((__local\n                      float *) red_arr_mem_79439)[sext_i32_i64(local_tid_79433)] =\n                        defunc_9_slope_fun_res_72284;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_79437)[sext_i32_i64(local_tid_79433)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_79439)[sext_i32_i64(local_tid_79433)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, q_65346)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_72225;\n                float x_72226;\n                float x_72227;\n                float x_72228;\n                float x_79448;\n                float x_79449;\n                float x_79450;\n                float x_79451;\n                bool ltid_in_bounds_79454 = slt64(sext_i32_i64(local_tid_79433),\n                                                  q_65346 *\n                                                  squot64(segred_group_sizze_72216,\n                                                          segment_sizze_nonzzero_79430));\n                int32_t skip_threads_79455;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_79454) {\n                        x_72227 = ((volatile __local\n                                    float *) red_arr_mem_79437)[sext_i32_i64(local_tid_79433)];\n       ",
                   "                 x_72228 = ((volatile __local\n                                    float *) red_arr_mem_79439)[sext_i32_i64(local_tid_79433)];\n                        if ((local_tid_79433 - squot32(local_tid_79433, 32) *\n                             32) == 0) {\n                            x_72225 = x_72227;\n                            x_72226 = x_72228;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_79455 = 1;\n                    while (slt32(skip_threads_79455, 32)) {\n                        bool thread_active_79456 = sle32(skip_threads_79455,\n                                                         local_tid_79433 -\n                                                         squot32(local_tid_79433,\n                                                                 32) * 32) &&\n                             ltid_in_bounds_79454;\n                        \n                        if (thread_active_79456) {\n                            // read operands\n                            {\n                                x_72225 = ((volatile __local\n                                            float *) red_arr_mem_79437)[sext_i32_i64(local_tid_79433) -\n                                                                        sext_i32_i64(skip_threads_79455)];\n                                x_72226 = ((volatile __local\n                                            float *) red_arr_mem_79439)[sext_i32_i64(local_tid_79433) -\n                                                                        sext_i32_i64(skip_threads_79455)];\n                            }\n                        }\n                        // perform operation\n                        {\n                            bool inactive_79457 =\n                                 slt64(srem64(sext_i32_i64(local_tid_79433),\n                                              q_65346),\n                         ",
                   "              sext_i32_i64(local_tid_79433) -\n                                       sext_i32_i64(local_tid_79433 -\n                                       skip_threads_79455));\n                            \n                            if (thread_active_79456 && inactive_79457) {\n                                x_72225 = x_72227;\n                                x_72226 = x_72228;\n                            }\n                            if (thread_active_79456) {\n                                if (!inactive_79457) {\n                                    float defunc_1_op_res_72229 = x_72225 +\n                                          x_72227;\n                                    float defunc_1_op_res_72230 = x_72226 +\n                                          x_72228;\n                                    \n                                    x_72225 = defunc_1_op_res_72229;\n                                    x_72226 = defunc_1_op_res_72230;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_79435, skip_threads_79455)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (thread_active_79456) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_79437)[sext_i32_i64(local_tid_79433)] =\n                                    x_72225;\n                                x_72227 = x_72225;\n                                ((volatile __local\n                                  float *) red_arr_mem_79439)[sext_i32_i64(local_tid_79433)] =\n                                    x_72226;\n                                x_72228 = x_72226;\n                            }\n                        }\n                        if (sle32(wave_sizze_79435, skip_threads_79455)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n   ",
                   "                     }\n                        skip_threads_79455 *= 2;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // last thread of block 'i' writes its result to offset 'i'\n                {\n                    if ((local_tid_79433 - squot32(local_tid_79433, 32) * 32) ==\n                        31 && ltid_in_bounds_79454) {\n                        ((volatile __local\n                          float *) red_arr_mem_79437)[sext_i32_i64(squot32(local_tid_79433,\n                                                                           32))] =\n                            x_72225;\n                        ((volatile __local\n                          float *) red_arr_mem_79439)[sext_i32_i64(squot32(local_tid_79433,\n                                                                           32))] =\n                            x_72226;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // scan the first block, after which offset 'i' contains carry-in for block 'i+1'\n                {\n                    int32_t skip_threads_79458;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_79433, 32) == 0 &&\n                            ltid_in_bounds_79454) {\n                            x_79450 = ((volatile __local\n                                        float *) red_arr_mem_79437)[sext_i32_i64(local_tid_79433)];\n                            x_79451 = ((volatile __local\n                                        float *) red_arr_mem_79439)[sext_i32_i64(local_tid_79433)];\n                            if ((local_tid_79433 - squot32(local_tid_79433,\n                                                           32) * 32) == 0) {\n                                x_79448 = x_79450;\n                                x_79449 = x_79451;\n                            }\n                        }\n                ",
                   "    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_79458 = 1;\n                        while (slt32(skip_threads_79458, 32)) {\n                            bool thread_active_79459 = sle32(skip_threads_79458,\n                                                             local_tid_79433 -\n                                                             squot32(local_tid_79433,\n                                                                     32) *\n                                                             32) &&\n                                 (squot32(local_tid_79433, 32) == 0 &&\n                                  ltid_in_bounds_79454);\n                            \n                            if (thread_active_79459) {\n                                // read operands\n                                {\n                                    x_79448 = ((volatile __local\n                                                float *) red_arr_mem_79437)[sext_i32_i64(local_tid_79433) -\n                                                                            sext_i32_i64(skip_threads_79458)];\n                                    x_79449 = ((volatile __local\n                                                float *) red_arr_mem_79439)[sext_i32_i64(local_tid_79433) -\n                                                                            sext_i32_i64(skip_threads_79458)];\n                                }\n                            }\n                            // perform operation\n                            {\n                                bool inactive_79460 =\n                                     slt64(srem64(sext_i32_i64(local_tid_79433 *\n                                                  32 + 32 - 1), q_65346),\n                                           sext_i32_i64(local_tid_79433 * 32 +\n                                           32 - 1) -\n                                           sext_i32_i64(",
                   "(local_tid_79433 -\n                                                         skip_threads_79458) *\n                                           32 + 32 - 1));\n                                \n                                if (thread_active_79459 && inactive_79460) {\n                                    x_79448 = x_79450;\n                                    x_79449 = x_79451;\n                                }\n                                if (thread_active_79459) {\n                                    if (!inactive_79460) {\n                                        float defunc_1_op_res_79452 = x_79448 +\n                                              x_79450;\n                                        float defunc_1_op_res_79453 = x_79449 +\n                                              x_79451;\n                                        \n                                        x_79448 = defunc_1_op_res_79452;\n                                        x_79449 = defunc_1_op_res_79453;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_79435, skip_threads_79458)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (thread_active_79459) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_79437)[sext_i32_i64(local_tid_79433)] =\n                                        x_79448;\n                                    x_79450 = x_79448;\n                                    ((volatile __local\n                                      float *) red_arr_mem_79439)[sext_i32_i64(local_tid_79433)] =\n                                        x_79449;\n                                    x_79451 = x_79449;\n                                }\n                            }\n                         ",
                   "   if (sle32(wave_sizze_79435, skip_threads_79458)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_79458 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                \n                bool no_carry_in_79461 = squot32(local_tid_79433, 32) == 0 ||\n                     !ltid_in_bounds_79454;\n                \n                // carry-in for every block except the first\n                {\n                    // read operands\n                    {\n                        if (!no_carry_in_79461) {\n                            x_72227 = x_72225;\n                            x_72228 = x_72226;\n                            x_72225 = ((__local\n                                        float *) red_arr_mem_79437)[sext_i32_i64(squot32(local_tid_79433,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                            x_72226 = ((__local\n                                        float *) red_arr_mem_79439)[sext_i32_i64(squot32(local_tid_79433,\n                                                                                         32)) -\n                                                                    (int64_t) 1];\n                        }\n                    }\n                    // perform operation\n                    {\n                        bool inactive_79462 =\n                             slt64(srem64(sext_i32_i64(local_tid_79433),\n                                          q_65346),\n                                   sext_i32_i64(local_tid_79433) -\n                                   sext_i32_i64(squot32(local_tid_79433, 32) *\n                                   32 - 1));\n                        \n                        if (!no_carry_in_79461) {\n                            if (inactiv",
                   "e_79462) {\n                                x_72225 = x_72227;\n                                x_72226 = x_72228;\n                            }\n                        }\n                        if (!no_carry_in_79461) {\n                            if (!inactive_79462) {\n                                float defunc_1_op_res_72229 = x_72225 + x_72227;\n                                float defunc_1_op_res_72230 = x_72226 + x_72228;\n                                \n                                x_72225 = defunc_1_op_res_72229;\n                                x_72226 = defunc_1_op_res_72230;\n                            }\n                        }\n                    }\n                    // write final result\n                    {\n                        if (!no_carry_in_79461) {\n                            ((__local\n                              float *) red_arr_mem_79437)[sext_i32_i64(local_tid_79433)] =\n                                x_72225;\n                            ((__local\n                              float *) red_arr_mem_79439)[sext_i32_i64(local_tid_79433)] =\n                                x_72226;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_79433, 32) == 0 &&\n                        ltid_in_bounds_79454) {\n                        ((__local\n                          float *) red_arr_mem_79437)[sext_i32_i64(local_tid_79433)] =\n                            x_72227;\n                        ((__local\n                          float *) red_arr_mem_79439)[sext_i32_i64(local_tid_79433)] =\n                            x_72228;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_79443) *\n   ",
                   "                   squot64(segred_group_sizze_72216,\n                              segment_sizze_nonzzero_79430) +\n                      sext_i32_i64(local_tid_79433), m_65343 * n_m_65352) &&\n                slt64(sext_i32_i64(local_tid_79433),\n                      squot64(segred_group_sizze_72216,\n                              segment_sizze_nonzzero_79430))) {\n                float tmp_79463;\n                \n                tmp_79463 = ((__local\n                              float *) red_arr_mem_79437)[(sext_i32_i64(local_tid_79433) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_79430 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77802)[squot64(sext_i32_i64(virt_group_id_79443) *\n                                              squot64(segred_group_sizze_72216,\n                                                      segment_sizze_nonzzero_79430) +\n                                              sext_i32_i64(local_tid_79433),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_79443) *\n                                       squot64(segred_group_sizze_72216,\n                                               segment_sizze_nonzzero_79430) +\n                                       sext_i32_i64(local_tid_79433) -\n                                       squot64(sext_i32_i64(virt_group_id_79443) *\n                                               squot64(segred_group_sizze_72216,\n                                                       segment_sizze_nonzzero_79430) +\n                                               sext_i32_i64(local_tid_79433),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_79463;\n                \n                float tmp_79464;\n                ",
                   "\n                tmp_79464 = ((__local\n                              float *) red_arr_mem_79439)[(sext_i32_i64(local_tid_79433) +\n                                                           (int64_t) 1) *\n                                                          segment_sizze_nonzzero_79430 -\n                                                          (int64_t) 1];\n                ((__global\n                  float *) mem_77806)[squot64(sext_i32_i64(virt_group_id_79443) *\n                                              squot64(segred_group_sizze_72216,\n                                                      segment_sizze_nonzzero_79430) +\n                                              sext_i32_i64(local_tid_79433),\n                                              n_m_65352) * n_m_65352 +\n                                      (sext_i32_i64(virt_group_id_79443) *\n                                       squot64(segred_group_sizze_72216,\n                                               segment_sizze_nonzzero_79430) +\n                                       sext_i32_i64(local_tid_79433) -\n                                       squot64(sext_i32_i64(virt_group_id_79443) *\n                                               squot64(segred_group_sizze_72216,\n                                                       segment_sizze_nonzzero_79430) +\n                                               sext_i32_i64(local_tid_79433),\n                                               n_m_65352) * n_m_65352)] =\n                    tmp_79464;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_72216\n}\n",
                   NULL};
static const char *tuning_param_names[] =
                  {"builtin#replicate_f32.group_size_78278",
                   "builtin#replicate_i64.group_size_78392",
                   "main.segmap_group_size_66697",
                   "main.segmap_group_size_67289",
                   "main.segmap_group_size_67347",
                   "main.segmap_group_size_67661",
                   "main.segmap_group_size_67686",
                   "main.segmap_group_size_67712",
                   "main.segmap_group_size_67738",
                   "main.segmap_group_size_68324",
                   "main.segmap_group_size_69026",
                   "main.segmap_group_size_69101",
                   "main.segmap_group_size_69452",
                   "main.segmap_group_size_69477",
                   "main.segmap_group_size_69503",
                   "main.segmap_group_size_69529",
                   "main.segmap_group_size_70183",
                   "main.segmap_group_size_70998",
                   "main.segmap_group_size_71100",
                   "main.segmap_group_size_71491",
                   "main.segmap_group_size_71516",
                   "main.segmap_group_size_71542",
                   "main.segmap_group_size_71568",
                   "main.segmap_group_size_72476",
                   "main.segmap_group_size_72501",
                   "main.segmap_group_size_72527",
                   "main.segmap_group_size_72553",
                   "main.segmap_group_size_73143",
                   "main.segmap_group_size_73168",
                   "main.segmap_group_size_73194",
                   "main.segmap_group_size_73220",
                   "main.segmap_group_size_73900",
                   "main.segmap_group_size_73925",
                   "main.segmap_group_size_73951",
                   "main.segmap_group_size_73977",
                   "main.segmap_group_size_74432",
                   "main.segmap_num_groups_66699",
                   "main.segmap_num_groups_68326",
                   "main.segmap_num_groups_70185",
                   "main.segred_group_size_67234",
                   "main.segred_group_size_67302",
                   "main.segred_group_size_68953",
                   "main.segred_group_size_69048",
                   "main.segred_group_size_70912",
                   "main.segred_group_size_71039",
                   "main.segred_num_groups_67236",
                   "main.segred_num_groups_67304",
                   "main.segred_num_groups_68955",
                   "main.segred_num_groups_69050",
                   "main.segred_num_groups_70914",
                   "main.segred_num_groups_71041",
                   "main.segscan_group_size_67824",
                   "main.segscan_group_size_69615",
                   "main.segscan_group_size_71654",
                   "main.segscan_group_size_72639",
                   "main.segscan_group_size_73306",
                   "main.segscan_group_size_74063",
                   "main.segscan_num_groups_67826",
                   "main.segscan_num_groups_69617",
                   "main.segscan_num_groups_71656",
                   "main.segscan_num_groups_72641",
                   "main.segscan_num_groups_73308",
                   "main.segscan_num_groups_74065", "main.suff_outer_par_0",
                   "main.suff_outer_par_1", "main.suff_outer_par_2",
                   "main.suff_outer_par_3", "main.suff_outer_par_4",
                   "main.suff_outer_par_5", "main.tile_size_74752",
                   "main.tile_size_75306", "main.tile_size_75977"};
static const char *tuning_param_vars[] =
                  {"builtinzhreplicate_f32zigroup_sizze_78278",
                   "builtinzhreplicate_i64zigroup_sizze_78392",
                   "mainzisegmap_group_sizze_66697",
                   "mainzisegmap_group_sizze_67289",
                   "mainzisegmap_group_sizze_67347",
                   "mainzisegmap_group_sizze_67661",
                   "mainzisegmap_group_sizze_67686",
                   "mainzisegmap_group_sizze_67712",
                   "mainzisegmap_group_sizze_67738",
                   "mainzisegmap_group_sizze_68324",
                   "mainzisegmap_group_sizze_69026",
                   "mainzisegmap_group_sizze_69101",
                   "mainzisegmap_group_sizze_69452",
                   "mainzisegmap_group_sizze_69477",
                   "mainzisegmap_group_sizze_69503",
                   "mainzisegmap_group_sizze_69529",
                   "mainzisegmap_group_sizze_70183",
                   "mainzisegmap_group_sizze_70998",
                   "mainzisegmap_group_sizze_71100",
                   "mainzisegmap_group_sizze_71491",
                   "mainzisegmap_group_sizze_71516",
                   "mainzisegmap_group_sizze_71542",
                   "mainzisegmap_group_sizze_71568",
                   "mainzisegmap_group_sizze_72476",
                   "mainzisegmap_group_sizze_72501",
                   "mainzisegmap_group_sizze_72527",
                   "mainzisegmap_group_sizze_72553",
                   "mainzisegmap_group_sizze_73143",
                   "mainzisegmap_group_sizze_73168",
                   "mainzisegmap_group_sizze_73194",
                   "mainzisegmap_group_sizze_73220",
                   "mainzisegmap_group_sizze_73900",
                   "mainzisegmap_group_sizze_73925",
                   "mainzisegmap_group_sizze_73951",
                   "mainzisegmap_group_sizze_73977",
                   "mainzisegmap_group_sizze_74432",
                   "mainzisegmap_num_groups_66699",
                   "mainzisegmap_num_groups_68326",
                   "mainzisegmap_num_groups_70185",
                   "mainzisegred_group_sizze_67234",
                   "mainzisegred_group_sizze_67302",
                   "mainzisegred_group_sizze_68953",
                   "mainzisegred_group_sizze_69048",
                   "mainzisegred_group_sizze_70912",
                   "mainzisegred_group_sizze_71039",
                   "mainzisegred_num_groups_67236",
                   "mainzisegred_num_groups_67304",
                   "mainzisegred_num_groups_68955",
                   "mainzisegred_num_groups_69050",
                   "mainzisegred_num_groups_70914",
                   "mainzisegred_num_groups_71041",
                   "mainzisegscan_group_sizze_67824",
                   "mainzisegscan_group_sizze_69615",
                   "mainzisegscan_group_sizze_71654",
                   "mainzisegscan_group_sizze_72639",
                   "mainzisegscan_group_sizze_73306",
                   "mainzisegscan_group_sizze_74063",
                   "mainzisegscan_num_groups_67826",
                   "mainzisegscan_num_groups_69617",
                   "mainzisegscan_num_groups_71656",
                   "mainzisegscan_num_groups_72641",
                   "mainzisegscan_num_groups_73308",
                   "mainzisegscan_num_groups_74065", "mainzisuff_outer_par_0",
                   "mainzisuff_outer_par_1", "mainzisuff_outer_par_2",
                   "mainzisuff_outer_par_3", "mainzisuff_outer_par_4",
                   "mainzisuff_outer_par_5", "mainzitile_sizze_74752",
                   "mainzitile_sizze_75306", "mainzitile_sizze_75977"};
static const char *tuning_param_classes[] = {"group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "num_groups", "num_groups",
                                             "num_groups", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "num_groups",
                                             "num_groups", "num_groups",
                                             "num_groups", "num_groups",
                                             "num_groups", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "group_size",
                                             "group_size", "num_groups",
                                             "num_groups", "num_groups",
                                             "num_groups", "num_groups",
                                             "num_groups", "threshold(def,)",
                                             "threshold(def, !main.suff_outer_par_0)",
                                             "threshold(def,)",
                                             "threshold(def, !main.suff_outer_par_2)",
                                             "threshold(def,)",
                                             "threshold(def, !main.suff_outer_par_4)",
                                             "tile_size", "tile_size",
                                             "tile_size"};
struct tuning_params {
    int64_t *builtinzhreplicate_f32zigroup_sizze_78278;
    int64_t *builtinzhreplicate_i64zigroup_sizze_78392;
    int64_t *mainzisegmap_group_sizze_66697;
    int64_t *mainzisegmap_group_sizze_67289;
    int64_t *mainzisegmap_group_sizze_67347;
    int64_t *mainzisegmap_group_sizze_67661;
    int64_t *mainzisegmap_group_sizze_67686;
    int64_t *mainzisegmap_group_sizze_67712;
    int64_t *mainzisegmap_group_sizze_67738;
    int64_t *mainzisegmap_group_sizze_68324;
    int64_t *mainzisegmap_group_sizze_69026;
    int64_t *mainzisegmap_group_sizze_69101;
    int64_t *mainzisegmap_group_sizze_69452;
    int64_t *mainzisegmap_group_sizze_69477;
    int64_t *mainzisegmap_group_sizze_69503;
    int64_t *mainzisegmap_group_sizze_69529;
    int64_t *mainzisegmap_group_sizze_70183;
    int64_t *mainzisegmap_group_sizze_70998;
    int64_t *mainzisegmap_group_sizze_71100;
    int64_t *mainzisegmap_group_sizze_71491;
    int64_t *mainzisegmap_group_sizze_71516;
    int64_t *mainzisegmap_group_sizze_71542;
    int64_t *mainzisegmap_group_sizze_71568;
    int64_t *mainzisegmap_group_sizze_72476;
    int64_t *mainzisegmap_group_sizze_72501;
    int64_t *mainzisegmap_group_sizze_72527;
    int64_t *mainzisegmap_group_sizze_72553;
    int64_t *mainzisegmap_group_sizze_73143;
    int64_t *mainzisegmap_group_sizze_73168;
    int64_t *mainzisegmap_group_sizze_73194;
    int64_t *mainzisegmap_group_sizze_73220;
    int64_t *mainzisegmap_group_sizze_73900;
    int64_t *mainzisegmap_group_sizze_73925;
    int64_t *mainzisegmap_group_sizze_73951;
    int64_t *mainzisegmap_group_sizze_73977;
    int64_t *mainzisegmap_group_sizze_74432;
    int64_t *mainzisegmap_num_groups_66699;
    int64_t *mainzisegmap_num_groups_68326;
    int64_t *mainzisegmap_num_groups_70185;
    int64_t *mainzisegred_group_sizze_67234;
    int64_t *mainzisegred_group_sizze_67302;
    int64_t *mainzisegred_group_sizze_68953;
    int64_t *mainzisegred_group_sizze_69048;
    int64_t *mainzisegred_group_sizze_70912;
    int64_t *mainzisegred_group_sizze_71039;
    int64_t *mainzisegred_num_groups_67236;
    int64_t *mainzisegred_num_groups_67304;
    int64_t *mainzisegred_num_groups_68955;
    int64_t *mainzisegred_num_groups_69050;
    int64_t *mainzisegred_num_groups_70914;
    int64_t *mainzisegred_num_groups_71041;
    int64_t *mainzisegscan_group_sizze_67824;
    int64_t *mainzisegscan_group_sizze_69615;
    int64_t *mainzisegscan_group_sizze_71654;
    int64_t *mainzisegscan_group_sizze_72639;
    int64_t *mainzisegscan_group_sizze_73306;
    int64_t *mainzisegscan_group_sizze_74063;
    int64_t *mainzisegscan_num_groups_67826;
    int64_t *mainzisegscan_num_groups_69617;
    int64_t *mainzisegscan_num_groups_71656;
    int64_t *mainzisegscan_num_groups_72641;
    int64_t *mainzisegscan_num_groups_73308;
    int64_t *mainzisegscan_num_groups_74065;
    int64_t *mainzisuff_outer_par_0;
    int64_t *mainzisuff_outer_par_1;
    int64_t *mainzisuff_outer_par_2;
    int64_t *mainzisuff_outer_par_3;
    int64_t *mainzisuff_outer_par_4;
    int64_t *mainzisuff_outer_par_5;
    int64_t *mainzitile_sizze_74752;
    int64_t *mainzitile_sizze_75306;
    int64_t *mainzitile_sizze_75977;
};
struct futhark_context_config {
    int in_use;
    struct opencl_config opencl;
    int64_t tuning_params[72];
    int num_build_opts;
    const char **build_opts;
};
struct futhark_context_config *futhark_context_config_new(void)
{
    struct futhark_context_config *cfg =
                                  (struct futhark_context_config *) malloc(sizeof(struct futhark_context_config));
    
    if (cfg == NULL)
        return NULL;
    cfg->in_use = 0;
    cfg->num_build_opts = 0;
    cfg->build_opts = (const char **) malloc(sizeof(const char *));
    cfg->build_opts[0] = NULL;
    cfg->tuning_params[0] = 0;
    cfg->tuning_params[1] = 0;
    cfg->tuning_params[2] = 0;
    cfg->tuning_params[3] = 0;
    cfg->tuning_params[4] = 0;
    cfg->tuning_params[5] = 0;
    cfg->tuning_params[6] = 0;
    cfg->tuning_params[7] = 0;
    cfg->tuning_params[8] = 0;
    cfg->tuning_params[9] = 0;
    cfg->tuning_params[10] = 0;
    cfg->tuning_params[11] = 0;
    cfg->tuning_params[12] = 0;
    cfg->tuning_params[13] = 0;
    cfg->tuning_params[14] = 0;
    cfg->tuning_params[15] = 0;
    cfg->tuning_params[16] = 0;
    cfg->tuning_params[17] = 0;
    cfg->tuning_params[18] = 0;
    cfg->tuning_params[19] = 0;
    cfg->tuning_params[20] = 0;
    cfg->tuning_params[21] = 0;
    cfg->tuning_params[22] = 0;
    cfg->tuning_params[23] = 0;
    cfg->tuning_params[24] = 0;
    cfg->tuning_params[25] = 0;
    cfg->tuning_params[26] = 0;
    cfg->tuning_params[27] = 0;
    cfg->tuning_params[28] = 0;
    cfg->tuning_params[29] = 0;
    cfg->tuning_params[30] = 0;
    cfg->tuning_params[31] = 0;
    cfg->tuning_params[32] = 0;
    cfg->tuning_params[33] = 0;
    cfg->tuning_params[34] = 0;
    cfg->tuning_params[35] = 0;
    cfg->tuning_params[36] = 0;
    cfg->tuning_params[37] = 0;
    cfg->tuning_params[38] = 0;
    cfg->tuning_params[39] = 0;
    cfg->tuning_params[40] = 0;
    cfg->tuning_params[41] = 0;
    cfg->tuning_params[42] = 0;
    cfg->tuning_params[43] = 0;
    cfg->tuning_params[44] = 0;
    cfg->tuning_params[45] = 0;
    cfg->tuning_params[46] = 0;
    cfg->tuning_params[47] = 0;
    cfg->tuning_params[48] = 0;
    cfg->tuning_params[49] = 0;
    cfg->tuning_params[50] = 0;
    cfg->tuning_params[51] = 0;
    cfg->tuning_params[52] = 0;
    cfg->tuning_params[53] = 0;
    cfg->tuning_params[54] = 0;
    cfg->tuning_params[55] = 0;
    cfg->tuning_params[56] = 0;
    cfg->tuning_params[57] = 0;
    cfg->tuning_params[58] = 0;
    cfg->tuning_params[59] = 0;
    cfg->tuning_params[60] = 0;
    cfg->tuning_params[61] = 0;
    cfg->tuning_params[62] = 0;
    cfg->tuning_params[63] = 0;
    cfg->tuning_params[64] = 0;
    cfg->tuning_params[65] = 0;
    cfg->tuning_params[66] = 0;
    cfg->tuning_params[67] = 0;
    cfg->tuning_params[68] = 0;
    cfg->tuning_params[69] = 0;
    cfg->tuning_params[70] = 0;
    cfg->tuning_params[71] = 0;
    opencl_config_init(&cfg->opencl, 72, tuning_param_names, tuning_param_vars,
                       cfg->tuning_params, tuning_param_classes);
    return cfg;
}
void futhark_context_config_free(struct futhark_context_config *cfg)
{
    assert(!cfg->in_use);
    free(cfg->build_opts);
    free(cfg);
}
void futhark_context_config_add_build_option(struct futhark_context_config *cfg,
                                             const char *opt)
{
    cfg->build_opts[cfg->num_build_opts] = opt;
    cfg->num_build_opts++;
    cfg->build_opts = (const char **) realloc(cfg->build_opts,
                                              (cfg->num_build_opts + 1) *
                                              sizeof(const char *));
    cfg->build_opts[cfg->num_build_opts] = NULL;
}
void futhark_context_config_set_debugging(struct futhark_context_config *cfg,
                                          int flag)
{
    cfg->opencl.profiling = cfg->opencl.logging = cfg->opencl.debugging = flag;
}
void futhark_context_config_set_profiling(struct futhark_context_config *cfg,
                                          int flag)
{
    cfg->opencl.profiling = flag;
}
void futhark_context_config_set_logging(struct futhark_context_config *cfg,
                                        int flag)
{
    cfg->opencl.logging = flag;
}
void futhark_context_config_set_device(struct futhark_context_config *cfg, const
                                       char *s)
{
    set_preferred_device(&cfg->opencl, s);
}
void futhark_context_config_set_platform(struct futhark_context_config *cfg,
                                         const char *s)
{
    set_preferred_platform(&cfg->opencl, s);
}
void futhark_context_config_select_device_interactively(struct futhark_context_config *cfg)
{
    select_device_interactively(&cfg->opencl);
}
void futhark_context_config_list_devices(struct futhark_context_config *cfg)
{
    (void) cfg;
    list_devices();
}
void futhark_context_config_dump_program_to(struct futhark_context_config *cfg,
                                            const char *path)
{
    cfg->opencl.dump_program_to = path;
}
void futhark_context_config_load_program_from(struct futhark_context_config *cfg,
                                              const char *path)
{
    cfg->opencl.load_program_from = path;
}
void futhark_context_config_dump_binary_to(struct futhark_context_config *cfg,
                                           const char *path)
{
    cfg->opencl.dump_binary_to = path;
}
void futhark_context_config_load_binary_from(struct futhark_context_config *cfg,
                                             const char *path)
{
    cfg->opencl.load_binary_from = path;
}
void futhark_context_config_set_default_group_size(struct futhark_context_config *cfg,
                                                   int size)
{
    cfg->opencl.default_group_size = size;
    cfg->opencl.default_group_size_changed = 1;
}
void futhark_context_config_set_default_num_groups(struct futhark_context_config *cfg,
                                                   int num)
{
    cfg->opencl.default_num_groups = num;
}
void futhark_context_config_set_default_tile_size(struct futhark_context_config *cfg,
                                                  int size)
{
    cfg->opencl.default_tile_size = size;
    cfg->opencl.default_tile_size_changed = 1;
}
void futhark_context_config_set_default_reg_tile_size(struct futhark_context_config *cfg,
                                                      int size)
{
    cfg->opencl.default_reg_tile_size = size;
}
void futhark_context_config_set_default_threshold(struct futhark_context_config *cfg,
                                                  int size)
{
    cfg->opencl.default_threshold = size;
}
int futhark_context_config_set_tuning_param(struct futhark_context_config *cfg,
                                            const char *param_name,
                                            size_t new_value)
{
    for (int i = 0; i < 72; i++) {
        if (strcmp(param_name, tuning_param_names[i]) == 0) {
            cfg->tuning_params[i] = new_value;
            return 0;
        }
    }
    if (strcmp(param_name, "default_group_size") == 0) {
        cfg->opencl.default_group_size = new_value;
        return 0;
    }
    if (strcmp(param_name, "default_num_groups") == 0) {
        cfg->opencl.default_num_groups = new_value;
        return 0;
    }
    if (strcmp(param_name, "default_threshold") == 0) {
        cfg->opencl.default_threshold = new_value;
        return 0;
    }
    if (strcmp(param_name, "default_tile_size") == 0) {
        cfg->opencl.default_tile_size = new_value;
        return 0;
    }
    if (strcmp(param_name, "default_reg_tile_size") == 0) {
        cfg->opencl.default_reg_tile_size = new_value;
        return 0;
    }
    return 1;
}
struct futhark_context {
    struct futhark_context_config *cfg;
    int detail_memory;
    int debugging;
    int profiling;
    int profiling_paused;
    int logging;
    lock_t lock;
    char *error;
    FILE *log;
    int64_t peak_mem_usage_device;
    int64_t cur_mem_usage_device;
    int64_t peak_mem_usage_default;
    int64_t cur_mem_usage_default;
    struct {
        int dummy;
    } constants;
    struct memblock_device mainzicounter_mem_78522;
    struct memblock_device mainzicounter_mem_78604;
    struct memblock_device mainzicounter_mem_78911;
    struct memblock_device mainzicounter_mem_79013;
    struct memblock_device mainzicounter_mem_79360;
    struct memblock_device mainzicounter_mem_79474;
    int total_runs;
    long total_runtime;
    cl_kernel builtinzhreplicate_f32zireplicate_78275;
    cl_kernel builtinzhreplicate_i64zireplicate_78389;
    cl_kernel gpu_map_transpose_f32;
    cl_kernel gpu_map_transpose_f32_low_height;
    cl_kernel gpu_map_transpose_f32_low_width;
    cl_kernel gpu_map_transpose_f32_small;
    cl_kernel mainziscan_stage1_67850;
    cl_kernel mainziscan_stage1_69641;
    cl_kernel mainziscan_stage1_71680;
    cl_kernel mainziscan_stage1_72665;
    cl_kernel mainziscan_stage1_73332;
    cl_kernel mainziscan_stage1_74089;
    cl_kernel mainziscan_stage2_67850;
    cl_kernel mainziscan_stage2_69641;
    cl_kernel mainziscan_stage2_71680;
    cl_kernel mainziscan_stage2_72665;
    cl_kernel mainziscan_stage2_73332;
    cl_kernel mainziscan_stage2_74089;
    cl_kernel mainziscan_stage3_67850;
    cl_kernel mainziscan_stage3_69641;
    cl_kernel mainziscan_stage3_71680;
    cl_kernel mainziscan_stage3_72665;
    cl_kernel mainziscan_stage3_73332;
    cl_kernel mainziscan_stage3_74089;
    cl_kernel mainzisegmap_66881;
    cl_kernel mainzisegmap_67903;
    cl_kernel mainzisegmap_67922;
    cl_kernel mainzisegmap_67934;
    cl_kernel mainzisegmap_67954;
    cl_kernel mainzisegmap_68125;
    cl_kernel mainzisegmap_68266;
    cl_kernel mainzisegmap_68538;
    cl_kernel mainzisegmap_69694;
    cl_kernel mainzisegmap_69713;
    cl_kernel mainzisegmap_69725;
    cl_kernel mainzisegmap_69745;
    cl_kernel mainzisegmap_69946;
    cl_kernel mainzisegmap_70099;
    cl_kernel mainzisegmap_70429;
    cl_kernel mainzisegmap_71733;
    cl_kernel mainzisegmap_71752;
    cl_kernel mainzisegmap_71764;
    cl_kernel mainzisegmap_71784;
    cl_kernel mainzisegmap_72017;
    cl_kernel mainzisegmap_72182;
    cl_kernel mainzisegmap_72718;
    cl_kernel mainzisegmap_72737;
    cl_kernel mainzisegmap_72749;
    cl_kernel mainzisegmap_72769;
    cl_kernel mainzisegmap_73385;
    cl_kernel mainzisegmap_73404;
    cl_kernel mainzisegmap_73416;
    cl_kernel mainzisegmap_73436;
    cl_kernel mainzisegmap_74142;
    cl_kernel mainzisegmap_74161;
    cl_kernel mainzisegmap_74173;
    cl_kernel mainzisegmap_74193;
    cl_kernel mainzisegmap_74555;
    cl_kernel mainzisegmap_intragroup_72785;
    cl_kernel mainzisegmap_intragroup_73453;
    cl_kernel mainzisegmap_intragroup_74210;
    cl_kernel mainzisegmap_intragroup_74758;
    cl_kernel mainzisegmap_intragroup_75312;
    cl_kernel mainzisegmap_intragroup_75983;
    cl_kernel mainzisegred_large_68229;
    cl_kernel mainzisegred_large_68279;
    cl_kernel mainzisegred_large_70052;
    cl_kernel mainzisegred_large_70122;
    cl_kernel mainzisegred_large_72125;
    cl_kernel mainzisegred_large_72224;
    cl_kernel mainzisegred_small_68229;
    cl_kernel mainzisegred_small_68279;
    cl_kernel mainzisegred_small_70052;
    cl_kernel mainzisegred_small_70122;
    cl_kernel mainzisegred_small_72125;
    cl_kernel mainzisegred_small_72224;
    int64_t copy_dev_to_dev_total_runtime;
    int copy_dev_to_dev_runs;
    int64_t copy_dev_to_host_total_runtime;
    int copy_dev_to_host_runs;
    int64_t copy_host_to_dev_total_runtime;
    int copy_host_to_dev_runs;
    int64_t copy_scalar_to_dev_total_runtime;
    int copy_scalar_to_dev_runs;
    int64_t copy_scalar_from_dev_total_runtime;
    int copy_scalar_from_dev_runs;
    int64_t builtinzhreplicate_f32zireplicate_78275_total_runtime;
    int builtinzhreplicate_f32zireplicate_78275_runs;
    int64_t builtinzhreplicate_i64zireplicate_78389_total_runtime;
    int builtinzhreplicate_i64zireplicate_78389_runs;
    int64_t gpu_map_transpose_f32_total_runtime;
    int gpu_map_transpose_f32_runs;
    int64_t gpu_map_transpose_f32_low_height_total_runtime;
    int gpu_map_transpose_f32_low_height_runs;
    int64_t gpu_map_transpose_f32_low_width_total_runtime;
    int gpu_map_transpose_f32_low_width_runs;
    int64_t gpu_map_transpose_f32_small_total_runtime;
    int gpu_map_transpose_f32_small_runs;
    int64_t mainziscan_stage1_67850_total_runtime;
    int mainziscan_stage1_67850_runs;
    int64_t mainziscan_stage1_69641_total_runtime;
    int mainziscan_stage1_69641_runs;
    int64_t mainziscan_stage1_71680_total_runtime;
    int mainziscan_stage1_71680_runs;
    int64_t mainziscan_stage1_72665_total_runtime;
    int mainziscan_stage1_72665_runs;
    int64_t mainziscan_stage1_73332_total_runtime;
    int mainziscan_stage1_73332_runs;
    int64_t mainziscan_stage1_74089_total_runtime;
    int mainziscan_stage1_74089_runs;
    int64_t mainziscan_stage2_67850_total_runtime;
    int mainziscan_stage2_67850_runs;
    int64_t mainziscan_stage2_69641_total_runtime;
    int mainziscan_stage2_69641_runs;
    int64_t mainziscan_stage2_71680_total_runtime;
    int mainziscan_stage2_71680_runs;
    int64_t mainziscan_stage2_72665_total_runtime;
    int mainziscan_stage2_72665_runs;
    int64_t mainziscan_stage2_73332_total_runtime;
    int mainziscan_stage2_73332_runs;
    int64_t mainziscan_stage2_74089_total_runtime;
    int mainziscan_stage2_74089_runs;
    int64_t mainziscan_stage3_67850_total_runtime;
    int mainziscan_stage3_67850_runs;
    int64_t mainziscan_stage3_69641_total_runtime;
    int mainziscan_stage3_69641_runs;
    int64_t mainziscan_stage3_71680_total_runtime;
    int mainziscan_stage3_71680_runs;
    int64_t mainziscan_stage3_72665_total_runtime;
    int mainziscan_stage3_72665_runs;
    int64_t mainziscan_stage3_73332_total_runtime;
    int mainziscan_stage3_73332_runs;
    int64_t mainziscan_stage3_74089_total_runtime;
    int mainziscan_stage3_74089_runs;
    int64_t mainzisegmap_66881_total_runtime;
    int mainzisegmap_66881_runs;
    int64_t mainzisegmap_67903_total_runtime;
    int mainzisegmap_67903_runs;
    int64_t mainzisegmap_67922_total_runtime;
    int mainzisegmap_67922_runs;
    int64_t mainzisegmap_67934_total_runtime;
    int mainzisegmap_67934_runs;
    int64_t mainzisegmap_67954_total_runtime;
    int mainzisegmap_67954_runs;
    int64_t mainzisegmap_68125_total_runtime;
    int mainzisegmap_68125_runs;
    int64_t mainzisegmap_68266_total_runtime;
    int mainzisegmap_68266_runs;
    int64_t mainzisegmap_68538_total_runtime;
    int mainzisegmap_68538_runs;
    int64_t mainzisegmap_69694_total_runtime;
    int mainzisegmap_69694_runs;
    int64_t mainzisegmap_69713_total_runtime;
    int mainzisegmap_69713_runs;
    int64_t mainzisegmap_69725_total_runtime;
    int mainzisegmap_69725_runs;
    int64_t mainzisegmap_69745_total_runtime;
    int mainzisegmap_69745_runs;
    int64_t mainzisegmap_69946_total_runtime;
    int mainzisegmap_69946_runs;
    int64_t mainzisegmap_70099_total_runtime;
    int mainzisegmap_70099_runs;
    int64_t mainzisegmap_70429_total_runtime;
    int mainzisegmap_70429_runs;
    int64_t mainzisegmap_71733_total_runtime;
    int mainzisegmap_71733_runs;
    int64_t mainzisegmap_71752_total_runtime;
    int mainzisegmap_71752_runs;
    int64_t mainzisegmap_71764_total_runtime;
    int mainzisegmap_71764_runs;
    int64_t mainzisegmap_71784_total_runtime;
    int mainzisegmap_71784_runs;
    int64_t mainzisegmap_72017_total_runtime;
    int mainzisegmap_72017_runs;
    int64_t mainzisegmap_72182_total_runtime;
    int mainzisegmap_72182_runs;
    int64_t mainzisegmap_72718_total_runtime;
    int mainzisegmap_72718_runs;
    int64_t mainzisegmap_72737_total_runtime;
    int mainzisegmap_72737_runs;
    int64_t mainzisegmap_72749_total_runtime;
    int mainzisegmap_72749_runs;
    int64_t mainzisegmap_72769_total_runtime;
    int mainzisegmap_72769_runs;
    int64_t mainzisegmap_73385_total_runtime;
    int mainzisegmap_73385_runs;
    int64_t mainzisegmap_73404_total_runtime;
    int mainzisegmap_73404_runs;
    int64_t mainzisegmap_73416_total_runtime;
    int mainzisegmap_73416_runs;
    int64_t mainzisegmap_73436_total_runtime;
    int mainzisegmap_73436_runs;
    int64_t mainzisegmap_74142_total_runtime;
    int mainzisegmap_74142_runs;
    int64_t mainzisegmap_74161_total_runtime;
    int mainzisegmap_74161_runs;
    int64_t mainzisegmap_74173_total_runtime;
    int mainzisegmap_74173_runs;
    int64_t mainzisegmap_74193_total_runtime;
    int mainzisegmap_74193_runs;
    int64_t mainzisegmap_74555_total_runtime;
    int mainzisegmap_74555_runs;
    int64_t mainzisegmap_intragroup_72785_total_runtime;
    int mainzisegmap_intragroup_72785_runs;
    int64_t mainzisegmap_intragroup_73453_total_runtime;
    int mainzisegmap_intragroup_73453_runs;
    int64_t mainzisegmap_intragroup_74210_total_runtime;
    int mainzisegmap_intragroup_74210_runs;
    int64_t mainzisegmap_intragroup_74758_total_runtime;
    int mainzisegmap_intragroup_74758_runs;
    int64_t mainzisegmap_intragroup_75312_total_runtime;
    int mainzisegmap_intragroup_75312_runs;
    int64_t mainzisegmap_intragroup_75983_total_runtime;
    int mainzisegmap_intragroup_75983_runs;
    int64_t mainzisegred_large_68229_total_runtime;
    int mainzisegred_large_68229_runs;
    int64_t mainzisegred_large_68279_total_runtime;
    int mainzisegred_large_68279_runs;
    int64_t mainzisegred_large_70052_total_runtime;
    int mainzisegred_large_70052_runs;
    int64_t mainzisegred_large_70122_total_runtime;
    int mainzisegred_large_70122_runs;
    int64_t mainzisegred_large_72125_total_runtime;
    int mainzisegred_large_72125_runs;
    int64_t mainzisegred_large_72224_total_runtime;
    int mainzisegred_large_72224_runs;
    int64_t mainzisegred_small_68229_total_runtime;
    int mainzisegred_small_68229_runs;
    int64_t mainzisegred_small_68279_total_runtime;
    int mainzisegred_small_68279_runs;
    int64_t mainzisegred_small_70052_total_runtime;
    int mainzisegred_small_70052_runs;
    int64_t mainzisegred_small_70122_total_runtime;
    int mainzisegred_small_70122_runs;
    int64_t mainzisegred_small_72125_total_runtime;
    int mainzisegred_small_72125_runs;
    int64_t mainzisegred_small_72224_total_runtime;
    int mainzisegred_small_72224_runs;
    cl_mem global_failure;
    cl_mem global_failure_args;
    struct opencl_context opencl;
    struct tuning_params tuning_params;
    cl_int failure_is_an_option;
};
void post_opencl_setup(struct opencl_context *ctx,
                       struct opencl_device_option *option)
{
    if ((ctx->lockstep_width == 0 && strstr(option->platform_name,
                                            "NVIDIA CUDA") != NULL) &&
        (option->device_type & CL_DEVICE_TYPE_GPU) == CL_DEVICE_TYPE_GPU) {
        ctx->lockstep_width = 32;
    }
    if ((ctx->lockstep_width == 0 && strstr(option->platform_name,
                                            "AMD Accelerated Parallel Processing") !=
         NULL) && (option->device_type & CL_DEVICE_TYPE_GPU) ==
        CL_DEVICE_TYPE_GPU) {
        ctx->lockstep_width = 32;
    }
    if ((ctx->lockstep_width == 0 && strstr(option->platform_name, "") !=
         NULL) && (option->device_type & CL_DEVICE_TYPE_GPU) ==
        CL_DEVICE_TYPE_GPU) {
        ctx->lockstep_width = 1;
    }
    if ((ctx->cfg.default_num_groups == 0 && strstr(option->platform_name,
                                                    "") != NULL) &&
        (option->device_type & CL_DEVICE_TYPE_GPU) == CL_DEVICE_TYPE_GPU) {
        size_t MAX_COMPUTE_UNITS_val = 0;
        
        clGetDeviceInfo(ctx->device, CL_DEVICE_MAX_COMPUTE_UNITS,
                        sizeof(MAX_COMPUTE_UNITS_val), &MAX_COMPUTE_UNITS_val,
                        NULL);
        ctx->cfg.default_num_groups = 4 * MAX_COMPUTE_UNITS_val;
    }
    if ((ctx->cfg.default_group_size == 0 && strstr(option->platform_name,
                                                    "") != NULL) &&
        (option->device_type & CL_DEVICE_TYPE_GPU) == CL_DEVICE_TYPE_GPU) {
        ctx->cfg.default_group_size = 256;
    }
    if ((ctx->cfg.default_tile_size == 0 && strstr(option->platform_name, "") !=
         NULL) && (option->device_type & CL_DEVICE_TYPE_GPU) ==
        CL_DEVICE_TYPE_GPU) {
        ctx->cfg.default_tile_size = 32;
    }
    if ((ctx->cfg.default_reg_tile_size == 0 && strstr(option->platform_name,
                                                       "") != NULL) &&
        (option->device_type & CL_DEVICE_TYPE_GPU) == CL_DEVICE_TYPE_GPU) {
        ctx->cfg.default_reg_tile_size = 2;
    }
    if ((ctx->cfg.default_threshold == 0 && strstr(option->platform_name, "") !=
         NULL) && (option->device_type & CL_DEVICE_TYPE_GPU) ==
        CL_DEVICE_TYPE_GPU) {
        ctx->cfg.default_threshold = 32768;
    }
    if ((ctx->lockstep_width == 0 && strstr(option->platform_name, "") !=
         NULL) && (option->device_type & CL_DEVICE_TYPE_CPU) ==
        CL_DEVICE_TYPE_CPU) {
        ctx->lockstep_width = 1;
    }
    if ((ctx->cfg.default_num_groups == 0 && strstr(option->platform_name,
                                                    "") != NULL) &&
        (option->device_type & CL_DEVICE_TYPE_CPU) == CL_DEVICE_TYPE_CPU) {
        size_t MAX_COMPUTE_UNITS_val = 0;
        
        clGetDeviceInfo(ctx->device, CL_DEVICE_MAX_COMPUTE_UNITS,
                        sizeof(MAX_COMPUTE_UNITS_val), &MAX_COMPUTE_UNITS_val,
                        NULL);
        ctx->cfg.default_num_groups = MAX_COMPUTE_UNITS_val;
    }
    if ((ctx->cfg.default_group_size == 0 && strstr(option->platform_name,
                                                    "") != NULL) &&
        (option->device_type & CL_DEVICE_TYPE_CPU) == CL_DEVICE_TYPE_CPU) {
        ctx->cfg.default_group_size = 32;
    }
    if ((ctx->cfg.default_tile_size == 0 && strstr(option->platform_name, "") !=
         NULL) && (option->device_type & CL_DEVICE_TYPE_CPU) ==
        CL_DEVICE_TYPE_CPU) {
        ctx->cfg.default_tile_size = 4;
    }
    if ((ctx->cfg.default_reg_tile_size == 0 && strstr(option->platform_name,
                                                       "") != NULL) &&
        (option->device_type & CL_DEVICE_TYPE_CPU) == CL_DEVICE_TYPE_CPU) {
        ctx->cfg.default_reg_tile_size = 1;
    }
    if ((ctx->cfg.default_threshold == 0 && strstr(option->platform_name, "") !=
         NULL) && (option->device_type & CL_DEVICE_TYPE_CPU) ==
        CL_DEVICE_TYPE_CPU) {
        size_t MAX_COMPUTE_UNITS_val = 0;
        
        clGetDeviceInfo(ctx->device, CL_DEVICE_MAX_COMPUTE_UNITS,
                        sizeof(MAX_COMPUTE_UNITS_val), &MAX_COMPUTE_UNITS_val,
                        NULL);
        ctx->cfg.default_threshold = MAX_COMPUTE_UNITS_val;
    }
}
static void init_context_early(struct futhark_context_config *cfg,
                               struct futhark_context *ctx)
{
    ctx->opencl.cfg = cfg->opencl;
    ctx->detail_memory = cfg->opencl.debugging;
    ctx->debugging = cfg->opencl.debugging;
    ctx->profiling = cfg->opencl.profiling;
    ctx->profiling_paused = 0;
    ctx->logging = cfg->opencl.logging;
    ctx->error = NULL;
    ctx->log = stderr;
    ctx->opencl.profiling_records_capacity = 200;
    ctx->opencl.profiling_records_used = 0;
    ctx->opencl.profiling_records =
        malloc(ctx->opencl.profiling_records_capacity *
        sizeof(struct profiling_record));
    create_lock(&ctx->lock);
    ctx->failure_is_an_option = 0;
    ctx->peak_mem_usage_device = 0;
    ctx->cur_mem_usage_device = 0;
    ctx->peak_mem_usage_default = 0;
    ctx->cur_mem_usage_default = 0;
    ctx->total_runs = 0;
    ctx->total_runtime = 0;
    ctx->copy_dev_to_dev_total_runtime = 0;
    ctx->copy_dev_to_dev_runs = 0;
    ctx->copy_dev_to_host_total_runtime = 0;
    ctx->copy_dev_to_host_runs = 0;
    ctx->copy_host_to_dev_total_runtime = 0;
    ctx->copy_host_to_dev_runs = 0;
    ctx->copy_scalar_to_dev_total_runtime = 0;
    ctx->copy_scalar_to_dev_runs = 0;
    ctx->copy_scalar_from_dev_total_runtime = 0;
    ctx->copy_scalar_from_dev_runs = 0;
    ctx->builtinzhreplicate_f32zireplicate_78275_total_runtime = 0;
    ctx->builtinzhreplicate_f32zireplicate_78275_runs = 0;
    ctx->builtinzhreplicate_i64zireplicate_78389_total_runtime = 0;
    ctx->builtinzhreplicate_i64zireplicate_78389_runs = 0;
    ctx->gpu_map_transpose_f32_total_runtime = 0;
    ctx->gpu_map_transpose_f32_runs = 0;
    ctx->gpu_map_transpose_f32_low_height_total_runtime = 0;
    ctx->gpu_map_transpose_f32_low_height_runs = 0;
    ctx->gpu_map_transpose_f32_low_width_total_runtime = 0;
    ctx->gpu_map_transpose_f32_low_width_runs = 0;
    ctx->gpu_map_transpose_f32_small_total_runtime = 0;
    ctx->gpu_map_transpose_f32_small_runs = 0;
    ctx->mainziscan_stage1_67850_total_runtime = 0;
    ctx->mainziscan_stage1_67850_runs = 0;
    ctx->mainziscan_stage1_69641_total_runtime = 0;
    ctx->mainziscan_stage1_69641_runs = 0;
    ctx->mainziscan_stage1_71680_total_runtime = 0;
    ctx->mainziscan_stage1_71680_runs = 0;
    ctx->mainziscan_stage1_72665_total_runtime = 0;
    ctx->mainziscan_stage1_72665_runs = 0;
    ctx->mainziscan_stage1_73332_total_runtime = 0;
    ctx->mainziscan_stage1_73332_runs = 0;
    ctx->mainziscan_stage1_74089_total_runtime = 0;
    ctx->mainziscan_stage1_74089_runs = 0;
    ctx->mainziscan_stage2_67850_total_runtime = 0;
    ctx->mainziscan_stage2_67850_runs = 0;
    ctx->mainziscan_stage2_69641_total_runtime = 0;
    ctx->mainziscan_stage2_69641_runs = 0;
    ctx->mainziscan_stage2_71680_total_runtime = 0;
    ctx->mainziscan_stage2_71680_runs = 0;
    ctx->mainziscan_stage2_72665_total_runtime = 0;
    ctx->mainziscan_stage2_72665_runs = 0;
    ctx->mainziscan_stage2_73332_total_runtime = 0;
    ctx->mainziscan_stage2_73332_runs = 0;
    ctx->mainziscan_stage2_74089_total_runtime = 0;
    ctx->mainziscan_stage2_74089_runs = 0;
    ctx->mainziscan_stage3_67850_total_runtime = 0;
    ctx->mainziscan_stage3_67850_runs = 0;
    ctx->mainziscan_stage3_69641_total_runtime = 0;
    ctx->mainziscan_stage3_69641_runs = 0;
    ctx->mainziscan_stage3_71680_total_runtime = 0;
    ctx->mainziscan_stage3_71680_runs = 0;
    ctx->mainziscan_stage3_72665_total_runtime = 0;
    ctx->mainziscan_stage3_72665_runs = 0;
    ctx->mainziscan_stage3_73332_total_runtime = 0;
    ctx->mainziscan_stage3_73332_runs = 0;
    ctx->mainziscan_stage3_74089_total_runtime = 0;
    ctx->mainziscan_stage3_74089_runs = 0;
    ctx->mainzisegmap_66881_total_runtime = 0;
    ctx->mainzisegmap_66881_runs = 0;
    ctx->mainzisegmap_67903_total_runtime = 0;
    ctx->mainzisegmap_67903_runs = 0;
    ctx->mainzisegmap_67922_total_runtime = 0;
    ctx->mainzisegmap_67922_runs = 0;
    ctx->mainzisegmap_67934_total_runtime = 0;
    ctx->mainzisegmap_67934_runs = 0;
    ctx->mainzisegmap_67954_total_runtime = 0;
    ctx->mainzisegmap_67954_runs = 0;
    ctx->mainzisegmap_68125_total_runtime = 0;
    ctx->mainzisegmap_68125_runs = 0;
    ctx->mainzisegmap_68266_total_runtime = 0;
    ctx->mainzisegmap_68266_runs = 0;
    ctx->mainzisegmap_68538_total_runtime = 0;
    ctx->mainzisegmap_68538_runs = 0;
    ctx->mainzisegmap_69694_total_runtime = 0;
    ctx->mainzisegmap_69694_runs = 0;
    ctx->mainzisegmap_69713_total_runtime = 0;
    ctx->mainzisegmap_69713_runs = 0;
    ctx->mainzisegmap_69725_total_runtime = 0;
    ctx->mainzisegmap_69725_runs = 0;
    ctx->mainzisegmap_69745_total_runtime = 0;
    ctx->mainzisegmap_69745_runs = 0;
    ctx->mainzisegmap_69946_total_runtime = 0;
    ctx->mainzisegmap_69946_runs = 0;
    ctx->mainzisegmap_70099_total_runtime = 0;
    ctx->mainzisegmap_70099_runs = 0;
    ctx->mainzisegmap_70429_total_runtime = 0;
    ctx->mainzisegmap_70429_runs = 0;
    ctx->mainzisegmap_71733_total_runtime = 0;
    ctx->mainzisegmap_71733_runs = 0;
    ctx->mainzisegmap_71752_total_runtime = 0;
    ctx->mainzisegmap_71752_runs = 0;
    ctx->mainzisegmap_71764_total_runtime = 0;
    ctx->mainzisegmap_71764_runs = 0;
    ctx->mainzisegmap_71784_total_runtime = 0;
    ctx->mainzisegmap_71784_runs = 0;
    ctx->mainzisegmap_72017_total_runtime = 0;
    ctx->mainzisegmap_72017_runs = 0;
    ctx->mainzisegmap_72182_total_runtime = 0;
    ctx->mainzisegmap_72182_runs = 0;
    ctx->mainzisegmap_72718_total_runtime = 0;
    ctx->mainzisegmap_72718_runs = 0;
    ctx->mainzisegmap_72737_total_runtime = 0;
    ctx->mainzisegmap_72737_runs = 0;
    ctx->mainzisegmap_72749_total_runtime = 0;
    ctx->mainzisegmap_72749_runs = 0;
    ctx->mainzisegmap_72769_total_runtime = 0;
    ctx->mainzisegmap_72769_runs = 0;
    ctx->mainzisegmap_73385_total_runtime = 0;
    ctx->mainzisegmap_73385_runs = 0;
    ctx->mainzisegmap_73404_total_runtime = 0;
    ctx->mainzisegmap_73404_runs = 0;
    ctx->mainzisegmap_73416_total_runtime = 0;
    ctx->mainzisegmap_73416_runs = 0;
    ctx->mainzisegmap_73436_total_runtime = 0;
    ctx->mainzisegmap_73436_runs = 0;
    ctx->mainzisegmap_74142_total_runtime = 0;
    ctx->mainzisegmap_74142_runs = 0;
    ctx->mainzisegmap_74161_total_runtime = 0;
    ctx->mainzisegmap_74161_runs = 0;
    ctx->mainzisegmap_74173_total_runtime = 0;
    ctx->mainzisegmap_74173_runs = 0;
    ctx->mainzisegmap_74193_total_runtime = 0;
    ctx->mainzisegmap_74193_runs = 0;
    ctx->mainzisegmap_74555_total_runtime = 0;
    ctx->mainzisegmap_74555_runs = 0;
    ctx->mainzisegmap_intragroup_72785_total_runtime = 0;
    ctx->mainzisegmap_intragroup_72785_runs = 0;
    ctx->mainzisegmap_intragroup_73453_total_runtime = 0;
    ctx->mainzisegmap_intragroup_73453_runs = 0;
    ctx->mainzisegmap_intragroup_74210_total_runtime = 0;
    ctx->mainzisegmap_intragroup_74210_runs = 0;
    ctx->mainzisegmap_intragroup_74758_total_runtime = 0;
    ctx->mainzisegmap_intragroup_74758_runs = 0;
    ctx->mainzisegmap_intragroup_75312_total_runtime = 0;
    ctx->mainzisegmap_intragroup_75312_runs = 0;
    ctx->mainzisegmap_intragroup_75983_total_runtime = 0;
    ctx->mainzisegmap_intragroup_75983_runs = 0;
    ctx->mainzisegred_large_68229_total_runtime = 0;
    ctx->mainzisegred_large_68229_runs = 0;
    ctx->mainzisegred_large_68279_total_runtime = 0;
    ctx->mainzisegred_large_68279_runs = 0;
    ctx->mainzisegred_large_70052_total_runtime = 0;
    ctx->mainzisegred_large_70052_runs = 0;
    ctx->mainzisegred_large_70122_total_runtime = 0;
    ctx->mainzisegred_large_70122_runs = 0;
    ctx->mainzisegred_large_72125_total_runtime = 0;
    ctx->mainzisegred_large_72125_runs = 0;
    ctx->mainzisegred_large_72224_total_runtime = 0;
    ctx->mainzisegred_large_72224_runs = 0;
    ctx->mainzisegred_small_68229_total_runtime = 0;
    ctx->mainzisegred_small_68229_runs = 0;
    ctx->mainzisegred_small_68279_total_runtime = 0;
    ctx->mainzisegred_small_68279_runs = 0;
    ctx->mainzisegred_small_70052_total_runtime = 0;
    ctx->mainzisegred_small_70052_runs = 0;
    ctx->mainzisegred_small_70122_total_runtime = 0;
    ctx->mainzisegred_small_70122_runs = 0;
    ctx->mainzisegred_small_72125_total_runtime = 0;
    ctx->mainzisegred_small_72125_runs = 0;
    ctx->mainzisegred_small_72224_total_runtime = 0;
    ctx->mainzisegred_small_72224_runs = 0;
}
static int init_context_late(struct futhark_context_config *cfg,
                             struct futhark_context *ctx, cl_program prog)
{
    cl_int error;
    cl_int no_error = -1;
    
    ctx->global_failure = clCreateBuffer(ctx->opencl.ctx, CL_MEM_READ_WRITE |
                                         CL_MEM_COPY_HOST_PTR, sizeof(cl_int),
                                         &no_error, &error);
    OPENCL_SUCCEED_OR_RETURN(error);
    // The +1 is to avoid zero-byte allocations.
    ctx->global_failure_args = clCreateBuffer(ctx->opencl.ctx,
                                              CL_MEM_READ_WRITE,
                                              sizeof(int64_t) * (2 + 1), NULL,
                                              &error);
    OPENCL_SUCCEED_OR_RETURN(error);
    {
        ctx->builtinzhreplicate_f32zireplicate_78275 = clCreateKernel(prog,
                                                                      "builtinzhreplicate_f32zireplicate_78275",
                                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "builtin#replicate_f32.replicate_78275");
    }
    {
        ctx->builtinzhreplicate_i64zireplicate_78389 = clCreateKernel(prog,
                                                                      "builtinzhreplicate_i64zireplicate_78389",
                                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "builtin#replicate_i64.replicate_78389");
    }
    {
        ctx->gpu_map_transpose_f32 = clCreateKernel(prog,
                                                    "gpu_map_transpose_f32",
                                                    &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "gpu_map_transpose_f32");
    }
    {
        ctx->gpu_map_transpose_f32_low_height = clCreateKernel(prog,
                                                               "gpu_map_transpose_f32_low_height",
                                                               &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "gpu_map_transpose_f32_low_height");
    }
    {
        ctx->gpu_map_transpose_f32_low_width = clCreateKernel(prog,
                                                              "gpu_map_transpose_f32_low_width",
                                                              &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "gpu_map_transpose_f32_low_width");
    }
    {
        ctx->gpu_map_transpose_f32_small = clCreateKernel(prog,
                                                          "gpu_map_transpose_f32_small",
                                                          &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "gpu_map_transpose_f32_small");
    }
    {
        ctx->mainziscan_stage1_67850 = clCreateKernel(prog,
                                                      "mainziscan_stage1_67850",
                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_67850, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.scan_stage1_67850");
    }
    {
        ctx->mainziscan_stage1_69641 = clCreateKernel(prog,
                                                      "mainziscan_stage1_69641",
                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_69641, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.scan_stage1_69641");
    }
    {
        ctx->mainziscan_stage1_71680 = clCreateKernel(prog,
                                                      "mainziscan_stage1_71680",
                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_71680, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.scan_stage1_71680");
    }
    {
        ctx->mainziscan_stage1_72665 = clCreateKernel(prog,
                                                      "mainziscan_stage1_72665",
                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_72665, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.scan_stage1_72665");
    }
    {
        ctx->mainziscan_stage1_73332 = clCreateKernel(prog,
                                                      "mainziscan_stage1_73332",
                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_73332, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.scan_stage1_73332");
    }
    {
        ctx->mainziscan_stage1_74089 = clCreateKernel(prog,
                                                      "mainziscan_stage1_74089",
                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_74089, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.scan_stage1_74089");
    }
    {
        ctx->mainziscan_stage2_67850 = clCreateKernel(prog,
                                                      "mainziscan_stage2_67850",
                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_67850, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.scan_stage2_67850");
    }
    {
        ctx->mainziscan_stage2_69641 = clCreateKernel(prog,
                                                      "mainziscan_stage2_69641",
                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_69641, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.scan_stage2_69641");
    }
    {
        ctx->mainziscan_stage2_71680 = clCreateKernel(prog,
                                                      "mainziscan_stage2_71680",
                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_71680, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.scan_stage2_71680");
    }
    {
        ctx->mainziscan_stage2_72665 = clCreateKernel(prog,
                                                      "mainziscan_stage2_72665",
                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_72665, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.scan_stage2_72665");
    }
    {
        ctx->mainziscan_stage2_73332 = clCreateKernel(prog,
                                                      "mainziscan_stage2_73332",
                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_73332, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.scan_stage2_73332");
    }
    {
        ctx->mainziscan_stage2_74089 = clCreateKernel(prog,
                                                      "mainziscan_stage2_74089",
                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_74089, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.scan_stage2_74089");
    }
    {
        ctx->mainziscan_stage3_67850 = clCreateKernel(prog,
                                                      "mainziscan_stage3_67850",
                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_67850, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.scan_stage3_67850");
    }
    {
        ctx->mainziscan_stage3_69641 = clCreateKernel(prog,
                                                      "mainziscan_stage3_69641",
                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_69641, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.scan_stage3_69641");
    }
    {
        ctx->mainziscan_stage3_71680 = clCreateKernel(prog,
                                                      "mainziscan_stage3_71680",
                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_71680, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.scan_stage3_71680");
    }
    {
        ctx->mainziscan_stage3_72665 = clCreateKernel(prog,
                                                      "mainziscan_stage3_72665",
                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_72665, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.scan_stage3_72665");
    }
    {
        ctx->mainziscan_stage3_73332 = clCreateKernel(prog,
                                                      "mainziscan_stage3_73332",
                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_73332, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.scan_stage3_73332");
    }
    {
        ctx->mainziscan_stage3_74089 = clCreateKernel(prog,
                                                      "mainziscan_stage3_74089",
                                                      &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_74089, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.scan_stage3_74089");
    }
    {
        ctx->mainzisegmap_66881 = clCreateKernel(prog, "mainzisegmap_66881",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_66881, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_66881, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_66881");
    }
    {
        ctx->mainzisegmap_67903 = clCreateKernel(prog, "mainzisegmap_67903",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_67903, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_67903");
    }
    {
        ctx->mainzisegmap_67922 = clCreateKernel(prog, "mainzisegmap_67922",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_67922, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_67922");
    }
    {
        ctx->mainzisegmap_67934 = clCreateKernel(prog, "mainzisegmap_67934",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_67934, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_67934");
    }
    {
        ctx->mainzisegmap_67954 = clCreateKernel(prog, "mainzisegmap_67954",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_67954, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_67954");
    }
    {
        ctx->mainzisegmap_68125 = clCreateKernel(prog, "mainzisegmap_68125",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_68125, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_68125, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_68125");
    }
    {
        ctx->mainzisegmap_68266 = clCreateKernel(prog, "mainzisegmap_68266",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_68266, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_68266");
    }
    {
        ctx->mainzisegmap_68538 = clCreateKernel(prog, "mainzisegmap_68538",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_68538, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_68538, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_68538");
    }
    {
        ctx->mainzisegmap_69694 = clCreateKernel(prog, "mainzisegmap_69694",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_69694, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_69694");
    }
    {
        ctx->mainzisegmap_69713 = clCreateKernel(prog, "mainzisegmap_69713",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_69713, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_69713");
    }
    {
        ctx->mainzisegmap_69725 = clCreateKernel(prog, "mainzisegmap_69725",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_69725, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_69725");
    }
    {
        ctx->mainzisegmap_69745 = clCreateKernel(prog, "mainzisegmap_69745",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_69745, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_69745");
    }
    {
        ctx->mainzisegmap_69946 = clCreateKernel(prog, "mainzisegmap_69946",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_69946, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_69946, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_69946");
    }
    {
        ctx->mainzisegmap_70099 = clCreateKernel(prog, "mainzisegmap_70099",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_70099, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_70099");
    }
    {
        ctx->mainzisegmap_70429 = clCreateKernel(prog, "mainzisegmap_70429",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_70429, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_70429, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_70429");
    }
    {
        ctx->mainzisegmap_71733 = clCreateKernel(prog, "mainzisegmap_71733",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_71733, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_71733");
    }
    {
        ctx->mainzisegmap_71752 = clCreateKernel(prog, "mainzisegmap_71752",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_71752, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_71752");
    }
    {
        ctx->mainzisegmap_71764 = clCreateKernel(prog, "mainzisegmap_71764",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_71764, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_71764");
    }
    {
        ctx->mainzisegmap_71784 = clCreateKernel(prog, "mainzisegmap_71784",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_71784, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_71784");
    }
    {
        ctx->mainzisegmap_72017 = clCreateKernel(prog, "mainzisegmap_72017",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_72017, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_72017, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_72017");
    }
    {
        ctx->mainzisegmap_72182 = clCreateKernel(prog, "mainzisegmap_72182",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_72182, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_72182");
    }
    {
        ctx->mainzisegmap_72718 = clCreateKernel(prog, "mainzisegmap_72718",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_72718, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_72718");
    }
    {
        ctx->mainzisegmap_72737 = clCreateKernel(prog, "mainzisegmap_72737",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_72737, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_72737");
    }
    {
        ctx->mainzisegmap_72749 = clCreateKernel(prog, "mainzisegmap_72749",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_72749, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_72749");
    }
    {
        ctx->mainzisegmap_72769 = clCreateKernel(prog, "mainzisegmap_72769",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_72769, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_72769");
    }
    {
        ctx->mainzisegmap_73385 = clCreateKernel(prog, "mainzisegmap_73385",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_73385, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_73385");
    }
    {
        ctx->mainzisegmap_73404 = clCreateKernel(prog, "mainzisegmap_73404",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_73404, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_73404");
    }
    {
        ctx->mainzisegmap_73416 = clCreateKernel(prog, "mainzisegmap_73416",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_73416, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_73416");
    }
    {
        ctx->mainzisegmap_73436 = clCreateKernel(prog, "mainzisegmap_73436",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_73436, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_73436");
    }
    {
        ctx->mainzisegmap_74142 = clCreateKernel(prog, "mainzisegmap_74142",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_74142, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_74142");
    }
    {
        ctx->mainzisegmap_74161 = clCreateKernel(prog, "mainzisegmap_74161",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_74161, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_74161");
    }
    {
        ctx->mainzisegmap_74173 = clCreateKernel(prog, "mainzisegmap_74173",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_74173, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_74173");
    }
    {
        ctx->mainzisegmap_74193 = clCreateKernel(prog, "mainzisegmap_74193",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_74193, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_74193");
    }
    {
        ctx->mainzisegmap_74555 = clCreateKernel(prog, "mainzisegmap_74555",
                                                 &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_74555, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_74555, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_74555");
    }
    {
        ctx->mainzisegmap_intragroup_72785 = clCreateKernel(prog,
                                                            "mainzisegmap_intragroup_72785",
                                                            &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_72785");
    }
    {
        ctx->mainzisegmap_intragroup_73453 = clCreateKernel(prog,
                                                            "mainzisegmap_intragroup_73453",
                                                            &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_73453");
    }
    {
        ctx->mainzisegmap_intragroup_74210 = clCreateKernel(prog,
                                                            "mainzisegmap_intragroup_74210",
                                                            &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_74210");
    }
    {
        ctx->mainzisegmap_intragroup_74758 = clCreateKernel(prog,
                                                            "mainzisegmap_intragroup_74758",
                                                            &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_74758");
    }
    {
        ctx->mainzisegmap_intragroup_75312 = clCreateKernel(prog,
                                                            "mainzisegmap_intragroup_75312",
                                                            &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_75312");
    }
    {
        ctx->mainzisegmap_intragroup_75983 = clCreateKernel(prog,
                                                            "mainzisegmap_intragroup_75983",
                                                            &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_75983");
    }
    {
        ctx->mainzisegred_large_68229 = clCreateKernel(prog,
                                                       "mainzisegred_large_68229",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_68229, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_68229");
    }
    {
        ctx->mainzisegred_large_68279 = clCreateKernel(prog,
                                                       "mainzisegred_large_68279",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_68279, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_68279");
    }
    {
        ctx->mainzisegred_large_70052 = clCreateKernel(prog,
                                                       "mainzisegred_large_70052",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_70052, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_70052");
    }
    {
        ctx->mainzisegred_large_70122 = clCreateKernel(prog,
                                                       "mainzisegred_large_70122",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_70122, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_70122");
    }
    {
        ctx->mainzisegred_large_72125 = clCreateKernel(prog,
                                                       "mainzisegred_large_72125",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_72125, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_72125");
    }
    {
        ctx->mainzisegred_large_72224 = clCreateKernel(prog,
                                                       "mainzisegred_large_72224",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_72224, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_72224");
    }
    {
        ctx->mainzisegred_small_68229 = clCreateKernel(prog,
                                                       "mainzisegred_small_68229",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_68229, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_68229");
    }
    {
        ctx->mainzisegred_small_68279 = clCreateKernel(prog,
                                                       "mainzisegred_small_68279",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_68279, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_68279");
    }
    {
        ctx->mainzisegred_small_70052 = clCreateKernel(prog,
                                                       "mainzisegred_small_70052",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_70052, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_70052");
    }
    {
        ctx->mainzisegred_small_70122 = clCreateKernel(prog,
                                                       "mainzisegred_small_70122",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_70122, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_70122");
    }
    {
        ctx->mainzisegred_small_72125 = clCreateKernel(prog,
                                                       "mainzisegred_small_72125",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_72125, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_72125");
    }
    {
        ctx->mainzisegred_small_72224 = clCreateKernel(prog,
                                                       "mainzisegred_small_72224",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_72224, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_72224");
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_78522.references = NULL;
        ctx->mainzicounter_mem_78522.size = 0;
        ctx->mainzicounter_mem_78522.mem = clCreateBuffer(ctx->opencl.ctx,
                                                          CL_MEM_READ_WRITE,
                                                          (10240 >
                                                           0 ? 10240 : 1) *
                                                          sizeof(int32_t), NULL,
                                                          &success);
        OPENCL_SUCCEED_OR_RETURN(success);
        if (10240 > 0)
            OPENCL_SUCCEED_OR_RETURN(clEnqueueWriteBuffer(ctx->opencl.queue,
                                                          ctx->mainzicounter_mem_78522.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_80023,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_78604.references = NULL;
        ctx->mainzicounter_mem_78604.size = 0;
        ctx->mainzicounter_mem_78604.mem = clCreateBuffer(ctx->opencl.ctx,
                                                          CL_MEM_READ_WRITE,
                                                          (10240 >
                                                           0 ? 10240 : 1) *
                                                          sizeof(int32_t), NULL,
                                                          &success);
        OPENCL_SUCCEED_OR_RETURN(success);
        if (10240 > 0)
            OPENCL_SUCCEED_OR_RETURN(clEnqueueWriteBuffer(ctx->opencl.queue,
                                                          ctx->mainzicounter_mem_78604.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_80039,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_78911.references = NULL;
        ctx->mainzicounter_mem_78911.size = 0;
        ctx->mainzicounter_mem_78911.mem = clCreateBuffer(ctx->opencl.ctx,
                                                          CL_MEM_READ_WRITE,
                                                          (10240 >
                                                           0 ? 10240 : 1) *
                                                          sizeof(int32_t), NULL,
                                                          &success);
        OPENCL_SUCCEED_OR_RETURN(success);
        if (10240 > 0)
            OPENCL_SUCCEED_OR_RETURN(clEnqueueWriteBuffer(ctx->opencl.queue,
                                                          ctx->mainzicounter_mem_78911.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_80100,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_79013.references = NULL;
        ctx->mainzicounter_mem_79013.size = 0;
        ctx->mainzicounter_mem_79013.mem = clCreateBuffer(ctx->opencl.ctx,
                                                          CL_MEM_READ_WRITE,
                                                          (10240 >
                                                           0 ? 10240 : 1) *
                                                          sizeof(int32_t), NULL,
                                                          &success);
        OPENCL_SUCCEED_OR_RETURN(success);
        if (10240 > 0)
            OPENCL_SUCCEED_OR_RETURN(clEnqueueWriteBuffer(ctx->opencl.queue,
                                                          ctx->mainzicounter_mem_79013.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_80116,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_79360.references = NULL;
        ctx->mainzicounter_mem_79360.size = 0;
        ctx->mainzicounter_mem_79360.mem = clCreateBuffer(ctx->opencl.ctx,
                                                          CL_MEM_READ_WRITE,
                                                          (10240 >
                                                           0 ? 10240 : 1) *
                                                          sizeof(int32_t), NULL,
                                                          &success);
        OPENCL_SUCCEED_OR_RETURN(success);
        if (10240 > 0)
            OPENCL_SUCCEED_OR_RETURN(clEnqueueWriteBuffer(ctx->opencl.queue,
                                                          ctx->mainzicounter_mem_79360.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_80177,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_79474.references = NULL;
        ctx->mainzicounter_mem_79474.size = 0;
        ctx->mainzicounter_mem_79474.mem = clCreateBuffer(ctx->opencl.ctx,
                                                          CL_MEM_READ_WRITE,
                                                          (10240 >
                                                           0 ? 10240 : 1) *
                                                          sizeof(int32_t), NULL,
                                                          &success);
        OPENCL_SUCCEED_OR_RETURN(success);
        if (10240 > 0)
            OPENCL_SUCCEED_OR_RETURN(clEnqueueWriteBuffer(ctx->opencl.queue,
                                                          ctx->mainzicounter_mem_79474.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_80193,
                                                          0, NULL, NULL));
    }
    ctx->tuning_params.builtinzhreplicate_f32zigroup_sizze_78278 =
        &cfg->tuning_params[0];
    ctx->tuning_params.builtinzhreplicate_i64zigroup_sizze_78392 =
        &cfg->tuning_params[1];
    ctx->tuning_params.mainzisegmap_group_sizze_66697 = &cfg->tuning_params[2];
    ctx->tuning_params.mainzisegmap_group_sizze_67289 = &cfg->tuning_params[3];
    ctx->tuning_params.mainzisegmap_group_sizze_67347 = &cfg->tuning_params[4];
    ctx->tuning_params.mainzisegmap_group_sizze_67661 = &cfg->tuning_params[5];
    ctx->tuning_params.mainzisegmap_group_sizze_67686 = &cfg->tuning_params[6];
    ctx->tuning_params.mainzisegmap_group_sizze_67712 = &cfg->tuning_params[7];
    ctx->tuning_params.mainzisegmap_group_sizze_67738 = &cfg->tuning_params[8];
    ctx->tuning_params.mainzisegmap_group_sizze_68324 = &cfg->tuning_params[9];
    ctx->tuning_params.mainzisegmap_group_sizze_69026 = &cfg->tuning_params[10];
    ctx->tuning_params.mainzisegmap_group_sizze_69101 = &cfg->tuning_params[11];
    ctx->tuning_params.mainzisegmap_group_sizze_69452 = &cfg->tuning_params[12];
    ctx->tuning_params.mainzisegmap_group_sizze_69477 = &cfg->tuning_params[13];
    ctx->tuning_params.mainzisegmap_group_sizze_69503 = &cfg->tuning_params[14];
    ctx->tuning_params.mainzisegmap_group_sizze_69529 = &cfg->tuning_params[15];
    ctx->tuning_params.mainzisegmap_group_sizze_70183 = &cfg->tuning_params[16];
    ctx->tuning_params.mainzisegmap_group_sizze_70998 = &cfg->tuning_params[17];
    ctx->tuning_params.mainzisegmap_group_sizze_71100 = &cfg->tuning_params[18];
    ctx->tuning_params.mainzisegmap_group_sizze_71491 = &cfg->tuning_params[19];
    ctx->tuning_params.mainzisegmap_group_sizze_71516 = &cfg->tuning_params[20];
    ctx->tuning_params.mainzisegmap_group_sizze_71542 = &cfg->tuning_params[21];
    ctx->tuning_params.mainzisegmap_group_sizze_71568 = &cfg->tuning_params[22];
    ctx->tuning_params.mainzisegmap_group_sizze_72476 = &cfg->tuning_params[23];
    ctx->tuning_params.mainzisegmap_group_sizze_72501 = &cfg->tuning_params[24];
    ctx->tuning_params.mainzisegmap_group_sizze_72527 = &cfg->tuning_params[25];
    ctx->tuning_params.mainzisegmap_group_sizze_72553 = &cfg->tuning_params[26];
    ctx->tuning_params.mainzisegmap_group_sizze_73143 = &cfg->tuning_params[27];
    ctx->tuning_params.mainzisegmap_group_sizze_73168 = &cfg->tuning_params[28];
    ctx->tuning_params.mainzisegmap_group_sizze_73194 = &cfg->tuning_params[29];
    ctx->tuning_params.mainzisegmap_group_sizze_73220 = &cfg->tuning_params[30];
    ctx->tuning_params.mainzisegmap_group_sizze_73900 = &cfg->tuning_params[31];
    ctx->tuning_params.mainzisegmap_group_sizze_73925 = &cfg->tuning_params[32];
    ctx->tuning_params.mainzisegmap_group_sizze_73951 = &cfg->tuning_params[33];
    ctx->tuning_params.mainzisegmap_group_sizze_73977 = &cfg->tuning_params[34];
    ctx->tuning_params.mainzisegmap_group_sizze_74432 = &cfg->tuning_params[35];
    ctx->tuning_params.mainzisegmap_num_groups_66699 = &cfg->tuning_params[36];
    ctx->tuning_params.mainzisegmap_num_groups_68326 = &cfg->tuning_params[37];
    ctx->tuning_params.mainzisegmap_num_groups_70185 = &cfg->tuning_params[38];
    ctx->tuning_params.mainzisegred_group_sizze_67234 = &cfg->tuning_params[39];
    ctx->tuning_params.mainzisegred_group_sizze_67302 = &cfg->tuning_params[40];
    ctx->tuning_params.mainzisegred_group_sizze_68953 = &cfg->tuning_params[41];
    ctx->tuning_params.mainzisegred_group_sizze_69048 = &cfg->tuning_params[42];
    ctx->tuning_params.mainzisegred_group_sizze_70912 = &cfg->tuning_params[43];
    ctx->tuning_params.mainzisegred_group_sizze_71039 = &cfg->tuning_params[44];
    ctx->tuning_params.mainzisegred_num_groups_67236 = &cfg->tuning_params[45];
    ctx->tuning_params.mainzisegred_num_groups_67304 = &cfg->tuning_params[46];
    ctx->tuning_params.mainzisegred_num_groups_68955 = &cfg->tuning_params[47];
    ctx->tuning_params.mainzisegred_num_groups_69050 = &cfg->tuning_params[48];
    ctx->tuning_params.mainzisegred_num_groups_70914 = &cfg->tuning_params[49];
    ctx->tuning_params.mainzisegred_num_groups_71041 = &cfg->tuning_params[50];
    ctx->tuning_params.mainzisegscan_group_sizze_67824 =
        &cfg->tuning_params[51];
    ctx->tuning_params.mainzisegscan_group_sizze_69615 =
        &cfg->tuning_params[52];
    ctx->tuning_params.mainzisegscan_group_sizze_71654 =
        &cfg->tuning_params[53];
    ctx->tuning_params.mainzisegscan_group_sizze_72639 =
        &cfg->tuning_params[54];
    ctx->tuning_params.mainzisegscan_group_sizze_73306 =
        &cfg->tuning_params[55];
    ctx->tuning_params.mainzisegscan_group_sizze_74063 =
        &cfg->tuning_params[56];
    ctx->tuning_params.mainzisegscan_num_groups_67826 = &cfg->tuning_params[57];
    ctx->tuning_params.mainzisegscan_num_groups_69617 = &cfg->tuning_params[58];
    ctx->tuning_params.mainzisegscan_num_groups_71656 = &cfg->tuning_params[59];
    ctx->tuning_params.mainzisegscan_num_groups_72641 = &cfg->tuning_params[60];
    ctx->tuning_params.mainzisegscan_num_groups_73308 = &cfg->tuning_params[61];
    ctx->tuning_params.mainzisegscan_num_groups_74065 = &cfg->tuning_params[62];
    ctx->tuning_params.mainzisuff_outer_par_0 = &cfg->tuning_params[63];
    ctx->tuning_params.mainzisuff_outer_par_1 = &cfg->tuning_params[64];
    ctx->tuning_params.mainzisuff_outer_par_2 = &cfg->tuning_params[65];
    ctx->tuning_params.mainzisuff_outer_par_3 = &cfg->tuning_params[66];
    ctx->tuning_params.mainzisuff_outer_par_4 = &cfg->tuning_params[67];
    ctx->tuning_params.mainzisuff_outer_par_5 = &cfg->tuning_params[68];
    ctx->tuning_params.mainzitile_sizze_74752 = &cfg->tuning_params[69];
    ctx->tuning_params.mainzitile_sizze_75306 = &cfg->tuning_params[70];
    ctx->tuning_params.mainzitile_sizze_75977 = &cfg->tuning_params[71];
    init_constants(ctx);
    // Clear the free list of any deallocations that occurred while initialising constants.
    OPENCL_SUCCEED_OR_RETURN(opencl_free_all(&ctx->opencl));
    // The program will be properly freed after all the kernels have also been freed.
    OPENCL_SUCCEED_OR_RETURN(clReleaseProgram(prog));
    return futhark_context_sync(ctx);
}
struct futhark_context *futhark_context_new(struct futhark_context_config *cfg)
{
    assert(!cfg->in_use);
    
    struct futhark_context *ctx =
                           (struct futhark_context *) malloc(sizeof(struct futhark_context));
    
    if (ctx == NULL)
        return NULL;
    ctx->cfg = cfg;
    ctx->cfg->in_use = 1;
    
    int required_types = 0;
    
    init_context_early(cfg, ctx);
    
    cl_program prog = setup_opencl(&ctx->opencl, opencl_program, required_types,
                                   cfg->build_opts);
    
    init_context_late(cfg, ctx, prog);
    return ctx;
}
struct futhark_context *futhark_context_new_with_command_queue(struct futhark_context_config *cfg,
                                                               cl_command_queue queue)
{
    assert(!cfg->in_use);
    
    struct futhark_context *ctx =
                           (struct futhark_context *) malloc(sizeof(struct futhark_context));
    
    if (ctx == NULL)
        return NULL;
    ctx->cfg = cfg;
    ctx->cfg->in_use = 1;
    
    int required_types = 0;
    
    init_context_early(cfg, ctx);
    
    cl_program prog = setup_opencl_with_command_queue(&ctx->opencl, queue,
                                                      opencl_program,
                                                      required_types,
                                                      cfg->build_opts);
    
    init_context_late(cfg, ctx, prog);
    return ctx;
}
void futhark_context_free(struct futhark_context *ctx)
{
    free_constants(ctx);
    free_lock(&ctx->lock);
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->builtinzhreplicate_f32zireplicate_78275));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->builtinzhreplicate_i64zireplicate_78389));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->gpu_map_transpose_f32));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->gpu_map_transpose_f32_low_height));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->gpu_map_transpose_f32_low_width));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->gpu_map_transpose_f32_small));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_67850));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_69641));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_71680));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_72665));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_73332));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_74089));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_67850));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_69641));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_71680));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_72665));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_73332));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_74089));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_67850));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_69641));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_71680));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_72665));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_73332));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_74089));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_66881));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_67903));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_67922));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_67934));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_67954));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_68125));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_68266));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_68538));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_69694));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_69713));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_69725));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_69745));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_69946));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_70099));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_70429));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_71733));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_71752));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_71764));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_71784));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_72017));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_72182));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_72718));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_72737));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_72749));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_72769));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_73385));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_73404));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_73416));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_73436));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_74142));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_74161));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_74173));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_74193));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_74555));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_72785));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_73453));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_74210));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_74758));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_75312));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_75983));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_68229));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_68279));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_70052));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_70122));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_72125));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_72224));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_68229));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_68279));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_70052));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_70122));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_72125));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_72224));
    teardown_opencl(&ctx->opencl);
    ctx->cfg->in_use = 0;
    free(ctx);
}
int futhark_context_sync(struct futhark_context *ctx)
{
    cl_int failure_idx = -1;
    
    if (ctx->failure_is_an_option) {
        OPENCL_SUCCEED_OR_RETURN(clEnqueueReadBuffer(ctx->opencl.queue,
                                                     ctx->global_failure,
                                                     CL_FALSE, 0,
                                                     sizeof(cl_int),
                                                     &failure_idx, 0, NULL,
                                                     ctx->profiling_paused ||
                                                     !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                               &ctx->copy_scalar_from_dev_runs,
                                                                                               &ctx->copy_scalar_from_dev_total_runtime)));
        ctx->failure_is_an_option = 0;
    }
    OPENCL_SUCCEED_OR_RETURN(clFinish(ctx->opencl.queue));
    if (failure_idx >= 0) {
        cl_int no_failure = -1;
        
        OPENCL_SUCCEED_OR_RETURN(clEnqueueWriteBuffer(ctx->opencl.queue,
                                                      ctx->global_failure,
                                                      CL_TRUE, 0,
                                                      sizeof(cl_int),
                                                      &no_failure, 0, NULL,
                                                      NULL));
        
        int64_t args[2 + 1];
        
        OPENCL_SUCCEED_OR_RETURN(clEnqueueReadBuffer(ctx->opencl.queue,
                                                     ctx->global_failure_args,
                                                     CL_TRUE, 0, sizeof(args),
                                                     &args, 0, NULL,
                                                     ctx->profiling_paused ||
                                                     !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                               &ctx->copy_dev_to_host_runs,
                                                                                               &ctx->copy_dev_to_host_total_runtime)));
        switch (failure_idx) {
            
          case 0:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:449:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 1:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:459:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 2:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 3:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 4:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 5:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:449:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 6:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:459:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 7:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 8:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 9:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 10:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:449:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 11:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:459:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 12:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 13:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 14:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 15:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:449:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 16:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:459:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 17:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 18:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 19:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 20:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:449:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 21:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:459:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 22:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 23:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 24:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 25:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:449:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 26:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:459:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 27:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 28:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 29:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 30:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:449:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 31:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:459:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 32:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 33:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 34:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 35:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:449:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 36:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:459:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 37:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 38:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 39:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 40:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:449:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 41:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:459:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 42:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 43:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 44:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 45:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:449:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 46:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:459:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 47:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 48:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 49:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 50:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:449:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 51:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:459:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 52:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 53:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 54:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 55:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:449:26-36\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 56:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:459:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 57:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:460:35-48\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:442:3-469:10\n   #5  loess.fut:502:15-61\n   #6  loess.fut:589:13-56\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:588:5-590:26\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 58:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:484:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 59:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:483:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:479:3-487:25\n   #4  loess.fut:503:16-51\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 60:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:535:27-33\n   #1  loess.fut:548:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:545:3-549:9\n   #6  loess.fut:608:13-59\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:607:5-609:29\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
            
          case 61:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:536:27-37\n   #1  loess.fut:548:13-50\n   #2  /prelude/soacs.fut:59:3-10\n   #3  /prelude/array.fut:195:3-17\n   #4  utils.fut:6:3-16\n   #5  loess.fut:545:3-549:9\n   #6  loess.fut:608:13-59\n   #7  /prelude/soacs.fut:67:19-23\n   #8  /prelude/soacs.fut:67:3-37\n   #9  loess.fut:607:5-609:29\n   #10 loess.fut:572:1-611:26\n",
                              args[0], args[1]);
                break;
            }
        }
        return 1;
    }
    return 0;
}
cl_command_queue futhark_context_get_command_queue(struct futhark_context *ctx)
{
    return ctx->opencl.queue;
}
static int memblock_unref_device(struct futhark_context *ctx,
                                 struct memblock_device *block, const
                                 char *desc)
{
    if (block->references != NULL) {
        *block->references -= 1;
        if (ctx->detail_memory)
            fprintf(ctx->log,
                    "Unreferencing block %s (allocated as %s) in %s: %d references remaining.\n",
                    desc, block->desc, "space 'device'", *block->references);
        if (*block->references == 0) {
            ctx->cur_mem_usage_device -= block->size;
            OPENCL_SUCCEED_OR_RETURN(opencl_free(&ctx->opencl, block->mem,
                                                 desc));
            free(block->references);
            if (ctx->detail_memory)
                fprintf(ctx->log,
                        "%lld bytes freed (now allocated: %lld bytes)\n",
                        (long long) block->size,
                        (long long) ctx->cur_mem_usage_device);
        }
        block->references = NULL;
    }
    return 0;
}
static int memblock_alloc_device(struct futhark_context *ctx,
                                 struct memblock_device *block, int64_t size,
                                 const char *desc)
{
    if (size < 0)
        futhark_panic(1,
                      "Negative allocation of %lld bytes attempted for %s in %s.\n",
                      (long long) size, desc, "space 'device'",
                      ctx->cur_mem_usage_device);
    
    int ret = memblock_unref_device(ctx, block, desc);
    
    ctx->cur_mem_usage_device += size;
    if (ctx->detail_memory)
        fprintf(ctx->log,
                "Allocating %lld bytes for %s in %s (then allocated: %lld bytes)",
                (long long) size, desc, "space 'device'",
                (long long) ctx->cur_mem_usage_device);
    if (ctx->cur_mem_usage_device > ctx->peak_mem_usage_device) {
        ctx->peak_mem_usage_device = ctx->cur_mem_usage_device;
        if (ctx->detail_memory)
            fprintf(ctx->log, " (new peak).\n");
    } else if (ctx->detail_memory)
        fprintf(ctx->log, ".\n");
    OPENCL_SUCCEED_OR_RETURN(opencl_alloc(&ctx->opencl, (size_t) size, desc,
                                          &block->mem));
    block->references = (int *) malloc(sizeof(int));
    *block->references = 1;
    block->size = size;
    block->desc = desc;
    return ret;
}
static int memblock_set_device(struct futhark_context *ctx,
                               struct memblock_device *lhs,
                               struct memblock_device *rhs, const
                               char *lhs_desc)
{
    int ret = memblock_unref_device(ctx, lhs, lhs_desc);
    
    if (rhs->references != NULL)
        (*rhs->references)++;
    *lhs = *rhs;
    return ret;
}
static int memblock_unref(struct futhark_context *ctx, struct memblock *block,
                          const char *desc)
{
    if (block->references != NULL) {
        *block->references -= 1;
        if (ctx->detail_memory)
            fprintf(ctx->log,
                    "Unreferencing block %s (allocated as %s) in %s: %d references remaining.\n",
                    desc, block->desc, "default space", *block->references);
        if (*block->references == 0) {
            ctx->cur_mem_usage_default -= block->size;
            free(block->mem);
            free(block->references);
            if (ctx->detail_memory)
                fprintf(ctx->log,
                        "%lld bytes freed (now allocated: %lld bytes)\n",
                        (long long) block->size,
                        (long long) ctx->cur_mem_usage_default);
        }
        block->references = NULL;
    }
    return 0;
}
static int memblock_alloc(struct futhark_context *ctx, struct memblock *block,
                          int64_t size, const char *desc)
{
    if (size < 0)
        futhark_panic(1,
                      "Negative allocation of %lld bytes attempted for %s in %s.\n",
                      (long long) size, desc, "default space",
                      ctx->cur_mem_usage_default);
    
    int ret = memblock_unref(ctx, block, desc);
    
    ctx->cur_mem_usage_default += size;
    if (ctx->detail_memory)
        fprintf(ctx->log,
                "Allocating %lld bytes for %s in %s (then allocated: %lld bytes)",
                (long long) size, desc, "default space",
                (long long) ctx->cur_mem_usage_default);
    if (ctx->cur_mem_usage_default > ctx->peak_mem_usage_default) {
        ctx->peak_mem_usage_default = ctx->cur_mem_usage_default;
        if (ctx->detail_memory)
            fprintf(ctx->log, " (new peak).\n");
    } else if (ctx->detail_memory)
        fprintf(ctx->log, ".\n");
    block->mem = (unsigned char *) malloc((size_t) size);
    block->references = (int *) malloc(sizeof(int));
    *block->references = 1;
    block->size = size;
    block->desc = desc;
    return ret;
}
static int memblock_set(struct futhark_context *ctx, struct memblock *lhs,
                        struct memblock *rhs, const char *lhs_desc)
{
    int ret = memblock_unref(ctx, lhs, lhs_desc);
    
    if (rhs->references != NULL)
        (*rhs->references)++;
    *lhs = *rhs;
    return ret;
}
int futhark_get_tuning_param_count(void)
{
    return sizeof(tuning_param_names) / sizeof(tuning_param_names[0]);
}
const char *futhark_get_tuning_param_name(int i)
{
    return tuning_param_names[i];
}
const char *futhark_get_tuning_param_class(int i)
{
    return tuning_param_classes[i];
}
char *futhark_context_report(struct futhark_context *ctx)
{
    if (futhark_context_sync(ctx) != 0)
        return NULL;
    
    struct str_builder builder;
    
    str_builder_init(&builder);
    if (ctx->detail_memory || ctx->profiling || ctx->logging) {
        str_builder(&builder,
                    "Peak memory usage for space 'device': %lld bytes.\n",
                    (long long) ctx->peak_mem_usage_device);
        { }
    }
    if (ctx->profiling) {
        OPENCL_SUCCEED_FATAL(opencl_tally_profiling_records(&ctx->opencl));
        str_builder(&builder,
                    "copy_dev_to_dev                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->copy_dev_to_dev_runs,
                    (long) ctx->copy_dev_to_dev_total_runtime /
                    (ctx->copy_dev_to_dev_runs !=
                     0 ? ctx->copy_dev_to_dev_runs : 1),
                    (long) ctx->copy_dev_to_dev_total_runtime);
        ctx->total_runtime += ctx->copy_dev_to_dev_total_runtime;
        ctx->total_runs += ctx->copy_dev_to_dev_runs;
        str_builder(&builder,
                    "copy_dev_to_host                      ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->copy_dev_to_host_runs,
                    (long) ctx->copy_dev_to_host_total_runtime /
                    (ctx->copy_dev_to_host_runs !=
                     0 ? ctx->copy_dev_to_host_runs : 1),
                    (long) ctx->copy_dev_to_host_total_runtime);
        ctx->total_runtime += ctx->copy_dev_to_host_total_runtime;
        ctx->total_runs += ctx->copy_dev_to_host_runs;
        str_builder(&builder,
                    "copy_host_to_dev                      ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->copy_host_to_dev_runs,
                    (long) ctx->copy_host_to_dev_total_runtime /
                    (ctx->copy_host_to_dev_runs !=
                     0 ? ctx->copy_host_to_dev_runs : 1),
                    (long) ctx->copy_host_to_dev_total_runtime);
        ctx->total_runtime += ctx->copy_host_to_dev_total_runtime;
        ctx->total_runs += ctx->copy_host_to_dev_runs;
        str_builder(&builder,
                    "copy_scalar_to_dev                    ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->copy_scalar_to_dev_runs,
                    (long) ctx->copy_scalar_to_dev_total_runtime /
                    (ctx->copy_scalar_to_dev_runs !=
                     0 ? ctx->copy_scalar_to_dev_runs : 1),
                    (long) ctx->copy_scalar_to_dev_total_runtime);
        ctx->total_runtime += ctx->copy_scalar_to_dev_total_runtime;
        ctx->total_runs += ctx->copy_scalar_to_dev_runs;
        str_builder(&builder,
                    "copy_scalar_from_dev                  ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->copy_scalar_from_dev_runs,
                    (long) ctx->copy_scalar_from_dev_total_runtime /
                    (ctx->copy_scalar_from_dev_runs !=
                     0 ? ctx->copy_scalar_from_dev_runs : 1),
                    (long) ctx->copy_scalar_from_dev_total_runtime);
        ctx->total_runtime += ctx->copy_scalar_from_dev_total_runtime;
        ctx->total_runs += ctx->copy_scalar_from_dev_runs;
        str_builder(&builder,
                    "builtin#replicate_f32.replicate_78275 ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->builtinzhreplicate_f32zireplicate_78275_runs,
                    (long) ctx->builtinzhreplicate_f32zireplicate_78275_total_runtime /
                    (ctx->builtinzhreplicate_f32zireplicate_78275_runs !=
                     0 ? ctx->builtinzhreplicate_f32zireplicate_78275_runs : 1),
                    (long) ctx->builtinzhreplicate_f32zireplicate_78275_total_runtime);
        ctx->total_runtime +=
            ctx->builtinzhreplicate_f32zireplicate_78275_total_runtime;
        ctx->total_runs += ctx->builtinzhreplicate_f32zireplicate_78275_runs;
        str_builder(&builder,
                    "builtin#replicate_i64.replicate_78389 ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->builtinzhreplicate_i64zireplicate_78389_runs,
                    (long) ctx->builtinzhreplicate_i64zireplicate_78389_total_runtime /
                    (ctx->builtinzhreplicate_i64zireplicate_78389_runs !=
                     0 ? ctx->builtinzhreplicate_i64zireplicate_78389_runs : 1),
                    (long) ctx->builtinzhreplicate_i64zireplicate_78389_total_runtime);
        ctx->total_runtime +=
            ctx->builtinzhreplicate_i64zireplicate_78389_total_runtime;
        ctx->total_runs += ctx->builtinzhreplicate_i64zireplicate_78389_runs;
        str_builder(&builder,
                    "gpu_map_transpose_f32                 ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->gpu_map_transpose_f32_runs,
                    (long) ctx->gpu_map_transpose_f32_total_runtime /
                    (ctx->gpu_map_transpose_f32_runs !=
                     0 ? ctx->gpu_map_transpose_f32_runs : 1),
                    (long) ctx->gpu_map_transpose_f32_total_runtime);
        ctx->total_runtime += ctx->gpu_map_transpose_f32_total_runtime;
        ctx->total_runs += ctx->gpu_map_transpose_f32_runs;
        str_builder(&builder,
                    "gpu_map_transpose_f32_low_height      ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->gpu_map_transpose_f32_low_height_runs,
                    (long) ctx->gpu_map_transpose_f32_low_height_total_runtime /
                    (ctx->gpu_map_transpose_f32_low_height_runs !=
                     0 ? ctx->gpu_map_transpose_f32_low_height_runs : 1),
                    (long) ctx->gpu_map_transpose_f32_low_height_total_runtime);
        ctx->total_runtime +=
            ctx->gpu_map_transpose_f32_low_height_total_runtime;
        ctx->total_runs += ctx->gpu_map_transpose_f32_low_height_runs;
        str_builder(&builder,
                    "gpu_map_transpose_f32_low_width       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->gpu_map_transpose_f32_low_width_runs,
                    (long) ctx->gpu_map_transpose_f32_low_width_total_runtime /
                    (ctx->gpu_map_transpose_f32_low_width_runs !=
                     0 ? ctx->gpu_map_transpose_f32_low_width_runs : 1),
                    (long) ctx->gpu_map_transpose_f32_low_width_total_runtime);
        ctx->total_runtime +=
            ctx->gpu_map_transpose_f32_low_width_total_runtime;
        ctx->total_runs += ctx->gpu_map_transpose_f32_low_width_runs;
        str_builder(&builder,
                    "gpu_map_transpose_f32_small           ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->gpu_map_transpose_f32_small_runs,
                    (long) ctx->gpu_map_transpose_f32_small_total_runtime /
                    (ctx->gpu_map_transpose_f32_small_runs !=
                     0 ? ctx->gpu_map_transpose_f32_small_runs : 1),
                    (long) ctx->gpu_map_transpose_f32_small_total_runtime);
        ctx->total_runtime += ctx->gpu_map_transpose_f32_small_total_runtime;
        ctx->total_runs += ctx->gpu_map_transpose_f32_small_runs;
        str_builder(&builder,
                    "main.scan_stage1_67850                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_67850_runs,
                    (long) ctx->mainziscan_stage1_67850_total_runtime /
                    (ctx->mainziscan_stage1_67850_runs !=
                     0 ? ctx->mainziscan_stage1_67850_runs : 1),
                    (long) ctx->mainziscan_stage1_67850_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_67850_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_67850_runs;
        str_builder(&builder,
                    "main.scan_stage1_69641                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_69641_runs,
                    (long) ctx->mainziscan_stage1_69641_total_runtime /
                    (ctx->mainziscan_stage1_69641_runs !=
                     0 ? ctx->mainziscan_stage1_69641_runs : 1),
                    (long) ctx->mainziscan_stage1_69641_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_69641_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_69641_runs;
        str_builder(&builder,
                    "main.scan_stage1_71680                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_71680_runs,
                    (long) ctx->mainziscan_stage1_71680_total_runtime /
                    (ctx->mainziscan_stage1_71680_runs !=
                     0 ? ctx->mainziscan_stage1_71680_runs : 1),
                    (long) ctx->mainziscan_stage1_71680_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_71680_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_71680_runs;
        str_builder(&builder,
                    "main.scan_stage1_72665                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_72665_runs,
                    (long) ctx->mainziscan_stage1_72665_total_runtime /
                    (ctx->mainziscan_stage1_72665_runs !=
                     0 ? ctx->mainziscan_stage1_72665_runs : 1),
                    (long) ctx->mainziscan_stage1_72665_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_72665_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_72665_runs;
        str_builder(&builder,
                    "main.scan_stage1_73332                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_73332_runs,
                    (long) ctx->mainziscan_stage1_73332_total_runtime /
                    (ctx->mainziscan_stage1_73332_runs !=
                     0 ? ctx->mainziscan_stage1_73332_runs : 1),
                    (long) ctx->mainziscan_stage1_73332_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_73332_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_73332_runs;
        str_builder(&builder,
                    "main.scan_stage1_74089                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_74089_runs,
                    (long) ctx->mainziscan_stage1_74089_total_runtime /
                    (ctx->mainziscan_stage1_74089_runs !=
                     0 ? ctx->mainziscan_stage1_74089_runs : 1),
                    (long) ctx->mainziscan_stage1_74089_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_74089_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_74089_runs;
        str_builder(&builder,
                    "main.scan_stage2_67850                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_67850_runs,
                    (long) ctx->mainziscan_stage2_67850_total_runtime /
                    (ctx->mainziscan_stage2_67850_runs !=
                     0 ? ctx->mainziscan_stage2_67850_runs : 1),
                    (long) ctx->mainziscan_stage2_67850_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_67850_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_67850_runs;
        str_builder(&builder,
                    "main.scan_stage2_69641                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_69641_runs,
                    (long) ctx->mainziscan_stage2_69641_total_runtime /
                    (ctx->mainziscan_stage2_69641_runs !=
                     0 ? ctx->mainziscan_stage2_69641_runs : 1),
                    (long) ctx->mainziscan_stage2_69641_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_69641_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_69641_runs;
        str_builder(&builder,
                    "main.scan_stage2_71680                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_71680_runs,
                    (long) ctx->mainziscan_stage2_71680_total_runtime /
                    (ctx->mainziscan_stage2_71680_runs !=
                     0 ? ctx->mainziscan_stage2_71680_runs : 1),
                    (long) ctx->mainziscan_stage2_71680_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_71680_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_71680_runs;
        str_builder(&builder,
                    "main.scan_stage2_72665                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_72665_runs,
                    (long) ctx->mainziscan_stage2_72665_total_runtime /
                    (ctx->mainziscan_stage2_72665_runs !=
                     0 ? ctx->mainziscan_stage2_72665_runs : 1),
                    (long) ctx->mainziscan_stage2_72665_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_72665_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_72665_runs;
        str_builder(&builder,
                    "main.scan_stage2_73332                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_73332_runs,
                    (long) ctx->mainziscan_stage2_73332_total_runtime /
                    (ctx->mainziscan_stage2_73332_runs !=
                     0 ? ctx->mainziscan_stage2_73332_runs : 1),
                    (long) ctx->mainziscan_stage2_73332_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_73332_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_73332_runs;
        str_builder(&builder,
                    "main.scan_stage2_74089                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_74089_runs,
                    (long) ctx->mainziscan_stage2_74089_total_runtime /
                    (ctx->mainziscan_stage2_74089_runs !=
                     0 ? ctx->mainziscan_stage2_74089_runs : 1),
                    (long) ctx->mainziscan_stage2_74089_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_74089_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_74089_runs;
        str_builder(&builder,
                    "main.scan_stage3_67850                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_67850_runs,
                    (long) ctx->mainziscan_stage3_67850_total_runtime /
                    (ctx->mainziscan_stage3_67850_runs !=
                     0 ? ctx->mainziscan_stage3_67850_runs : 1),
                    (long) ctx->mainziscan_stage3_67850_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_67850_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_67850_runs;
        str_builder(&builder,
                    "main.scan_stage3_69641                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_69641_runs,
                    (long) ctx->mainziscan_stage3_69641_total_runtime /
                    (ctx->mainziscan_stage3_69641_runs !=
                     0 ? ctx->mainziscan_stage3_69641_runs : 1),
                    (long) ctx->mainziscan_stage3_69641_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_69641_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_69641_runs;
        str_builder(&builder,
                    "main.scan_stage3_71680                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_71680_runs,
                    (long) ctx->mainziscan_stage3_71680_total_runtime /
                    (ctx->mainziscan_stage3_71680_runs !=
                     0 ? ctx->mainziscan_stage3_71680_runs : 1),
                    (long) ctx->mainziscan_stage3_71680_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_71680_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_71680_runs;
        str_builder(&builder,
                    "main.scan_stage3_72665                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_72665_runs,
                    (long) ctx->mainziscan_stage3_72665_total_runtime /
                    (ctx->mainziscan_stage3_72665_runs !=
                     0 ? ctx->mainziscan_stage3_72665_runs : 1),
                    (long) ctx->mainziscan_stage3_72665_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_72665_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_72665_runs;
        str_builder(&builder,
                    "main.scan_stage3_73332                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_73332_runs,
                    (long) ctx->mainziscan_stage3_73332_total_runtime /
                    (ctx->mainziscan_stage3_73332_runs !=
                     0 ? ctx->mainziscan_stage3_73332_runs : 1),
                    (long) ctx->mainziscan_stage3_73332_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_73332_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_73332_runs;
        str_builder(&builder,
                    "main.scan_stage3_74089                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_74089_runs,
                    (long) ctx->mainziscan_stage3_74089_total_runtime /
                    (ctx->mainziscan_stage3_74089_runs !=
                     0 ? ctx->mainziscan_stage3_74089_runs : 1),
                    (long) ctx->mainziscan_stage3_74089_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_74089_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_74089_runs;
        str_builder(&builder,
                    "main.segmap_66881                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_66881_runs,
                    (long) ctx->mainzisegmap_66881_total_runtime /
                    (ctx->mainzisegmap_66881_runs !=
                     0 ? ctx->mainzisegmap_66881_runs : 1),
                    (long) ctx->mainzisegmap_66881_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_66881_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_66881_runs;
        str_builder(&builder,
                    "main.segmap_67903                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_67903_runs,
                    (long) ctx->mainzisegmap_67903_total_runtime /
                    (ctx->mainzisegmap_67903_runs !=
                     0 ? ctx->mainzisegmap_67903_runs : 1),
                    (long) ctx->mainzisegmap_67903_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_67903_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_67903_runs;
        str_builder(&builder,
                    "main.segmap_67922                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_67922_runs,
                    (long) ctx->mainzisegmap_67922_total_runtime /
                    (ctx->mainzisegmap_67922_runs !=
                     0 ? ctx->mainzisegmap_67922_runs : 1),
                    (long) ctx->mainzisegmap_67922_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_67922_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_67922_runs;
        str_builder(&builder,
                    "main.segmap_67934                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_67934_runs,
                    (long) ctx->mainzisegmap_67934_total_runtime /
                    (ctx->mainzisegmap_67934_runs !=
                     0 ? ctx->mainzisegmap_67934_runs : 1),
                    (long) ctx->mainzisegmap_67934_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_67934_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_67934_runs;
        str_builder(&builder,
                    "main.segmap_67954                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_67954_runs,
                    (long) ctx->mainzisegmap_67954_total_runtime /
                    (ctx->mainzisegmap_67954_runs !=
                     0 ? ctx->mainzisegmap_67954_runs : 1),
                    (long) ctx->mainzisegmap_67954_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_67954_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_67954_runs;
        str_builder(&builder,
                    "main.segmap_68125                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_68125_runs,
                    (long) ctx->mainzisegmap_68125_total_runtime /
                    (ctx->mainzisegmap_68125_runs !=
                     0 ? ctx->mainzisegmap_68125_runs : 1),
                    (long) ctx->mainzisegmap_68125_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_68125_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_68125_runs;
        str_builder(&builder,
                    "main.segmap_68266                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_68266_runs,
                    (long) ctx->mainzisegmap_68266_total_runtime /
                    (ctx->mainzisegmap_68266_runs !=
                     0 ? ctx->mainzisegmap_68266_runs : 1),
                    (long) ctx->mainzisegmap_68266_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_68266_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_68266_runs;
        str_builder(&builder,
                    "main.segmap_68538                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_68538_runs,
                    (long) ctx->mainzisegmap_68538_total_runtime /
                    (ctx->mainzisegmap_68538_runs !=
                     0 ? ctx->mainzisegmap_68538_runs : 1),
                    (long) ctx->mainzisegmap_68538_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_68538_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_68538_runs;
        str_builder(&builder,
                    "main.segmap_69694                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_69694_runs,
                    (long) ctx->mainzisegmap_69694_total_runtime /
                    (ctx->mainzisegmap_69694_runs !=
                     0 ? ctx->mainzisegmap_69694_runs : 1),
                    (long) ctx->mainzisegmap_69694_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_69694_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_69694_runs;
        str_builder(&builder,
                    "main.segmap_69713                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_69713_runs,
                    (long) ctx->mainzisegmap_69713_total_runtime /
                    (ctx->mainzisegmap_69713_runs !=
                     0 ? ctx->mainzisegmap_69713_runs : 1),
                    (long) ctx->mainzisegmap_69713_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_69713_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_69713_runs;
        str_builder(&builder,
                    "main.segmap_69725                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_69725_runs,
                    (long) ctx->mainzisegmap_69725_total_runtime /
                    (ctx->mainzisegmap_69725_runs !=
                     0 ? ctx->mainzisegmap_69725_runs : 1),
                    (long) ctx->mainzisegmap_69725_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_69725_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_69725_runs;
        str_builder(&builder,
                    "main.segmap_69745                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_69745_runs,
                    (long) ctx->mainzisegmap_69745_total_runtime /
                    (ctx->mainzisegmap_69745_runs !=
                     0 ? ctx->mainzisegmap_69745_runs : 1),
                    (long) ctx->mainzisegmap_69745_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_69745_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_69745_runs;
        str_builder(&builder,
                    "main.segmap_69946                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_69946_runs,
                    (long) ctx->mainzisegmap_69946_total_runtime /
                    (ctx->mainzisegmap_69946_runs !=
                     0 ? ctx->mainzisegmap_69946_runs : 1),
                    (long) ctx->mainzisegmap_69946_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_69946_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_69946_runs;
        str_builder(&builder,
                    "main.segmap_70099                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_70099_runs,
                    (long) ctx->mainzisegmap_70099_total_runtime /
                    (ctx->mainzisegmap_70099_runs !=
                     0 ? ctx->mainzisegmap_70099_runs : 1),
                    (long) ctx->mainzisegmap_70099_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_70099_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_70099_runs;
        str_builder(&builder,
                    "main.segmap_70429                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_70429_runs,
                    (long) ctx->mainzisegmap_70429_total_runtime /
                    (ctx->mainzisegmap_70429_runs !=
                     0 ? ctx->mainzisegmap_70429_runs : 1),
                    (long) ctx->mainzisegmap_70429_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_70429_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_70429_runs;
        str_builder(&builder,
                    "main.segmap_71733                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_71733_runs,
                    (long) ctx->mainzisegmap_71733_total_runtime /
                    (ctx->mainzisegmap_71733_runs !=
                     0 ? ctx->mainzisegmap_71733_runs : 1),
                    (long) ctx->mainzisegmap_71733_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_71733_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_71733_runs;
        str_builder(&builder,
                    "main.segmap_71752                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_71752_runs,
                    (long) ctx->mainzisegmap_71752_total_runtime /
                    (ctx->mainzisegmap_71752_runs !=
                     0 ? ctx->mainzisegmap_71752_runs : 1),
                    (long) ctx->mainzisegmap_71752_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_71752_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_71752_runs;
        str_builder(&builder,
                    "main.segmap_71764                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_71764_runs,
                    (long) ctx->mainzisegmap_71764_total_runtime /
                    (ctx->mainzisegmap_71764_runs !=
                     0 ? ctx->mainzisegmap_71764_runs : 1),
                    (long) ctx->mainzisegmap_71764_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_71764_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_71764_runs;
        str_builder(&builder,
                    "main.segmap_71784                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_71784_runs,
                    (long) ctx->mainzisegmap_71784_total_runtime /
                    (ctx->mainzisegmap_71784_runs !=
                     0 ? ctx->mainzisegmap_71784_runs : 1),
                    (long) ctx->mainzisegmap_71784_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_71784_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_71784_runs;
        str_builder(&builder,
                    "main.segmap_72017                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_72017_runs,
                    (long) ctx->mainzisegmap_72017_total_runtime /
                    (ctx->mainzisegmap_72017_runs !=
                     0 ? ctx->mainzisegmap_72017_runs : 1),
                    (long) ctx->mainzisegmap_72017_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_72017_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_72017_runs;
        str_builder(&builder,
                    "main.segmap_72182                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_72182_runs,
                    (long) ctx->mainzisegmap_72182_total_runtime /
                    (ctx->mainzisegmap_72182_runs !=
                     0 ? ctx->mainzisegmap_72182_runs : 1),
                    (long) ctx->mainzisegmap_72182_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_72182_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_72182_runs;
        str_builder(&builder,
                    "main.segmap_72718                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_72718_runs,
                    (long) ctx->mainzisegmap_72718_total_runtime /
                    (ctx->mainzisegmap_72718_runs !=
                     0 ? ctx->mainzisegmap_72718_runs : 1),
                    (long) ctx->mainzisegmap_72718_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_72718_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_72718_runs;
        str_builder(&builder,
                    "main.segmap_72737                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_72737_runs,
                    (long) ctx->mainzisegmap_72737_total_runtime /
                    (ctx->mainzisegmap_72737_runs !=
                     0 ? ctx->mainzisegmap_72737_runs : 1),
                    (long) ctx->mainzisegmap_72737_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_72737_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_72737_runs;
        str_builder(&builder,
                    "main.segmap_72749                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_72749_runs,
                    (long) ctx->mainzisegmap_72749_total_runtime /
                    (ctx->mainzisegmap_72749_runs !=
                     0 ? ctx->mainzisegmap_72749_runs : 1),
                    (long) ctx->mainzisegmap_72749_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_72749_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_72749_runs;
        str_builder(&builder,
                    "main.segmap_72769                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_72769_runs,
                    (long) ctx->mainzisegmap_72769_total_runtime /
                    (ctx->mainzisegmap_72769_runs !=
                     0 ? ctx->mainzisegmap_72769_runs : 1),
                    (long) ctx->mainzisegmap_72769_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_72769_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_72769_runs;
        str_builder(&builder,
                    "main.segmap_73385                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_73385_runs,
                    (long) ctx->mainzisegmap_73385_total_runtime /
                    (ctx->mainzisegmap_73385_runs !=
                     0 ? ctx->mainzisegmap_73385_runs : 1),
                    (long) ctx->mainzisegmap_73385_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_73385_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_73385_runs;
        str_builder(&builder,
                    "main.segmap_73404                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_73404_runs,
                    (long) ctx->mainzisegmap_73404_total_runtime /
                    (ctx->mainzisegmap_73404_runs !=
                     0 ? ctx->mainzisegmap_73404_runs : 1),
                    (long) ctx->mainzisegmap_73404_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_73404_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_73404_runs;
        str_builder(&builder,
                    "main.segmap_73416                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_73416_runs,
                    (long) ctx->mainzisegmap_73416_total_runtime /
                    (ctx->mainzisegmap_73416_runs !=
                     0 ? ctx->mainzisegmap_73416_runs : 1),
                    (long) ctx->mainzisegmap_73416_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_73416_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_73416_runs;
        str_builder(&builder,
                    "main.segmap_73436                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_73436_runs,
                    (long) ctx->mainzisegmap_73436_total_runtime /
                    (ctx->mainzisegmap_73436_runs !=
                     0 ? ctx->mainzisegmap_73436_runs : 1),
                    (long) ctx->mainzisegmap_73436_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_73436_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_73436_runs;
        str_builder(&builder,
                    "main.segmap_74142                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_74142_runs,
                    (long) ctx->mainzisegmap_74142_total_runtime /
                    (ctx->mainzisegmap_74142_runs !=
                     0 ? ctx->mainzisegmap_74142_runs : 1),
                    (long) ctx->mainzisegmap_74142_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_74142_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_74142_runs;
        str_builder(&builder,
                    "main.segmap_74161                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_74161_runs,
                    (long) ctx->mainzisegmap_74161_total_runtime /
                    (ctx->mainzisegmap_74161_runs !=
                     0 ? ctx->mainzisegmap_74161_runs : 1),
                    (long) ctx->mainzisegmap_74161_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_74161_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_74161_runs;
        str_builder(&builder,
                    "main.segmap_74173                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_74173_runs,
                    (long) ctx->mainzisegmap_74173_total_runtime /
                    (ctx->mainzisegmap_74173_runs !=
                     0 ? ctx->mainzisegmap_74173_runs : 1),
                    (long) ctx->mainzisegmap_74173_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_74173_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_74173_runs;
        str_builder(&builder,
                    "main.segmap_74193                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_74193_runs,
                    (long) ctx->mainzisegmap_74193_total_runtime /
                    (ctx->mainzisegmap_74193_runs !=
                     0 ? ctx->mainzisegmap_74193_runs : 1),
                    (long) ctx->mainzisegmap_74193_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_74193_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_74193_runs;
        str_builder(&builder,
                    "main.segmap_74555                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_74555_runs,
                    (long) ctx->mainzisegmap_74555_total_runtime /
                    (ctx->mainzisegmap_74555_runs !=
                     0 ? ctx->mainzisegmap_74555_runs : 1),
                    (long) ctx->mainzisegmap_74555_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_74555_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_74555_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_72785          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_72785_runs,
                    (long) ctx->mainzisegmap_intragroup_72785_total_runtime /
                    (ctx->mainzisegmap_intragroup_72785_runs !=
                     0 ? ctx->mainzisegmap_intragroup_72785_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_72785_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_72785_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_72785_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_73453          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_73453_runs,
                    (long) ctx->mainzisegmap_intragroup_73453_total_runtime /
                    (ctx->mainzisegmap_intragroup_73453_runs !=
                     0 ? ctx->mainzisegmap_intragroup_73453_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_73453_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_73453_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_73453_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_74210          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_74210_runs,
                    (long) ctx->mainzisegmap_intragroup_74210_total_runtime /
                    (ctx->mainzisegmap_intragroup_74210_runs !=
                     0 ? ctx->mainzisegmap_intragroup_74210_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_74210_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_74210_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_74210_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_74758          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_74758_runs,
                    (long) ctx->mainzisegmap_intragroup_74758_total_runtime /
                    (ctx->mainzisegmap_intragroup_74758_runs !=
                     0 ? ctx->mainzisegmap_intragroup_74758_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_74758_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_74758_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_74758_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_75312          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_75312_runs,
                    (long) ctx->mainzisegmap_intragroup_75312_total_runtime /
                    (ctx->mainzisegmap_intragroup_75312_runs !=
                     0 ? ctx->mainzisegmap_intragroup_75312_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_75312_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_75312_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_75312_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_75983          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_75983_runs,
                    (long) ctx->mainzisegmap_intragroup_75983_total_runtime /
                    (ctx->mainzisegmap_intragroup_75983_runs !=
                     0 ? ctx->mainzisegmap_intragroup_75983_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_75983_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_75983_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_75983_runs;
        str_builder(&builder,
                    "main.segred_large_68229               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_68229_runs,
                    (long) ctx->mainzisegred_large_68229_total_runtime /
                    (ctx->mainzisegred_large_68229_runs !=
                     0 ? ctx->mainzisegred_large_68229_runs : 1),
                    (long) ctx->mainzisegred_large_68229_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_68229_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_68229_runs;
        str_builder(&builder,
                    "main.segred_large_68279               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_68279_runs,
                    (long) ctx->mainzisegred_large_68279_total_runtime /
                    (ctx->mainzisegred_large_68279_runs !=
                     0 ? ctx->mainzisegred_large_68279_runs : 1),
                    (long) ctx->mainzisegred_large_68279_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_68279_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_68279_runs;
        str_builder(&builder,
                    "main.segred_large_70052               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_70052_runs,
                    (long) ctx->mainzisegred_large_70052_total_runtime /
                    (ctx->mainzisegred_large_70052_runs !=
                     0 ? ctx->mainzisegred_large_70052_runs : 1),
                    (long) ctx->mainzisegred_large_70052_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_70052_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_70052_runs;
        str_builder(&builder,
                    "main.segred_large_70122               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_70122_runs,
                    (long) ctx->mainzisegred_large_70122_total_runtime /
                    (ctx->mainzisegred_large_70122_runs !=
                     0 ? ctx->mainzisegred_large_70122_runs : 1),
                    (long) ctx->mainzisegred_large_70122_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_70122_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_70122_runs;
        str_builder(&builder,
                    "main.segred_large_72125               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_72125_runs,
                    (long) ctx->mainzisegred_large_72125_total_runtime /
                    (ctx->mainzisegred_large_72125_runs !=
                     0 ? ctx->mainzisegred_large_72125_runs : 1),
                    (long) ctx->mainzisegred_large_72125_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_72125_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_72125_runs;
        str_builder(&builder,
                    "main.segred_large_72224               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_72224_runs,
                    (long) ctx->mainzisegred_large_72224_total_runtime /
                    (ctx->mainzisegred_large_72224_runs !=
                     0 ? ctx->mainzisegred_large_72224_runs : 1),
                    (long) ctx->mainzisegred_large_72224_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_72224_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_72224_runs;
        str_builder(&builder,
                    "main.segred_small_68229               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_68229_runs,
                    (long) ctx->mainzisegred_small_68229_total_runtime /
                    (ctx->mainzisegred_small_68229_runs !=
                     0 ? ctx->mainzisegred_small_68229_runs : 1),
                    (long) ctx->mainzisegred_small_68229_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_68229_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_68229_runs;
        str_builder(&builder,
                    "main.segred_small_68279               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_68279_runs,
                    (long) ctx->mainzisegred_small_68279_total_runtime /
                    (ctx->mainzisegred_small_68279_runs !=
                     0 ? ctx->mainzisegred_small_68279_runs : 1),
                    (long) ctx->mainzisegred_small_68279_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_68279_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_68279_runs;
        str_builder(&builder,
                    "main.segred_small_70052               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_70052_runs,
                    (long) ctx->mainzisegred_small_70052_total_runtime /
                    (ctx->mainzisegred_small_70052_runs !=
                     0 ? ctx->mainzisegred_small_70052_runs : 1),
                    (long) ctx->mainzisegred_small_70052_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_70052_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_70052_runs;
        str_builder(&builder,
                    "main.segred_small_70122               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_70122_runs,
                    (long) ctx->mainzisegred_small_70122_total_runtime /
                    (ctx->mainzisegred_small_70122_runs !=
                     0 ? ctx->mainzisegred_small_70122_runs : 1),
                    (long) ctx->mainzisegred_small_70122_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_70122_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_70122_runs;
        str_builder(&builder,
                    "main.segred_small_72125               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_72125_runs,
                    (long) ctx->mainzisegred_small_72125_total_runtime /
                    (ctx->mainzisegred_small_72125_runs !=
                     0 ? ctx->mainzisegred_small_72125_runs : 1),
                    (long) ctx->mainzisegred_small_72125_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_72125_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_72125_runs;
        str_builder(&builder,
                    "main.segred_small_72224               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_72224_runs,
                    (long) ctx->mainzisegred_small_72224_total_runtime /
                    (ctx->mainzisegred_small_72224_runs !=
                     0 ? ctx->mainzisegred_small_72224_runs : 1),
                    (long) ctx->mainzisegred_small_72224_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_72224_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_72224_runs;
        str_builder(&builder, "%d operations with cumulative runtime: %6ldus\n",
                    ctx->total_runs, ctx->total_runtime);
    }
    return builder.str;
}
char *futhark_context_get_error(struct futhark_context *ctx)
{
    char *error = ctx->error;
    
    ctx->error = NULL;
    return error;
}
void futhark_context_set_logging_file(struct futhark_context *ctx, FILE *f)
{
    ctx->log = f;
}
void futhark_context_pause_profiling(struct futhark_context *ctx)
{
    ctx->profiling_paused = 1;
}
void futhark_context_unpause_profiling(struct futhark_context *ctx)
{
    ctx->profiling_paused = 0;
}
int futhark_context_clear_caches(struct futhark_context *ctx)
{
    lock_lock(&ctx->lock);
    ctx->peak_mem_usage_device = 0;
    ctx->peak_mem_usage_default = 0;
    if (ctx->error == NULL)
        ctx->error = OPENCL_SUCCEED_NONFATAL(opencl_free_all(&ctx->opencl));
    lock_unlock(&ctx->lock);
    return ctx->error != NULL;
}

static int futrts_builtinzhgpu_map_transpose_f32(struct futhark_context *ctx,
                                                 struct memblock_device destmem_0,
                                                 int32_t destoffset_1,
                                                 struct memblock_device srcmem_2,
                                                 int32_t srcoffset_3,
                                                 int32_t num_arrays_4,
                                                 int32_t x_elems_5,
                                                 int32_t y_elems_6);
static int futrts_builtinzhreplicate_f32(struct futhark_context *ctx,
                                         struct memblock_device mem_78271,
                                         int32_t num_elems_78272,
                                         float val_78273);
static int futrts_builtinzhreplicate_i64(struct futhark_context *ctx,
                                         struct memblock_device mem_78385,
                                         int32_t num_elems_78386,
                                         int64_t val_78387);
static int futrts_entry_main(struct futhark_context *ctx,
                             struct memblock_device *mem_out_p_79967,
                             struct memblock_device Y_mem_76976,
                             int64_t m_65343, int64_t n_65344, int64_t q_65346,
                             int64_t degree_65347, int64_t jump_65348,
                             int64_t jump_threshold_65349,
                             int64_t q_threshold_65350);

static int init_constants(struct futhark_context *ctx)
{
    (void) ctx;
    
    int err = 0;
    
    
  cleanup:
    return err;
}
static int free_constants(struct futhark_context *ctx)
{
    (void) ctx;
    return 0;
}
struct futhark_f32_2d {
    struct memblock_device mem;
    int64_t shape[2];
};
struct futhark_f32_2d *futhark_new_f32_2d(struct futhark_context *ctx, const
                                          float *data, int64_t dim0,
                                          int64_t dim1)
{
    struct futhark_f32_2d *bad = NULL;
    struct futhark_f32_2d *arr =
                          (struct futhark_f32_2d *) malloc(sizeof(struct futhark_f32_2d));
    
    if (arr == NULL)
        return bad;
    lock_lock(&ctx->lock);
    arr->mem.references = NULL;
    if (memblock_alloc_device(ctx, &arr->mem, dim0 * dim1 * 4, "arr->mem"))
        return NULL;
    arr->shape[0] = dim0;
    arr->shape[1] = dim1;
    if ((size_t) (dim0 * dim1) * 4 > 0)
        OPENCL_SUCCEED_OR_RETURN(clEnqueueWriteBuffer(ctx->opencl.queue,
                                                      arr->mem.mem, CL_TRUE,
                                                      (size_t) 0,
                                                      (size_t) ((size_t) (dim0 *
                                                                          dim1) *
                                                                4), data + 0, 0,
                                                      NULL,
                                                      ctx->profiling_paused ||
                                                      !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                &ctx->copy_dev_to_host_runs,
                                                                                                &ctx->copy_dev_to_host_total_runtime)));
    lock_unlock(&ctx->lock);
    return arr;
}
struct futhark_f32_2d *futhark_new_raw_f32_2d(struct futhark_context *ctx, const
                                              cl_mem data, int64_t offset,
                                              int64_t dim0, int64_t dim1)
{
    struct futhark_f32_2d *bad = NULL;
    struct futhark_f32_2d *arr =
                          (struct futhark_f32_2d *) malloc(sizeof(struct futhark_f32_2d));
    
    if (arr == NULL)
        return bad;
    lock_lock(&ctx->lock);
    arr->mem.references = NULL;
    if (memblock_alloc_device(ctx, &arr->mem, dim0 * dim1 * 4, "arr->mem"))
        return NULL;
    arr->shape[0] = dim0;
    arr->shape[1] = dim1;
    if ((size_t) (dim0 * dim1) * 4 > 0) {
        OPENCL_SUCCEED_OR_RETURN(clEnqueueCopyBuffer(ctx->opencl.queue, data,
                                                     arr->mem.mem,
                                                     (size_t) offset,
                                                     (size_t) 0,
                                                     (size_t) ((size_t) (dim0 *
                                                                         dim1) *
                                                               4), 0, NULL,
                                                     ctx->profiling_paused ||
                                                     !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                               &ctx->copy_dev_to_dev_runs,
                                                                                               &ctx->copy_dev_to_dev_total_runtime)));
        if (ctx->debugging)
            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
    }
    lock_unlock(&ctx->lock);
    return arr;
}
int futhark_free_f32_2d(struct futhark_context *ctx, struct futhark_f32_2d *arr)
{
    lock_lock(&ctx->lock);
    if (memblock_unref_device(ctx, &arr->mem, "arr->mem") != 0)
        return 1;
    lock_unlock(&ctx->lock);
    free(arr);
    return 0;
}
int futhark_values_f32_2d(struct futhark_context *ctx,
                          struct futhark_f32_2d *arr, float *data)
{
    lock_lock(&ctx->lock);
    if ((size_t) (arr->shape[0] * arr->shape[1]) * 4 > 0) {
        OPENCL_SUCCEED_OR_RETURN(clEnqueueReadBuffer(ctx->opencl.queue,
                                                     arr->mem.mem,
                                                     ctx->failure_is_an_option ? CL_FALSE : CL_TRUE,
                                                     (size_t) 0,
                                                     (size_t) ((size_t) (arr->shape[0] *
                                                                         arr->shape[1]) *
                                                               4), data + 0, 0,
                                                     NULL,
                                                     ctx->profiling_paused ||
                                                     !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                               &ctx->copy_host_to_dev_runs,
                                                                                               &ctx->copy_host_to_dev_total_runtime)));
        if (ctx->failure_is_an_option && futhark_context_sync(ctx) != 0)
            return 1;
    }
    lock_unlock(&ctx->lock);
    return 0;
}
cl_mem futhark_values_raw_f32_2d(struct futhark_context *ctx,
                                 struct futhark_f32_2d *arr)
{
    (void) ctx;
    return arr->mem.mem;
}
const int64_t *futhark_shape_f32_2d(struct futhark_context *ctx,
                                    struct futhark_f32_2d *arr)
{
    (void) ctx;
    return arr->shape;
}

static int futrts_builtinzhgpu_map_transpose_f32(struct futhark_context *ctx,
                                                 struct memblock_device destmem_0,
                                                 int32_t destoffset_1,
                                                 struct memblock_device srcmem_2,
                                                 int32_t srcoffset_3,
                                                 int32_t num_arrays_4,
                                                 int32_t x_elems_5,
                                                 int32_t y_elems_6)
{
    (void) ctx;
    
    int err = 0;
    
    if (!(num_arrays_4 == 0 || (x_elems_5 == 0 || y_elems_6 == 0))) {
        int32_t muly_8 = squot32(16, x_elems_5);
        int32_t mulx_7 = squot32(16, y_elems_6);
        
        if (num_arrays_4 == 1 && (x_elems_5 == 1 || y_elems_6 == 1)) {
            if (sext_i32_i64(x_elems_5 * y_elems_6 * 4) > 0) {
                OPENCL_SUCCEED_OR_RETURN(clEnqueueCopyBuffer(ctx->opencl.queue,
                                                             srcmem_2.mem,
                                                             destmem_0.mem,
                                                             (size_t) sext_i32_i64(srcoffset_3),
                                                             (size_t) sext_i32_i64(destoffset_1),
                                                             (size_t) sext_i32_i64(x_elems_5 *
                                                             y_elems_6 * 4), 0,
                                                             NULL,
                                                             ctx->profiling_paused ||
                                                             !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                       &ctx->copy_dev_to_dev_runs,
                                                                                                       &ctx->copy_dev_to_dev_total_runtime)));
                if (ctx->debugging)
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
            }
        } else {
            if (sle32(x_elems_5, 8) && slt32(16, y_elems_6)) {
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_width,
                                                        0,
                                                        (size_t) (int64_t) 1088,
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_width,
                                                        1, sizeof(destoffset_1),
                                                        &destoffset_1));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_width,
                                                        2, sizeof(srcoffset_3),
                                                        &srcoffset_3));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_width,
                                                        3, sizeof(num_arrays_4),
                                                        &num_arrays_4));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_width,
                                                        4, sizeof(x_elems_5),
                                                        &x_elems_5));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_width,
                                                        5, sizeof(y_elems_6),
                                                        &y_elems_6));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_width,
                                                        6, sizeof(mulx_7),
                                                        &mulx_7));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_width,
                                                        7, sizeof(muly_8),
                                                        &muly_8));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_width,
                                                        8,
                                                        sizeof(destmem_0.mem),
                                                        &destmem_0.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_width,
                                                        9, sizeof(srcmem_2.mem),
                                                        &srcmem_2.mem));
                if (1 * ((size_t) sdiv_up32(x_elems_5, 16) * (size_t) 16) *
                    ((size_t) sdiv_up32(sdiv_up32(y_elems_6, muly_8), 16) *
                     (size_t) 16) * ((size_t) num_arrays_4 * (size_t) 1) != 0) {
                    const size_t global_work_sizze_79937[3] =
                                 {(size_t) sdiv_up32(x_elems_5, 16) *
                                  (size_t) 16,
                                  (size_t) sdiv_up32(sdiv_up32(y_elems_6,
                                                               muly_8), 16) *
                                  (size_t) 16, (size_t) num_arrays_4 *
                                  (size_t) 1};
                    const size_t local_work_sizze_79941[3] = {(size_t) 16,
                                                              (size_t) 16,
                                                              (size_t) 1};
                    int64_t time_start_79938 = 0, time_end_79939 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu, %zu, %zu] and local work size [%zu, %zu, %zu]; local memory: %d bytes.\n",
                                "gpu_map_transpose_f32_low_width",
                                global_work_sizze_79937[0],
                                global_work_sizze_79937[1],
                                global_work_sizze_79937[2],
                                local_work_sizze_79941[0],
                                local_work_sizze_79941[1],
                                local_work_sizze_79941[2], (int) (0 +
                                                                  (int64_t) 1088));
                        time_start_79938 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->gpu_map_transpose_f32_low_width,
                                                                    3, NULL,
                                                                    global_work_sizze_79937,
                                                                    local_work_sizze_79941,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->gpu_map_transpose_f32_low_width_runs,
                                                                                                              &ctx->gpu_map_transpose_f32_low_width_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_79939 = get_wall_time();
                        
                        long time_diff_79940 = time_end_79939 -
                             time_start_79938;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "gpu_map_transpose_f32_low_width",
                                time_diff_79940);
                    }
                }
            } else {
                if (sle32(y_elems_6, 8) && slt32(16, x_elems_5)) {
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_height,
                                                            0,
                                                            (size_t) (int64_t) 1088,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_height,
                                                            1,
                                                            sizeof(destoffset_1),
                                                            &destoffset_1));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_height,
                                                            2,
                                                            sizeof(srcoffset_3),
                                                            &srcoffset_3));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_height,
                                                            3,
                                                            sizeof(num_arrays_4),
                                                            &num_arrays_4));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_height,
                                                            4,
                                                            sizeof(x_elems_5),
                                                            &x_elems_5));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_height,
                                                            5,
                                                            sizeof(y_elems_6),
                                                            &y_elems_6));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_height,
                                                            6, sizeof(mulx_7),
                                                            &mulx_7));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_height,
                                                            7, sizeof(muly_8),
                                                            &muly_8));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_height,
                                                            8,
                                                            sizeof(destmem_0.mem),
                                                            &destmem_0.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_low_height,
                                                            9,
                                                            sizeof(srcmem_2.mem),
                                                            &srcmem_2.mem));
                    if (1 * ((size_t) sdiv_up32(sdiv_up32(x_elems_5, mulx_7),
                                                16) * (size_t) 16) *
                        ((size_t) sdiv_up32(y_elems_6, 16) * (size_t) 16) *
                        ((size_t) num_arrays_4 * (size_t) 1) != 0) {
                        const size_t global_work_sizze_79942[3] =
                                     {(size_t) sdiv_up32(sdiv_up32(x_elems_5,
                                                                   mulx_7),
                                                         16) * (size_t) 16,
                                      (size_t) sdiv_up32(y_elems_6, 16) *
                                      (size_t) 16, (size_t) num_arrays_4 *
                                      (size_t) 1};
                        const size_t local_work_sizze_79946[3] = {(size_t) 16,
                                                                  (size_t) 16,
                                                                  (size_t) 1};
                        int64_t time_start_79943 = 0, time_end_79944 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu, %zu, %zu] and local work size [%zu, %zu, %zu]; local memory: %d bytes.\n",
                                    "gpu_map_transpose_f32_low_height",
                                    global_work_sizze_79942[0],
                                    global_work_sizze_79942[1],
                                    global_work_sizze_79942[2],
                                    local_work_sizze_79946[0],
                                    local_work_sizze_79946[1],
                                    local_work_sizze_79946[2], (int) (0 +
                                                                      (int64_t) 1088));
                            time_start_79943 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->gpu_map_transpose_f32_low_height,
                                                                        3, NULL,
                                                                        global_work_sizze_79942,
                                                                        local_work_sizze_79946,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->gpu_map_transpose_f32_low_height_runs,
                                                                                                                  &ctx->gpu_map_transpose_f32_low_height_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_79944 = get_wall_time();
                            
                            long time_diff_79945 = time_end_79944 -
                                 time_start_79943;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "gpu_map_transpose_f32_low_height",
                                    time_diff_79945);
                        }
                    }
                } else {
                    if (sle32(x_elems_5, 8) && sle32(y_elems_6, 8)) {
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_small,
                                                                0,
                                                                (size_t) (int64_t) 1,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_small,
                                                                1,
                                                                sizeof(destoffset_1),
                                                                &destoffset_1));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_small,
                                                                2,
                                                                sizeof(srcoffset_3),
                                                                &srcoffset_3));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_small,
                                                                3,
                                                                sizeof(num_arrays_4),
                                                                &num_arrays_4));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_small,
                                                                4,
                                                                sizeof(x_elems_5),
                                                                &x_elems_5));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_small,
                                                                5,
                                                                sizeof(y_elems_6),
                                                                &y_elems_6));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_small,
                                                                6,
                                                                sizeof(mulx_7),
                                                                &mulx_7));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_small,
                                                                7,
                                                                sizeof(muly_8),
                                                                &muly_8));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_small,
                                                                8,
                                                                sizeof(destmem_0.mem),
                                                                &destmem_0.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_small,
                                                                9,
                                                                sizeof(srcmem_2.mem),
                                                                &srcmem_2.mem));
                        if (1 * ((size_t) sdiv_up32(num_arrays_4 * x_elems_5 *
                                                    y_elems_6, 256) *
                                 (size_t) 256) != 0) {
                            const size_t global_work_sizze_79947[1] =
                                         {(size_t) sdiv_up32(num_arrays_4 *
                                                             x_elems_5 *
                                                             y_elems_6, 256) *
                                         (size_t) 256};
                            const size_t local_work_sizze_79951[1] =
                                         {(size_t) 256};
                            int64_t time_start_79948 = 0, time_end_79949 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "gpu_map_transpose_f32_small",
                                        global_work_sizze_79947[0],
                                        local_work_sizze_79951[0], (int) (0 +
                                                                          (int64_t) 1));
                                time_start_79948 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->gpu_map_transpose_f32_small,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_79947,
                                                                            local_work_sizze_79951,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->gpu_map_transpose_f32_small_runs,
                                                                                                                      &ctx->gpu_map_transpose_f32_small_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_79949 = get_wall_time();
                                
                                long time_diff_79950 = time_end_79949 -
                                     time_start_79948;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_f32_small",
                                        time_diff_79950);
                            }
                        }
                    } else {
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32,
                                                                0,
                                                                (size_t) (int64_t) 4224,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32,
                                                                1,
                                                                sizeof(destoffset_1),
                                                                &destoffset_1));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32,
                                                                2,
                                                                sizeof(srcoffset_3),
                                                                &srcoffset_3));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32,
                                                                3,
                                                                sizeof(num_arrays_4),
                                                                &num_arrays_4));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32,
                                                                4,
                                                                sizeof(x_elems_5),
                                                                &x_elems_5));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32,
                                                                5,
                                                                sizeof(y_elems_6),
                                                                &y_elems_6));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32,
                                                                6,
                                                                sizeof(mulx_7),
                                                                &mulx_7));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32,
                                                                7,
                                                                sizeof(muly_8),
                                                                &muly_8));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32,
                                                                8,
                                                                sizeof(destmem_0.mem),
                                                                &destmem_0.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32,
                                                                9,
                                                                sizeof(srcmem_2.mem),
                                                                &srcmem_2.mem));
                        if (1 * ((size_t) sdiv_up32(x_elems_5, 32) *
                                 (size_t) 32) * ((size_t) sdiv_up32(y_elems_6,
                                                                    32) *
                                                 (size_t) 8) *
                            ((size_t) num_arrays_4 * (size_t) 1) != 0) {
                            const size_t global_work_sizze_79952[3] =
                                         {(size_t) sdiv_up32(x_elems_5, 32) *
                                          (size_t) 32,
                                          (size_t) sdiv_up32(y_elems_6, 32) *
                                          (size_t) 8, (size_t) num_arrays_4 *
                                          (size_t) 1};
                            const size_t local_work_sizze_79956[3] =
                                         {(size_t) 32, (size_t) 8, (size_t) 1};
                            int64_t time_start_79953 = 0, time_end_79954 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu, %zu, %zu] and local work size [%zu, %zu, %zu]; local memory: %d bytes.\n",
                                        "gpu_map_transpose_f32",
                                        global_work_sizze_79952[0],
                                        global_work_sizze_79952[1],
                                        global_work_sizze_79952[2],
                                        local_work_sizze_79956[0],
                                        local_work_sizze_79956[1],
                                        local_work_sizze_79956[2], (int) (0 +
                                                                          (int64_t) 4224));
                                time_start_79953 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->gpu_map_transpose_f32,
                                                                            3,
                                                                            NULL,
                                                                            global_work_sizze_79952,
                                                                            local_work_sizze_79956,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->gpu_map_transpose_f32_runs,
                                                                                                                      &ctx->gpu_map_transpose_f32_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_79954 = get_wall_time();
                                
                                long time_diff_79955 = time_end_79954 -
                                     time_start_79953;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_f32",
                                        time_diff_79955);
                            }
                        }
                    }
                }
            }
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_builtinzhreplicate_f32(struct futhark_context *ctx,
                                         struct memblock_device mem_78271,
                                         int32_t num_elems_78272,
                                         float val_78273)
{
    (void) ctx;
    
    int err = 0;
    int64_t group_sizze_78278;
    
    group_sizze_78278 =
        *ctx->tuning_params.builtinzhreplicate_f32zigroup_sizze_78278;
    
    int64_t num_groups_78279 = sdiv_up64(num_elems_78272, group_sizze_78278);
    
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_f32zireplicate_78275,
                                            0, sizeof(num_elems_78272),
                                            &num_elems_78272));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_f32zireplicate_78275,
                                            1, sizeof(val_78273), &val_78273));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_f32zireplicate_78275,
                                            2, sizeof(mem_78271.mem),
                                            &mem_78271.mem));
    if (1 * ((size_t) num_groups_78279 * (size_t) group_sizze_78278) != 0) {
        const size_t global_work_sizze_79957[1] = {(size_t) num_groups_78279 *
                     (size_t) group_sizze_78278};
        const size_t local_work_sizze_79961[1] = {(size_t) group_sizze_78278};
        int64_t time_start_79958 = 0, time_end_79959 = 0;
        
        if (ctx->debugging) {
            fprintf(ctx->log,
                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                    "builtin#replicate_f32.replicate_78275",
                    global_work_sizze_79957[0], local_work_sizze_79961[0],
                    (int) 0);
            time_start_79958 = get_wall_time();
        }
        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                        ctx->builtinzhreplicate_f32zireplicate_78275,
                                                        1, NULL,
                                                        global_work_sizze_79957,
                                                        local_work_sizze_79961,
                                                        0, NULL,
                                                        ctx->profiling_paused ||
                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                  &ctx->builtinzhreplicate_f32zireplicate_78275_runs,
                                                                                                  &ctx->builtinzhreplicate_f32zireplicate_78275_total_runtime)));
        if (ctx->debugging) {
            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
            time_end_79959 = get_wall_time();
            
            long time_diff_79960 = time_end_79959 - time_start_79958;
            
            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                    "builtin#replicate_f32.replicate_78275", time_diff_79960);
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_builtinzhreplicate_i64(struct futhark_context *ctx,
                                         struct memblock_device mem_78385,
                                         int32_t num_elems_78386,
                                         int64_t val_78387)
{
    (void) ctx;
    
    int err = 0;
    int64_t group_sizze_78392;
    
    group_sizze_78392 =
        *ctx->tuning_params.builtinzhreplicate_i64zigroup_sizze_78392;
    
    int64_t num_groups_78393 = sdiv_up64(num_elems_78386, group_sizze_78392);
    
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_i64zireplicate_78389,
                                            0, sizeof(num_elems_78386),
                                            &num_elems_78386));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_i64zireplicate_78389,
                                            1, sizeof(val_78387), &val_78387));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_i64zireplicate_78389,
                                            2, sizeof(mem_78385.mem),
                                            &mem_78385.mem));
    if (1 * ((size_t) num_groups_78393 * (size_t) group_sizze_78392) != 0) {
        const size_t global_work_sizze_79962[1] = {(size_t) num_groups_78393 *
                     (size_t) group_sizze_78392};
        const size_t local_work_sizze_79966[1] = {(size_t) group_sizze_78392};
        int64_t time_start_79963 = 0, time_end_79964 = 0;
        
        if (ctx->debugging) {
            fprintf(ctx->log,
                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                    "builtin#replicate_i64.replicate_78389",
                    global_work_sizze_79962[0], local_work_sizze_79966[0],
                    (int) 0);
            time_start_79963 = get_wall_time();
        }
        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                        ctx->builtinzhreplicate_i64zireplicate_78389,
                                                        1, NULL,
                                                        global_work_sizze_79962,
                                                        local_work_sizze_79966,
                                                        0, NULL,
                                                        ctx->profiling_paused ||
                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                  &ctx->builtinzhreplicate_i64zireplicate_78389_runs,
                                                                                                  &ctx->builtinzhreplicate_i64zireplicate_78389_total_runtime)));
        if (ctx->debugging) {
            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
            time_end_79964 = get_wall_time();
            
            long time_diff_79965 = time_end_79964 - time_start_79963;
            
            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                    "builtin#replicate_i64.replicate_78389", time_diff_79965);
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_entry_main(struct futhark_context *ctx,
                             struct memblock_device *mem_out_p_79967,
                             struct memblock_device Y_mem_76976,
                             int64_t m_65343, int64_t n_65344, int64_t q_65346,
                             int64_t degree_65347, int64_t jump_65348,
                             int64_t jump_threshold_65349,
                             int64_t q_threshold_65350)
{
    (void) ctx;
    
    int err = 0;
    struct memblock_device mem_out_78270;
    
    mem_out_78270.references = NULL;
    
    bool cond_65351 = jump_65348 == (int64_t) 1;
    int64_t n_m_65352;
    
    if (cond_65351) {
        n_m_65352 = n_65344;
    } else {
        bool zzero_65353 = jump_65348 == (int64_t) 0;
        bool nonzzero_65354 = !zzero_65353;
        bool nonzzero_cert_65355;
        
        if (!nonzzero_65354) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  loess.fut:579:38-45\n   #1  loess.fut:572:1-611:26\n");
            if (memblock_unref_device(ctx, &mem_out_78270, "mem_out_78270") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t x_65356 = sdiv64(n_65344, jump_65348);
        int64_t n_m_f_res_65357 = add64((int64_t) 1, x_65356);
        
        n_m_65352 = n_m_f_res_65357;
    }
    
    int64_t i_65358 = sub64(n_65344, (int64_t) 1);
    bool x_65359 = sle64((int64_t) 0, i_65358);
    bool y_65360 = slt64(i_65358, n_65344);
    bool bounds_check_65361 = x_65359 && y_65360;
    bool index_certs_65362;
    
    if (!bounds_check_65361) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", (long long) i_65358,
                               "] out of bounds for array of shape [",
                               (long long) n_65344, "].",
                               "-> #0  /prelude/array.fut:26:29-34\n   #1  utils.fut:45:13-20\n   #2  loess.fut:584:5-54\n   #3  loess.fut:572:1-611:26\n");
        if (memblock_unref_device(ctx, &mem_out_78270, "mem_out_78270") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    int64_t min_res_65364 = smin64(n_65344, q_65346);
    bool bounds_invalid_upwards_65365 = slt64(n_m_65352, (int64_t) 0);
    bool valid_65366 = !bounds_invalid_upwards_65365;
    bool range_valid_c_65367;
    
    if (!valid_65366) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (long long) (int64_t) 0, "..",
                               (long long) (int64_t) 1, "..<",
                               (long long) n_m_65352, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  utils.fut:6:3-16\n   #3  loess.fut:442:3-469:10\n   #4  loess.fut:502:15-61\n   #5  loess.fut:589:13-56\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:588:5-590:26\n   #9  loess.fut:572:1-611:26\n");
        if (memblock_unref_device(ctx, &mem_out_78270, "mem_out_78270") != 0)
            return 1;
        err = 1;
        goto cleanup;
    }
    
    bool loop_cond_65369 = slt64((int64_t) 1, min_res_65364);
    float i64_res_65370 = sitofp_i64_f32(q_65346);
    bool cond_65371 = slt64(jump_65348, jump_threshold_65349);
    bool cond_f_res_65372 = slt64(q_threshold_65350, q_65346);
    bool x_65373 = !cond_65371;
    bool y_65374 = cond_f_res_65372 && x_65373;
    bool cond_65375 = cond_65371 || y_65374;
    struct memblock_device ext_mem_77996;
    
    ext_mem_77996.references = NULL;
    
    struct memblock_device ext_mem_77995;
    
    ext_mem_77995.references = NULL;
    if (cond_65375) {
        bool match_lit_65378 = (int64_t) 0 == degree_65347;
        int64_t binop_x_76977 = m_65343 * n_m_65352;
        int64_t binop_y_76978 = (int64_t) 4 * binop_x_76977;
        int64_t bytes_76979 = smax64((int64_t) 0, binop_y_76978);
        struct memblock_device ext_mem_77824;
        
        ext_mem_77824.references = NULL;
        
        struct memblock_device ext_mem_77823;
        
        ext_mem_77823.references = NULL;
        if (match_lit_65378) {
            struct memblock_device mem_76980;
            
            mem_76980.references = NULL;
            if (memblock_alloc_device(ctx, &mem_76980, bytes_76979,
                                      "mem_76980")) {
                err = 1;
                goto cleanup;
            }
            if (futrts_builtinzhreplicate_f32(ctx, mem_76980, m_65343 *
                                              n_m_65352, 0.0F) != 0) {
                if (memblock_unref_device(ctx, &mem_76980, "mem_76980") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77823,
                                          "ext_mem_77823") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77824,
                                          "ext_mem_77824") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77995,
                                          "ext_mem_77995") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77996,
                                          "ext_mem_77996") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_78270,
                                          "mem_out_78270") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            bool suff_outer_par_66693;
            
            suff_outer_par_66693 = *ctx->tuning_params.mainzisuff_outer_par_0 <=
                m_65343;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_outer_par_0", (long) m_65343,
                        suff_outer_par_66693 ? "true" : "false");
            
            int64_t segmap_group_sizze_66876;
            
            segmap_group_sizze_66876 =
                *ctx->tuning_params.mainzisegmap_group_sizze_66697;
            
            int64_t num_groups_66877;
            int32_t max_num_groups_78283;
            
            max_num_groups_78283 =
                *ctx->tuning_params.mainzisegmap_num_groups_66699;
            num_groups_66877 = sext_i64_i32(smax64((int64_t) 1,
                                                   smin64(sdiv_up64(m_65343,
                                                                    segmap_group_sizze_66876),
                                                          sext_i32_i64(max_num_groups_78283))));
            
            int64_t nest_sizze_67843 = m_65343 * n_65344;
            int64_t segscan_group_sizze_67844;
            
            segscan_group_sizze_67844 =
                *ctx->tuning_params.mainzisegscan_group_sizze_67824;
            
            int64_t num_groups_67845;
            int32_t max_num_groups_78284;
            
            max_num_groups_78284 =
                *ctx->tuning_params.mainzisegscan_num_groups_67826;
            num_groups_67845 = sext_i64_i32(smax64((int64_t) 1,
                                                   smin64(sdiv_up64(nest_sizze_67843,
                                                                    segscan_group_sizze_67844),
                                                          sext_i32_i64(max_num_groups_78284))));
            
            int64_t segmap_group_sizze_67897;
            
            segmap_group_sizze_67897 =
                *ctx->tuning_params.mainzisegmap_group_sizze_67738;
            
            int64_t segmap_group_sizze_67917;
            
            segmap_group_sizze_67917 =
                *ctx->tuning_params.mainzisegmap_group_sizze_67712;
            
            int64_t segmap_group_sizze_67927;
            
            segmap_group_sizze_67927 =
                *ctx->tuning_params.mainzisegmap_group_sizze_67686;
            
            int64_t nest_sizze_67948 = m_65343 * q_65346;
            int64_t segmap_group_sizze_67949;
            
            segmap_group_sizze_67949 =
                *ctx->tuning_params.mainzisegmap_group_sizze_67661;
            
            bool suff_outer_par_67966;
            
            suff_outer_par_67966 = *ctx->tuning_params.mainzisuff_outer_par_1 <=
                binop_x_76977;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_outer_par_1", (long) binop_x_76977,
                        suff_outer_par_67966 ? "true" : "false");
            
            int64_t segmap_group_sizze_68118;
            
            segmap_group_sizze_68118 =
                *ctx->tuning_params.mainzisegmap_group_sizze_67347;
            
            int64_t nest_sizze_68221 = q_65346 * binop_x_76977;
            int64_t segred_group_sizze_68222;
            
            segred_group_sizze_68222 =
                *ctx->tuning_params.mainzisegred_group_sizze_67302;
            
            int64_t num_groups_68223;
            int32_t max_num_groups_78285;
            
            max_num_groups_78285 =
                *ctx->tuning_params.mainzisegred_num_groups_67304;
            num_groups_68223 = sext_i64_i32(smax64((int64_t) 1,
                                                   smin64(sdiv_up64(nest_sizze_68221,
                                                                    segred_group_sizze_68222),
                                                          sext_i32_i64(max_num_groups_78285))));
            
            int64_t segmap_group_sizze_68261;
            
            segmap_group_sizze_68261 =
                *ctx->tuning_params.mainzisegmap_group_sizze_67289;
            
            int64_t segred_group_sizze_68272;
            
            segred_group_sizze_68272 =
                *ctx->tuning_params.mainzisegred_group_sizze_67234;
            
            int64_t num_groups_68273;
            int32_t max_num_groups_78286;
            
            max_num_groups_78286 =
                *ctx->tuning_params.mainzisegred_num_groups_67236;
            num_groups_68273 = sext_i64_i32(smax64((int64_t) 1,
                                                   smin64(sdiv_up64(nest_sizze_68221,
                                                                    segred_group_sizze_68272),
                                                          sext_i32_i64(max_num_groups_78286))));
            
            int64_t tile_sizze_74753;
            
            tile_sizze_74753 = *ctx->tuning_params.mainzitile_sizze_74752;
            
            int64_t group_sizze_74754 = tile_sizze_74753 * tile_sizze_74753;
            int64_t bytes_76982 = (int64_t) 4 * nest_sizze_67843;
            int64_t binop_y_76985 = (int64_t) 8 * n_65344;
            int64_t bytes_76986 = smax64((int64_t) 0, binop_y_76985);
            int64_t binop_y_77000 = (int64_t) 4 * n_65344;
            int64_t bytes_77001 = smax64((int64_t) 0, binop_y_77000);
            int64_t binop_y_77045 = (int64_t) 4 * q_65346;
            int64_t bytes_77046 = smax64((int64_t) 0, binop_y_77045);
            int64_t binop_y_77060 = (int64_t) 4 * n_m_65352;
            int64_t bytes_77061 = smax64((int64_t) 0, binop_y_77060);
            int64_t binop_y_77080 = (int64_t) 8 * nest_sizze_67843;
            int64_t bytes_77081 = smax64((int64_t) 0, binop_y_77080);
            int64_t bytes_77085 = smax64((int64_t) 0, bytes_76982);
            int64_t binop_y_77098 = (int64_t) 8 * m_65343;
            int64_t bytes_77099 = smax64((int64_t) 0, binop_y_77098);
            int64_t binop_y_77107 = (int64_t) 4 * m_65343;
            int64_t bytes_77108 = smax64((int64_t) 0, binop_y_77107);
            int64_t binop_y_77112 = (int64_t) 4 * nest_sizze_67948;
            int64_t bytes_77113 = smax64((int64_t) 0, binop_y_77112);
            int64_t bytes_77118 = (int64_t) 8 * group_sizze_74754;
            int64_t bytes_77127 = (int64_t) 4 * group_sizze_74754;
            int64_t bytes_77137 = smax64((int64_t) 0, bytes_77127);
            int64_t binop_x_78009 = (int64_t) 4 * tile_sizze_74753;
            int64_t sizze_78010 = tile_sizze_74753 * binop_x_78009;
            int64_t binop_y_77164 = (int64_t) 8 * binop_x_76977;
            int64_t bytes_77165 = smax64((int64_t) 0, binop_y_77164);
            int64_t binop_x_78075 = (int64_t) 4 * tile_sizze_74753;
            int64_t num_bytes_78076 = tile_sizze_74753 * binop_x_78075;
            int64_t maxSubHelper_78134 = umax64(sizze_78010, num_bytes_78076);
            int64_t num_threads_78201 = segmap_group_sizze_66876 *
                    num_groups_66877;
            int64_t total_sizze_78202 = bytes_77061 * num_threads_78201;
            int64_t total_sizze_78203 = bytes_77046 * num_threads_78201;
            int64_t total_sizze_78204 = bytes_76986 * num_threads_78201;
            int64_t total_sizze_78205 = bytes_76986 * num_threads_78201;
            int64_t total_sizze_78206 = bytes_77001 * num_threads_78201;
            struct memblock_device ext_mem_77196;
            
            ext_mem_77196.references = NULL;
            
            int32_t local_memory_capacity_78641;
            
            local_memory_capacity_78641 = ctx->opencl.max_local_memory;
            if (sle64((int64_t) 0, sext_i32_i64(local_memory_capacity_78641)) &&
                suff_outer_par_66693) {
                struct memblock_device mem_76983;
                
                mem_76983.references = NULL;
                if (memblock_alloc_device(ctx, &mem_76983, bytes_76982,
                                          "mem_76983")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_76983,
                                                          (int64_t) 0,
                                                          Y_mem_76976,
                                                          (int64_t) 0,
                                                          (int64_t) 1, n_65344,
                                                          m_65343) != 0) {
                    if (memblock_unref_device(ctx, &mem_76983, "mem_76983") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77196,
                                              "ext_mem_77196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_76980, "mem_76980") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77823,
                                              "ext_mem_77823") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77824,
                                              "ext_mem_77824") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77995,
                                              "ext_mem_77995") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77996,
                                              "ext_mem_77996") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_78270,
                                              "mem_out_78270") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77077;
                
                mem_77077.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77077, binop_y_76978,
                                          "mem_77077")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_78129;
                
                color_78129.references = NULL;
                if (memblock_alloc_device(ctx, &color_78129, total_sizze_78202,
                                          "color_78129")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_78130;
                
                color_78130.references = NULL;
                if (memblock_alloc_device(ctx, &color_78130, total_sizze_78203,
                                          "color_78130")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_78131;
                
                color_78131.references = NULL;
                if (memblock_alloc_device(ctx, &color_78131, total_sizze_78204,
                                          "color_78131")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_78132;
                
                color_78132.references = NULL;
                if (memblock_alloc_device(ctx, &color_78132, total_sizze_78205,
                                          "color_78132")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_78133;
                
                color_78133.references = NULL;
                if (memblock_alloc_device(ctx, &color_78133, total_sizze_78206,
                                          "color_78133")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        3, sizeof(m_65343),
                                                        &m_65343));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        4, sizeof(n_65344),
                                                        &n_65344));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        5, sizeof(q_65346),
                                                        &q_65346));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        6, sizeof(jump_65348),
                                                        &jump_65348));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        7, sizeof(n_m_65352),
                                                        &n_m_65352));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        8, sizeof(i_65358),
                                                        &i_65358));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        9, sizeof(x_65359),
                                                        &x_65359));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        10,
                                                        sizeof(min_res_65364),
                                                        &min_res_65364));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        11,
                                                        sizeof(loop_cond_65369),
                                                        &loop_cond_65369));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        12,
                                                        sizeof(i64_res_65370),
                                                        &i64_res_65370));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        13,
                                                        sizeof(num_groups_66877),
                                                        &num_groups_66877));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        14,
                                                        sizeof(num_threads_78201),
                                                        &num_threads_78201));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        15,
                                                        sizeof(mem_76983.mem),
                                                        &mem_76983.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        16,
                                                        sizeof(mem_77077.mem),
                                                        &mem_77077.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        17,
                                                        sizeof(color_78129.mem),
                                                        &color_78129.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        18,
                                                        sizeof(color_78130.mem),
                                                        &color_78130.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        19,
                                                        sizeof(color_78131.mem),
                                                        &color_78131.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        20,
                                                        sizeof(color_78132.mem),
                                                        &color_78132.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_66881,
                                                        21,
                                                        sizeof(color_78133.mem),
                                                        &color_78133.mem));
                if (1 * ((size_t) num_groups_66877 *
                         (size_t) segmap_group_sizze_66876) != 0) {
                    const size_t global_work_sizze_79968[1] =
                                 {(size_t) num_groups_66877 *
                                 (size_t) segmap_group_sizze_66876};
                    const size_t local_work_sizze_79972[1] =
                                 {(size_t) segmap_group_sizze_66876};
                    int64_t time_start_79969 = 0, time_end_79970 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_66881", global_work_sizze_79968[0],
                                local_work_sizze_79972[0], (int) 0);
                        time_start_79969 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_66881,
                                                                    1, NULL,
                                                                    global_work_sizze_79968,
                                                                    local_work_sizze_79972,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_66881_runs,
                                                                                                              &ctx->mainzisegmap_66881_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_79970 = get_wall_time();
                        
                        long time_diff_79971 = time_end_79970 -
                             time_start_79969;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_66881", time_diff_79971);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_76983, "mem_76983") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78129, "color_78129") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78130, "color_78130") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78131, "color_78131") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78132, "color_78132") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78133, "color_78133") !=
                    0)
                    return 1;
                
                struct memblock_device mem_77194;
                
                mem_77194.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77194, bytes_76979,
                                          "mem_77194")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_77194,
                                                          (int64_t) 0,
                                                          mem_77077,
                                                          (int64_t) 0,
                                                          (int64_t) 1, m_65343,
                                                          n_m_65352) != 0) {
                    if (memblock_unref_device(ctx, &mem_77194, "mem_77194") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78133,
                                              "color_78133") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78132,
                                              "color_78132") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78131,
                                              "color_78131") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78130,
                                              "color_78130") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78129,
                                              "color_78129") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77077, "mem_77077") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_76983, "mem_76983") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77196,
                                              "ext_mem_77196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_76980, "mem_76980") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77823,
                                              "ext_mem_77823") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77824,
                                              "ext_mem_77824") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77995,
                                              "ext_mem_77995") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77996,
                                              "ext_mem_77996") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_78270,
                                              "mem_out_78270") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                if (memblock_unref_device(ctx, &mem_77077, "mem_77077") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_77196, &mem_77194,
                                        "mem_77194") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77194, "mem_77194") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78133, "color_78133") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78132, "color_78132") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78131, "color_78131") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78130, "color_78130") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_78129, "color_78129") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77077, "mem_77077") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_76983, "mem_76983") != 0)
                    return 1;
            } else {
                struct memblock_device mem_77082;
                
                mem_77082.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77082, bytes_77081,
                                          "mem_77082")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64((int64_t) 0, m_65343 * n_65344)) {
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegScan");
                    
                    int64_t stage1_max_num_groups_78320;
                    
                    stage1_max_num_groups_78320 = ctx->opencl.max_group_size;
                    
                    int64_t stage1_num_groups_78321 =
                            smin64(stage1_max_num_groups_78320,
                                   num_groups_67845);
                    int32_t num_threads_78322 =
                            sext_i64_i32(stage1_num_groups_78321 *
                            segscan_group_sizze_67844);
                    
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_67850,
                                                            1,
                                                            (size_t) smax64((int64_t) 1,
                                                                            (int64_t) 8 *
                                                                            segscan_group_sizze_67844),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_67850,
                                                            2, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_67850,
                                                            3, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_67850,
                                                            4,
                                                            sizeof(num_threads_78322),
                                                            &num_threads_78322));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_67850,
                                                            5,
                                                            sizeof(Y_mem_76976.mem),
                                                            &Y_mem_76976.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_67850,
                                                            6,
                                                            sizeof(mem_77082.mem),
                                                            &mem_77082.mem));
                    if (1 * ((size_t) stage1_num_groups_78321 *
                             (size_t) segscan_group_sizze_67844) != 0) {
                        const size_t global_work_sizze_79973[1] =
                                     {(size_t) stage1_num_groups_78321 *
                                     (size_t) segscan_group_sizze_67844};
                        const size_t local_work_sizze_79977[1] =
                                     {(size_t) segscan_group_sizze_67844};
                        int64_t time_start_79974 = 0, time_end_79975 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.scan_stage1_67850",
                                    global_work_sizze_79973[0],
                                    local_work_sizze_79977[0], (int) (0 +
                                                                      smax64((int64_t) 1,
                                                                             (int64_t) 8 *
                                                                             segscan_group_sizze_67844)));
                            time_start_79974 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainziscan_stage1_67850,
                                                                        1, NULL,
                                                                        global_work_sizze_79973,
                                                                        local_work_sizze_79977,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainziscan_stage1_67850_runs,
                                                                                                                  &ctx->mainziscan_stage1_67850_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_79975 = get_wall_time();
                            
                            long time_diff_79976 = time_end_79975 -
                                 time_start_79974;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.scan_stage1_67850", time_diff_79976);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                                (long long) (segscan_group_sizze_67844 *
                                             sdiv_up64(m_65343 * n_65344,
                                                       sext_i32_i64(num_threads_78322))),
                                '\n');
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_67850,
                                                            1,
                                                            (size_t) smax64((int64_t) 1,
                                                                            (int64_t) 8 *
                                                                            stage1_num_groups_78321),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_67850,
                                                            2, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_67850,
                                                            3, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_67850,
                                                            4,
                                                            sizeof(stage1_num_groups_78321),
                                                            &stage1_num_groups_78321));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_67850,
                                                            5,
                                                            sizeof(num_threads_78322),
                                                            &num_threads_78322));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_67850,
                                                            6,
                                                            sizeof(mem_77082.mem),
                                                            &mem_77082.mem));
                    if (1 * ((size_t) (int64_t) 1 *
                             (size_t) stage1_num_groups_78321) != 0) {
                        const size_t global_work_sizze_79978[1] =
                                     {(size_t) (int64_t) 1 *
                                     (size_t) stage1_num_groups_78321};
                        const size_t local_work_sizze_79982[1] =
                                     {(size_t) stage1_num_groups_78321};
                        int64_t time_start_79979 = 0, time_end_79980 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.scan_stage2_67850",
                                    global_work_sizze_79978[0],
                                    local_work_sizze_79982[0], (int) (0 +
                                                                      smax64((int64_t) 1,
                                                                             (int64_t) 8 *
                                                                             stage1_num_groups_78321)));
                            time_start_79979 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainziscan_stage2_67850,
                                                                        1, NULL,
                                                                        global_work_sizze_79978,
                                                                        local_work_sizze_79982,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainziscan_stage2_67850_runs,
                                                                                                                  &ctx->mainziscan_stage2_67850_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_79980 = get_wall_time();
                            
                            long time_diff_79981 = time_end_79980 -
                                 time_start_79979;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.scan_stage2_67850", time_diff_79981);
                        }
                    }
                    
                    int32_t required_groups_78373 =
                            sext_i64_i32(sdiv_up64(m_65343 * n_65344,
                                                   segscan_group_sizze_67844));
                    
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_67850,
                                                            1, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_67850,
                                                            2, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_67850,
                                                            3,
                                                            sizeof(num_groups_67845),
                                                            &num_groups_67845));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_67850,
                                                            4,
                                                            sizeof(num_threads_78322),
                                                            &num_threads_78322));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_67850,
                                                            5,
                                                            sizeof(required_groups_78373),
                                                            &required_groups_78373));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_67850,
                                                            6,
                                                            sizeof(mem_77082.mem),
                                                            &mem_77082.mem));
                    if (1 * ((size_t) num_groups_67845 *
                             (size_t) segscan_group_sizze_67844) != 0) {
                        const size_t global_work_sizze_79983[1] =
                                     {(size_t) num_groups_67845 *
                                     (size_t) segscan_group_sizze_67844};
                        const size_t local_work_sizze_79987[1] =
                                     {(size_t) segscan_group_sizze_67844};
                        int64_t time_start_79984 = 0, time_end_79985 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.scan_stage3_67850",
                                    global_work_sizze_79983[0],
                                    local_work_sizze_79987[0], (int) 0);
                            time_start_79984 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainziscan_stage3_67850,
                                                                        1, NULL,
                                                                        global_work_sizze_79983,
                                                                        local_work_sizze_79987,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainziscan_stage3_67850_runs,
                                                                                                                  &ctx->mainziscan_stage3_67850_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_79985 = get_wall_time();
                            
                            long time_diff_79986 = time_end_79985 -
                                 time_start_79984;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.scan_stage3_67850", time_diff_79986);
                        }
                    }
                }
                
                struct memblock_device mem_77086;
                
                mem_77086.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77086, bytes_77085,
                                          "mem_77086")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_f32(ctx, mem_77086, m_65343 *
                                                  n_65344, 0.0F) != 0) {
                    if (memblock_unref_device(ctx, &mem_77086, "mem_77086") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77082, "mem_77082") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77196,
                                              "ext_mem_77196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_76980, "mem_76980") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77823,
                                              "ext_mem_77823") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77824,
                                              "ext_mem_77824") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77995,
                                              "ext_mem_77995") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77996,
                                              "ext_mem_77996") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_78270,
                                              "mem_out_78270") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77090;
                
                mem_77090.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77090, bytes_77081,
                                          "mem_77090")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_i64(ctx, mem_77090, m_65343 *
                                                  n_65344, (int64_t) -1) != 0) {
                    if (memblock_unref_device(ctx, &mem_77090, "mem_77090") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77086, "mem_77086") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77082, "mem_77082") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77196,
                                              "ext_mem_77196") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_76980, "mem_76980") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77823,
                                              "ext_mem_77823") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77824,
                                              "ext_mem_77824") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77995,
                                              "ext_mem_77995") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77996,
                                              "ext_mem_77996") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_78270,
                                              "mem_out_78270") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t segmap_usable_groups_67898 = sdiv_up64(nest_sizze_67843,
                                                               segmap_group_sizze_67897);
                
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67903,
                                                        1, sizeof(m_65343),
                                                        &m_65343));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67903,
                                                        2, sizeof(n_65344),
                                                        &n_65344));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67903,
                                                        3,
                                                        sizeof(Y_mem_76976.mem),
                                                        &Y_mem_76976.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67903,
                                                        4,
                                                        sizeof(mem_77082.mem),
                                                        &mem_77082.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67903,
                                                        5,
                                                        sizeof(mem_77086.mem),
                                                        &mem_77086.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67903,
                                                        6,
                                                        sizeof(mem_77090.mem),
                                                        &mem_77090.mem));
                if (1 * ((size_t) segmap_usable_groups_67898 *
                         (size_t) segmap_group_sizze_67897) != 0) {
                    const size_t global_work_sizze_79988[1] =
                                 {(size_t) segmap_usable_groups_67898 *
                                 (size_t) segmap_group_sizze_67897};
                    const size_t local_work_sizze_79992[1] =
                                 {(size_t) segmap_group_sizze_67897};
                    int64_t time_start_79989 = 0, time_end_79990 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_67903", global_work_sizze_79988[0],
                                local_work_sizze_79992[0], (int) 0);
                        time_start_79989 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_67903,
                                                                    1, NULL,
                                                                    global_work_sizze_79988,
                                                                    local_work_sizze_79992,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_67903_runs,
                                                                                                              &ctx->mainzisegmap_67903_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_79990 = get_wall_time();
                        
                        long time_diff_79991 = time_end_79990 -
                             time_start_79989;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_67903", time_diff_79991);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_usable_groups_67918 = sdiv_up64(nest_sizze_67843,
                                                               segmap_group_sizze_67917);
                struct memblock_device mem_77096;
                
                mem_77096.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77096, bytes_77081,
                                          "mem_77096")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67922,
                                                        1, sizeof(m_65343),
                                                        &m_65343));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67922,
                                                        2, sizeof(n_65344),
                                                        &n_65344));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67922,
                                                        3,
                                                        sizeof(mem_77090.mem),
                                                        &mem_77090.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67922,
                                                        4,
                                                        sizeof(mem_77096.mem),
                                                        &mem_77096.mem));
                if (1 * ((size_t) segmap_usable_groups_67918 *
                         (size_t) segmap_group_sizze_67917) != 0) {
                    const size_t global_work_sizze_79993[1] =
                                 {(size_t) segmap_usable_groups_67918 *
                                 (size_t) segmap_group_sizze_67917};
                    const size_t local_work_sizze_79997[1] =
                                 {(size_t) segmap_group_sizze_67917};
                    int64_t time_start_79994 = 0, time_end_79995 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_67922", global_work_sizze_79993[0],
                                local_work_sizze_79997[0], (int) 0);
                        time_start_79994 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_67922,
                                                                    1, NULL,
                                                                    global_work_sizze_79993,
                                                                    local_work_sizze_79997,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_67922_runs,
                                                                                                              &ctx->mainzisegmap_67922_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_79995 = get_wall_time();
                        
                        long time_diff_79996 = time_end_79995 -
                             time_start_79994;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_67922", time_diff_79996);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_usable_groups_67928 = sdiv_up64(m_65343,
                                                               segmap_group_sizze_67927);
                struct memblock_device mem_77100;
                
                mem_77100.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77100, bytes_77099,
                                          "mem_77100")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77103;
                
                mem_77103.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77103, bytes_77099,
                                          "mem_77103")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77106;
                
                mem_77106.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77106, bytes_77099,
                                          "mem_77106")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77109;
                
                mem_77109.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77109, bytes_77108,
                                          "mem_77109")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67934,
                                                        1, sizeof(m_65343),
                                                        &m_65343));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67934,
                                                        2, sizeof(n_65344),
                                                        &n_65344));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67934,
                                                        3, sizeof(q_65346),
                                                        &q_65346));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67934,
                                                        4, sizeof(i_65358),
                                                        &i_65358));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67934,
                                                        5,
                                                        sizeof(min_res_65364),
                                                        &min_res_65364));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67934,
                                                        6,
                                                        sizeof(i64_res_65370),
                                                        &i64_res_65370));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67934,
                                                        7,
                                                        sizeof(mem_77082.mem),
                                                        &mem_77082.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67934,
                                                        8,
                                                        sizeof(mem_77100.mem),
                                                        &mem_77100.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67934,
                                                        9,
                                                        sizeof(mem_77103.mem),
                                                        &mem_77103.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67934,
                                                        10,
                                                        sizeof(mem_77106.mem),
                                                        &mem_77106.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67934,
                                                        11,
                                                        sizeof(mem_77109.mem),
                                                        &mem_77109.mem));
                if (1 * ((size_t) segmap_usable_groups_67928 *
                         (size_t) segmap_group_sizze_67927) != 0) {
                    const size_t global_work_sizze_79998[1] =
                                 {(size_t) segmap_usable_groups_67928 *
                                 (size_t) segmap_group_sizze_67927};
                    const size_t local_work_sizze_80002[1] =
                                 {(size_t) segmap_group_sizze_67927};
                    int64_t time_start_79999 = 0, time_end_80000 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_67934", global_work_sizze_79998[0],
                                local_work_sizze_80002[0], (int) 0);
                        time_start_79999 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_67934,
                                                                    1, NULL,
                                                                    global_work_sizze_79998,
                                                                    local_work_sizze_80002,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_67934_runs,
                                                                                                              &ctx->mainzisegmap_67934_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_80000 = get_wall_time();
                        
                        long time_diff_80001 = time_end_80000 -
                             time_start_79999;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_67934", time_diff_80001);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_usable_groups_67950 = sdiv_up64(nest_sizze_67948,
                                                               segmap_group_sizze_67949);
                struct memblock_device mem_77114;
                
                mem_77114.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77114, bytes_77113,
                                          "mem_77114")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67954,
                                                        1, sizeof(m_65343),
                                                        &m_65343));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67954,
                                                        2, sizeof(n_65344),
                                                        &n_65344));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67954,
                                                        3, sizeof(q_65346),
                                                        &q_65346));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67954,
                                                        4, sizeof(i_65358),
                                                        &i_65358));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67954,
                                                        5,
                                                        sizeof(mem_77082.mem),
                                                        &mem_77082.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_67954,
                                                        6,
                                                        sizeof(mem_77114.mem),
                                                        &mem_77114.mem));
                if (1 * ((size_t) segmap_usable_groups_67950 *
                         (size_t) segmap_group_sizze_67949) != 0) {
                    const size_t global_work_sizze_80003[1] =
                                 {(size_t) segmap_usable_groups_67950 *
                                 (size_t) segmap_group_sizze_67949};
                    const size_t local_work_sizze_80007[1] =
                                 {(size_t) segmap_group_sizze_67949};
                    int64_t time_start_80004 = 0, time_end_80005 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_67954", global_work_sizze_80003[0],
                                local_work_sizze_80007[0], (int) 0);
                        time_start_80004 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_67954,
                                                                    1, NULL,
                                                                    global_work_sizze_80003,
                                                                    local_work_sizze_80007,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_67954_runs,
                                                                                                              &ctx->mainzisegmap_67954_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_80005 = get_wall_time();
                        
                        long time_diff_80006 = time_end_80005 -
                             time_start_80004;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_67954", time_diff_80006);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                struct memblock_device ext_mem_77190;
                
                ext_mem_77190.references = NULL;
                
                int32_t local_memory_capacity_78640;
                
                local_memory_capacity_78640 = ctx->opencl.max_local_memory;
                if (sle64(bytes_77137 + srem64((int64_t) 8 - srem64(bytes_77137,
                                                                    (int64_t) 8),
                                               (int64_t) 8),
                          sext_i32_i64(local_memory_capacity_78640)) &&
                    suff_outer_par_67966) {
                    int64_t num_groups_x_74755 = sdiv_up64(m_65343,
                                                           tile_sizze_74753);
                    int64_t num_groups_y_74756 = sdiv_up64(n_m_65352,
                                                           tile_sizze_74753);
                    int64_t num_groups_top_74757 = num_groups_x_74755 *
                            num_groups_y_74756;
                    int64_t num_whole_tiles_74888 = squot64(q_65346,
                                                            tile_sizze_74753);
                    int64_t residual_input_75084 = srem64(q_65346,
                                                          tile_sizze_74753);
                    bool cond_75085 = residual_input_75084 == (int64_t) 0;
                    struct memblock_device mem_77161;
                    
                    mem_77161.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77161, bytes_76979,
                                              "mem_77161")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            1,
                                                            sizeof(ctx->failure_is_an_option),
                                                            &ctx->failure_is_an_option));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            3,
                                                            (size_t) bytes_77137,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            4, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            5, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            6, sizeof(q_65346),
                                                            &q_65346));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            7,
                                                            sizeof(jump_65348),
                                                            &jump_65348));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            8,
                                                            sizeof(n_m_65352),
                                                            &n_m_65352));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            9, sizeof(i_65358),
                                                            &i_65358));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            10, sizeof(x_65359),
                                                            &x_65359));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            11,
                                                            sizeof(min_res_65364),
                                                            &min_res_65364));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            12,
                                                            sizeof(loop_cond_65369),
                                                            &loop_cond_65369));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            13,
                                                            sizeof(num_groups_x_74755),
                                                            &num_groups_x_74755));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            14,
                                                            sizeof(num_groups_y_74756),
                                                            &num_groups_y_74756));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            15,
                                                            sizeof(num_whole_tiles_74888),
                                                            &num_whole_tiles_74888));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            16,
                                                            sizeof(residual_input_75084),
                                                            &residual_input_75084));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            17,
                                                            sizeof(cond_75085),
                                                            &cond_75085));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            18,
                                                            sizeof(mem_77082.mem),
                                                            &mem_77082.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            19,
                                                            sizeof(mem_77086.mem),
                                                            &mem_77086.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            20,
                                                            sizeof(mem_77090.mem),
                                                            &mem_77090.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            21,
                                                            sizeof(mem_77096.mem),
                                                            &mem_77096.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            22,
                                                            sizeof(mem_77100.mem),
                                                            &mem_77100.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            23,
                                                            sizeof(mem_77103.mem),
                                                            &mem_77103.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            24,
                                                            sizeof(mem_77106.mem),
                                                            &mem_77106.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            25,
                                                            sizeof(mem_77109.mem),
                                                            &mem_77109.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            26,
                                                            sizeof(mem_77114.mem),
                                                            &mem_77114.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74758,
                                                            27,
                                                            sizeof(mem_77161.mem),
                                                            &mem_77161.mem));
                    if (1 * ((size_t) num_groups_top_74757 *
                             (size_t) group_sizze_74754) != 0) {
                        const size_t global_work_sizze_80008[1] =
                                     {(size_t) num_groups_top_74757 *
                                     (size_t) group_sizze_74754};
                        const size_t local_work_sizze_80012[1] =
                                     {(size_t) group_sizze_74754};
                        int64_t time_start_80009 = 0, time_end_80010 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segmap_intragroup_74758",
                                    global_work_sizze_80008[0],
                                    local_work_sizze_80012[0], (int) (0 +
                                                                      bytes_77137));
                            time_start_80009 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_intragroup_74758,
                                                                        1, NULL,
                                                                        global_work_sizze_80008,
                                                                        local_work_sizze_80012,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_intragroup_74758_runs,
                                                                                                                  &ctx->mainzisegmap_intragroup_74758_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_80010 = get_wall_time();
                            
                            long time_diff_80011 = time_end_80010 -
                                 time_start_80009;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_74758",
                                    time_diff_80011);
                        }
                    }
                    ctx->failure_is_an_option = 1;
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_set_device(ctx, &ext_mem_77190, &mem_77161,
                                            "mem_77161") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77161, "mem_77161") !=
                        0)
                        return 1;
                } else {
                    int64_t segmap_usable_groups_68119 =
                            sdiv_up64(binop_x_76977, segmap_group_sizze_68118);
                    struct memblock_device mem_77166;
                    
                    mem_77166.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77166, bytes_77165,
                                              "mem_77166")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77170;
                    
                    mem_77170.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77170, bytes_77165,
                                              "mem_77170")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77174;
                    
                    mem_77174.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77174, bytes_76979,
                                              "mem_77174")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68125,
                                                            1,
                                                            sizeof(ctx->failure_is_an_option),
                                                            &ctx->failure_is_an_option));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68125,
                                                            3, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68125,
                                                            4, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68125,
                                                            5,
                                                            sizeof(jump_65348),
                                                            &jump_65348));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68125,
                                                            6,
                                                            sizeof(n_m_65352),
                                                            &n_m_65352));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68125,
                                                            7, sizeof(i_65358),
                                                            &i_65358));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68125,
                                                            8, sizeof(x_65359),
                                                            &x_65359));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68125,
                                                            9,
                                                            sizeof(min_res_65364),
                                                            &min_res_65364));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68125,
                                                            10,
                                                            sizeof(loop_cond_65369),
                                                            &loop_cond_65369));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68125,
                                                            11,
                                                            sizeof(mem_77090.mem),
                                                            &mem_77090.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68125,
                                                            12,
                                                            sizeof(mem_77096.mem),
                                                            &mem_77096.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68125,
                                                            13,
                                                            sizeof(mem_77100.mem),
                                                            &mem_77100.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68125,
                                                            14,
                                                            sizeof(mem_77103.mem),
                                                            &mem_77103.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68125,
                                                            15,
                                                            sizeof(mem_77106.mem),
                                                            &mem_77106.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68125,
                                                            16,
                                                            sizeof(mem_77109.mem),
                                                            &mem_77109.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68125,
                                                            17,
                                                            sizeof(mem_77166.mem),
                                                            &mem_77166.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68125,
                                                            18,
                                                            sizeof(mem_77170.mem),
                                                            &mem_77170.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68125,
                                                            19,
                                                            sizeof(mem_77174.mem),
                                                            &mem_77174.mem));
                    if (1 * ((size_t) segmap_usable_groups_68119 *
                             (size_t) segmap_group_sizze_68118) != 0) {
                        const size_t global_work_sizze_80013[1] =
                                     {(size_t) segmap_usable_groups_68119 *
                                     (size_t) segmap_group_sizze_68118};
                        const size_t local_work_sizze_80017[1] =
                                     {(size_t) segmap_group_sizze_68118};
                        int64_t time_start_80014 = 0, time_end_80015 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segmap_68125",
                                    global_work_sizze_80013[0],
                                    local_work_sizze_80017[0], (int) 0);
                            time_start_80014 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_68125,
                                                                        1, NULL,
                                                                        global_work_sizze_80013,
                                                                        local_work_sizze_80017,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_68125_runs,
                                                                                                                  &ctx->mainzisegmap_68125_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_80015 = get_wall_time();
                            
                            long time_diff_80016 = time_end_80015 -
                                 time_start_80014;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_68125", time_diff_80016);
                        }
                    }
                    ctx->failure_is_an_option = 1;
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &mem_77166, "mem_77166") !=
                        0)
                        return 1;
                    
                    struct memblock_device mem_77179;
                    
                    mem_77179.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77179, bytes_76979,
                                              "mem_77179")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (slt64(q_65346 * (int64_t) 2,
                              segred_group_sizze_68222)) {
                        int64_t segment_sizze_nonzzero_78486 =
                                smax64((int64_t) 1, q_65346);
                        int64_t num_threads_78487 = num_groups_68223 *
                                segred_group_sizze_68222;
                        
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                    (long long) (m_65343 * n_m_65352), '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                    (long long) q_65346, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c",
                                    "segments_per_group",
                                    (long long) squot64(segred_group_sizze_68222,
                                                        segment_sizze_nonzzero_78486),
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                    (long long) sext_i64_i32(sdiv_up64(m_65343 *
                                                                       n_m_65352,
                                                                       squot64(segred_group_sizze_68222,
                                                                               segment_sizze_nonzzero_78486))),
                                    '\n');
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68229,
                                                                1,
                                                                (size_t) ((int64_t) 4 *
                                                                          segred_group_sizze_68222),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68229,
                                                                2,
                                                                sizeof(m_65343),
                                                                &m_65343));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68229,
                                                                3,
                                                                sizeof(n_65344),
                                                                &n_65344));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68229,
                                                                4,
                                                                sizeof(q_65346),
                                                                &q_65346));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68229,
                                                                5,
                                                                sizeof(jump_65348),
                                                                &jump_65348));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68229,
                                                                6,
                                                                sizeof(n_m_65352),
                                                                &n_m_65352));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68229,
                                                                7,
                                                                sizeof(i_65358),
                                                                &i_65358));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68229,
                                                                8,
                                                                sizeof(num_groups_68223),
                                                                &num_groups_68223));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68229,
                                                                9,
                                                                sizeof(segment_sizze_nonzzero_78486),
                                                                &segment_sizze_nonzzero_78486));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68229,
                                                                10,
                                                                sizeof(mem_77082.mem),
                                                                &mem_77082.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68229,
                                                                11,
                                                                sizeof(mem_77090.mem),
                                                                &mem_77090.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68229,
                                                                12,
                                                                sizeof(mem_77114.mem),
                                                                &mem_77114.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68229,
                                                                13,
                                                                sizeof(mem_77170.mem),
                                                                &mem_77170.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68229,
                                                                14,
                                                                sizeof(mem_77174.mem),
                                                                &mem_77174.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68229,
                                                                15,
                                                                sizeof(mem_77179.mem),
                                                                &mem_77179.mem));
                        if (1 * ((size_t) num_groups_68223 *
                                 (size_t) segred_group_sizze_68222) != 0) {
                            const size_t global_work_sizze_80018[1] =
                                         {(size_t) num_groups_68223 *
                                         (size_t) segred_group_sizze_68222};
                            const size_t local_work_sizze_80022[1] =
                                         {(size_t) segred_group_sizze_68222};
                            int64_t time_start_80019 = 0, time_end_80020 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segred_small_68229",
                                        global_work_sizze_80018[0],
                                        local_work_sizze_80022[0], (int) (0 +
                                                                          (int64_t) 4 *
                                                                          segred_group_sizze_68222));
                                time_start_80019 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegred_small_68229,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_80018,
                                                                            local_work_sizze_80022,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegred_small_68229_runs,
                                                                                                                      &ctx->mainzisegred_small_68229_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_80020 = get_wall_time();
                                
                                long time_diff_80021 = time_end_80020 -
                                     time_start_80019;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segred_small_68229",
                                        time_diff_80021);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                    } else {
                        int64_t groups_per_segment_78515 =
                                sdiv_up64(num_groups_68223, smax64((int64_t) 1,
                                                                   m_65343 *
                                                                   n_m_65352));
                        int64_t elements_per_thread_78516 = sdiv_up64(q_65346,
                                                                      segred_group_sizze_68222 *
                                                                      groups_per_segment_78515);
                        int64_t virt_num_groups_78517 =
                                groups_per_segment_78515 * (m_65343 *
                                                            n_m_65352);
                        int64_t num_threads_78518 = num_groups_68223 *
                                segred_group_sizze_68222;
                        int64_t threads_per_segment_78519 =
                                groups_per_segment_78515 *
                                segred_group_sizze_68222;
                        
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                    (long long) (m_65343 * n_m_65352), '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                    (long long) q_65346, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                    (long long) virt_num_groups_78517, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                    (long long) num_groups_68223, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "group_size",
                                    (long long) segred_group_sizze_68222, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                    (long long) elements_per_thread_78516,
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c",
                                    "groups_per_segment",
                                    (long long) groups_per_segment_78515, '\n');
                        
                        struct memblock_device segred_tmp_mem_78520;
                        
                        segred_tmp_mem_78520.references = NULL;
                        if (memblock_alloc_device(ctx, &segred_tmp_mem_78520,
                                                  (int64_t) 4 *
                                                  virt_num_groups_78517,
                                                  "segred_tmp_mem_78520")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mainzicounter_mem_78522 =
                                               ctx->mainzicounter_mem_78522;
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                1, (size_t) 1,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                2,
                                                                (size_t) ((int64_t) 4 *
                                                                          segred_group_sizze_68222),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                3,
                                                                sizeof(m_65343),
                                                                &m_65343));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                4,
                                                                sizeof(n_65344),
                                                                &n_65344));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                5,
                                                                sizeof(q_65346),
                                                                &q_65346));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                6,
                                                                sizeof(jump_65348),
                                                                &jump_65348));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                7,
                                                                sizeof(n_m_65352),
                                                                &n_m_65352));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                8,
                                                                sizeof(i_65358),
                                                                &i_65358));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                9,
                                                                sizeof(num_groups_68223),
                                                                &num_groups_68223));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                10,
                                                                sizeof(groups_per_segment_78515),
                                                                &groups_per_segment_78515));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                11,
                                                                sizeof(elements_per_thread_78516),
                                                                &elements_per_thread_78516));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                12,
                                                                sizeof(virt_num_groups_78517),
                                                                &virt_num_groups_78517));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                13,
                                                                sizeof(threads_per_segment_78519),
                                                                &threads_per_segment_78519));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                14,
                                                                sizeof(mem_77082.mem),
                                                                &mem_77082.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                15,
                                                                sizeof(mem_77090.mem),
                                                                &mem_77090.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                16,
                                                                sizeof(mem_77114.mem),
                                                                &mem_77114.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                17,
                                                                sizeof(mem_77170.mem),
                                                                &mem_77170.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                18,
                                                                sizeof(mem_77174.mem),
                                                                &mem_77174.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                19,
                                                                sizeof(mem_77179.mem),
                                                                &mem_77179.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                20,
                                                                sizeof(segred_tmp_mem_78520.mem),
                                                                &segred_tmp_mem_78520.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68229,
                                                                21,
                                                                sizeof(mainzicounter_mem_78522.mem),
                                                                &mainzicounter_mem_78522.mem));
                        if (1 * ((size_t) num_groups_68223 *
                                 (size_t) segred_group_sizze_68222) != 0) {
                            const size_t global_work_sizze_80024[1] =
                                         {(size_t) num_groups_68223 *
                                         (size_t) segred_group_sizze_68222};
                            const size_t local_work_sizze_80028[1] =
                                         {(size_t) segred_group_sizze_68222};
                            int64_t time_start_80025 = 0, time_end_80026 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segred_large_68229",
                                        global_work_sizze_80024[0],
                                        local_work_sizze_80028[0], (int) (0 +
                                                                          1 +
                                                                          (int64_t) 4 *
                                                                          segred_group_sizze_68222));
                                time_start_80025 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegred_large_68229,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_80024,
                                                                            local_work_sizze_80028,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegred_large_68229_runs,
                                                                                                                      &ctx->mainzisegred_large_68229_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_80026 = get_wall_time();
                                
                                long time_diff_80027 = time_end_80026 -
                                     time_start_80025;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segred_large_68229",
                                        time_diff_80027);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &segred_tmp_mem_78520,
                                                  "segred_tmp_mem_78520") != 0)
                            return 1;
                    }
                    
                    int64_t segmap_usable_groups_68262 =
                            sdiv_up64(binop_x_76977, segmap_group_sizze_68261);
                    struct memblock_device mem_77184;
                    
                    mem_77184.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77184, bytes_76979,
                                              "mem_77184")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68266,
                                                            1, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68266,
                                                            2,
                                                            sizeof(n_m_65352),
                                                            &n_m_65352));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68266,
                                                            3,
                                                            sizeof(mem_77179.mem),
                                                            &mem_77179.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68266,
                                                            4,
                                                            sizeof(mem_77184.mem),
                                                            &mem_77184.mem));
                    if (1 * ((size_t) segmap_usable_groups_68262 *
                             (size_t) segmap_group_sizze_68261) != 0) {
                        const size_t global_work_sizze_80029[1] =
                                     {(size_t) segmap_usable_groups_68262 *
                                     (size_t) segmap_group_sizze_68261};
                        const size_t local_work_sizze_80033[1] =
                                     {(size_t) segmap_group_sizze_68261};
                        int64_t time_start_80030 = 0, time_end_80031 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segmap_68266",
                                    global_work_sizze_80029[0],
                                    local_work_sizze_80033[0], (int) 0);
                            time_start_80030 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_68266,
                                                                        1, NULL,
                                                                        global_work_sizze_80029,
                                                                        local_work_sizze_80033,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_68266_runs,
                                                                                                                  &ctx->mainzisegmap_68266_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_80031 = get_wall_time();
                            
                            long time_diff_80032 = time_end_80031 -
                                 time_start_80030;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_68266", time_diff_80032);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &mem_77179, "mem_77179") !=
                        0)
                        return 1;
                    
                    struct memblock_device mem_77189;
                    
                    mem_77189.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77189, bytes_76979,
                                              "mem_77189")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (slt64(q_65346 * (int64_t) 2,
                              segred_group_sizze_68272)) {
                        int64_t segment_sizze_nonzzero_78568 =
                                smax64((int64_t) 1, q_65346);
                        int64_t num_threads_78569 = num_groups_68273 *
                                segred_group_sizze_68272;
                        
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                    (long long) (m_65343 * n_m_65352), '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                    (long long) q_65346, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c",
                                    "segments_per_group",
                                    (long long) squot64(segred_group_sizze_68272,
                                                        segment_sizze_nonzzero_78568),
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                    (long long) sext_i64_i32(sdiv_up64(m_65343 *
                                                                       n_m_65352,
                                                                       squot64(segred_group_sizze_68272,
                                                                               segment_sizze_nonzzero_78568))),
                                    '\n');
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68279,
                                                                1,
                                                                (size_t) ((int64_t) 4 *
                                                                          segred_group_sizze_68272),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68279,
                                                                2,
                                                                sizeof(m_65343),
                                                                &m_65343));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68279,
                                                                3,
                                                                sizeof(n_65344),
                                                                &n_65344));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68279,
                                                                4,
                                                                sizeof(q_65346),
                                                                &q_65346));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68279,
                                                                5,
                                                                sizeof(jump_65348),
                                                                &jump_65348));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68279,
                                                                6,
                                                                sizeof(n_m_65352),
                                                                &n_m_65352));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68279,
                                                                7,
                                                                sizeof(i_65358),
                                                                &i_65358));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68279,
                                                                8,
                                                                sizeof(num_groups_68273),
                                                                &num_groups_68273));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68279,
                                                                9,
                                                                sizeof(segment_sizze_nonzzero_78568),
                                                                &segment_sizze_nonzzero_78568));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68279,
                                                                10,
                                                                sizeof(mem_77082.mem),
                                                                &mem_77082.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68279,
                                                                11,
                                                                sizeof(mem_77086.mem),
                                                                &mem_77086.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68279,
                                                                12,
                                                                sizeof(mem_77090.mem),
                                                                &mem_77090.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68279,
                                                                13,
                                                                sizeof(mem_77114.mem),
                                                                &mem_77114.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68279,
                                                                14,
                                                                sizeof(mem_77170.mem),
                                                                &mem_77170.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68279,
                                                                15,
                                                                sizeof(mem_77174.mem),
                                                                &mem_77174.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68279,
                                                                16,
                                                                sizeof(mem_77184.mem),
                                                                &mem_77184.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_68279,
                                                                17,
                                                                sizeof(mem_77189.mem),
                                                                &mem_77189.mem));
                        if (1 * ((size_t) num_groups_68273 *
                                 (size_t) segred_group_sizze_68272) != 0) {
                            const size_t global_work_sizze_80034[1] =
                                         {(size_t) num_groups_68273 *
                                         (size_t) segred_group_sizze_68272};
                            const size_t local_work_sizze_80038[1] =
                                         {(size_t) segred_group_sizze_68272};
                            int64_t time_start_80035 = 0, time_end_80036 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segred_small_68279",
                                        global_work_sizze_80034[0],
                                        local_work_sizze_80038[0], (int) (0 +
                                                                          (int64_t) 4 *
                                                                          segred_group_sizze_68272));
                                time_start_80035 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegred_small_68279,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_80034,
                                                                            local_work_sizze_80038,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegred_small_68279_runs,
                                                                                                                      &ctx->mainzisegred_small_68279_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_80036 = get_wall_time();
                                
                                long time_diff_80037 = time_end_80036 -
                                     time_start_80035;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segred_small_68279",
                                        time_diff_80037);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                    } else {
                        int64_t groups_per_segment_78597 =
                                sdiv_up64(num_groups_68273, smax64((int64_t) 1,
                                                                   m_65343 *
                                                                   n_m_65352));
                        int64_t elements_per_thread_78598 = sdiv_up64(q_65346,
                                                                      segred_group_sizze_68272 *
                                                                      groups_per_segment_78597);
                        int64_t virt_num_groups_78599 =
                                groups_per_segment_78597 * (m_65343 *
                                                            n_m_65352);
                        int64_t num_threads_78600 = num_groups_68273 *
                                segred_group_sizze_68272;
                        int64_t threads_per_segment_78601 =
                                groups_per_segment_78597 *
                                segred_group_sizze_68272;
                        
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                    (long long) (m_65343 * n_m_65352), '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                    (long long) q_65346, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                    (long long) virt_num_groups_78599, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                    (long long) num_groups_68273, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "group_size",
                                    (long long) segred_group_sizze_68272, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                    (long long) elements_per_thread_78598,
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c",
                                    "groups_per_segment",
                                    (long long) groups_per_segment_78597, '\n');
                        
                        struct memblock_device segred_tmp_mem_78602;
                        
                        segred_tmp_mem_78602.references = NULL;
                        if (memblock_alloc_device(ctx, &segred_tmp_mem_78602,
                                                  (int64_t) 4 *
                                                  virt_num_groups_78599,
                                                  "segred_tmp_mem_78602")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mainzicounter_mem_78604 =
                                               ctx->mainzicounter_mem_78604;
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                1, (size_t) 1,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                2,
                                                                (size_t) ((int64_t) 4 *
                                                                          segred_group_sizze_68272),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                3,
                                                                sizeof(m_65343),
                                                                &m_65343));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                4,
                                                                sizeof(n_65344),
                                                                &n_65344));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                5,
                                                                sizeof(q_65346),
                                                                &q_65346));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                6,
                                                                sizeof(jump_65348),
                                                                &jump_65348));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                7,
                                                                sizeof(n_m_65352),
                                                                &n_m_65352));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                8,
                                                                sizeof(i_65358),
                                                                &i_65358));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                9,
                                                                sizeof(num_groups_68273),
                                                                &num_groups_68273));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                10,
                                                                sizeof(groups_per_segment_78597),
                                                                &groups_per_segment_78597));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                11,
                                                                sizeof(elements_per_thread_78598),
                                                                &elements_per_thread_78598));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                12,
                                                                sizeof(virt_num_groups_78599),
                                                                &virt_num_groups_78599));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                13,
                                                                sizeof(threads_per_segment_78601),
                                                                &threads_per_segment_78601));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                14,
                                                                sizeof(mem_77082.mem),
                                                                &mem_77082.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                15,
                                                                sizeof(mem_77086.mem),
                                                                &mem_77086.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                16,
                                                                sizeof(mem_77090.mem),
                                                                &mem_77090.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                17,
                                                                sizeof(mem_77114.mem),
                                                                &mem_77114.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                18,
                                                                sizeof(mem_77170.mem),
                                                                &mem_77170.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                19,
                                                                sizeof(mem_77174.mem),
                                                                &mem_77174.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                20,
                                                                sizeof(mem_77184.mem),
                                                                &mem_77184.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                21,
                                                                sizeof(mem_77189.mem),
                                                                &mem_77189.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                22,
                                                                sizeof(segred_tmp_mem_78602.mem),
                                                                &segred_tmp_mem_78602.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_68279,
                                                                23,
                                                                sizeof(mainzicounter_mem_78604.mem),
                                                                &mainzicounter_mem_78604.mem));
                        if (1 * ((size_t) num_groups_68273 *
                                 (size_t) segred_group_sizze_68272) != 0) {
                            const size_t global_work_sizze_80040[1] =
                                         {(size_t) num_groups_68273 *
                                         (size_t) segred_group_sizze_68272};
                            const size_t local_work_sizze_80044[1] =
                                         {(size_t) segred_group_sizze_68272};
                            int64_t time_start_80041 = 0, time_end_80042 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segred_large_68279",
                                        global_work_sizze_80040[0],
                                        local_work_sizze_80044[0], (int) (0 +
                                                                          1 +
                                                                          (int64_t) 4 *
                                                                          segred_group_sizze_68272));
                                time_start_80041 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegred_large_68279,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_80040,
                                                                            local_work_sizze_80044,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegred_large_68279_runs,
                                                                                                                      &ctx->mainzisegred_large_68279_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_80042 = get_wall_time();
                                
                                long time_diff_80043 = time_end_80042 -
                                     time_start_80041;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segred_large_68279",
                                        time_diff_80043);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &segred_tmp_mem_78602,
                                                  "segred_tmp_mem_78602") != 0)
                            return 1;
                    }
                    if (memblock_unref_device(ctx, &mem_77170, "mem_77170") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77174, "mem_77174") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77184, "mem_77184") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_77190, &mem_77189,
                                            "mem_77189") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77189, "mem_77189") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77184, "mem_77184") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77179, "mem_77179") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77174, "mem_77174") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77170, "mem_77170") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77166, "mem_77166") !=
                        0)
                        return 1;
                }
                if (memblock_unref_device(ctx, &mem_77082, "mem_77082") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77086, "mem_77086") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77090, "mem_77090") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77096, "mem_77096") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77100, "mem_77100") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77103, "mem_77103") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77106, "mem_77106") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77109, "mem_77109") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77114, "mem_77114") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_77196, &ext_mem_77190,
                                        "ext_mem_77190") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77190,
                                          "ext_mem_77190") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77114, "mem_77114") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77109, "mem_77109") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77106, "mem_77106") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77103, "mem_77103") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77100, "mem_77100") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77096, "mem_77096") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77090, "mem_77090") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77086, "mem_77086") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77082, "mem_77082") != 0)
                    return 1;
            }
            if (memblock_set_device(ctx, &ext_mem_77824, &ext_mem_77196,
                                    "ext_mem_77196") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_77823, &mem_76980,
                                    "mem_76980") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_77196, "ext_mem_77196") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_76980, "mem_76980") != 0)
                return 1;
        } else {
            bool match_lit_65557 = (int64_t) 1 == degree_65347;
            struct memblock_device ext_mem_77822;
            
            ext_mem_77822.references = NULL;
            
            struct memblock_device ext_mem_77821;
            
            ext_mem_77821.references = NULL;
            if (match_lit_65557) {
                bool suff_outer_par_68320;
                
                suff_outer_par_68320 =
                    *ctx->tuning_params.mainzisuff_outer_par_2 <= m_65343;
                if (ctx->logging)
                    fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                            "main.suff_outer_par_2", (long) m_65343,
                            suff_outer_par_68320 ? "true" : "false");
                
                int64_t segmap_group_sizze_68532;
                
                segmap_group_sizze_68532 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_68324;
                
                int64_t num_groups_68533;
                int32_t max_num_groups_78642;
                
                max_num_groups_78642 =
                    *ctx->tuning_params.mainzisegmap_num_groups_68326;
                num_groups_68533 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(m_65343,
                                                                        segmap_group_sizze_68532),
                                                              sext_i32_i64(max_num_groups_78642))));
                
                int64_t nest_sizze_69634 = m_65343 * n_65344;
                int64_t segscan_group_sizze_69635;
                
                segscan_group_sizze_69635 =
                    *ctx->tuning_params.mainzisegscan_group_sizze_69615;
                
                int64_t num_groups_69636;
                int32_t max_num_groups_78643;
                
                max_num_groups_78643 =
                    *ctx->tuning_params.mainzisegscan_num_groups_69617;
                num_groups_69636 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(nest_sizze_69634,
                                                                        segscan_group_sizze_69635),
                                                              sext_i32_i64(max_num_groups_78643))));
                
                int64_t segmap_group_sizze_69688;
                
                segmap_group_sizze_69688 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_69529;
                
                int64_t segmap_group_sizze_69708;
                
                segmap_group_sizze_69708 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_69503;
                
                int64_t segmap_group_sizze_69718;
                
                segmap_group_sizze_69718 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_69477;
                
                int64_t nest_sizze_69739 = m_65343 * q_65346;
                int64_t segmap_group_sizze_69740;
                
                segmap_group_sizze_69740 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_69452;
                
                bool suff_outer_par_69757;
                
                suff_outer_par_69757 =
                    *ctx->tuning_params.mainzisuff_outer_par_3 <= binop_x_76977;
                if (ctx->logging)
                    fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                            "main.suff_outer_par_3", (long) binop_x_76977,
                            suff_outer_par_69757 ? "true" : "false");
                
                int64_t segmap_group_sizze_69939;
                
                segmap_group_sizze_69939 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_69101;
                
                int64_t nest_sizze_70042 = q_65346 * binop_x_76977;
                int64_t segred_group_sizze_70043;
                
                segred_group_sizze_70043 =
                    *ctx->tuning_params.mainzisegred_group_sizze_69048;
                
                int64_t num_groups_70044;
                int32_t max_num_groups_78644;
                
                max_num_groups_78644 =
                    *ctx->tuning_params.mainzisegred_num_groups_69050;
                num_groups_70044 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(nest_sizze_70042,
                                                                        segred_group_sizze_70043),
                                                              sext_i32_i64(max_num_groups_78644))));
                
                int64_t segmap_group_sizze_70092;
                
                segmap_group_sizze_70092 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_69026;
                
                int64_t segred_group_sizze_70114;
                
                segred_group_sizze_70114 =
                    *ctx->tuning_params.mainzisegred_group_sizze_68953;
                
                int64_t num_groups_70115;
                int32_t max_num_groups_78645;
                
                max_num_groups_78645 =
                    *ctx->tuning_params.mainzisegred_num_groups_68955;
                num_groups_70115 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(nest_sizze_70042,
                                                                        segred_group_sizze_70114),
                                                              sext_i32_i64(max_num_groups_78645))));
                
                int64_t tile_sizze_75307;
                
                tile_sizze_75307 = *ctx->tuning_params.mainzitile_sizze_75306;
                
                int64_t group_sizze_75308 = tile_sizze_75307 * tile_sizze_75307;
                int64_t bytes_77198 = (int64_t) 4 * nest_sizze_69634;
                int64_t binop_y_77201 = (int64_t) 8 * n_65344;
                int64_t bytes_77202 = smax64((int64_t) 0, binop_y_77201);
                int64_t binop_y_77216 = (int64_t) 4 * n_65344;
                int64_t bytes_77217 = smax64((int64_t) 0, binop_y_77216);
                int64_t binop_y_77261 = (int64_t) 4 * q_65346;
                int64_t bytes_77262 = smax64((int64_t) 0, binop_y_77261);
                int64_t binop_y_77276 = (int64_t) 4 * n_m_65352;
                int64_t bytes_77277 = smax64((int64_t) 0, binop_y_77276);
                int64_t binop_y_77314 = (int64_t) 8 * nest_sizze_69634;
                int64_t bytes_77315 = smax64((int64_t) 0, binop_y_77314);
                int64_t bytes_77319 = smax64((int64_t) 0, bytes_77198);
                int64_t binop_y_77332 = (int64_t) 8 * m_65343;
                int64_t bytes_77333 = smax64((int64_t) 0, binop_y_77332);
                int64_t binop_y_77341 = (int64_t) 4 * m_65343;
                int64_t bytes_77342 = smax64((int64_t) 0, binop_y_77341);
                int64_t binop_y_77346 = (int64_t) 4 * nest_sizze_69739;
                int64_t bytes_77347 = smax64((int64_t) 0, binop_y_77346);
                int64_t bytes_77352 = (int64_t) 8 * group_sizze_75308;
                int64_t bytes_77361 = (int64_t) 4 * group_sizze_75308;
                int64_t bytes_77379 = smax64((int64_t) 0, bytes_77361);
                int64_t binop_x_78019 = (int64_t) 4 * tile_sizze_75307;
                int64_t sizze_78020 = tile_sizze_75307 * binop_x_78019;
                int64_t binop_y_77429 = (int64_t) 8 * binop_x_76977;
                int64_t bytes_77430 = smax64((int64_t) 0, binop_y_77429);
                int64_t binop_x_78081 = (int64_t) 4 * tile_sizze_75307;
                int64_t num_bytes_78082 = tile_sizze_75307 * binop_x_78081;
                int64_t binop_x_78086 = (int64_t) 4 * tile_sizze_75307;
                int64_t num_bytes_78087 = tile_sizze_75307 * binop_x_78086;
                int64_t binop_x_78091 = (int64_t) 4 * tile_sizze_75307;
                int64_t num_bytes_78092 = tile_sizze_75307 * binop_x_78091;
                int64_t maxSubHelper_78148 = umax64(bytes_77361, sizze_78020);
                int64_t maxSubHelper_78149 = umax64(num_bytes_78092,
                                                    maxSubHelper_78148);
                int64_t maxSubHelper_78150 = umax64(bytes_77361, sizze_78020);
                int64_t maxSubHelper_78151 = umax64(num_bytes_78087,
                                                    maxSubHelper_78150);
                int64_t maxSubHelper_78152 = umax64(sizze_78020,
                                                    num_bytes_78082);
                int64_t num_threads_78217 = segmap_group_sizze_68532 *
                        num_groups_68533;
                int64_t total_sizze_78218 = bytes_77277 * num_threads_78217;
                int64_t total_sizze_78219 = bytes_77277 * num_threads_78217;
                int64_t total_sizze_78220 = bytes_77262 * num_threads_78217;
                int64_t total_sizze_78221 = bytes_77202 * num_threads_78217;
                int64_t total_sizze_78222 = bytes_77202 * num_threads_78217;
                int64_t total_sizze_78223 = bytes_77217 * num_threads_78217;
                struct memblock_device ext_mem_77488;
                
                ext_mem_77488.references = NULL;
                
                struct memblock_device ext_mem_77487;
                
                ext_mem_77487.references = NULL;
                
                int32_t local_memory_capacity_79056;
                
                local_memory_capacity_79056 = ctx->opencl.max_local_memory;
                if (sle64((int64_t) 0,
                          sext_i32_i64(local_memory_capacity_79056)) &&
                    suff_outer_par_68320) {
                    struct memblock_device mem_77199;
                    
                    mem_77199.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77199, bytes_77198,
                                              "mem_77199")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_77199,
                                                              (int64_t) 0,
                                                              Y_mem_76976,
                                                              (int64_t) 0,
                                                              (int64_t) 1,
                                                              n_65344,
                                                              m_65343) != 0) {
                        if (memblock_unref_device(ctx, &mem_77199,
                                                  "mem_77199") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77487,
                                                  "ext_mem_77487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77488,
                                                  "ext_mem_77488") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77308;
                    
                    mem_77308.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77308, binop_y_76978,
                                              "mem_77308")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77311;
                    
                    mem_77311.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77311, binop_y_76978,
                                              "mem_77311")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78142;
                    
                    color_78142.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78142,
                                              total_sizze_78218,
                                              "color_78142")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78143;
                    
                    color_78143.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78143,
                                              total_sizze_78219,
                                              "color_78143")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78144;
                    
                    color_78144.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78144,
                                              total_sizze_78220,
                                              "color_78144")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78145;
                    
                    color_78145.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78145,
                                              total_sizze_78221,
                                              "color_78145")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78146;
                    
                    color_78146.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78146,
                                              total_sizze_78222,
                                              "color_78146")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78147;
                    
                    color_78147.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78147,
                                              total_sizze_78223,
                                              "color_78147")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            1,
                                                            sizeof(ctx->failure_is_an_option),
                                                            &ctx->failure_is_an_option));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            3, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            4, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            5, sizeof(q_65346),
                                                            &q_65346));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            6,
                                                            sizeof(jump_65348),
                                                            &jump_65348));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            7,
                                                            sizeof(n_m_65352),
                                                            &n_m_65352));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            8, sizeof(i_65358),
                                                            &i_65358));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            9, sizeof(x_65359),
                                                            &x_65359));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            10,
                                                            sizeof(min_res_65364),
                                                            &min_res_65364));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            11,
                                                            sizeof(loop_cond_65369),
                                                            &loop_cond_65369));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            12,
                                                            sizeof(i64_res_65370),
                                                            &i64_res_65370));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            13,
                                                            sizeof(num_groups_68533),
                                                            &num_groups_68533));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            14,
                                                            sizeof(num_threads_78217),
                                                            &num_threads_78217));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            15,
                                                            sizeof(mem_77199.mem),
                                                            &mem_77199.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            16,
                                                            sizeof(mem_77308.mem),
                                                            &mem_77308.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            17,
                                                            sizeof(mem_77311.mem),
                                                            &mem_77311.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            18,
                                                            sizeof(color_78142.mem),
                                                            &color_78142.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            19,
                                                            sizeof(color_78143.mem),
                                                            &color_78143.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            20,
                                                            sizeof(color_78144.mem),
                                                            &color_78144.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            21,
                                                            sizeof(color_78145.mem),
                                                            &color_78145.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            22,
                                                            sizeof(color_78146.mem),
                                                            &color_78146.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_68538,
                                                            23,
                                                            sizeof(color_78147.mem),
                                                            &color_78147.mem));
                    if (1 * ((size_t) num_groups_68533 *
                             (size_t) segmap_group_sizze_68532) != 0) {
                        const size_t global_work_sizze_80045[1] =
                                     {(size_t) num_groups_68533 *
                                     (size_t) segmap_group_sizze_68532};
                        const size_t local_work_sizze_80049[1] =
                                     {(size_t) segmap_group_sizze_68532};
                        int64_t time_start_80046 = 0, time_end_80047 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segmap_68538",
                                    global_work_sizze_80045[0],
                                    local_work_sizze_80049[0], (int) 0);
                            time_start_80046 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_68538,
                                                                        1, NULL,
                                                                        global_work_sizze_80045,
                                                                        local_work_sizze_80049,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_68538_runs,
                                                                                                                  &ctx->mainzisegmap_68538_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_80047 = get_wall_time();
                            
                            long time_diff_80048 = time_end_80047 -
                                 time_start_80046;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_68538", time_diff_80048);
                        }
                    }
                    ctx->failure_is_an_option = 1;
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &mem_77199, "mem_77199") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78142,
                                              "color_78142") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78143,
                                              "color_78143") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78144,
                                              "color_78144") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78145,
                                              "color_78145") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78146,
                                              "color_78146") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78147,
                                              "color_78147") != 0)
                        return 1;
                    
                    struct memblock_device mem_77480;
                    
                    mem_77480.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77480, bytes_76979,
                                              "mem_77480")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_77480,
                                                              (int64_t) 0,
                                                              mem_77308,
                                                              (int64_t) 0,
                                                              (int64_t) 1,
                                                              m_65343,
                                                              n_m_65352) != 0) {
                        if (memblock_unref_device(ctx, &mem_77480,
                                                  "mem_77480") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78147,
                                                  "color_78147") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78146,
                                                  "color_78146") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78145,
                                                  "color_78145") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78144,
                                                  "color_78144") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78143,
                                                  "color_78143") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78142,
                                                  "color_78142") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77311,
                                                  "mem_77311") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77308,
                                                  "mem_77308") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77199,
                                                  "mem_77199") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77487,
                                                  "ext_mem_77487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77488,
                                                  "ext_mem_77488") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    if (memblock_unref_device(ctx, &mem_77308, "mem_77308") !=
                        0)
                        return 1;
                    
                    struct memblock_device mem_77485;
                    
                    mem_77485.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77485, bytes_76979,
                                              "mem_77485")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_77485,
                                                              (int64_t) 0,
                                                              mem_77311,
                                                              (int64_t) 0,
                                                              (int64_t) 1,
                                                              m_65343,
                                                              n_m_65352) != 0) {
                        if (memblock_unref_device(ctx, &mem_77485,
                                                  "mem_77485") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77480,
                                                  "mem_77480") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78147,
                                                  "color_78147") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78146,
                                                  "color_78146") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78145,
                                                  "color_78145") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78144,
                                                  "color_78144") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78143,
                                                  "color_78143") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78142,
                                                  "color_78142") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77311,
                                                  "mem_77311") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77308,
                                                  "mem_77308") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77199,
                                                  "mem_77199") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77487,
                                                  "ext_mem_77487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77488,
                                                  "ext_mem_77488") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    if (memblock_unref_device(ctx, &mem_77311, "mem_77311") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_77488, &mem_77480,
                                            "mem_77480") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_77487, &mem_77485,
                                            "mem_77485") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77485, "mem_77485") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77480, "mem_77480") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78147,
                                              "color_78147") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78146,
                                              "color_78146") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78145,
                                              "color_78145") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78144,
                                              "color_78144") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78143,
                                              "color_78143") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78142,
                                              "color_78142") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77311, "mem_77311") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77308, "mem_77308") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77199, "mem_77199") !=
                        0)
                        return 1;
                } else {
                    struct memblock_device mem_77316;
                    
                    mem_77316.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77316, bytes_77315,
                                              "mem_77316")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (slt64((int64_t) 0, m_65343 * n_65344)) {
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegScan");
                        
                        int64_t stage1_max_num_groups_78685;
                        
                        stage1_max_num_groups_78685 =
                            ctx->opencl.max_group_size;
                        
                        int64_t stage1_num_groups_78686 =
                                smin64(stage1_max_num_groups_78685,
                                       num_groups_69636);
                        int32_t num_threads_78687 =
                                sext_i64_i32(stage1_num_groups_78686 *
                                segscan_group_sizze_69635);
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_69641,
                                                                1,
                                                                (size_t) smax64((int64_t) 1,
                                                                                (int64_t) 8 *
                                                                                segscan_group_sizze_69635),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_69641,
                                                                2,
                                                                sizeof(m_65343),
                                                                &m_65343));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_69641,
                                                                3,
                                                                sizeof(n_65344),
                                                                &n_65344));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_69641,
                                                                4,
                                                                sizeof(num_threads_78687),
                                                                &num_threads_78687));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_69641,
                                                                5,
                                                                sizeof(Y_mem_76976.mem),
                                                                &Y_mem_76976.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_69641,
                                                                6,
                                                                sizeof(mem_77316.mem),
                                                                &mem_77316.mem));
                        if (1 * ((size_t) stage1_num_groups_78686 *
                                 (size_t) segscan_group_sizze_69635) != 0) {
                            const size_t global_work_sizze_80050[1] =
                                         {(size_t) stage1_num_groups_78686 *
                                         (size_t) segscan_group_sizze_69635};
                            const size_t local_work_sizze_80054[1] =
                                         {(size_t) segscan_group_sizze_69635};
                            int64_t time_start_80051 = 0, time_end_80052 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.scan_stage1_69641",
                                        global_work_sizze_80050[0],
                                        local_work_sizze_80054[0], (int) (0 +
                                                                          smax64((int64_t) 1,
                                                                                 (int64_t) 8 *
                                                                                 segscan_group_sizze_69635)));
                                time_start_80051 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainziscan_stage1_69641,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_80050,
                                                                            local_work_sizze_80054,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainziscan_stage1_69641_runs,
                                                                                                                      &ctx->mainziscan_stage1_69641_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_80052 = get_wall_time();
                                
                                long time_diff_80053 = time_end_80052 -
                                     time_start_80051;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.scan_stage1_69641",
                                        time_diff_80053);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                                    (long long) (segscan_group_sizze_69635 *
                                                 sdiv_up64(m_65343 * n_65344,
                                                           sext_i32_i64(num_threads_78687))),
                                    '\n');
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_69641,
                                                                1,
                                                                (size_t) smax64((int64_t) 1,
                                                                                (int64_t) 8 *
                                                                                stage1_num_groups_78686),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_69641,
                                                                2,
                                                                sizeof(m_65343),
                                                                &m_65343));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_69641,
                                                                3,
                                                                sizeof(n_65344),
                                                                &n_65344));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_69641,
                                                                4,
                                                                sizeof(stage1_num_groups_78686),
                                                                &stage1_num_groups_78686));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_69641,
                                                                5,
                                                                sizeof(num_threads_78687),
                                                                &num_threads_78687));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_69641,
                                                                6,
                                                                sizeof(mem_77316.mem),
                                                                &mem_77316.mem));
                        if (1 * ((size_t) (int64_t) 1 *
                                 (size_t) stage1_num_groups_78686) != 0) {
                            const size_t global_work_sizze_80055[1] =
                                         {(size_t) (int64_t) 1 *
                                         (size_t) stage1_num_groups_78686};
                            const size_t local_work_sizze_80059[1] =
                                         {(size_t) stage1_num_groups_78686};
                            int64_t time_start_80056 = 0, time_end_80057 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.scan_stage2_69641",
                                        global_work_sizze_80055[0],
                                        local_work_sizze_80059[0], (int) (0 +
                                                                          smax64((int64_t) 1,
                                                                                 (int64_t) 8 *
                                                                                 stage1_num_groups_78686)));
                                time_start_80056 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainziscan_stage2_69641,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_80055,
                                                                            local_work_sizze_80059,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainziscan_stage2_69641_runs,
                                                                                                                      &ctx->mainziscan_stage2_69641_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_80057 = get_wall_time();
                                
                                long time_diff_80058 = time_end_80057 -
                                     time_start_80056;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.scan_stage2_69641",
                                        time_diff_80058);
                            }
                        }
                        
                        int32_t required_groups_78738 =
                                sext_i64_i32(sdiv_up64(m_65343 * n_65344,
                                                       segscan_group_sizze_69635));
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_69641,
                                                                1,
                                                                sizeof(m_65343),
                                                                &m_65343));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_69641,
                                                                2,
                                                                sizeof(n_65344),
                                                                &n_65344));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_69641,
                                                                3,
                                                                sizeof(num_groups_69636),
                                                                &num_groups_69636));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_69641,
                                                                4,
                                                                sizeof(num_threads_78687),
                                                                &num_threads_78687));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_69641,
                                                                5,
                                                                sizeof(required_groups_78738),
                                                                &required_groups_78738));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_69641,
                                                                6,
                                                                sizeof(mem_77316.mem),
                                                                &mem_77316.mem));
                        if (1 * ((size_t) num_groups_69636 *
                                 (size_t) segscan_group_sizze_69635) != 0) {
                            const size_t global_work_sizze_80060[1] =
                                         {(size_t) num_groups_69636 *
                                         (size_t) segscan_group_sizze_69635};
                            const size_t local_work_sizze_80064[1] =
                                         {(size_t) segscan_group_sizze_69635};
                            int64_t time_start_80061 = 0, time_end_80062 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.scan_stage3_69641",
                                        global_work_sizze_80060[0],
                                        local_work_sizze_80064[0], (int) 0);
                                time_start_80061 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainziscan_stage3_69641,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_80060,
                                                                            local_work_sizze_80064,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainziscan_stage3_69641_runs,
                                                                                                                      &ctx->mainziscan_stage3_69641_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_80062 = get_wall_time();
                                
                                long time_diff_80063 = time_end_80062 -
                                     time_start_80061;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.scan_stage3_69641",
                                        time_diff_80063);
                            }
                        }
                    }
                    
                    struct memblock_device mem_77320;
                    
                    mem_77320.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77320, bytes_77319,
                                              "mem_77320")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f32(ctx, mem_77320, m_65343 *
                                                      n_65344, 0.0F) != 0) {
                        if (memblock_unref_device(ctx, &mem_77320,
                                                  "mem_77320") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77316,
                                                  "mem_77316") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77487,
                                                  "ext_mem_77487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77488,
                                                  "ext_mem_77488") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77324;
                    
                    mem_77324.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77324, bytes_77315,
                                              "mem_77324")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_i64(ctx, mem_77324, m_65343 *
                                                      n_65344, (int64_t) -1) !=
                        0) {
                        if (memblock_unref_device(ctx, &mem_77324,
                                                  "mem_77324") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77320,
                                                  "mem_77320") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77316,
                                                  "mem_77316") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77487,
                                                  "ext_mem_77487") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77488,
                                                  "ext_mem_77488") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    int64_t segmap_usable_groups_69689 =
                            sdiv_up64(nest_sizze_69634,
                                      segmap_group_sizze_69688);
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69694,
                                                            1, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69694,
                                                            2, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69694,
                                                            3,
                                                            sizeof(Y_mem_76976.mem),
                                                            &Y_mem_76976.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69694,
                                                            4,
                                                            sizeof(mem_77316.mem),
                                                            &mem_77316.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69694,
                                                            5,
                                                            sizeof(mem_77320.mem),
                                                            &mem_77320.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69694,
                                                            6,
                                                            sizeof(mem_77324.mem),
                                                            &mem_77324.mem));
                    if (1 * ((size_t) segmap_usable_groups_69689 *
                             (size_t) segmap_group_sizze_69688) != 0) {
                        const size_t global_work_sizze_80065[1] =
                                     {(size_t) segmap_usable_groups_69689 *
                                     (size_t) segmap_group_sizze_69688};
                        const size_t local_work_sizze_80069[1] =
                                     {(size_t) segmap_group_sizze_69688};
                        int64_t time_start_80066 = 0, time_end_80067 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segmap_69694",
                                    global_work_sizze_80065[0],
                                    local_work_sizze_80069[0], (int) 0);
                            time_start_80066 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_69694,
                                                                        1, NULL,
                                                                        global_work_sizze_80065,
                                                                        local_work_sizze_80069,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_69694_runs,
                                                                                                                  &ctx->mainzisegmap_69694_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_80067 = get_wall_time();
                            
                            long time_diff_80068 = time_end_80067 -
                                 time_start_80066;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_69694", time_diff_80068);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    int64_t segmap_usable_groups_69709 =
                            sdiv_up64(nest_sizze_69634,
                                      segmap_group_sizze_69708);
                    struct memblock_device mem_77330;
                    
                    mem_77330.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77330, bytes_77315,
                                              "mem_77330")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69713,
                                                            1, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69713,
                                                            2, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69713,
                                                            3,
                                                            sizeof(mem_77324.mem),
                                                            &mem_77324.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69713,
                                                            4,
                                                            sizeof(mem_77330.mem),
                                                            &mem_77330.mem));
                    if (1 * ((size_t) segmap_usable_groups_69709 *
                             (size_t) segmap_group_sizze_69708) != 0) {
                        const size_t global_work_sizze_80070[1] =
                                     {(size_t) segmap_usable_groups_69709 *
                                     (size_t) segmap_group_sizze_69708};
                        const size_t local_work_sizze_80074[1] =
                                     {(size_t) segmap_group_sizze_69708};
                        int64_t time_start_80071 = 0, time_end_80072 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segmap_69713",
                                    global_work_sizze_80070[0],
                                    local_work_sizze_80074[0], (int) 0);
                            time_start_80071 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_69713,
                                                                        1, NULL,
                                                                        global_work_sizze_80070,
                                                                        local_work_sizze_80074,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_69713_runs,
                                                                                                                  &ctx->mainzisegmap_69713_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_80072 = get_wall_time();
                            
                            long time_diff_80073 = time_end_80072 -
                                 time_start_80071;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_69713", time_diff_80073);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    int64_t segmap_usable_groups_69719 = sdiv_up64(m_65343,
                                                                   segmap_group_sizze_69718);
                    struct memblock_device mem_77334;
                    
                    mem_77334.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77334, bytes_77333,
                                              "mem_77334")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77337;
                    
                    mem_77337.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77337, bytes_77333,
                                              "mem_77337")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77340;
                    
                    mem_77340.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77340, bytes_77333,
                                              "mem_77340")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77343;
                    
                    mem_77343.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77343, bytes_77342,
                                              "mem_77343")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69725,
                                                            1, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69725,
                                                            2, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69725,
                                                            3, sizeof(q_65346),
                                                            &q_65346));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69725,
                                                            4, sizeof(i_65358),
                                                            &i_65358));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69725,
                                                            5,
                                                            sizeof(min_res_65364),
                                                            &min_res_65364));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69725,
                                                            6,
                                                            sizeof(i64_res_65370),
                                                            &i64_res_65370));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69725,
                                                            7,
                                                            sizeof(mem_77316.mem),
                                                            &mem_77316.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69725,
                                                            8,
                                                            sizeof(mem_77334.mem),
                                                            &mem_77334.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69725,
                                                            9,
                                                            sizeof(mem_77337.mem),
                                                            &mem_77337.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69725,
                                                            10,
                                                            sizeof(mem_77340.mem),
                                                            &mem_77340.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69725,
                                                            11,
                                                            sizeof(mem_77343.mem),
                                                            &mem_77343.mem));
                    if (1 * ((size_t) segmap_usable_groups_69719 *
                             (size_t) segmap_group_sizze_69718) != 0) {
                        const size_t global_work_sizze_80075[1] =
                                     {(size_t) segmap_usable_groups_69719 *
                                     (size_t) segmap_group_sizze_69718};
                        const size_t local_work_sizze_80079[1] =
                                     {(size_t) segmap_group_sizze_69718};
                        int64_t time_start_80076 = 0, time_end_80077 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segmap_69725",
                                    global_work_sizze_80075[0],
                                    local_work_sizze_80079[0], (int) 0);
                            time_start_80076 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_69725,
                                                                        1, NULL,
                                                                        global_work_sizze_80075,
                                                                        local_work_sizze_80079,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_69725_runs,
                                                                                                                  &ctx->mainzisegmap_69725_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_80077 = get_wall_time();
                            
                            long time_diff_80078 = time_end_80077 -
                                 time_start_80076;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_69725", time_diff_80078);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    int64_t segmap_usable_groups_69741 =
                            sdiv_up64(nest_sizze_69739,
                                      segmap_group_sizze_69740);
                    struct memblock_device mem_77348;
                    
                    mem_77348.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77348, bytes_77347,
                                              "mem_77348")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69745,
                                                            1, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69745,
                                                            2, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69745,
                                                            3, sizeof(q_65346),
                                                            &q_65346));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69745,
                                                            4, sizeof(i_65358),
                                                            &i_65358));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69745,
                                                            5,
                                                            sizeof(mem_77316.mem),
                                                            &mem_77316.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69745,
                                                            6,
                                                            sizeof(mem_77348.mem),
                                                            &mem_77348.mem));
                    if (1 * ((size_t) segmap_usable_groups_69741 *
                             (size_t) segmap_group_sizze_69740) != 0) {
                        const size_t global_work_sizze_80080[1] =
                                     {(size_t) segmap_usable_groups_69741 *
                                     (size_t) segmap_group_sizze_69740};
                        const size_t local_work_sizze_80084[1] =
                                     {(size_t) segmap_group_sizze_69740};
                        int64_t time_start_80081 = 0, time_end_80082 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segmap_69745",
                                    global_work_sizze_80080[0],
                                    local_work_sizze_80084[0], (int) 0);
                            time_start_80081 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_69745,
                                                                        1, NULL,
                                                                        global_work_sizze_80080,
                                                                        local_work_sizze_80084,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_69745_runs,
                                                                                                                  &ctx->mainzisegmap_69745_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_80082 = get_wall_time();
                            
                            long time_diff_80083 = time_end_80082 -
                                 time_start_80081;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_69745", time_diff_80083);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    struct memblock_device ext_mem_77476;
                    
                    ext_mem_77476.references = NULL;
                    
                    struct memblock_device ext_mem_77475;
                    
                    ext_mem_77475.references = NULL;
                    
                    int32_t local_memory_capacity_79055;
                    
                    local_memory_capacity_79055 = ctx->opencl.max_local_memory;
                    if (sle64(bytes_77379 + srem64((int64_t) 8 -
                                                   srem64(bytes_77379,
                                                          (int64_t) 8),
                                                   (int64_t) 8),
                              sext_i32_i64(local_memory_capacity_79055)) &&
                        suff_outer_par_69757) {
                        int64_t num_groups_x_75309 = sdiv_up64(m_65343,
                                                               tile_sizze_75307);
                        int64_t num_groups_y_75310 = sdiv_up64(n_m_65352,
                                                               tile_sizze_75307);
                        int64_t num_groups_top_75311 = num_groups_x_75309 *
                                num_groups_y_75310;
                        int64_t num_whole_tiles_75442 = squot64(q_65346,
                                                                tile_sizze_75307);
                        int64_t residual_input_75690 = srem64(q_65346,
                                                              tile_sizze_75307);
                        bool cond_75691 = residual_input_75690 == (int64_t) 0;
                        struct memblock_device mem_77422;
                        
                        mem_77422.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77422, bytes_76979,
                                                  "mem_77422")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77426;
                        
                        mem_77426.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77426, bytes_76979,
                                                  "mem_77426")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                1,
                                                                sizeof(ctx->failure_is_an_option),
                                                                &ctx->failure_is_an_option));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                3,
                                                                (size_t) bytes_77379,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                4,
                                                                sizeof(m_65343),
                                                                &m_65343));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                5,
                                                                sizeof(n_65344),
                                                                &n_65344));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                6,
                                                                sizeof(q_65346),
                                                                &q_65346));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                7,
                                                                sizeof(jump_65348),
                                                                &jump_65348));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                8,
                                                                sizeof(n_m_65352),
                                                                &n_m_65352));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                9,
                                                                sizeof(i_65358),
                                                                &i_65358));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                10,
                                                                sizeof(x_65359),
                                                                &x_65359));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                11,
                                                                sizeof(min_res_65364),
                                                                &min_res_65364));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                12,
                                                                sizeof(loop_cond_65369),
                                                                &loop_cond_65369));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                13,
                                                                sizeof(num_groups_x_75309),
                                                                &num_groups_x_75309));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                14,
                                                                sizeof(num_groups_y_75310),
                                                                &num_groups_y_75310));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                15,
                                                                sizeof(num_whole_tiles_75442),
                                                                &num_whole_tiles_75442));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                16,
                                                                sizeof(residual_input_75690),
                                                                &residual_input_75690));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                17,
                                                                sizeof(cond_75691),
                                                                &cond_75691));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                18,
                                                                sizeof(mem_77316.mem),
                                                                &mem_77316.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                19,
                                                                sizeof(mem_77320.mem),
                                                                &mem_77320.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                20,
                                                                sizeof(mem_77324.mem),
                                                                &mem_77324.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                21,
                                                                sizeof(mem_77330.mem),
                                                                &mem_77330.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                22,
                                                                sizeof(mem_77334.mem),
                                                                &mem_77334.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                23,
                                                                sizeof(mem_77337.mem),
                                                                &mem_77337.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                24,
                                                                sizeof(mem_77340.mem),
                                                                &mem_77340.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                25,
                                                                sizeof(mem_77343.mem),
                                                                &mem_77343.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                26,
                                                                sizeof(mem_77348.mem),
                                                                &mem_77348.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                27,
                                                                sizeof(mem_77422.mem),
                                                                &mem_77422.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75312,
                                                                28,
                                                                sizeof(mem_77426.mem),
                                                                &mem_77426.mem));
                        if (1 * ((size_t) num_groups_top_75311 *
                                 (size_t) group_sizze_75308) != 0) {
                            const size_t global_work_sizze_80085[1] =
                                         {(size_t) num_groups_top_75311 *
                                         (size_t) group_sizze_75308};
                            const size_t local_work_sizze_80089[1] =
                                         {(size_t) group_sizze_75308};
                            int64_t time_start_80086 = 0, time_end_80087 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_intragroup_75312",
                                        global_work_sizze_80085[0],
                                        local_work_sizze_80089[0], (int) (0 +
                                                                          bytes_77379));
                                time_start_80086 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_intragroup_75312,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_80085,
                                                                            local_work_sizze_80089,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_intragroup_75312_runs,
                                                                                                                      &ctx->mainzisegmap_intragroup_75312_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_80087 = get_wall_time();
                                
                                long time_diff_80088 = time_end_80087 -
                                     time_start_80086;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_75312",
                                        time_diff_80088);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_77476, &mem_77422,
                                                "mem_77422") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_77475, &mem_77426,
                                                "mem_77426") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77426,
                                                  "mem_77426") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77422,
                                                  "mem_77422") != 0)
                            return 1;
                    } else {
                        int64_t segmap_usable_groups_69940 =
                                sdiv_up64(binop_x_76977,
                                          segmap_group_sizze_69939);
                        struct memblock_device mem_77431;
                        
                        mem_77431.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77431, bytes_77430,
                                                  "mem_77431")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77435;
                        
                        mem_77435.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77435, bytes_77430,
                                                  "mem_77435")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77439;
                        
                        mem_77439.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77439, bytes_76979,
                                                  "mem_77439")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69946,
                                                                1,
                                                                sizeof(ctx->failure_is_an_option),
                                                                &ctx->failure_is_an_option));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69946,
                                                                3,
                                                                sizeof(m_65343),
                                                                &m_65343));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69946,
                                                                4,
                                                                sizeof(n_65344),
                                                                &n_65344));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69946,
                                                                5,
                                                                sizeof(jump_65348),
                                                                &jump_65348));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69946,
                                                                6,
                                                                sizeof(n_m_65352),
                                                                &n_m_65352));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69946,
                                                                7,
                                                                sizeof(i_65358),
                                                                &i_65358));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69946,
                                                                8,
                                                                sizeof(x_65359),
                                                                &x_65359));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69946,
                                                                9,
                                                                sizeof(min_res_65364),
                                                                &min_res_65364));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69946,
                                                                10,
                                                                sizeof(loop_cond_65369),
                                                                &loop_cond_65369));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69946,
                                                                11,
                                                                sizeof(mem_77324.mem),
                                                                &mem_77324.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69946,
                                                                12,
                                                                sizeof(mem_77330.mem),
                                                                &mem_77330.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69946,
                                                                13,
                                                                sizeof(mem_77334.mem),
                                                                &mem_77334.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69946,
                                                                14,
                                                                sizeof(mem_77337.mem),
                                                                &mem_77337.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69946,
                                                                15,
                                                                sizeof(mem_77340.mem),
                                                                &mem_77340.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69946,
                                                                16,
                                                                sizeof(mem_77343.mem),
                                                                &mem_77343.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69946,
                                                                17,
                                                                sizeof(mem_77431.mem),
                                                                &mem_77431.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69946,
                                                                18,
                                                                sizeof(mem_77435.mem),
                                                                &mem_77435.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_69946,
                                                                19,
                                                                sizeof(mem_77439.mem),
                                                                &mem_77439.mem));
                        if (1 * ((size_t) segmap_usable_groups_69940 *
                                 (size_t) segmap_group_sizze_69939) != 0) {
                            const size_t global_work_sizze_80090[1] =
                                         {(size_t) segmap_usable_groups_69940 *
                                         (size_t) segmap_group_sizze_69939};
                            const size_t local_work_sizze_80094[1] =
                                         {(size_t) segmap_group_sizze_69939};
                            int64_t time_start_80091 = 0, time_end_80092 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_69946",
                                        global_work_sizze_80090[0],
                                        local_work_sizze_80094[0], (int) 0);
                                time_start_80091 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_69946,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_80090,
                                                                            local_work_sizze_80094,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_69946_runs,
                                                                                                                      &ctx->mainzisegmap_69946_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_80092 = get_wall_time();
                                
                                long time_diff_80093 = time_end_80092 -
                                     time_start_80091;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_69946", time_diff_80093);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_77431,
                                                  "mem_77431") != 0)
                            return 1;
                        
                        struct memblock_device mem_77444;
                        
                        mem_77444.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77444, bytes_76979,
                                                  "mem_77444")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77448;
                        
                        mem_77448.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77448, bytes_76979,
                                                  "mem_77448")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77452;
                        
                        mem_77452.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77452, bytes_76979,
                                                  "mem_77452")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (slt64(q_65346 * (int64_t) 2,
                                  segred_group_sizze_70043)) {
                            int64_t segment_sizze_nonzzero_78859 =
                                    smax64((int64_t) 1, q_65346);
                            int64_t num_threads_78860 = num_groups_70044 *
                                    segred_group_sizze_70043;
                            
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                        (long long) (m_65343 * n_m_65352),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                        (long long) q_65346, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "segments_per_group",
                                        (long long) squot64(segred_group_sizze_70043,
                                                            segment_sizze_nonzzero_78859),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "required_groups",
                                        (long long) sext_i64_i32(sdiv_up64(m_65343 *
                                                                           n_m_65352,
                                                                           squot64(segred_group_sizze_70043,
                                                                                   segment_sizze_nonzzero_78859))),
                                        '\n');
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70052,
                                                                    1,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_70043),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70052,
                                                                    2,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_70043),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70052,
                                                                    3,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_70043),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70052,
                                                                    4,
                                                                    sizeof(m_65343),
                                                                    &m_65343));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70052,
                                                                    5,
                                                                    sizeof(n_65344),
                                                                    &n_65344));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70052,
                                                                    6,
                                                                    sizeof(q_65346),
                                                                    &q_65346));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70052,
                                                                    7,
                                                                    sizeof(jump_65348),
                                                                    &jump_65348));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70052,
                                                                    8,
                                                                    sizeof(n_m_65352),
                                                                    &n_m_65352));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70052,
                                                                    9,
                                                                    sizeof(i_65358),
                                                                    &i_65358));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70052,
                                                                    10,
                                                                    sizeof(num_groups_70044),
                                                                    &num_groups_70044));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70052,
                                                                    11,
                                                                    sizeof(segment_sizze_nonzzero_78859),
                                                                    &segment_sizze_nonzzero_78859));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70052,
                                                                    12,
                                                                    sizeof(mem_77316.mem),
                                                                    &mem_77316.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70052,
                                                                    13,
                                                                    sizeof(mem_77324.mem),
                                                                    &mem_77324.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70052,
                                                                    14,
                                                                    sizeof(mem_77348.mem),
                                                                    &mem_77348.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70052,
                                                                    15,
                                                                    sizeof(mem_77435.mem),
                                                                    &mem_77435.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70052,
                                                                    16,
                                                                    sizeof(mem_77439.mem),
                                                                    &mem_77439.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70052,
                                                                    17,
                                                                    sizeof(mem_77444.mem),
                                                                    &mem_77444.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70052,
                                                                    18,
                                                                    sizeof(mem_77448.mem),
                                                                    &mem_77448.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70052,
                                                                    19,
                                                                    sizeof(mem_77452.mem),
                                                                    &mem_77452.mem));
                            if (1 * ((size_t) num_groups_70044 *
                                     (size_t) segred_group_sizze_70043) != 0) {
                                const size_t global_work_sizze_80095[1] =
                                             {(size_t) num_groups_70044 *
                                             (size_t) segred_group_sizze_70043};
                                const size_t local_work_sizze_80099[1] =
                                             {(size_t) segred_group_sizze_70043};
                                int64_t time_start_80096 = 0, time_end_80097 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segred_small_70052",
                                            global_work_sizze_80095[0],
                                            local_work_sizze_80099[0],
                                            (int) (0 + (int64_t) 4 *
                                                   segred_group_sizze_70043 +
                                                   (int64_t) 4 *
                                                   segred_group_sizze_70043 +
                                                   (int64_t) 4 *
                                                   segred_group_sizze_70043));
                                    time_start_80096 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegred_small_70052,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_80095,
                                                                                local_work_sizze_80099,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegred_small_70052_runs,
                                                                                                                          &ctx->mainzisegred_small_70052_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_80097 = get_wall_time();
                                    
                                    long time_diff_80098 = time_end_80097 -
                                         time_start_80096;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segred_small_70052",
                                            time_diff_80098);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                        } else {
                            int64_t groups_per_segment_78900 =
                                    sdiv_up64(num_groups_70044,
                                              smax64((int64_t) 1, m_65343 *
                                                     n_m_65352));
                            int64_t elements_per_thread_78901 =
                                    sdiv_up64(q_65346,
                                              segred_group_sizze_70043 *
                                              groups_per_segment_78900);
                            int64_t virt_num_groups_78902 =
                                    groups_per_segment_78900 * (m_65343 *
                                                                n_m_65352);
                            int64_t num_threads_78903 = num_groups_70044 *
                                    segred_group_sizze_70043;
                            int64_t threads_per_segment_78904 =
                                    groups_per_segment_78900 *
                                    segred_group_sizze_70043;
                            
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                        (long long) (m_65343 * n_m_65352),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                        (long long) q_65346, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "virt_num_groups",
                                        (long long) virt_num_groups_78902,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                        (long long) num_groups_70044, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "group_size",
                                        (long long) segred_group_sizze_70043,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "elems_per_thread",
                                        (long long) elements_per_thread_78901,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "groups_per_segment",
                                        (long long) groups_per_segment_78900,
                                        '\n');
                            
                            struct memblock_device segred_tmp_mem_78905;
                            
                            segred_tmp_mem_78905.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_78905,
                                                      (int64_t) 4 *
                                                      virt_num_groups_78902,
                                                      "segred_tmp_mem_78905")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device segred_tmp_mem_78907;
                            
                            segred_tmp_mem_78907.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_78907,
                                                      (int64_t) 4 *
                                                      virt_num_groups_78902,
                                                      "segred_tmp_mem_78907")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device segred_tmp_mem_78909;
                            
                            segred_tmp_mem_78909.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_78909,
                                                      (int64_t) 4 *
                                                      virt_num_groups_78902,
                                                      "segred_tmp_mem_78909")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mainzicounter_mem_78911 =
                                                   ctx->mainzicounter_mem_78911;
                            
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    1,
                                                                    (size_t) 1,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    2,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_70043),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    3,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_70043),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    4,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_70043),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    5,
                                                                    sizeof(m_65343),
                                                                    &m_65343));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    6,
                                                                    sizeof(n_65344),
                                                                    &n_65344));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    7,
                                                                    sizeof(q_65346),
                                                                    &q_65346));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    8,
                                                                    sizeof(jump_65348),
                                                                    &jump_65348));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    9,
                                                                    sizeof(n_m_65352),
                                                                    &n_m_65352));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    10,
                                                                    sizeof(i_65358),
                                                                    &i_65358));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    11,
                                                                    sizeof(num_groups_70044),
                                                                    &num_groups_70044));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    12,
                                                                    sizeof(groups_per_segment_78900),
                                                                    &groups_per_segment_78900));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    13,
                                                                    sizeof(elements_per_thread_78901),
                                                                    &elements_per_thread_78901));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    14,
                                                                    sizeof(virt_num_groups_78902),
                                                                    &virt_num_groups_78902));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    15,
                                                                    sizeof(threads_per_segment_78904),
                                                                    &threads_per_segment_78904));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    16,
                                                                    sizeof(mem_77316.mem),
                                                                    &mem_77316.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    17,
                                                                    sizeof(mem_77324.mem),
                                                                    &mem_77324.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    18,
                                                                    sizeof(mem_77348.mem),
                                                                    &mem_77348.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    19,
                                                                    sizeof(mem_77435.mem),
                                                                    &mem_77435.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    20,
                                                                    sizeof(mem_77439.mem),
                                                                    &mem_77439.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    21,
                                                                    sizeof(mem_77444.mem),
                                                                    &mem_77444.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    22,
                                                                    sizeof(mem_77448.mem),
                                                                    &mem_77448.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    23,
                                                                    sizeof(mem_77452.mem),
                                                                    &mem_77452.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    24,
                                                                    sizeof(segred_tmp_mem_78905.mem),
                                                                    &segred_tmp_mem_78905.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    25,
                                                                    sizeof(segred_tmp_mem_78907.mem),
                                                                    &segred_tmp_mem_78907.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    26,
                                                                    sizeof(segred_tmp_mem_78909.mem),
                                                                    &segred_tmp_mem_78909.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70052,
                                                                    27,
                                                                    sizeof(mainzicounter_mem_78911.mem),
                                                                    &mainzicounter_mem_78911.mem));
                            if (1 * ((size_t) num_groups_70044 *
                                     (size_t) segred_group_sizze_70043) != 0) {
                                const size_t global_work_sizze_80101[1] =
                                             {(size_t) num_groups_70044 *
                                             (size_t) segred_group_sizze_70043};
                                const size_t local_work_sizze_80105[1] =
                                             {(size_t) segred_group_sizze_70043};
                                int64_t time_start_80102 = 0, time_end_80103 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segred_large_70052",
                                            global_work_sizze_80101[0],
                                            local_work_sizze_80105[0],
                                            (int) (0 + 1 + (int64_t) 4 *
                                                   segred_group_sizze_70043 +
                                                   (int64_t) 4 *
                                                   segred_group_sizze_70043 +
                                                   (int64_t) 4 *
                                                   segred_group_sizze_70043));
                                    time_start_80102 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegred_large_70052,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_80101,
                                                                                local_work_sizze_80105,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegred_large_70052_runs,
                                                                                                                          &ctx->mainzisegred_large_70052_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_80103 = get_wall_time();
                                    
                                    long time_diff_80104 = time_end_80103 -
                                         time_start_80102;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segred_large_70052",
                                            time_diff_80104);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_78909,
                                                      "segred_tmp_mem_78909") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_78907,
                                                      "segred_tmp_mem_78907") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_78905,
                                                      "segred_tmp_mem_78905") !=
                                0)
                                return 1;
                        }
                        
                        int64_t segmap_usable_groups_70093 =
                                sdiv_up64(binop_x_76977,
                                          segmap_group_sizze_70092);
                        struct memblock_device mem_77457;
                        
                        mem_77457.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77457, bytes_76979,
                                                  "mem_77457")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77461;
                        
                        mem_77461.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77461, bytes_76979,
                                                  "mem_77461")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77465;
                        
                        mem_77465.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77465, bytes_76979,
                                                  "mem_77465")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70099,
                                                                1,
                                                                sizeof(m_65343),
                                                                &m_65343));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70099,
                                                                2,
                                                                sizeof(n_m_65352),
                                                                &n_m_65352));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70099,
                                                                3,
                                                                sizeof(mem_77444.mem),
                                                                &mem_77444.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70099,
                                                                4,
                                                                sizeof(mem_77448.mem),
                                                                &mem_77448.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70099,
                                                                5,
                                                                sizeof(mem_77452.mem),
                                                                &mem_77452.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70099,
                                                                6,
                                                                sizeof(mem_77457.mem),
                                                                &mem_77457.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70099,
                                                                7,
                                                                sizeof(mem_77461.mem),
                                                                &mem_77461.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70099,
                                                                8,
                                                                sizeof(mem_77465.mem),
                                                                &mem_77465.mem));
                        if (1 * ((size_t) segmap_usable_groups_70093 *
                                 (size_t) segmap_group_sizze_70092) != 0) {
                            const size_t global_work_sizze_80106[1] =
                                         {(size_t) segmap_usable_groups_70093 *
                                         (size_t) segmap_group_sizze_70092};
                            const size_t local_work_sizze_80110[1] =
                                         {(size_t) segmap_group_sizze_70092};
                            int64_t time_start_80107 = 0, time_end_80108 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_70099",
                                        global_work_sizze_80106[0],
                                        local_work_sizze_80110[0], (int) 0);
                                time_start_80107 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_70099,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_80106,
                                                                            local_work_sizze_80110,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_70099_runs,
                                                                                                                      &ctx->mainzisegmap_70099_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_80108 = get_wall_time();
                                
                                long time_diff_80109 = time_end_80108 -
                                     time_start_80107;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_70099", time_diff_80109);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_77444,
                                                  "mem_77444") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77448,
                                                  "mem_77448") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77452,
                                                  "mem_77452") != 0)
                            return 1;
                        
                        struct memblock_device mem_77470;
                        
                        mem_77470.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77470, bytes_76979,
                                                  "mem_77470")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77474;
                        
                        mem_77474.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77474, bytes_76979,
                                                  "mem_77474")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (slt64(q_65346 * (int64_t) 2,
                                  segred_group_sizze_70114)) {
                            int64_t segment_sizze_nonzzero_78969 =
                                    smax64((int64_t) 1, q_65346);
                            int64_t num_threads_78970 = num_groups_70115 *
                                    segred_group_sizze_70114;
                            
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                        (long long) (m_65343 * n_m_65352),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                        (long long) q_65346, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "segments_per_group",
                                        (long long) squot64(segred_group_sizze_70114,
                                                            segment_sizze_nonzzero_78969),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "required_groups",
                                        (long long) sext_i64_i32(sdiv_up64(m_65343 *
                                                                           n_m_65352,
                                                                           squot64(segred_group_sizze_70114,
                                                                                   segment_sizze_nonzzero_78969))),
                                        '\n');
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    1,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_70114),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    2,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_70114),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    3,
                                                                    sizeof(m_65343),
                                                                    &m_65343));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    4,
                                                                    sizeof(n_65344),
                                                                    &n_65344));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    5,
                                                                    sizeof(q_65346),
                                                                    &q_65346));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    6,
                                                                    sizeof(jump_65348),
                                                                    &jump_65348));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    7,
                                                                    sizeof(n_m_65352),
                                                                    &n_m_65352));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    8,
                                                                    sizeof(i_65358),
                                                                    &i_65358));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    9,
                                                                    sizeof(num_groups_70115),
                                                                    &num_groups_70115));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    10,
                                                                    sizeof(segment_sizze_nonzzero_78969),
                                                                    &segment_sizze_nonzzero_78969));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    11,
                                                                    sizeof(mem_77316.mem),
                                                                    &mem_77316.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    12,
                                                                    sizeof(mem_77320.mem),
                                                                    &mem_77320.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    13,
                                                                    sizeof(mem_77324.mem),
                                                                    &mem_77324.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    14,
                                                                    sizeof(mem_77348.mem),
                                                                    &mem_77348.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    15,
                                                                    sizeof(mem_77435.mem),
                                                                    &mem_77435.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    16,
                                                                    sizeof(mem_77439.mem),
                                                                    &mem_77439.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    17,
                                                                    sizeof(mem_77457.mem),
                                                                    &mem_77457.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    18,
                                                                    sizeof(mem_77461.mem),
                                                                    &mem_77461.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    19,
                                                                    sizeof(mem_77465.mem),
                                                                    &mem_77465.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    20,
                                                                    sizeof(mem_77470.mem),
                                                                    &mem_77470.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_70122,
                                                                    21,
                                                                    sizeof(mem_77474.mem),
                                                                    &mem_77474.mem));
                            if (1 * ((size_t) num_groups_70115 *
                                     (size_t) segred_group_sizze_70114) != 0) {
                                const size_t global_work_sizze_80111[1] =
                                             {(size_t) num_groups_70115 *
                                             (size_t) segred_group_sizze_70114};
                                const size_t local_work_sizze_80115[1] =
                                             {(size_t) segred_group_sizze_70114};
                                int64_t time_start_80112 = 0, time_end_80113 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segred_small_70122",
                                            global_work_sizze_80111[0],
                                            local_work_sizze_80115[0],
                                            (int) (0 + (int64_t) 4 *
                                                   segred_group_sizze_70114 +
                                                   (int64_t) 4 *
                                                   segred_group_sizze_70114));
                                    time_start_80112 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegred_small_70122,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_80111,
                                                                                local_work_sizze_80115,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegred_small_70122_runs,
                                                                                                                          &ctx->mainzisegred_small_70122_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_80113 = get_wall_time();
                                    
                                    long time_diff_80114 = time_end_80113 -
                                         time_start_80112;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segred_small_70122",
                                            time_diff_80114);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                        } else {
                            int64_t groups_per_segment_79004 =
                                    sdiv_up64(num_groups_70115,
                                              smax64((int64_t) 1, m_65343 *
                                                     n_m_65352));
                            int64_t elements_per_thread_79005 =
                                    sdiv_up64(q_65346,
                                              segred_group_sizze_70114 *
                                              groups_per_segment_79004);
                            int64_t virt_num_groups_79006 =
                                    groups_per_segment_79004 * (m_65343 *
                                                                n_m_65352);
                            int64_t num_threads_79007 = num_groups_70115 *
                                    segred_group_sizze_70114;
                            int64_t threads_per_segment_79008 =
                                    groups_per_segment_79004 *
                                    segred_group_sizze_70114;
                            
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                        (long long) (m_65343 * n_m_65352),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                        (long long) q_65346, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "virt_num_groups",
                                        (long long) virt_num_groups_79006,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                        (long long) num_groups_70115, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "group_size",
                                        (long long) segred_group_sizze_70114,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "elems_per_thread",
                                        (long long) elements_per_thread_79005,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "groups_per_segment",
                                        (long long) groups_per_segment_79004,
                                        '\n');
                            
                            struct memblock_device segred_tmp_mem_79009;
                            
                            segred_tmp_mem_79009.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_79009,
                                                      (int64_t) 4 *
                                                      virt_num_groups_79006,
                                                      "segred_tmp_mem_79009")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device segred_tmp_mem_79011;
                            
                            segred_tmp_mem_79011.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_79011,
                                                      (int64_t) 4 *
                                                      virt_num_groups_79006,
                                                      "segred_tmp_mem_79011")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mainzicounter_mem_79013 =
                                                   ctx->mainzicounter_mem_79013;
                            
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    1,
                                                                    (size_t) 1,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    2,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_70114),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    3,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_70114),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    4,
                                                                    sizeof(m_65343),
                                                                    &m_65343));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    5,
                                                                    sizeof(n_65344),
                                                                    &n_65344));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    6,
                                                                    sizeof(q_65346),
                                                                    &q_65346));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    7,
                                                                    sizeof(jump_65348),
                                                                    &jump_65348));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    8,
                                                                    sizeof(n_m_65352),
                                                                    &n_m_65352));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    9,
                                                                    sizeof(i_65358),
                                                                    &i_65358));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    10,
                                                                    sizeof(num_groups_70115),
                                                                    &num_groups_70115));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    11,
                                                                    sizeof(groups_per_segment_79004),
                                                                    &groups_per_segment_79004));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    12,
                                                                    sizeof(elements_per_thread_79005),
                                                                    &elements_per_thread_79005));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    13,
                                                                    sizeof(virt_num_groups_79006),
                                                                    &virt_num_groups_79006));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    14,
                                                                    sizeof(threads_per_segment_79008),
                                                                    &threads_per_segment_79008));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    15,
                                                                    sizeof(mem_77316.mem),
                                                                    &mem_77316.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    16,
                                                                    sizeof(mem_77320.mem),
                                                                    &mem_77320.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    17,
                                                                    sizeof(mem_77324.mem),
                                                                    &mem_77324.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    18,
                                                                    sizeof(mem_77348.mem),
                                                                    &mem_77348.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    19,
                                                                    sizeof(mem_77435.mem),
                                                                    &mem_77435.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    20,
                                                                    sizeof(mem_77439.mem),
                                                                    &mem_77439.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    21,
                                                                    sizeof(mem_77457.mem),
                                                                    &mem_77457.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    22,
                                                                    sizeof(mem_77461.mem),
                                                                    &mem_77461.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    23,
                                                                    sizeof(mem_77465.mem),
                                                                    &mem_77465.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    24,
                                                                    sizeof(mem_77470.mem),
                                                                    &mem_77470.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    25,
                                                                    sizeof(mem_77474.mem),
                                                                    &mem_77474.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    26,
                                                                    sizeof(segred_tmp_mem_79009.mem),
                                                                    &segred_tmp_mem_79009.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    27,
                                                                    sizeof(segred_tmp_mem_79011.mem),
                                                                    &segred_tmp_mem_79011.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_70122,
                                                                    28,
                                                                    sizeof(mainzicounter_mem_79013.mem),
                                                                    &mainzicounter_mem_79013.mem));
                            if (1 * ((size_t) num_groups_70115 *
                                     (size_t) segred_group_sizze_70114) != 0) {
                                const size_t global_work_sizze_80117[1] =
                                             {(size_t) num_groups_70115 *
                                             (size_t) segred_group_sizze_70114};
                                const size_t local_work_sizze_80121[1] =
                                             {(size_t) segred_group_sizze_70114};
                                int64_t time_start_80118 = 0, time_end_80119 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segred_large_70122",
                                            global_work_sizze_80117[0],
                                            local_work_sizze_80121[0],
                                            (int) (0 + 1 + (int64_t) 4 *
                                                   segred_group_sizze_70114 +
                                                   (int64_t) 4 *
                                                   segred_group_sizze_70114));
                                    time_start_80118 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegred_large_70122,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_80117,
                                                                                local_work_sizze_80121,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegred_large_70122_runs,
                                                                                                                          &ctx->mainzisegred_large_70122_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_80119 = get_wall_time();
                                    
                                    long time_diff_80120 = time_end_80119 -
                                         time_start_80118;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segred_large_70122",
                                            time_diff_80120);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_79011,
                                                      "segred_tmp_mem_79011") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_79009,
                                                      "segred_tmp_mem_79009") !=
                                0)
                                return 1;
                        }
                        if (memblock_unref_device(ctx, &mem_77435,
                                                  "mem_77435") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77439,
                                                  "mem_77439") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77457,
                                                  "mem_77457") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77461,
                                                  "mem_77461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77465,
                                                  "mem_77465") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_77476, &mem_77470,
                                                "mem_77470") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_77475, &mem_77474,
                                                "mem_77474") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77474,
                                                  "mem_77474") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77470,
                                                  "mem_77470") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77465,
                                                  "mem_77465") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77461,
                                                  "mem_77461") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77457,
                                                  "mem_77457") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77452,
                                                  "mem_77452") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77448,
                                                  "mem_77448") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77444,
                                                  "mem_77444") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77439,
                                                  "mem_77439") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77435,
                                                  "mem_77435") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77431,
                                                  "mem_77431") != 0)
                            return 1;
                    }
                    if (memblock_unref_device(ctx, &mem_77316, "mem_77316") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77320, "mem_77320") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77324, "mem_77324") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77330, "mem_77330") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77334, "mem_77334") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77337, "mem_77337") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77340, "mem_77340") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77343, "mem_77343") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77348, "mem_77348") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_77488, &ext_mem_77476,
                                            "ext_mem_77476") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_77487, &ext_mem_77475,
                                            "ext_mem_77475") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77475,
                                              "ext_mem_77475") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77476,
                                              "ext_mem_77476") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77348, "mem_77348") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77343, "mem_77343") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77340, "mem_77340") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77337, "mem_77337") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77334, "mem_77334") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77330, "mem_77330") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77324, "mem_77324") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77320, "mem_77320") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77316, "mem_77316") !=
                        0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_77822, &ext_mem_77488,
                                        "ext_mem_77488") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_77821, &ext_mem_77487,
                                        "ext_mem_77487") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77487,
                                          "ext_mem_77487") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77488,
                                          "ext_mem_77488") != 0)
                    return 1;
            } else {
                bool suff_outer_par_70179;
                
                suff_outer_par_70179 =
                    *ctx->tuning_params.mainzisuff_outer_par_4 <= m_65343;
                if (ctx->logging)
                    fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                            "main.suff_outer_par_4", (long) m_65343,
                            suff_outer_par_70179 ? "true" : "false");
                
                int64_t segmap_group_sizze_70423;
                
                segmap_group_sizze_70423 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_70183;
                
                int64_t num_groups_70424;
                int32_t max_num_groups_79057;
                
                max_num_groups_79057 =
                    *ctx->tuning_params.mainzisegmap_num_groups_70185;
                num_groups_70424 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(m_65343,
                                                                        segmap_group_sizze_70423),
                                                              sext_i32_i64(max_num_groups_79057))));
                
                int64_t nest_sizze_71673 = m_65343 * n_65344;
                int64_t segscan_group_sizze_71674;
                
                segscan_group_sizze_71674 =
                    *ctx->tuning_params.mainzisegscan_group_sizze_71654;
                
                int64_t num_groups_71675;
                int32_t max_num_groups_79058;
                
                max_num_groups_79058 =
                    *ctx->tuning_params.mainzisegscan_num_groups_71656;
                num_groups_71675 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(nest_sizze_71673,
                                                                        segscan_group_sizze_71674),
                                                              sext_i32_i64(max_num_groups_79058))));
                
                int64_t segmap_group_sizze_71727;
                
                segmap_group_sizze_71727 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_71568;
                
                int64_t segmap_group_sizze_71747;
                
                segmap_group_sizze_71747 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_71542;
                
                int64_t segmap_group_sizze_71757;
                
                segmap_group_sizze_71757 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_71516;
                
                int64_t nest_sizze_71778 = m_65343 * q_65346;
                int64_t segmap_group_sizze_71779;
                
                segmap_group_sizze_71779 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_71491;
                
                bool suff_outer_par_71796;
                
                suff_outer_par_71796 =
                    *ctx->tuning_params.mainzisuff_outer_par_5 <= binop_x_76977;
                if (ctx->logging)
                    fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                            "main.suff_outer_par_5", (long) binop_x_76977,
                            suff_outer_par_71796 ? "true" : "false");
                
                int64_t segmap_group_sizze_72010;
                
                segmap_group_sizze_72010 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_71100;
                
                int64_t nest_sizze_72113 = q_65346 * binop_x_76977;
                int64_t segred_group_sizze_72114;
                
                segred_group_sizze_72114 =
                    *ctx->tuning_params.mainzisegred_group_sizze_71039;
                
                int64_t num_groups_72115;
                int32_t max_num_groups_79059;
                
                max_num_groups_79059 =
                    *ctx->tuning_params.mainzisegred_num_groups_71041;
                num_groups_72115 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(nest_sizze_72113,
                                                                        segred_group_sizze_72114),
                                                              sext_i32_i64(max_num_groups_79059))));
                
                int64_t segmap_group_sizze_72173;
                
                segmap_group_sizze_72173 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_70998;
                
                int64_t segred_group_sizze_72216;
                
                segred_group_sizze_72216 =
                    *ctx->tuning_params.mainzisegred_group_sizze_70912;
                
                int64_t num_groups_72217;
                int32_t max_num_groups_79060;
                
                max_num_groups_79060 =
                    *ctx->tuning_params.mainzisegred_num_groups_70914;
                num_groups_72217 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(nest_sizze_72113,
                                                                        segred_group_sizze_72216),
                                                              sext_i32_i64(max_num_groups_79060))));
                
                int64_t tile_sizze_75978;
                
                tile_sizze_75978 = *ctx->tuning_params.mainzitile_sizze_75977;
                
                int64_t group_sizze_75979 = tile_sizze_75978 * tile_sizze_75978;
                int64_t bytes_77490 = (int64_t) 4 * nest_sizze_71673;
                int64_t binop_y_77493 = (int64_t) 8 * n_65344;
                int64_t bytes_77494 = smax64((int64_t) 0, binop_y_77493);
                int64_t binop_y_77508 = (int64_t) 4 * n_65344;
                int64_t bytes_77509 = smax64((int64_t) 0, binop_y_77508);
                int64_t binop_y_77553 = (int64_t) 4 * q_65346;
                int64_t bytes_77554 = smax64((int64_t) 0, binop_y_77553);
                int64_t binop_y_77568 = (int64_t) 4 * n_m_65352;
                int64_t bytes_77569 = smax64((int64_t) 0, binop_y_77568);
                int64_t binop_y_77606 = (int64_t) 8 * nest_sizze_71673;
                int64_t bytes_77607 = smax64((int64_t) 0, binop_y_77606);
                int64_t bytes_77611 = smax64((int64_t) 0, bytes_77490);
                int64_t binop_y_77624 = (int64_t) 8 * m_65343;
                int64_t bytes_77625 = smax64((int64_t) 0, binop_y_77624);
                int64_t binop_y_77633 = (int64_t) 4 * m_65343;
                int64_t bytes_77634 = smax64((int64_t) 0, binop_y_77633);
                int64_t binop_y_77638 = (int64_t) 4 * nest_sizze_71778;
                int64_t bytes_77639 = smax64((int64_t) 0, binop_y_77638);
                int64_t bytes_77644 = (int64_t) 8 * group_sizze_75979;
                int64_t bytes_77653 = (int64_t) 4 * group_sizze_75979;
                int64_t bytes_77679 = smax64((int64_t) 0, bytes_77653);
                int64_t binop_x_78041 = (int64_t) 4 * tile_sizze_75978;
                int64_t sizze_78042 = tile_sizze_75978 * binop_x_78041;
                int64_t binop_y_77745 = (int64_t) 8 * binop_x_76977;
                int64_t bytes_77746 = smax64((int64_t) 0, binop_y_77745);
                int64_t binop_x_78099 = (int64_t) 4 * tile_sizze_75978;
                int64_t num_bytes_78100 = tile_sizze_75978 * binop_x_78099;
                int64_t binop_x_78104 = (int64_t) 4 * tile_sizze_75978;
                int64_t num_bytes_78105 = tile_sizze_75978 * binop_x_78104;
                int64_t binop_x_78109 = (int64_t) 4 * tile_sizze_75978;
                int64_t num_bytes_78110 = tile_sizze_75978 * binop_x_78109;
                int64_t binop_x_78114 = (int64_t) 4 * tile_sizze_75978;
                int64_t num_bytes_78115 = tile_sizze_75978 * binop_x_78114;
                int64_t binop_x_78119 = (int64_t) 4 * tile_sizze_75978;
                int64_t num_bytes_78120 = tile_sizze_75978 * binop_x_78119;
                int64_t maxSubHelper_78170 = umax64(bytes_77653, sizze_78042);
                int64_t maxSubHelper_78171 = umax64(num_bytes_78120,
                                                    maxSubHelper_78170);
                int64_t maxSubHelper_78172 = umax64(bytes_77653, sizze_78042);
                int64_t maxSubHelper_78173 = umax64(num_bytes_78115,
                                                    maxSubHelper_78172);
                int64_t maxSubHelper_78174 = umax64(bytes_77653, sizze_78042);
                int64_t maxSubHelper_78175 = umax64(num_bytes_78110,
                                                    maxSubHelper_78174);
                int64_t maxSubHelper_78176 = umax64(bytes_77653, sizze_78042);
                int64_t maxSubHelper_78177 = umax64(num_bytes_78105,
                                                    maxSubHelper_78176);
                int64_t maxSubHelper_78178 = umax64(sizze_78042,
                                                    num_bytes_78100);
                int64_t num_threads_78234 = segmap_group_sizze_70423 *
                        num_groups_70424;
                int64_t total_sizze_78235 = bytes_77569 * num_threads_78234;
                int64_t total_sizze_78236 = bytes_77569 * num_threads_78234;
                int64_t total_sizze_78237 = bytes_77554 * num_threads_78234;
                int64_t total_sizze_78238 = bytes_77494 * num_threads_78234;
                int64_t total_sizze_78239 = bytes_77494 * num_threads_78234;
                int64_t total_sizze_78240 = bytes_77509 * num_threads_78234;
                struct memblock_device ext_mem_77820;
                
                ext_mem_77820.references = NULL;
                
                struct memblock_device ext_mem_77819;
                
                ext_mem_77819.references = NULL;
                
                int32_t local_memory_capacity_79517;
                
                local_memory_capacity_79517 = ctx->opencl.max_local_memory;
                if (sle64((int64_t) 0,
                          sext_i32_i64(local_memory_capacity_79517)) &&
                    suff_outer_par_70179) {
                    struct memblock_device mem_77491;
                    
                    mem_77491.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77491, bytes_77490,
                                              "mem_77491")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_77491,
                                                              (int64_t) 0,
                                                              Y_mem_76976,
                                                              (int64_t) 0,
                                                              (int64_t) 1,
                                                              n_65344,
                                                              m_65343) != 0) {
                        if (memblock_unref_device(ctx, &mem_77491,
                                                  "mem_77491") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77819,
                                                  "ext_mem_77819") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77820,
                                                  "ext_mem_77820") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77600;
                    
                    mem_77600.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77600, binop_y_76978,
                                              "mem_77600")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77603;
                    
                    mem_77603.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77603, binop_y_76978,
                                              "mem_77603")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78164;
                    
                    color_78164.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78164,
                                              total_sizze_78235,
                                              "color_78164")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78165;
                    
                    color_78165.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78165,
                                              total_sizze_78236,
                                              "color_78165")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78166;
                    
                    color_78166.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78166,
                                              total_sizze_78237,
                                              "color_78166")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78167;
                    
                    color_78167.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78167,
                                              total_sizze_78238,
                                              "color_78167")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78168;
                    
                    color_78168.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78168,
                                              total_sizze_78239,
                                              "color_78168")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_78169;
                    
                    color_78169.references = NULL;
                    if (memblock_alloc_device(ctx, &color_78169,
                                              total_sizze_78240,
                                              "color_78169")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            1,
                                                            sizeof(ctx->failure_is_an_option),
                                                            &ctx->failure_is_an_option));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            3, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            4, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            5, sizeof(q_65346),
                                                            &q_65346));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            6,
                                                            sizeof(jump_65348),
                                                            &jump_65348));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            7,
                                                            sizeof(n_m_65352),
                                                            &n_m_65352));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            8, sizeof(i_65358),
                                                            &i_65358));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            9, sizeof(x_65359),
                                                            &x_65359));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            10,
                                                            sizeof(min_res_65364),
                                                            &min_res_65364));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            11,
                                                            sizeof(loop_cond_65369),
                                                            &loop_cond_65369));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            12,
                                                            sizeof(i64_res_65370),
                                                            &i64_res_65370));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            13,
                                                            sizeof(num_groups_70424),
                                                            &num_groups_70424));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            14,
                                                            sizeof(num_threads_78234),
                                                            &num_threads_78234));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            15,
                                                            sizeof(mem_77491.mem),
                                                            &mem_77491.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            16,
                                                            sizeof(mem_77600.mem),
                                                            &mem_77600.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            17,
                                                            sizeof(mem_77603.mem),
                                                            &mem_77603.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            18,
                                                            sizeof(color_78164.mem),
                                                            &color_78164.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            19,
                                                            sizeof(color_78165.mem),
                                                            &color_78165.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            20,
                                                            sizeof(color_78166.mem),
                                                            &color_78166.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            21,
                                                            sizeof(color_78167.mem),
                                                            &color_78167.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            22,
                                                            sizeof(color_78168.mem),
                                                            &color_78168.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_70429,
                                                            23,
                                                            sizeof(color_78169.mem),
                                                            &color_78169.mem));
                    if (1 * ((size_t) num_groups_70424 *
                             (size_t) segmap_group_sizze_70423) != 0) {
                        const size_t global_work_sizze_80122[1] =
                                     {(size_t) num_groups_70424 *
                                     (size_t) segmap_group_sizze_70423};
                        const size_t local_work_sizze_80126[1] =
                                     {(size_t) segmap_group_sizze_70423};
                        int64_t time_start_80123 = 0, time_end_80124 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segmap_70429",
                                    global_work_sizze_80122[0],
                                    local_work_sizze_80126[0], (int) 0);
                            time_start_80123 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_70429,
                                                                        1, NULL,
                                                                        global_work_sizze_80122,
                                                                        local_work_sizze_80126,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_70429_runs,
                                                                                                                  &ctx->mainzisegmap_70429_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_80124 = get_wall_time();
                            
                            long time_diff_80125 = time_end_80124 -
                                 time_start_80123;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_70429", time_diff_80125);
                        }
                    }
                    ctx->failure_is_an_option = 1;
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &mem_77491, "mem_77491") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78164,
                                              "color_78164") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78165,
                                              "color_78165") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78166,
                                              "color_78166") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78167,
                                              "color_78167") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78168,
                                              "color_78168") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78169,
                                              "color_78169") != 0)
                        return 1;
                    
                    struct memblock_device mem_77812;
                    
                    mem_77812.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77812, bytes_76979,
                                              "mem_77812")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_77812,
                                                              (int64_t) 0,
                                                              mem_77600,
                                                              (int64_t) 0,
                                                              (int64_t) 1,
                                                              m_65343,
                                                              n_m_65352) != 0) {
                        if (memblock_unref_device(ctx, &mem_77812,
                                                  "mem_77812") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78169,
                                                  "color_78169") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78168,
                                                  "color_78168") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78167,
                                                  "color_78167") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78166,
                                                  "color_78166") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78165,
                                                  "color_78165") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78164,
                                                  "color_78164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77603,
                                                  "mem_77603") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77600,
                                                  "mem_77600") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77491,
                                                  "mem_77491") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77819,
                                                  "ext_mem_77819") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77820,
                                                  "ext_mem_77820") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    if (memblock_unref_device(ctx, &mem_77600, "mem_77600") !=
                        0)
                        return 1;
                    
                    struct memblock_device mem_77817;
                    
                    mem_77817.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77817, bytes_76979,
                                              "mem_77817")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_77817,
                                                              (int64_t) 0,
                                                              mem_77603,
                                                              (int64_t) 0,
                                                              (int64_t) 1,
                                                              m_65343,
                                                              n_m_65352) != 0) {
                        if (memblock_unref_device(ctx, &mem_77817,
                                                  "mem_77817") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77812,
                                                  "mem_77812") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78169,
                                                  "color_78169") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78168,
                                                  "color_78168") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78167,
                                                  "color_78167") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78166,
                                                  "color_78166") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78165,
                                                  "color_78165") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_78164,
                                                  "color_78164") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77603,
                                                  "mem_77603") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77600,
                                                  "mem_77600") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77491,
                                                  "mem_77491") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77819,
                                                  "ext_mem_77819") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77820,
                                                  "ext_mem_77820") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    if (memblock_unref_device(ctx, &mem_77603, "mem_77603") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_77820, &mem_77812,
                                            "mem_77812") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_77819, &mem_77817,
                                            "mem_77817") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77817, "mem_77817") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77812, "mem_77812") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78169,
                                              "color_78169") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78168,
                                              "color_78168") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78167,
                                              "color_78167") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78166,
                                              "color_78166") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78165,
                                              "color_78165") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_78164,
                                              "color_78164") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77603, "mem_77603") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77600, "mem_77600") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77491, "mem_77491") !=
                        0)
                        return 1;
                } else {
                    struct memblock_device mem_77608;
                    
                    mem_77608.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77608, bytes_77607,
                                              "mem_77608")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (slt64((int64_t) 0, m_65343 * n_65344)) {
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegScan");
                        
                        int64_t stage1_max_num_groups_79102;
                        
                        stage1_max_num_groups_79102 =
                            ctx->opencl.max_group_size;
                        
                        int64_t stage1_num_groups_79103 =
                                smin64(stage1_max_num_groups_79102,
                                       num_groups_71675);
                        int32_t num_threads_79104 =
                                sext_i64_i32(stage1_num_groups_79103 *
                                segscan_group_sizze_71674);
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_71680,
                                                                1,
                                                                (size_t) smax64((int64_t) 1,
                                                                                (int64_t) 8 *
                                                                                segscan_group_sizze_71674),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_71680,
                                                                2,
                                                                sizeof(m_65343),
                                                                &m_65343));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_71680,
                                                                3,
                                                                sizeof(n_65344),
                                                                &n_65344));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_71680,
                                                                4,
                                                                sizeof(num_threads_79104),
                                                                &num_threads_79104));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_71680,
                                                                5,
                                                                sizeof(Y_mem_76976.mem),
                                                                &Y_mem_76976.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_71680,
                                                                6,
                                                                sizeof(mem_77608.mem),
                                                                &mem_77608.mem));
                        if (1 * ((size_t) stage1_num_groups_79103 *
                                 (size_t) segscan_group_sizze_71674) != 0) {
                            const size_t global_work_sizze_80127[1] =
                                         {(size_t) stage1_num_groups_79103 *
                                         (size_t) segscan_group_sizze_71674};
                            const size_t local_work_sizze_80131[1] =
                                         {(size_t) segscan_group_sizze_71674};
                            int64_t time_start_80128 = 0, time_end_80129 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.scan_stage1_71680",
                                        global_work_sizze_80127[0],
                                        local_work_sizze_80131[0], (int) (0 +
                                                                          smax64((int64_t) 1,
                                                                                 (int64_t) 8 *
                                                                                 segscan_group_sizze_71674)));
                                time_start_80128 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainziscan_stage1_71680,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_80127,
                                                                            local_work_sizze_80131,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainziscan_stage1_71680_runs,
                                                                                                                      &ctx->mainziscan_stage1_71680_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_80129 = get_wall_time();
                                
                                long time_diff_80130 = time_end_80129 -
                                     time_start_80128;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.scan_stage1_71680",
                                        time_diff_80130);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                                    (long long) (segscan_group_sizze_71674 *
                                                 sdiv_up64(m_65343 * n_65344,
                                                           sext_i32_i64(num_threads_79104))),
                                    '\n');
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_71680,
                                                                1,
                                                                (size_t) smax64((int64_t) 1,
                                                                                (int64_t) 8 *
                                                                                stage1_num_groups_79103),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_71680,
                                                                2,
                                                                sizeof(m_65343),
                                                                &m_65343));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_71680,
                                                                3,
                                                                sizeof(n_65344),
                                                                &n_65344));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_71680,
                                                                4,
                                                                sizeof(stage1_num_groups_79103),
                                                                &stage1_num_groups_79103));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_71680,
                                                                5,
                                                                sizeof(num_threads_79104),
                                                                &num_threads_79104));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_71680,
                                                                6,
                                                                sizeof(mem_77608.mem),
                                                                &mem_77608.mem));
                        if (1 * ((size_t) (int64_t) 1 *
                                 (size_t) stage1_num_groups_79103) != 0) {
                            const size_t global_work_sizze_80132[1] =
                                         {(size_t) (int64_t) 1 *
                                         (size_t) stage1_num_groups_79103};
                            const size_t local_work_sizze_80136[1] =
                                         {(size_t) stage1_num_groups_79103};
                            int64_t time_start_80133 = 0, time_end_80134 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.scan_stage2_71680",
                                        global_work_sizze_80132[0],
                                        local_work_sizze_80136[0], (int) (0 +
                                                                          smax64((int64_t) 1,
                                                                                 (int64_t) 8 *
                                                                                 stage1_num_groups_79103)));
                                time_start_80133 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainziscan_stage2_71680,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_80132,
                                                                            local_work_sizze_80136,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainziscan_stage2_71680_runs,
                                                                                                                      &ctx->mainziscan_stage2_71680_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_80134 = get_wall_time();
                                
                                long time_diff_80135 = time_end_80134 -
                                     time_start_80133;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.scan_stage2_71680",
                                        time_diff_80135);
                            }
                        }
                        
                        int32_t required_groups_79155 =
                                sext_i64_i32(sdiv_up64(m_65343 * n_65344,
                                                       segscan_group_sizze_71674));
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_71680,
                                                                1,
                                                                sizeof(m_65343),
                                                                &m_65343));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_71680,
                                                                2,
                                                                sizeof(n_65344),
                                                                &n_65344));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_71680,
                                                                3,
                                                                sizeof(num_groups_71675),
                                                                &num_groups_71675));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_71680,
                                                                4,
                                                                sizeof(num_threads_79104),
                                                                &num_threads_79104));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_71680,
                                                                5,
                                                                sizeof(required_groups_79155),
                                                                &required_groups_79155));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_71680,
                                                                6,
                                                                sizeof(mem_77608.mem),
                                                                &mem_77608.mem));
                        if (1 * ((size_t) num_groups_71675 *
                                 (size_t) segscan_group_sizze_71674) != 0) {
                            const size_t global_work_sizze_80137[1] =
                                         {(size_t) num_groups_71675 *
                                         (size_t) segscan_group_sizze_71674};
                            const size_t local_work_sizze_80141[1] =
                                         {(size_t) segscan_group_sizze_71674};
                            int64_t time_start_80138 = 0, time_end_80139 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.scan_stage3_71680",
                                        global_work_sizze_80137[0],
                                        local_work_sizze_80141[0], (int) 0);
                                time_start_80138 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainziscan_stage3_71680,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_80137,
                                                                            local_work_sizze_80141,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainziscan_stage3_71680_runs,
                                                                                                                      &ctx->mainziscan_stage3_71680_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_80139 = get_wall_time();
                                
                                long time_diff_80140 = time_end_80139 -
                                     time_start_80138;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.scan_stage3_71680",
                                        time_diff_80140);
                            }
                        }
                    }
                    
                    struct memblock_device mem_77612;
                    
                    mem_77612.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77612, bytes_77611,
                                              "mem_77612")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f32(ctx, mem_77612, m_65343 *
                                                      n_65344, 0.0F) != 0) {
                        if (memblock_unref_device(ctx, &mem_77612,
                                                  "mem_77612") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77608,
                                                  "mem_77608") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77819,
                                                  "ext_mem_77819") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77820,
                                                  "ext_mem_77820") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77616;
                    
                    mem_77616.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77616, bytes_77607,
                                              "mem_77616")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_i64(ctx, mem_77616, m_65343 *
                                                      n_65344, (int64_t) -1) !=
                        0) {
                        if (memblock_unref_device(ctx, &mem_77616,
                                                  "mem_77616") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77612,
                                                  "mem_77612") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77608,
                                                  "mem_77608") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77819,
                                                  "ext_mem_77819") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77820,
                                                  "ext_mem_77820") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77821,
                                                  "ext_mem_77821") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77822,
                                                  "ext_mem_77822") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77823,
                                                  "ext_mem_77823") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77824,
                                                  "ext_mem_77824") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77995,
                                                  "ext_mem_77995") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &ext_mem_77996,
                                                  "ext_mem_77996") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_out_78270,
                                                  "mem_out_78270") != 0)
                            return 1;
                        err = 1;
                        goto cleanup;
                    }
                    
                    int64_t segmap_usable_groups_71728 =
                            sdiv_up64(nest_sizze_71673,
                                      segmap_group_sizze_71727);
                    
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71733,
                                                            1, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71733,
                                                            2, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71733,
                                                            3,
                                                            sizeof(Y_mem_76976.mem),
                                                            &Y_mem_76976.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71733,
                                                            4,
                                                            sizeof(mem_77608.mem),
                                                            &mem_77608.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71733,
                                                            5,
                                                            sizeof(mem_77612.mem),
                                                            &mem_77612.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71733,
                                                            6,
                                                            sizeof(mem_77616.mem),
                                                            &mem_77616.mem));
                    if (1 * ((size_t) segmap_usable_groups_71728 *
                             (size_t) segmap_group_sizze_71727) != 0) {
                        const size_t global_work_sizze_80142[1] =
                                     {(size_t) segmap_usable_groups_71728 *
                                     (size_t) segmap_group_sizze_71727};
                        const size_t local_work_sizze_80146[1] =
                                     {(size_t) segmap_group_sizze_71727};
                        int64_t time_start_80143 = 0, time_end_80144 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segmap_71733",
                                    global_work_sizze_80142[0],
                                    local_work_sizze_80146[0], (int) 0);
                            time_start_80143 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_71733,
                                                                        1, NULL,
                                                                        global_work_sizze_80142,
                                                                        local_work_sizze_80146,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_71733_runs,
                                                                                                                  &ctx->mainzisegmap_71733_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_80144 = get_wall_time();
                            
                            long time_diff_80145 = time_end_80144 -
                                 time_start_80143;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_71733", time_diff_80145);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    int64_t segmap_usable_groups_71748 =
                            sdiv_up64(nest_sizze_71673,
                                      segmap_group_sizze_71747);
                    struct memblock_device mem_77622;
                    
                    mem_77622.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77622, bytes_77607,
                                              "mem_77622")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71752,
                                                            1, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71752,
                                                            2, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71752,
                                                            3,
                                                            sizeof(mem_77616.mem),
                                                            &mem_77616.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71752,
                                                            4,
                                                            sizeof(mem_77622.mem),
                                                            &mem_77622.mem));
                    if (1 * ((size_t) segmap_usable_groups_71748 *
                             (size_t) segmap_group_sizze_71747) != 0) {
                        const size_t global_work_sizze_80147[1] =
                                     {(size_t) segmap_usable_groups_71748 *
                                     (size_t) segmap_group_sizze_71747};
                        const size_t local_work_sizze_80151[1] =
                                     {(size_t) segmap_group_sizze_71747};
                        int64_t time_start_80148 = 0, time_end_80149 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segmap_71752",
                                    global_work_sizze_80147[0],
                                    local_work_sizze_80151[0], (int) 0);
                            time_start_80148 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_71752,
                                                                        1, NULL,
                                                                        global_work_sizze_80147,
                                                                        local_work_sizze_80151,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_71752_runs,
                                                                                                                  &ctx->mainzisegmap_71752_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_80149 = get_wall_time();
                            
                            long time_diff_80150 = time_end_80149 -
                                 time_start_80148;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_71752", time_diff_80150);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    int64_t segmap_usable_groups_71758 = sdiv_up64(m_65343,
                                                                   segmap_group_sizze_71757);
                    struct memblock_device mem_77626;
                    
                    mem_77626.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77626, bytes_77625,
                                              "mem_77626")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77629;
                    
                    mem_77629.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77629, bytes_77625,
                                              "mem_77629")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77632;
                    
                    mem_77632.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77632, bytes_77625,
                                              "mem_77632")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_77635;
                    
                    mem_77635.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77635, bytes_77634,
                                              "mem_77635")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71764,
                                                            1, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71764,
                                                            2, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71764,
                                                            3, sizeof(q_65346),
                                                            &q_65346));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71764,
                                                            4, sizeof(i_65358),
                                                            &i_65358));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71764,
                                                            5,
                                                            sizeof(min_res_65364),
                                                            &min_res_65364));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71764,
                                                            6,
                                                            sizeof(i64_res_65370),
                                                            &i64_res_65370));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71764,
                                                            7,
                                                            sizeof(mem_77608.mem),
                                                            &mem_77608.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71764,
                                                            8,
                                                            sizeof(mem_77626.mem),
                                                            &mem_77626.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71764,
                                                            9,
                                                            sizeof(mem_77629.mem),
                                                            &mem_77629.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71764,
                                                            10,
                                                            sizeof(mem_77632.mem),
                                                            &mem_77632.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71764,
                                                            11,
                                                            sizeof(mem_77635.mem),
                                                            &mem_77635.mem));
                    if (1 * ((size_t) segmap_usable_groups_71758 *
                             (size_t) segmap_group_sizze_71757) != 0) {
                        const size_t global_work_sizze_80152[1] =
                                     {(size_t) segmap_usable_groups_71758 *
                                     (size_t) segmap_group_sizze_71757};
                        const size_t local_work_sizze_80156[1] =
                                     {(size_t) segmap_group_sizze_71757};
                        int64_t time_start_80153 = 0, time_end_80154 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segmap_71764",
                                    global_work_sizze_80152[0],
                                    local_work_sizze_80156[0], (int) 0);
                            time_start_80153 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_71764,
                                                                        1, NULL,
                                                                        global_work_sizze_80152,
                                                                        local_work_sizze_80156,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_71764_runs,
                                                                                                                  &ctx->mainzisegmap_71764_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_80154 = get_wall_time();
                            
                            long time_diff_80155 = time_end_80154 -
                                 time_start_80153;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_71764", time_diff_80155);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    int64_t segmap_usable_groups_71780 =
                            sdiv_up64(nest_sizze_71778,
                                      segmap_group_sizze_71779);
                    struct memblock_device mem_77640;
                    
                    mem_77640.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_77640, bytes_77639,
                                              "mem_77640")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71784,
                                                            1, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71784,
                                                            2, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71784,
                                                            3, sizeof(q_65346),
                                                            &q_65346));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71784,
                                                            4, sizeof(i_65358),
                                                            &i_65358));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71784,
                                                            5,
                                                            sizeof(mem_77608.mem),
                                                            &mem_77608.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_71784,
                                                            6,
                                                            sizeof(mem_77640.mem),
                                                            &mem_77640.mem));
                    if (1 * ((size_t) segmap_usable_groups_71780 *
                             (size_t) segmap_group_sizze_71779) != 0) {
                        const size_t global_work_sizze_80157[1] =
                                     {(size_t) segmap_usable_groups_71780 *
                                     (size_t) segmap_group_sizze_71779};
                        const size_t local_work_sizze_80161[1] =
                                     {(size_t) segmap_group_sizze_71779};
                        int64_t time_start_80158 = 0, time_end_80159 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.segmap_71784",
                                    global_work_sizze_80157[0],
                                    local_work_sizze_80161[0], (int) 0);
                            time_start_80158 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_71784,
                                                                        1, NULL,
                                                                        global_work_sizze_80157,
                                                                        local_work_sizze_80161,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_71784_runs,
                                                                                                                  &ctx->mainzisegmap_71784_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_80159 = get_wall_time();
                            
                            long time_diff_80160 = time_end_80159 -
                                 time_start_80158;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_71784", time_diff_80160);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    
                    struct memblock_device ext_mem_77808;
                    
                    ext_mem_77808.references = NULL;
                    
                    struct memblock_device ext_mem_77807;
                    
                    ext_mem_77807.references = NULL;
                    
                    int32_t local_memory_capacity_79516;
                    
                    local_memory_capacity_79516 = ctx->opencl.max_local_memory;
                    if (sle64(bytes_77679 + srem64((int64_t) 8 -
                                                   srem64(bytes_77679,
                                                          (int64_t) 8),
                                                   (int64_t) 8),
                              sext_i32_i64(local_memory_capacity_79516)) &&
                        suff_outer_par_71796) {
                        int64_t num_groups_x_75980 = sdiv_up64(m_65343,
                                                               tile_sizze_75978);
                        int64_t num_groups_y_75981 = sdiv_up64(n_m_65352,
                                                               tile_sizze_75978);
                        int64_t num_groups_top_75982 = num_groups_x_75980 *
                                num_groups_y_75981;
                        int64_t num_whole_tiles_76113 = squot64(q_65346,
                                                                tile_sizze_75978);
                        int64_t residual_input_76413 = srem64(q_65346,
                                                              tile_sizze_75978);
                        bool cond_76414 = residual_input_76413 == (int64_t) 0;
                        struct memblock_device mem_77738;
                        
                        mem_77738.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77738, bytes_76979,
                                                  "mem_77738")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77742;
                        
                        mem_77742.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77742, bytes_76979,
                                                  "mem_77742")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                1,
                                                                sizeof(ctx->failure_is_an_option),
                                                                &ctx->failure_is_an_option));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                3,
                                                                (size_t) bytes_77679,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                4,
                                                                sizeof(m_65343),
                                                                &m_65343));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                5,
                                                                sizeof(n_65344),
                                                                &n_65344));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                6,
                                                                sizeof(q_65346),
                                                                &q_65346));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                7,
                                                                sizeof(jump_65348),
                                                                &jump_65348));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                8,
                                                                sizeof(n_m_65352),
                                                                &n_m_65352));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                9,
                                                                sizeof(i_65358),
                                                                &i_65358));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                10,
                                                                sizeof(x_65359),
                                                                &x_65359));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                11,
                                                                sizeof(min_res_65364),
                                                                &min_res_65364));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                12,
                                                                sizeof(loop_cond_65369),
                                                                &loop_cond_65369));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                13,
                                                                sizeof(num_groups_x_75980),
                                                                &num_groups_x_75980));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                14,
                                                                sizeof(num_groups_y_75981),
                                                                &num_groups_y_75981));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                15,
                                                                sizeof(num_whole_tiles_76113),
                                                                &num_whole_tiles_76113));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                16,
                                                                sizeof(residual_input_76413),
                                                                &residual_input_76413));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                17,
                                                                sizeof(cond_76414),
                                                                &cond_76414));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                18,
                                                                sizeof(mem_77608.mem),
                                                                &mem_77608.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                19,
                                                                sizeof(mem_77612.mem),
                                                                &mem_77612.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                20,
                                                                sizeof(mem_77616.mem),
                                                                &mem_77616.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                21,
                                                                sizeof(mem_77622.mem),
                                                                &mem_77622.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                22,
                                                                sizeof(mem_77626.mem),
                                                                &mem_77626.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                23,
                                                                sizeof(mem_77629.mem),
                                                                &mem_77629.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                24,
                                                                sizeof(mem_77632.mem),
                                                                &mem_77632.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                25,
                                                                sizeof(mem_77635.mem),
                                                                &mem_77635.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                26,
                                                                sizeof(mem_77640.mem),
                                                                &mem_77640.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                27,
                                                                sizeof(mem_77738.mem),
                                                                &mem_77738.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_75983,
                                                                28,
                                                                sizeof(mem_77742.mem),
                                                                &mem_77742.mem));
                        if (1 * ((size_t) num_groups_top_75982 *
                                 (size_t) group_sizze_75979) != 0) {
                            const size_t global_work_sizze_80162[1] =
                                         {(size_t) num_groups_top_75982 *
                                         (size_t) group_sizze_75979};
                            const size_t local_work_sizze_80166[1] =
                                         {(size_t) group_sizze_75979};
                            int64_t time_start_80163 = 0, time_end_80164 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_intragroup_75983",
                                        global_work_sizze_80162[0],
                                        local_work_sizze_80166[0], (int) (0 +
                                                                          bytes_77679));
                                time_start_80163 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_intragroup_75983,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_80162,
                                                                            local_work_sizze_80166,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_intragroup_75983_runs,
                                                                                                                      &ctx->mainzisegmap_intragroup_75983_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_80164 = get_wall_time();
                                
                                long time_diff_80165 = time_end_80164 -
                                     time_start_80163;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_75983",
                                        time_diff_80165);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &ext_mem_77808, &mem_77738,
                                                "mem_77738") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_77807, &mem_77742,
                                                "mem_77742") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77742,
                                                  "mem_77742") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77738,
                                                  "mem_77738") != 0)
                            return 1;
                    } else {
                        int64_t segmap_usable_groups_72011 =
                                sdiv_up64(binop_x_76977,
                                          segmap_group_sizze_72010);
                        struct memblock_device mem_77747;
                        
                        mem_77747.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77747, bytes_77746,
                                                  "mem_77747")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77751;
                        
                        mem_77751.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77751, bytes_77746,
                                                  "mem_77751")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77755;
                        
                        mem_77755.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77755, bytes_76979,
                                                  "mem_77755")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72017,
                                                                1,
                                                                sizeof(ctx->failure_is_an_option),
                                                                &ctx->failure_is_an_option));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72017,
                                                                3,
                                                                sizeof(m_65343),
                                                                &m_65343));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72017,
                                                                4,
                                                                sizeof(n_65344),
                                                                &n_65344));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72017,
                                                                5,
                                                                sizeof(jump_65348),
                                                                &jump_65348));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72017,
                                                                6,
                                                                sizeof(n_m_65352),
                                                                &n_m_65352));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72017,
                                                                7,
                                                                sizeof(i_65358),
                                                                &i_65358));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72017,
                                                                8,
                                                                sizeof(x_65359),
                                                                &x_65359));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72017,
                                                                9,
                                                                sizeof(min_res_65364),
                                                                &min_res_65364));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72017,
                                                                10,
                                                                sizeof(loop_cond_65369),
                                                                &loop_cond_65369));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72017,
                                                                11,
                                                                sizeof(mem_77616.mem),
                                                                &mem_77616.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72017,
                                                                12,
                                                                sizeof(mem_77622.mem),
                                                                &mem_77622.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72017,
                                                                13,
                                                                sizeof(mem_77626.mem),
                                                                &mem_77626.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72017,
                                                                14,
                                                                sizeof(mem_77629.mem),
                                                                &mem_77629.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72017,
                                                                15,
                                                                sizeof(mem_77632.mem),
                                                                &mem_77632.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72017,
                                                                16,
                                                                sizeof(mem_77635.mem),
                                                                &mem_77635.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72017,
                                                                17,
                                                                sizeof(mem_77747.mem),
                                                                &mem_77747.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72017,
                                                                18,
                                                                sizeof(mem_77751.mem),
                                                                &mem_77751.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72017,
                                                                19,
                                                                sizeof(mem_77755.mem),
                                                                &mem_77755.mem));
                        if (1 * ((size_t) segmap_usable_groups_72011 *
                                 (size_t) segmap_group_sizze_72010) != 0) {
                            const size_t global_work_sizze_80167[1] =
                                         {(size_t) segmap_usable_groups_72011 *
                                         (size_t) segmap_group_sizze_72010};
                            const size_t local_work_sizze_80171[1] =
                                         {(size_t) segmap_group_sizze_72010};
                            int64_t time_start_80168 = 0, time_end_80169 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_72017",
                                        global_work_sizze_80167[0],
                                        local_work_sizze_80171[0], (int) 0);
                                time_start_80168 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_72017,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_80167,
                                                                            local_work_sizze_80171,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_72017_runs,
                                                                                                                      &ctx->mainzisegmap_72017_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_80169 = get_wall_time();
                                
                                long time_diff_80170 = time_end_80169 -
                                     time_start_80168;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_72017", time_diff_80170);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_77747,
                                                  "mem_77747") != 0)
                            return 1;
                        
                        struct memblock_device mem_77760;
                        
                        mem_77760.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77760, bytes_76979,
                                                  "mem_77760")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77764;
                        
                        mem_77764.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77764, bytes_76979,
                                                  "mem_77764")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77768;
                        
                        mem_77768.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77768, bytes_76979,
                                                  "mem_77768")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77772;
                        
                        mem_77772.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77772, bytes_76979,
                                                  "mem_77772")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77776;
                        
                        mem_77776.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77776, bytes_76979,
                                                  "mem_77776")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (slt64(q_65346 * (int64_t) 2,
                                  segred_group_sizze_72114)) {
                            int64_t segment_sizze_nonzzero_79292 =
                                    smax64((int64_t) 1, q_65346);
                            int64_t num_threads_79293 = num_groups_72115 *
                                    segred_group_sizze_72114;
                            
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                        (long long) (m_65343 * n_m_65352),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                        (long long) q_65346, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "segments_per_group",
                                        (long long) squot64(segred_group_sizze_72114,
                                                            segment_sizze_nonzzero_79292),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "required_groups",
                                        (long long) sext_i64_i32(sdiv_up64(m_65343 *
                                                                           n_m_65352,
                                                                           squot64(segred_group_sizze_72114,
                                                                                   segment_sizze_nonzzero_79292))),
                                        '\n');
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    1,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_72114),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    2,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_72114),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    3,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_72114),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    4,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_72114),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    5,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_72114),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    6,
                                                                    sizeof(m_65343),
                                                                    &m_65343));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    7,
                                                                    sizeof(n_65344),
                                                                    &n_65344));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    8,
                                                                    sizeof(q_65346),
                                                                    &q_65346));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    9,
                                                                    sizeof(jump_65348),
                                                                    &jump_65348));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    10,
                                                                    sizeof(n_m_65352),
                                                                    &n_m_65352));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    11,
                                                                    sizeof(i_65358),
                                                                    &i_65358));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    12,
                                                                    sizeof(num_groups_72115),
                                                                    &num_groups_72115));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    13,
                                                                    sizeof(segment_sizze_nonzzero_79292),
                                                                    &segment_sizze_nonzzero_79292));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    14,
                                                                    sizeof(mem_77608.mem),
                                                                    &mem_77608.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    15,
                                                                    sizeof(mem_77616.mem),
                                                                    &mem_77616.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    16,
                                                                    sizeof(mem_77640.mem),
                                                                    &mem_77640.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    17,
                                                                    sizeof(mem_77751.mem),
                                                                    &mem_77751.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    18,
                                                                    sizeof(mem_77755.mem),
                                                                    &mem_77755.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    19,
                                                                    sizeof(mem_77760.mem),
                                                                    &mem_77760.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    20,
                                                                    sizeof(mem_77764.mem),
                                                                    &mem_77764.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    21,
                                                                    sizeof(mem_77768.mem),
                                                                    &mem_77768.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    22,
                                                                    sizeof(mem_77772.mem),
                                                                    &mem_77772.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72125,
                                                                    23,
                                                                    sizeof(mem_77776.mem),
                                                                    &mem_77776.mem));
                            if (1 * ((size_t) num_groups_72115 *
                                     (size_t) segred_group_sizze_72114) != 0) {
                                const size_t global_work_sizze_80172[1] =
                                             {(size_t) num_groups_72115 *
                                             (size_t) segred_group_sizze_72114};
                                const size_t local_work_sizze_80176[1] =
                                             {(size_t) segred_group_sizze_72114};
                                int64_t time_start_80173 = 0, time_end_80174 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segred_small_72125",
                                            global_work_sizze_80172[0],
                                            local_work_sizze_80176[0],
                                            (int) (0 + (int64_t) 4 *
                                                   segred_group_sizze_72114 +
                                                   (int64_t) 4 *
                                                   segred_group_sizze_72114 +
                                                   (int64_t) 4 *
                                                   segred_group_sizze_72114 +
                                                   (int64_t) 4 *
                                                   segred_group_sizze_72114 +
                                                   (int64_t) 4 *
                                                   segred_group_sizze_72114));
                                    time_start_80173 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegred_small_72125,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_80172,
                                                                                local_work_sizze_80176,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegred_small_72125_runs,
                                                                                                                          &ctx->mainzisegred_small_72125_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_80174 = get_wall_time();
                                    
                                    long time_diff_80175 = time_end_80174 -
                                         time_start_80173;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segred_small_72125",
                                            time_diff_80175);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                        } else {
                            int64_t groups_per_segment_79345 =
                                    sdiv_up64(num_groups_72115,
                                              smax64((int64_t) 1, m_65343 *
                                                     n_m_65352));
                            int64_t elements_per_thread_79346 =
                                    sdiv_up64(q_65346,
                                              segred_group_sizze_72114 *
                                              groups_per_segment_79345);
                            int64_t virt_num_groups_79347 =
                                    groups_per_segment_79345 * (m_65343 *
                                                                n_m_65352);
                            int64_t num_threads_79348 = num_groups_72115 *
                                    segred_group_sizze_72114;
                            int64_t threads_per_segment_79349 =
                                    groups_per_segment_79345 *
                                    segred_group_sizze_72114;
                            
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                        (long long) (m_65343 * n_m_65352),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                        (long long) q_65346, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "virt_num_groups",
                                        (long long) virt_num_groups_79347,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                        (long long) num_groups_72115, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "group_size",
                                        (long long) segred_group_sizze_72114,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "elems_per_thread",
                                        (long long) elements_per_thread_79346,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "groups_per_segment",
                                        (long long) groups_per_segment_79345,
                                        '\n');
                            
                            struct memblock_device segred_tmp_mem_79350;
                            
                            segred_tmp_mem_79350.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_79350,
                                                      (int64_t) 4 *
                                                      virt_num_groups_79347,
                                                      "segred_tmp_mem_79350")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device segred_tmp_mem_79352;
                            
                            segred_tmp_mem_79352.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_79352,
                                                      (int64_t) 4 *
                                                      virt_num_groups_79347,
                                                      "segred_tmp_mem_79352")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device segred_tmp_mem_79354;
                            
                            segred_tmp_mem_79354.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_79354,
                                                      (int64_t) 4 *
                                                      virt_num_groups_79347,
                                                      "segred_tmp_mem_79354")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device segred_tmp_mem_79356;
                            
                            segred_tmp_mem_79356.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_79356,
                                                      (int64_t) 4 *
                                                      virt_num_groups_79347,
                                                      "segred_tmp_mem_79356")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device segred_tmp_mem_79358;
                            
                            segred_tmp_mem_79358.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_79358,
                                                      (int64_t) 4 *
                                                      virt_num_groups_79347,
                                                      "segred_tmp_mem_79358")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mainzicounter_mem_79360 =
                                                   ctx->mainzicounter_mem_79360;
                            
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    1,
                                                                    (size_t) 1,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    2,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_72114),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    3,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_72114),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    4,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_72114),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    5,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_72114),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    6,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_72114),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    7,
                                                                    sizeof(m_65343),
                                                                    &m_65343));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    8,
                                                                    sizeof(n_65344),
                                                                    &n_65344));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    9,
                                                                    sizeof(q_65346),
                                                                    &q_65346));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    10,
                                                                    sizeof(jump_65348),
                                                                    &jump_65348));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    11,
                                                                    sizeof(n_m_65352),
                                                                    &n_m_65352));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    12,
                                                                    sizeof(i_65358),
                                                                    &i_65358));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    13,
                                                                    sizeof(num_groups_72115),
                                                                    &num_groups_72115));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    14,
                                                                    sizeof(groups_per_segment_79345),
                                                                    &groups_per_segment_79345));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    15,
                                                                    sizeof(elements_per_thread_79346),
                                                                    &elements_per_thread_79346));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    16,
                                                                    sizeof(virt_num_groups_79347),
                                                                    &virt_num_groups_79347));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    17,
                                                                    sizeof(threads_per_segment_79349),
                                                                    &threads_per_segment_79349));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    18,
                                                                    sizeof(mem_77608.mem),
                                                                    &mem_77608.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    19,
                                                                    sizeof(mem_77616.mem),
                                                                    &mem_77616.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    20,
                                                                    sizeof(mem_77640.mem),
                                                                    &mem_77640.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    21,
                                                                    sizeof(mem_77751.mem),
                                                                    &mem_77751.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    22,
                                                                    sizeof(mem_77755.mem),
                                                                    &mem_77755.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    23,
                                                                    sizeof(mem_77760.mem),
                                                                    &mem_77760.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    24,
                                                                    sizeof(mem_77764.mem),
                                                                    &mem_77764.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    25,
                                                                    sizeof(mem_77768.mem),
                                                                    &mem_77768.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    26,
                                                                    sizeof(mem_77772.mem),
                                                                    &mem_77772.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    27,
                                                                    sizeof(mem_77776.mem),
                                                                    &mem_77776.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    28,
                                                                    sizeof(segred_tmp_mem_79350.mem),
                                                                    &segred_tmp_mem_79350.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    29,
                                                                    sizeof(segred_tmp_mem_79352.mem),
                                                                    &segred_tmp_mem_79352.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    30,
                                                                    sizeof(segred_tmp_mem_79354.mem),
                                                                    &segred_tmp_mem_79354.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    31,
                                                                    sizeof(segred_tmp_mem_79356.mem),
                                                                    &segred_tmp_mem_79356.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    32,
                                                                    sizeof(segred_tmp_mem_79358.mem),
                                                                    &segred_tmp_mem_79358.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72125,
                                                                    33,
                                                                    sizeof(mainzicounter_mem_79360.mem),
                                                                    &mainzicounter_mem_79360.mem));
                            if (1 * ((size_t) num_groups_72115 *
                                     (size_t) segred_group_sizze_72114) != 0) {
                                const size_t global_work_sizze_80178[1] =
                                             {(size_t) num_groups_72115 *
                                             (size_t) segred_group_sizze_72114};
                                const size_t local_work_sizze_80182[1] =
                                             {(size_t) segred_group_sizze_72114};
                                int64_t time_start_80179 = 0, time_end_80180 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segred_large_72125",
                                            global_work_sizze_80178[0],
                                            local_work_sizze_80182[0],
                                            (int) (0 + 1 + (int64_t) 4 *
                                                   segred_group_sizze_72114 +
                                                   (int64_t) 4 *
                                                   segred_group_sizze_72114 +
                                                   (int64_t) 4 *
                                                   segred_group_sizze_72114 +
                                                   (int64_t) 4 *
                                                   segred_group_sizze_72114 +
                                                   (int64_t) 4 *
                                                   segred_group_sizze_72114));
                                    time_start_80179 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegred_large_72125,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_80178,
                                                                                local_work_sizze_80182,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegred_large_72125_runs,
                                                                                                                          &ctx->mainzisegred_large_72125_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_80180 = get_wall_time();
                                    
                                    long time_diff_80181 = time_end_80180 -
                                         time_start_80179;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segred_large_72125",
                                            time_diff_80181);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_79358,
                                                      "segred_tmp_mem_79358") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_79356,
                                                      "segred_tmp_mem_79356") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_79354,
                                                      "segred_tmp_mem_79354") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_79352,
                                                      "segred_tmp_mem_79352") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_79350,
                                                      "segred_tmp_mem_79350") !=
                                0)
                                return 1;
                        }
                        
                        int64_t segmap_usable_groups_72174 =
                                sdiv_up64(binop_x_76977,
                                          segmap_group_sizze_72173);
                        struct memblock_device mem_77781;
                        
                        mem_77781.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77781, bytes_76979,
                                                  "mem_77781")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77785;
                        
                        mem_77785.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77785, bytes_76979,
                                                  "mem_77785")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77789;
                        
                        mem_77789.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77789, bytes_76979,
                                                  "mem_77789")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77793;
                        
                        mem_77793.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77793, bytes_76979,
                                                  "mem_77793")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77797;
                        
                        mem_77797.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77797, bytes_76979,
                                                  "mem_77797")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72182,
                                                                1,
                                                                sizeof(m_65343),
                                                                &m_65343));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72182,
                                                                2,
                                                                sizeof(n_m_65352),
                                                                &n_m_65352));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72182,
                                                                3,
                                                                sizeof(mem_77760.mem),
                                                                &mem_77760.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72182,
                                                                4,
                                                                sizeof(mem_77764.mem),
                                                                &mem_77764.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72182,
                                                                5,
                                                                sizeof(mem_77768.mem),
                                                                &mem_77768.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72182,
                                                                6,
                                                                sizeof(mem_77772.mem),
                                                                &mem_77772.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72182,
                                                                7,
                                                                sizeof(mem_77776.mem),
                                                                &mem_77776.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72182,
                                                                8,
                                                                sizeof(mem_77781.mem),
                                                                &mem_77781.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72182,
                                                                9,
                                                                sizeof(mem_77785.mem),
                                                                &mem_77785.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72182,
                                                                10,
                                                                sizeof(mem_77789.mem),
                                                                &mem_77789.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72182,
                                                                11,
                                                                sizeof(mem_77793.mem),
                                                                &mem_77793.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72182,
                                                                12,
                                                                sizeof(mem_77797.mem),
                                                                &mem_77797.mem));
                        if (1 * ((size_t) segmap_usable_groups_72174 *
                                 (size_t) segmap_group_sizze_72173) != 0) {
                            const size_t global_work_sizze_80183[1] =
                                         {(size_t) segmap_usable_groups_72174 *
                                         (size_t) segmap_group_sizze_72173};
                            const size_t local_work_sizze_80187[1] =
                                         {(size_t) segmap_group_sizze_72173};
                            int64_t time_start_80184 = 0, time_end_80185 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                        "main.segmap_72182",
                                        global_work_sizze_80183[0],
                                        local_work_sizze_80187[0], (int) 0);
                                time_start_80184 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_72182,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_80183,
                                                                            local_work_sizze_80187,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_72182_runs,
                                                                                                                      &ctx->mainzisegmap_72182_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_80185 = get_wall_time();
                                
                                long time_diff_80186 = time_end_80185 -
                                     time_start_80184;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_72182", time_diff_80186);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_77760,
                                                  "mem_77760") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77764,
                                                  "mem_77764") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77768,
                                                  "mem_77768") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77772,
                                                  "mem_77772") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77776,
                                                  "mem_77776") != 0)
                            return 1;
                        
                        struct memblock_device mem_77802;
                        
                        mem_77802.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77802, bytes_76979,
                                                  "mem_77802")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_77806;
                        
                        mem_77806.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_77806, bytes_76979,
                                                  "mem_77806")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (slt64(q_65346 * (int64_t) 2,
                                  segred_group_sizze_72216)) {
                            int64_t segment_sizze_nonzzero_79430 =
                                    smax64((int64_t) 1, q_65346);
                            int64_t num_threads_79431 = num_groups_72217 *
                                    segred_group_sizze_72216;
                            
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegRed-small");
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                        (long long) (m_65343 * n_m_65352),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                        (long long) q_65346, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "segments_per_group",
                                        (long long) squot64(segred_group_sizze_72216,
                                                            segment_sizze_nonzzero_79430),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "required_groups",
                                        (long long) sext_i64_i32(sdiv_up64(m_65343 *
                                                                           n_m_65352,
                                                                           squot64(segred_group_sizze_72216,
                                                                                   segment_sizze_nonzzero_79430))),
                                        '\n');
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    1,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_72216),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    2,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_72216),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    3,
                                                                    sizeof(m_65343),
                                                                    &m_65343));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    4,
                                                                    sizeof(n_65344),
                                                                    &n_65344));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    5,
                                                                    sizeof(q_65346),
                                                                    &q_65346));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    6,
                                                                    sizeof(jump_65348),
                                                                    &jump_65348));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    7,
                                                                    sizeof(n_m_65352),
                                                                    &n_m_65352));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    8,
                                                                    sizeof(i_65358),
                                                                    &i_65358));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    9,
                                                                    sizeof(num_groups_72217),
                                                                    &num_groups_72217));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    10,
                                                                    sizeof(segment_sizze_nonzzero_79430),
                                                                    &segment_sizze_nonzzero_79430));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    11,
                                                                    sizeof(mem_77608.mem),
                                                                    &mem_77608.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    12,
                                                                    sizeof(mem_77612.mem),
                                                                    &mem_77612.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    13,
                                                                    sizeof(mem_77616.mem),
                                                                    &mem_77616.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    14,
                                                                    sizeof(mem_77640.mem),
                                                                    &mem_77640.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    15,
                                                                    sizeof(mem_77751.mem),
                                                                    &mem_77751.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    16,
                                                                    sizeof(mem_77755.mem),
                                                                    &mem_77755.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    17,
                                                                    sizeof(mem_77781.mem),
                                                                    &mem_77781.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    18,
                                                                    sizeof(mem_77785.mem),
                                                                    &mem_77785.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    19,
                                                                    sizeof(mem_77789.mem),
                                                                    &mem_77789.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    20,
                                                                    sizeof(mem_77793.mem),
                                                                    &mem_77793.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    21,
                                                                    sizeof(mem_77797.mem),
                                                                    &mem_77797.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    22,
                                                                    sizeof(mem_77802.mem),
                                                                    &mem_77802.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_72224,
                                                                    23,
                                                                    sizeof(mem_77806.mem),
                                                                    &mem_77806.mem));
                            if (1 * ((size_t) num_groups_72217 *
                                     (size_t) segred_group_sizze_72216) != 0) {
                                const size_t global_work_sizze_80188[1] =
                                             {(size_t) num_groups_72217 *
                                             (size_t) segred_group_sizze_72216};
                                const size_t local_work_sizze_80192[1] =
                                             {(size_t) segred_group_sizze_72216};
                                int64_t time_start_80189 = 0, time_end_80190 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segred_small_72224",
                                            global_work_sizze_80188[0],
                                            local_work_sizze_80192[0],
                                            (int) (0 + (int64_t) 4 *
                                                   segred_group_sizze_72216 +
                                                   (int64_t) 4 *
                                                   segred_group_sizze_72216));
                                    time_start_80189 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegred_small_72224,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_80188,
                                                                                local_work_sizze_80192,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegred_small_72224_runs,
                                                                                                                          &ctx->mainzisegred_small_72224_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_80190 = get_wall_time();
                                    
                                    long time_diff_80191 = time_end_80190 -
                                         time_start_80189;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segred_small_72224",
                                            time_diff_80191);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                        } else {
                            int64_t groups_per_segment_79465 =
                                    sdiv_up64(num_groups_72217,
                                              smax64((int64_t) 1, m_65343 *
                                                     n_m_65352));
                            int64_t elements_per_thread_79466 =
                                    sdiv_up64(q_65346,
                                              segred_group_sizze_72216 *
                                              groups_per_segment_79465);
                            int64_t virt_num_groups_79467 =
                                    groups_per_segment_79465 * (m_65343 *
                                                                n_m_65352);
                            int64_t num_threads_79468 = num_groups_72217 *
                                    segred_group_sizze_72216;
                            int64_t threads_per_segment_79469 =
                                    groups_per_segment_79465 *
                                    segred_group_sizze_72216;
                            
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegRed-large");
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_segments",
                                        (long long) (m_65343 * n_m_65352),
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                        (long long) q_65346, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "virt_num_groups",
                                        (long long) virt_num_groups_79467,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                        (long long) num_groups_72217, '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c", "group_size",
                                        (long long) segred_group_sizze_72216,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "elems_per_thread",
                                        (long long) elements_per_thread_79466,
                                        '\n');
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s: %llu%c",
                                        "groups_per_segment",
                                        (long long) groups_per_segment_79465,
                                        '\n');
                            
                            struct memblock_device segred_tmp_mem_79470;
                            
                            segred_tmp_mem_79470.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_79470,
                                                      (int64_t) 4 *
                                                      virt_num_groups_79467,
                                                      "segred_tmp_mem_79470")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device segred_tmp_mem_79472;
                            
                            segred_tmp_mem_79472.references = NULL;
                            if (memblock_alloc_device(ctx,
                                                      &segred_tmp_mem_79472,
                                                      (int64_t) 4 *
                                                      virt_num_groups_79467,
                                                      "segred_tmp_mem_79472")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mainzicounter_mem_79474 =
                                                   ctx->mainzicounter_mem_79474;
                            
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    1,
                                                                    (size_t) 1,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    2,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_72216),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    3,
                                                                    (size_t) ((int64_t) 4 *
                                                                              segred_group_sizze_72216),
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    4,
                                                                    sizeof(m_65343),
                                                                    &m_65343));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    5,
                                                                    sizeof(n_65344),
                                                                    &n_65344));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    6,
                                                                    sizeof(q_65346),
                                                                    &q_65346));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    7,
                                                                    sizeof(jump_65348),
                                                                    &jump_65348));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    8,
                                                                    sizeof(n_m_65352),
                                                                    &n_m_65352));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    9,
                                                                    sizeof(i_65358),
                                                                    &i_65358));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    10,
                                                                    sizeof(num_groups_72217),
                                                                    &num_groups_72217));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    11,
                                                                    sizeof(groups_per_segment_79465),
                                                                    &groups_per_segment_79465));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    12,
                                                                    sizeof(elements_per_thread_79466),
                                                                    &elements_per_thread_79466));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    13,
                                                                    sizeof(virt_num_groups_79467),
                                                                    &virt_num_groups_79467));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    14,
                                                                    sizeof(threads_per_segment_79469),
                                                                    &threads_per_segment_79469));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    15,
                                                                    sizeof(mem_77608.mem),
                                                                    &mem_77608.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    16,
                                                                    sizeof(mem_77612.mem),
                                                                    &mem_77612.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    17,
                                                                    sizeof(mem_77616.mem),
                                                                    &mem_77616.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    18,
                                                                    sizeof(mem_77640.mem),
                                                                    &mem_77640.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    19,
                                                                    sizeof(mem_77751.mem),
                                                                    &mem_77751.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    20,
                                                                    sizeof(mem_77755.mem),
                                                                    &mem_77755.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    21,
                                                                    sizeof(mem_77781.mem),
                                                                    &mem_77781.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    22,
                                                                    sizeof(mem_77785.mem),
                                                                    &mem_77785.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    23,
                                                                    sizeof(mem_77789.mem),
                                                                    &mem_77789.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    24,
                                                                    sizeof(mem_77793.mem),
                                                                    &mem_77793.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    25,
                                                                    sizeof(mem_77797.mem),
                                                                    &mem_77797.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    26,
                                                                    sizeof(mem_77802.mem),
                                                                    &mem_77802.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    27,
                                                                    sizeof(mem_77806.mem),
                                                                    &mem_77806.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    28,
                                                                    sizeof(segred_tmp_mem_79470.mem),
                                                                    &segred_tmp_mem_79470.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    29,
                                                                    sizeof(segred_tmp_mem_79472.mem),
                                                                    &segred_tmp_mem_79472.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_72224,
                                                                    30,
                                                                    sizeof(mainzicounter_mem_79474.mem),
                                                                    &mainzicounter_mem_79474.mem));
                            if (1 * ((size_t) num_groups_72217 *
                                     (size_t) segred_group_sizze_72216) != 0) {
                                const size_t global_work_sizze_80194[1] =
                                             {(size_t) num_groups_72217 *
                                             (size_t) segred_group_sizze_72216};
                                const size_t local_work_sizze_80198[1] =
                                             {(size_t) segred_group_sizze_72216};
                                int64_t time_start_80195 = 0, time_end_80196 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                            "main.segred_large_72224",
                                            global_work_sizze_80194[0],
                                            local_work_sizze_80198[0],
                                            (int) (0 + 1 + (int64_t) 4 *
                                                   segred_group_sizze_72216 +
                                                   (int64_t) 4 *
                                                   segred_group_sizze_72216));
                                    time_start_80195 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegred_large_72224,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_80194,
                                                                                local_work_sizze_80198,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegred_large_72224_runs,
                                                                                                                          &ctx->mainzisegred_large_72224_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_80196 = get_wall_time();
                                    
                                    long time_diff_80197 = time_end_80196 -
                                         time_start_80195;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segred_large_72224",
                                            time_diff_80197);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_79472,
                                                      "segred_tmp_mem_79472") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &segred_tmp_mem_79470,
                                                      "segred_tmp_mem_79470") !=
                                0)
                                return 1;
                        }
                        if (memblock_unref_device(ctx, &mem_77751,
                                                  "mem_77751") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77755,
                                                  "mem_77755") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77781,
                                                  "mem_77781") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77785,
                                                  "mem_77785") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77789,
                                                  "mem_77789") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77793,
                                                  "mem_77793") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77797,
                                                  "mem_77797") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_77808, &mem_77802,
                                                "mem_77802") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &ext_mem_77807, &mem_77806,
                                                "mem_77806") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77806,
                                                  "mem_77806") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77802,
                                                  "mem_77802") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77797,
                                                  "mem_77797") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77793,
                                                  "mem_77793") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77789,
                                                  "mem_77789") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77785,
                                                  "mem_77785") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77781,
                                                  "mem_77781") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77776,
                                                  "mem_77776") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77772,
                                                  "mem_77772") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77768,
                                                  "mem_77768") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77764,
                                                  "mem_77764") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77760,
                                                  "mem_77760") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77755,
                                                  "mem_77755") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77751,
                                                  "mem_77751") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_77747,
                                                  "mem_77747") != 0)
                            return 1;
                    }
                    if (memblock_unref_device(ctx, &mem_77608, "mem_77608") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77612, "mem_77612") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77616, "mem_77616") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77622, "mem_77622") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77626, "mem_77626") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77629, "mem_77629") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77632, "mem_77632") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77635, "mem_77635") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77640, "mem_77640") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_77820, &ext_mem_77808,
                                            "ext_mem_77808") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &ext_mem_77819, &ext_mem_77807,
                                            "ext_mem_77807") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77807,
                                              "ext_mem_77807") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77808,
                                              "ext_mem_77808") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77640, "mem_77640") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77635, "mem_77635") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77632, "mem_77632") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77629, "mem_77629") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77626, "mem_77626") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77622, "mem_77622") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77616, "mem_77616") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77612, "mem_77612") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77608, "mem_77608") !=
                        0)
                        return 1;
                }
                if (memblock_set_device(ctx, &ext_mem_77822, &ext_mem_77820,
                                        "ext_mem_77820") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_77821, &ext_mem_77819,
                                        "ext_mem_77819") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77819,
                                          "ext_mem_77819") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77820,
                                          "ext_mem_77820") != 0)
                    return 1;
            }
            if (memblock_set_device(ctx, &ext_mem_77824, &ext_mem_77822,
                                    "ext_mem_77822") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_77823, &ext_mem_77821,
                                    "ext_mem_77821") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_77821, "ext_mem_77821") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_77822, "ext_mem_77822") !=
                0)
                return 1;
        }
        if (memblock_set_device(ctx, &ext_mem_77996, &ext_mem_77824,
                                "ext_mem_77824") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_77995, &ext_mem_77823,
                                "ext_mem_77823") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_77823, "ext_mem_77823") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_77824, "ext_mem_77824") != 0)
            return 1;
    } else {
        bool match_lit_66002 = (int64_t) 0 == degree_65347;
        int64_t binop_x_77825 = m_65343 * n_m_65352;
        int64_t binop_y_77826 = (int64_t) 4 * binop_x_77825;
        int64_t bytes_77827 = smax64((int64_t) 0, binop_y_77826);
        int64_t binop_x_77830 = m_65343 * n_65344;
        int64_t binop_y_77831 = (int64_t) 8 * binop_x_77830;
        int64_t bytes_77832 = smax64((int64_t) 0, binop_y_77831);
        int64_t binop_y_77835 = (int64_t) 4 * binop_x_77830;
        int64_t bytes_77836 = smax64((int64_t) 0, binop_y_77835);
        int64_t binop_y_77849 = (int64_t) 8 * m_65343;
        int64_t bytes_77850 = smax64((int64_t) 0, binop_y_77849);
        int64_t binop_y_77858 = (int64_t) 4 * m_65343;
        int64_t bytes_77859 = smax64((int64_t) 0, binop_y_77858);
        int64_t binop_x_77862 = m_65343 * q_65346;
        int64_t binop_y_77863 = (int64_t) 4 * binop_x_77862;
        int64_t bytes_77864 = smax64((int64_t) 0, binop_y_77863);
        int64_t binop_y_77868 = (int64_t) 4 * q_65346;
        int64_t bytes_77869 = smax64((int64_t) 0, binop_y_77868);
        struct memblock_device ext_mem_77994;
        
        ext_mem_77994.references = NULL;
        
        struct memblock_device ext_mem_77993;
        
        ext_mem_77993.references = NULL;
        if (match_lit_66002) {
            struct memblock_device mem_77828;
            
            mem_77828.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77828, bytes_77827,
                                      "mem_77828")) {
                err = 1;
                goto cleanup;
            }
            if (futrts_builtinzhreplicate_f32(ctx, mem_77828, m_65343 *
                                              n_m_65352, 0.0F) != 0) {
                if (memblock_unref_device(ctx, &mem_77828, "mem_77828") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77993,
                                          "ext_mem_77993") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77994,
                                          "ext_mem_77994") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77995,
                                          "ext_mem_77995") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77996,
                                          "ext_mem_77996") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_78270,
                                          "mem_out_78270") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            int64_t segscan_group_sizze_72659;
            
            segscan_group_sizze_72659 =
                *ctx->tuning_params.mainzisegscan_group_sizze_72639;
            
            int64_t num_groups_72660;
            int32_t max_num_groups_79518;
            
            max_num_groups_79518 =
                *ctx->tuning_params.mainzisegscan_num_groups_72641;
            num_groups_72660 = sext_i64_i32(smax64((int64_t) 1,
                                                   smin64(sdiv_up64(binop_x_77830,
                                                                    segscan_group_sizze_72659),
                                                          sext_i32_i64(max_num_groups_79518))));
            
            struct memblock_device mem_77833;
            
            mem_77833.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77833, bytes_77832,
                                      "mem_77833")) {
                err = 1;
                goto cleanup;
            }
            if (slt64((int64_t) 0, m_65343 * n_65344)) {
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                
                int64_t stage1_max_num_groups_79519;
                
                stage1_max_num_groups_79519 = ctx->opencl.max_group_size;
                
                int64_t stage1_num_groups_79520 =
                        smin64(stage1_max_num_groups_79519, num_groups_72660);
                int32_t num_threads_79521 =
                        sext_i64_i32(stage1_num_groups_79520 *
                        segscan_group_sizze_72659);
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_72665,
                                                        1,
                                                        (size_t) smax64((int64_t) 1,
                                                                        (int64_t) 8 *
                                                                        segscan_group_sizze_72659),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_72665,
                                                        2, sizeof(m_65343),
                                                        &m_65343));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_72665,
                                                        3, sizeof(n_65344),
                                                        &n_65344));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_72665,
                                                        4,
                                                        sizeof(num_threads_79521),
                                                        &num_threads_79521));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_72665,
                                                        5,
                                                        sizeof(Y_mem_76976.mem),
                                                        &Y_mem_76976.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_72665,
                                                        6,
                                                        sizeof(mem_77833.mem),
                                                        &mem_77833.mem));
                if (1 * ((size_t) stage1_num_groups_79520 *
                         (size_t) segscan_group_sizze_72659) != 0) {
                    const size_t global_work_sizze_80199[1] =
                                 {(size_t) stage1_num_groups_79520 *
                                 (size_t) segscan_group_sizze_72659};
                    const size_t local_work_sizze_80203[1] =
                                 {(size_t) segscan_group_sizze_72659};
                    int64_t time_start_80200 = 0, time_end_80201 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.scan_stage1_72665",
                                global_work_sizze_80199[0],
                                local_work_sizze_80203[0], (int) (0 +
                                                                  smax64((int64_t) 1,
                                                                         (int64_t) 8 *
                                                                         segscan_group_sizze_72659)));
                        time_start_80200 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage1_72665,
                                                                    1, NULL,
                                                                    global_work_sizze_80199,
                                                                    local_work_sizze_80203,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage1_72665_runs,
                                                                                                              &ctx->mainziscan_stage1_72665_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_80201 = get_wall_time();
                        
                        long time_diff_80202 = time_end_80201 -
                             time_start_80200;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage1_72665", time_diff_80202);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                            (long long) (segscan_group_sizze_72659 *
                                         sdiv_up64(m_65343 * n_65344,
                                                   sext_i32_i64(num_threads_79521))),
                            '\n');
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_72665,
                                                        1,
                                                        (size_t) smax64((int64_t) 1,
                                                                        (int64_t) 8 *
                                                                        stage1_num_groups_79520),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_72665,
                                                        2, sizeof(m_65343),
                                                        &m_65343));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_72665,
                                                        3, sizeof(n_65344),
                                                        &n_65344));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_72665,
                                                        4,
                                                        sizeof(stage1_num_groups_79520),
                                                        &stage1_num_groups_79520));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_72665,
                                                        5,
                                                        sizeof(num_threads_79521),
                                                        &num_threads_79521));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_72665,
                                                        6,
                                                        sizeof(mem_77833.mem),
                                                        &mem_77833.mem));
                if (1 * ((size_t) (int64_t) 1 *
                         (size_t) stage1_num_groups_79520) != 0) {
                    const size_t global_work_sizze_80204[1] =
                                 {(size_t) (int64_t) 1 *
                                 (size_t) stage1_num_groups_79520};
                    const size_t local_work_sizze_80208[1] =
                                 {(size_t) stage1_num_groups_79520};
                    int64_t time_start_80205 = 0, time_end_80206 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.scan_stage2_72665",
                                global_work_sizze_80204[0],
                                local_work_sizze_80208[0], (int) (0 +
                                                                  smax64((int64_t) 1,
                                                                         (int64_t) 8 *
                                                                         stage1_num_groups_79520)));
                        time_start_80205 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage2_72665,
                                                                    1, NULL,
                                                                    global_work_sizze_80204,
                                                                    local_work_sizze_80208,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage2_72665_runs,
                                                                                                              &ctx->mainziscan_stage2_72665_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_80206 = get_wall_time();
                        
                        long time_diff_80207 = time_end_80206 -
                             time_start_80205;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage2_72665", time_diff_80207);
                    }
                }
                
                int32_t required_groups_79572 = sext_i64_i32(sdiv_up64(m_65343 *
                                                                       n_65344,
                                                                       segscan_group_sizze_72659));
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_72665,
                                                        1, sizeof(m_65343),
                                                        &m_65343));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_72665,
                                                        2, sizeof(n_65344),
                                                        &n_65344));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_72665,
                                                        3,
                                                        sizeof(num_groups_72660),
                                                        &num_groups_72660));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_72665,
                                                        4,
                                                        sizeof(num_threads_79521),
                                                        &num_threads_79521));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_72665,
                                                        5,
                                                        sizeof(required_groups_79572),
                                                        &required_groups_79572));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_72665,
                                                        6,
                                                        sizeof(mem_77833.mem),
                                                        &mem_77833.mem));
                if (1 * ((size_t) num_groups_72660 *
                         (size_t) segscan_group_sizze_72659) != 0) {
                    const size_t global_work_sizze_80209[1] =
                                 {(size_t) num_groups_72660 *
                                 (size_t) segscan_group_sizze_72659};
                    const size_t local_work_sizze_80213[1] =
                                 {(size_t) segscan_group_sizze_72659};
                    int64_t time_start_80210 = 0, time_end_80211 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.scan_stage3_72665",
                                global_work_sizze_80209[0],
                                local_work_sizze_80213[0], (int) 0);
                        time_start_80210 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainziscan_stage3_72665,
                                                                    1, NULL,
                                                                    global_work_sizze_80209,
                                                                    local_work_sizze_80213,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainziscan_stage3_72665_runs,
                                                                                                              &ctx->mainziscan_stage3_72665_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_80211 = get_wall_time();
                        
                        long time_diff_80212 = time_end_80211 -
                             time_start_80210;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.scan_stage3_72665", time_diff_80212);
                    }
                }
            }
            
            struct memblock_device mem_77837;
            
            mem_77837.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77837, bytes_77836,
                                      "mem_77837")) {
                err = 1;
                goto cleanup;
            }
            if (futrts_builtinzhreplicate_f32(ctx, mem_77837, m_65343 * n_65344,
                                              0.0F) != 0) {
                if (memblock_unref_device(ctx, &mem_77837, "mem_77837") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77833, "mem_77833") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77828, "mem_77828") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77993,
                                          "ext_mem_77993") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77994,
                                          "ext_mem_77994") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77995,
                                          "ext_mem_77995") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77996,
                                          "ext_mem_77996") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_78270,
                                          "mem_out_78270") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_77841;
            
            mem_77841.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77841, bytes_77832,
                                      "mem_77841")) {
                err = 1;
                goto cleanup;
            }
            if (futrts_builtinzhreplicate_i64(ctx, mem_77841, m_65343 * n_65344,
                                              (int64_t) -1) != 0) {
                if (memblock_unref_device(ctx, &mem_77841, "mem_77841") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77837, "mem_77837") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77833, "mem_77833") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77828, "mem_77828") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77993,
                                          "ext_mem_77993") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77994,
                                          "ext_mem_77994") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77995,
                                          "ext_mem_77995") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &ext_mem_77996,
                                          "ext_mem_77996") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_out_78270,
                                          "mem_out_78270") != 0)
                    return 1;
                err = 1;
                goto cleanup;
            }
            
            int64_t segmap_group_sizze_72712;
            
            segmap_group_sizze_72712 =
                *ctx->tuning_params.mainzisegmap_group_sizze_72553;
            
            int64_t segmap_usable_groups_72713 = sdiv_up64(binop_x_77830,
                                                           segmap_group_sizze_72712);
            
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72718, 1,
                                                    sizeof(m_65343), &m_65343));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72718, 2,
                                                    sizeof(n_65344), &n_65344));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72718, 3,
                                                    sizeof(Y_mem_76976.mem),
                                                    &Y_mem_76976.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72718, 4,
                                                    sizeof(mem_77833.mem),
                                                    &mem_77833.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72718, 5,
                                                    sizeof(mem_77837.mem),
                                                    &mem_77837.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72718, 6,
                                                    sizeof(mem_77841.mem),
                                                    &mem_77841.mem));
            if (1 * ((size_t) segmap_usable_groups_72713 *
                     (size_t) segmap_group_sizze_72712) != 0) {
                const size_t global_work_sizze_80214[1] =
                             {(size_t) segmap_usable_groups_72713 *
                             (size_t) segmap_group_sizze_72712};
                const size_t local_work_sizze_80218[1] =
                             {(size_t) segmap_group_sizze_72712};
                int64_t time_start_80215 = 0, time_end_80216 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.segmap_72718", global_work_sizze_80214[0],
                            local_work_sizze_80218[0], (int) 0);
                    time_start_80215 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_72718,
                                                                1, NULL,
                                                                global_work_sizze_80214,
                                                                local_work_sizze_80218,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_72718_runs,
                                                                                                          &ctx->mainzisegmap_72718_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_80216 = get_wall_time();
                    
                    long time_diff_80217 = time_end_80216 - time_start_80215;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_72718", time_diff_80217);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int64_t segmap_group_sizze_72732;
            
            segmap_group_sizze_72732 =
                *ctx->tuning_params.mainzisegmap_group_sizze_72527;
            
            int64_t segmap_usable_groups_72733 = sdiv_up64(binop_x_77830,
                                                           segmap_group_sizze_72732);
            struct memblock_device mem_77847;
            
            mem_77847.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77847, bytes_77832,
                                      "mem_77847")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72737, 1,
                                                    sizeof(m_65343), &m_65343));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72737, 2,
                                                    sizeof(n_65344), &n_65344));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72737, 3,
                                                    sizeof(mem_77841.mem),
                                                    &mem_77841.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72737, 4,
                                                    sizeof(mem_77847.mem),
                                                    &mem_77847.mem));
            if (1 * ((size_t) segmap_usable_groups_72733 *
                     (size_t) segmap_group_sizze_72732) != 0) {
                const size_t global_work_sizze_80219[1] =
                             {(size_t) segmap_usable_groups_72733 *
                             (size_t) segmap_group_sizze_72732};
                const size_t local_work_sizze_80223[1] =
                             {(size_t) segmap_group_sizze_72732};
                int64_t time_start_80220 = 0, time_end_80221 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.segmap_72737", global_work_sizze_80219[0],
                            local_work_sizze_80223[0], (int) 0);
                    time_start_80220 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_72737,
                                                                1, NULL,
                                                                global_work_sizze_80219,
                                                                local_work_sizze_80223,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_72737_runs,
                                                                                                          &ctx->mainzisegmap_72737_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_80221 = get_wall_time();
                    
                    long time_diff_80222 = time_end_80221 - time_start_80220;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_72737", time_diff_80222);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int64_t segmap_group_sizze_72742;
            
            segmap_group_sizze_72742 =
                *ctx->tuning_params.mainzisegmap_group_sizze_72501;
            
            int64_t segmap_usable_groups_72743 = sdiv_up64(m_65343,
                                                           segmap_group_sizze_72742);
            struct memblock_device mem_77851;
            
            mem_77851.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77851, bytes_77850,
                                      "mem_77851")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_77854;
            
            mem_77854.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77854, bytes_77850,
                                      "mem_77854")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_77857;
            
            mem_77857.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77857, bytes_77850,
                                      "mem_77857")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_77860;
            
            mem_77860.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77860, bytes_77859,
                                      "mem_77860")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72749, 1,
                                                    sizeof(m_65343), &m_65343));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72749, 2,
                                                    sizeof(n_65344), &n_65344));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72749, 3,
                                                    sizeof(q_65346), &q_65346));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72749, 4,
                                                    sizeof(i_65358), &i_65358));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72749, 5,
                                                    sizeof(min_res_65364),
                                                    &min_res_65364));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72749, 6,
                                                    sizeof(i64_res_65370),
                                                    &i64_res_65370));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72749, 7,
                                                    sizeof(mem_77833.mem),
                                                    &mem_77833.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72749, 8,
                                                    sizeof(mem_77851.mem),
                                                    &mem_77851.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72749, 9,
                                                    sizeof(mem_77854.mem),
                                                    &mem_77854.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72749, 10,
                                                    sizeof(mem_77857.mem),
                                                    &mem_77857.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72749, 11,
                                                    sizeof(mem_77860.mem),
                                                    &mem_77860.mem));
            if (1 * ((size_t) segmap_usable_groups_72743 *
                     (size_t) segmap_group_sizze_72742) != 0) {
                const size_t global_work_sizze_80224[1] =
                             {(size_t) segmap_usable_groups_72743 *
                             (size_t) segmap_group_sizze_72742};
                const size_t local_work_sizze_80228[1] =
                             {(size_t) segmap_group_sizze_72742};
                int64_t time_start_80225 = 0, time_end_80226 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.segmap_72749", global_work_sizze_80224[0],
                            local_work_sizze_80228[0], (int) 0);
                    time_start_80225 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_72749,
                                                                1, NULL,
                                                                global_work_sizze_80224,
                                                                local_work_sizze_80228,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_72749_runs,
                                                                                                          &ctx->mainzisegmap_72749_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_80226 = get_wall_time();
                    
                    long time_diff_80227 = time_end_80226 - time_start_80225;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_72749", time_diff_80227);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int64_t segmap_group_sizze_72764;
            
            segmap_group_sizze_72764 =
                *ctx->tuning_params.mainzisegmap_group_sizze_72476;
            
            int64_t segmap_usable_groups_72765 = sdiv_up64(binop_x_77862,
                                                           segmap_group_sizze_72764);
            struct memblock_device mem_77865;
            
            mem_77865.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77865, bytes_77864,
                                      "mem_77865")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72769, 1,
                                                    sizeof(m_65343), &m_65343));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72769, 2,
                                                    sizeof(n_65344), &n_65344));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72769, 3,
                                                    sizeof(q_65346), &q_65346));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72769, 4,
                                                    sizeof(i_65358), &i_65358));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72769, 5,
                                                    sizeof(mem_77833.mem),
                                                    &mem_77833.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_72769, 6,
                                                    sizeof(mem_77865.mem),
                                                    &mem_77865.mem));
            if (1 * ((size_t) segmap_usable_groups_72765 *
                     (size_t) segmap_group_sizze_72764) != 0) {
                const size_t global_work_sizze_80229[1] =
                             {(size_t) segmap_usable_groups_72765 *
                             (size_t) segmap_group_sizze_72764};
                const size_t local_work_sizze_80233[1] =
                             {(size_t) segmap_group_sizze_72764};
                int64_t time_start_80230 = 0, time_end_80231 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.segmap_72769", global_work_sizze_80229[0],
                            local_work_sizze_80233[0], (int) 0);
                    time_start_80230 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_72769,
                                                                1, NULL,
                                                                global_work_sizze_80229,
                                                                local_work_sizze_80233,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_72769_runs,
                                                                                                          &ctx->mainzisegmap_72769_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_80231 = get_wall_time();
                    
                    long time_diff_80232 = time_end_80231 - time_start_80230;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_72769", time_diff_80232);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            struct memblock_device mem_77875;
            
            mem_77875.references = NULL;
            if (memblock_alloc_device(ctx, &mem_77875, bytes_77827,
                                      "mem_77875")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    1,
                                                    sizeof(ctx->failure_is_an_option),
                                                    &ctx->failure_is_an_option));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    3, (size_t) ((int64_t) 4 *
                                                                 q_65346),
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    4, (size_t) ((int64_t) 4 *
                                                                 q_65346),
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    5, (size_t) bytes_77869,
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    6, sizeof(m_65343),
                                                    &m_65343));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    7, sizeof(n_65344),
                                                    &n_65344));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    8, sizeof(q_65346),
                                                    &q_65346));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    9, sizeof(jump_65348),
                                                    &jump_65348));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    10, sizeof(n_m_65352),
                                                    &n_m_65352));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    11, sizeof(i_65358),
                                                    &i_65358));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    12, sizeof(x_65359),
                                                    &x_65359));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    13, sizeof(min_res_65364),
                                                    &min_res_65364));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    14, sizeof(loop_cond_65369),
                                                    &loop_cond_65369));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    15, sizeof(mem_77833.mem),
                                                    &mem_77833.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    16, sizeof(mem_77837.mem),
                                                    &mem_77837.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    17, sizeof(mem_77841.mem),
                                                    &mem_77841.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    18, sizeof(mem_77847.mem),
                                                    &mem_77847.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    19, sizeof(mem_77851.mem),
                                                    &mem_77851.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    20, sizeof(mem_77854.mem),
                                                    &mem_77854.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    21, sizeof(mem_77857.mem),
                                                    &mem_77857.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    22, sizeof(mem_77860.mem),
                                                    &mem_77860.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    23, sizeof(mem_77865.mem),
                                                    &mem_77865.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_72785,
                                                    24, sizeof(mem_77875.mem),
                                                    &mem_77875.mem));
            if (1 * ((size_t) binop_x_77825 * (size_t) q_65346) != 0) {
                const size_t global_work_sizze_80234[1] =
                             {(size_t) binop_x_77825 * (size_t) q_65346};
                const size_t local_work_sizze_80238[1] = {(size_t) q_65346};
                int64_t time_start_80235 = 0, time_end_80236 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log,
                            "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                            "main.segmap_intragroup_72785",
                            global_work_sizze_80234[0],
                            local_work_sizze_80238[0], (int) (0 + (int64_t) 4 *
                                                              q_65346 +
                                                              (int64_t) 4 *
                                                              q_65346 +
                                                              bytes_77869));
                    time_start_80235 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_intragroup_72785,
                                                                1, NULL,
                                                                global_work_sizze_80234,
                                                                local_work_sizze_80238,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_intragroup_72785_runs,
                                                                                                          &ctx->mainzisegmap_intragroup_72785_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_80236 = get_wall_time();
                    
                    long time_diff_80237 = time_end_80236 - time_start_80235;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_intragroup_72785", time_diff_80237);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &mem_77833, "mem_77833") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77837, "mem_77837") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77841, "mem_77841") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77847, "mem_77847") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77851, "mem_77851") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77854, "mem_77854") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77857, "mem_77857") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77860, "mem_77860") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77865, "mem_77865") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_77994, &mem_77875,
                                    "mem_77875") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_77993, &mem_77828,
                                    "mem_77828") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77875, "mem_77875") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77865, "mem_77865") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77860, "mem_77860") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77857, "mem_77857") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77854, "mem_77854") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77851, "mem_77851") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77847, "mem_77847") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77841, "mem_77841") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77837, "mem_77837") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77833, "mem_77833") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_77828, "mem_77828") != 0)
                return 1;
        } else {
            bool match_lit_66168 = (int64_t) 1 == degree_65347;
            struct memblock_device ext_mem_77992;
            
            ext_mem_77992.references = NULL;
            
            struct memblock_device ext_mem_77991;
            
            ext_mem_77991.references = NULL;
            if (match_lit_66168) {
                int64_t segscan_group_sizze_73326;
                
                segscan_group_sizze_73326 =
                    *ctx->tuning_params.mainzisegscan_group_sizze_73306;
                
                int64_t num_groups_73327;
                int32_t max_num_groups_79649;
                
                max_num_groups_79649 =
                    *ctx->tuning_params.mainzisegscan_num_groups_73308;
                num_groups_73327 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(binop_x_77830,
                                                                        segscan_group_sizze_73326),
                                                              sext_i32_i64(max_num_groups_79649))));
                
                struct memblock_device mem_77880;
                
                mem_77880.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77880, bytes_77832,
                                          "mem_77880")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64((int64_t) 0, m_65343 * n_65344)) {
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegScan");
                    
                    int64_t stage1_max_num_groups_79650;
                    
                    stage1_max_num_groups_79650 = ctx->opencl.max_group_size;
                    
                    int64_t stage1_num_groups_79651 =
                            smin64(stage1_max_num_groups_79650,
                                   num_groups_73327);
                    int32_t num_threads_79652 =
                            sext_i64_i32(stage1_num_groups_79651 *
                            segscan_group_sizze_73326);
                    
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_73332,
                                                            1,
                                                            (size_t) smax64((int64_t) 1,
                                                                            (int64_t) 8 *
                                                                            segscan_group_sizze_73326),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_73332,
                                                            2, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_73332,
                                                            3, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_73332,
                                                            4,
                                                            sizeof(num_threads_79652),
                                                            &num_threads_79652));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_73332,
                                                            5,
                                                            sizeof(Y_mem_76976.mem),
                                                            &Y_mem_76976.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_73332,
                                                            6,
                                                            sizeof(mem_77880.mem),
                                                            &mem_77880.mem));
                    if (1 * ((size_t) stage1_num_groups_79651 *
                             (size_t) segscan_group_sizze_73326) != 0) {
                        const size_t global_work_sizze_80239[1] =
                                     {(size_t) stage1_num_groups_79651 *
                                     (size_t) segscan_group_sizze_73326};
                        const size_t local_work_sizze_80243[1] =
                                     {(size_t) segscan_group_sizze_73326};
                        int64_t time_start_80240 = 0, time_end_80241 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.scan_stage1_73332",
                                    global_work_sizze_80239[0],
                                    local_work_sizze_80243[0], (int) (0 +
                                                                      smax64((int64_t) 1,
                                                                             (int64_t) 8 *
                                                                             segscan_group_sizze_73326)));
                            time_start_80240 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainziscan_stage1_73332,
                                                                        1, NULL,
                                                                        global_work_sizze_80239,
                                                                        local_work_sizze_80243,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainziscan_stage1_73332_runs,
                                                                                                                  &ctx->mainziscan_stage1_73332_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_80241 = get_wall_time();
                            
                            long time_diff_80242 = time_end_80241 -
                                 time_start_80240;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.scan_stage1_73332", time_diff_80242);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                                (long long) (segscan_group_sizze_73326 *
                                             sdiv_up64(m_65343 * n_65344,
                                                       sext_i32_i64(num_threads_79652))),
                                '\n');
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_73332,
                                                            1,
                                                            (size_t) smax64((int64_t) 1,
                                                                            (int64_t) 8 *
                                                                            stage1_num_groups_79651),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_73332,
                                                            2, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_73332,
                                                            3, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_73332,
                                                            4,
                                                            sizeof(stage1_num_groups_79651),
                                                            &stage1_num_groups_79651));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_73332,
                                                            5,
                                                            sizeof(num_threads_79652),
                                                            &num_threads_79652));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_73332,
                                                            6,
                                                            sizeof(mem_77880.mem),
                                                            &mem_77880.mem));
                    if (1 * ((size_t) (int64_t) 1 *
                             (size_t) stage1_num_groups_79651) != 0) {
                        const size_t global_work_sizze_80244[1] =
                                     {(size_t) (int64_t) 1 *
                                     (size_t) stage1_num_groups_79651};
                        const size_t local_work_sizze_80248[1] =
                                     {(size_t) stage1_num_groups_79651};
                        int64_t time_start_80245 = 0, time_end_80246 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.scan_stage2_73332",
                                    global_work_sizze_80244[0],
                                    local_work_sizze_80248[0], (int) (0 +
                                                                      smax64((int64_t) 1,
                                                                             (int64_t) 8 *
                                                                             stage1_num_groups_79651)));
                            time_start_80245 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainziscan_stage2_73332,
                                                                        1, NULL,
                                                                        global_work_sizze_80244,
                                                                        local_work_sizze_80248,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainziscan_stage2_73332_runs,
                                                                                                                  &ctx->mainziscan_stage2_73332_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_80246 = get_wall_time();
                            
                            long time_diff_80247 = time_end_80246 -
                                 time_start_80245;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.scan_stage2_73332", time_diff_80247);
                        }
                    }
                    
                    int32_t required_groups_79703 =
                            sext_i64_i32(sdiv_up64(m_65343 * n_65344,
                                                   segscan_group_sizze_73326));
                    
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_73332,
                                                            1, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_73332,
                                                            2, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_73332,
                                                            3,
                                                            sizeof(num_groups_73327),
                                                            &num_groups_73327));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_73332,
                                                            4,
                                                            sizeof(num_threads_79652),
                                                            &num_threads_79652));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_73332,
                                                            5,
                                                            sizeof(required_groups_79703),
                                                            &required_groups_79703));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_73332,
                                                            6,
                                                            sizeof(mem_77880.mem),
                                                            &mem_77880.mem));
                    if (1 * ((size_t) num_groups_73327 *
                             (size_t) segscan_group_sizze_73326) != 0) {
                        const size_t global_work_sizze_80249[1] =
                                     {(size_t) num_groups_73327 *
                                     (size_t) segscan_group_sizze_73326};
                        const size_t local_work_sizze_80253[1] =
                                     {(size_t) segscan_group_sizze_73326};
                        int64_t time_start_80250 = 0, time_end_80251 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.scan_stage3_73332",
                                    global_work_sizze_80249[0],
                                    local_work_sizze_80253[0], (int) 0);
                            time_start_80250 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainziscan_stage3_73332,
                                                                        1, NULL,
                                                                        global_work_sizze_80249,
                                                                        local_work_sizze_80253,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainziscan_stage3_73332_runs,
                                                                                                                  &ctx->mainziscan_stage3_73332_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_80251 = get_wall_time();
                            
                            long time_diff_80252 = time_end_80251 -
                                 time_start_80250;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.scan_stage3_73332", time_diff_80252);
                        }
                    }
                }
                
                struct memblock_device mem_77884;
                
                mem_77884.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77884, bytes_77836,
                                          "mem_77884")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_f32(ctx, mem_77884, m_65343 *
                                                  n_65344, 0.0F) != 0) {
                    if (memblock_unref_device(ctx, &mem_77884, "mem_77884") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77880, "mem_77880") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77991,
                                              "ext_mem_77991") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77992,
                                              "ext_mem_77992") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77993,
                                              "ext_mem_77993") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77994,
                                              "ext_mem_77994") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77995,
                                              "ext_mem_77995") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77996,
                                              "ext_mem_77996") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_78270,
                                              "mem_out_78270") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77888;
                
                mem_77888.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77888, bytes_77832,
                                          "mem_77888")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_i64(ctx, mem_77888, m_65343 *
                                                  n_65344, (int64_t) -1) != 0) {
                    if (memblock_unref_device(ctx, &mem_77888, "mem_77888") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77884, "mem_77884") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77880, "mem_77880") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77991,
                                              "ext_mem_77991") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77992,
                                              "ext_mem_77992") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77993,
                                              "ext_mem_77993") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77994,
                                              "ext_mem_77994") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77995,
                                              "ext_mem_77995") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77996,
                                              "ext_mem_77996") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_78270,
                                              "mem_out_78270") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t segmap_group_sizze_73379;
                
                segmap_group_sizze_73379 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_73220;
                
                int64_t segmap_usable_groups_73380 = sdiv_up64(binop_x_77830,
                                                               segmap_group_sizze_73379);
                
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73385,
                                                        1, sizeof(m_65343),
                                                        &m_65343));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73385,
                                                        2, sizeof(n_65344),
                                                        &n_65344));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73385,
                                                        3,
                                                        sizeof(Y_mem_76976.mem),
                                                        &Y_mem_76976.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73385,
                                                        4,
                                                        sizeof(mem_77880.mem),
                                                        &mem_77880.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73385,
                                                        5,
                                                        sizeof(mem_77884.mem),
                                                        &mem_77884.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73385,
                                                        6,
                                                        sizeof(mem_77888.mem),
                                                        &mem_77888.mem));
                if (1 * ((size_t) segmap_usable_groups_73380 *
                         (size_t) segmap_group_sizze_73379) != 0) {
                    const size_t global_work_sizze_80254[1] =
                                 {(size_t) segmap_usable_groups_73380 *
                                 (size_t) segmap_group_sizze_73379};
                    const size_t local_work_sizze_80258[1] =
                                 {(size_t) segmap_group_sizze_73379};
                    int64_t time_start_80255 = 0, time_end_80256 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_73385", global_work_sizze_80254[0],
                                local_work_sizze_80258[0], (int) 0);
                        time_start_80255 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_73385,
                                                                    1, NULL,
                                                                    global_work_sizze_80254,
                                                                    local_work_sizze_80258,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_73385_runs,
                                                                                                              &ctx->mainzisegmap_73385_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_80256 = get_wall_time();
                        
                        long time_diff_80257 = time_end_80256 -
                             time_start_80255;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_73385", time_diff_80257);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_group_sizze_73399;
                
                segmap_group_sizze_73399 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_73194;
                
                int64_t segmap_usable_groups_73400 = sdiv_up64(binop_x_77830,
                                                               segmap_group_sizze_73399);
                struct memblock_device mem_77894;
                
                mem_77894.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77894, bytes_77832,
                                          "mem_77894")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73404,
                                                        1, sizeof(m_65343),
                                                        &m_65343));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73404,
                                                        2, sizeof(n_65344),
                                                        &n_65344));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73404,
                                                        3,
                                                        sizeof(mem_77888.mem),
                                                        &mem_77888.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73404,
                                                        4,
                                                        sizeof(mem_77894.mem),
                                                        &mem_77894.mem));
                if (1 * ((size_t) segmap_usable_groups_73400 *
                         (size_t) segmap_group_sizze_73399) != 0) {
                    const size_t global_work_sizze_80259[1] =
                                 {(size_t) segmap_usable_groups_73400 *
                                 (size_t) segmap_group_sizze_73399};
                    const size_t local_work_sizze_80263[1] =
                                 {(size_t) segmap_group_sizze_73399};
                    int64_t time_start_80260 = 0, time_end_80261 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_73404", global_work_sizze_80259[0],
                                local_work_sizze_80263[0], (int) 0);
                        time_start_80260 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_73404,
                                                                    1, NULL,
                                                                    global_work_sizze_80259,
                                                                    local_work_sizze_80263,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_73404_runs,
                                                                                                              &ctx->mainzisegmap_73404_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_80261 = get_wall_time();
                        
                        long time_diff_80262 = time_end_80261 -
                             time_start_80260;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_73404", time_diff_80262);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_group_sizze_73409;
                
                segmap_group_sizze_73409 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_73168;
                
                int64_t segmap_usable_groups_73410 = sdiv_up64(m_65343,
                                                               segmap_group_sizze_73409);
                struct memblock_device mem_77898;
                
                mem_77898.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77898, bytes_77850,
                                          "mem_77898")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77901;
                
                mem_77901.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77901, bytes_77850,
                                          "mem_77901")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77904;
                
                mem_77904.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77904, bytes_77850,
                                          "mem_77904")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77907;
                
                mem_77907.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77907, bytes_77859,
                                          "mem_77907")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73416,
                                                        1, sizeof(m_65343),
                                                        &m_65343));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73416,
                                                        2, sizeof(n_65344),
                                                        &n_65344));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73416,
                                                        3, sizeof(q_65346),
                                                        &q_65346));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73416,
                                                        4, sizeof(i_65358),
                                                        &i_65358));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73416,
                                                        5,
                                                        sizeof(min_res_65364),
                                                        &min_res_65364));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73416,
                                                        6,
                                                        sizeof(i64_res_65370),
                                                        &i64_res_65370));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73416,
                                                        7,
                                                        sizeof(mem_77880.mem),
                                                        &mem_77880.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73416,
                                                        8,
                                                        sizeof(mem_77898.mem),
                                                        &mem_77898.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73416,
                                                        9,
                                                        sizeof(mem_77901.mem),
                                                        &mem_77901.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73416,
                                                        10,
                                                        sizeof(mem_77904.mem),
                                                        &mem_77904.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73416,
                                                        11,
                                                        sizeof(mem_77907.mem),
                                                        &mem_77907.mem));
                if (1 * ((size_t) segmap_usable_groups_73410 *
                         (size_t) segmap_group_sizze_73409) != 0) {
                    const size_t global_work_sizze_80264[1] =
                                 {(size_t) segmap_usable_groups_73410 *
                                 (size_t) segmap_group_sizze_73409};
                    const size_t local_work_sizze_80268[1] =
                                 {(size_t) segmap_group_sizze_73409};
                    int64_t time_start_80265 = 0, time_end_80266 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_73416", global_work_sizze_80264[0],
                                local_work_sizze_80268[0], (int) 0);
                        time_start_80265 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_73416,
                                                                    1, NULL,
                                                                    global_work_sizze_80264,
                                                                    local_work_sizze_80268,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_73416_runs,
                                                                                                              &ctx->mainzisegmap_73416_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_80266 = get_wall_time();
                        
                        long time_diff_80267 = time_end_80266 -
                             time_start_80265;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_73416", time_diff_80267);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_group_sizze_73431;
                
                segmap_group_sizze_73431 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_73143;
                
                int64_t segmap_usable_groups_73432 = sdiv_up64(binop_x_77862,
                                                               segmap_group_sizze_73431);
                struct memblock_device mem_77912;
                
                mem_77912.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77912, bytes_77864,
                                          "mem_77912")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73436,
                                                        1, sizeof(m_65343),
                                                        &m_65343));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73436,
                                                        2, sizeof(n_65344),
                                                        &n_65344));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73436,
                                                        3, sizeof(q_65346),
                                                        &q_65346));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73436,
                                                        4, sizeof(i_65358),
                                                        &i_65358));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73436,
                                                        5,
                                                        sizeof(mem_77880.mem),
                                                        &mem_77880.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_73436,
                                                        6,
                                                        sizeof(mem_77912.mem),
                                                        &mem_77912.mem));
                if (1 * ((size_t) segmap_usable_groups_73432 *
                         (size_t) segmap_group_sizze_73431) != 0) {
                    const size_t global_work_sizze_80269[1] =
                                 {(size_t) segmap_usable_groups_73432 *
                                 (size_t) segmap_group_sizze_73431};
                    const size_t local_work_sizze_80273[1] =
                                 {(size_t) segmap_group_sizze_73431};
                    int64_t time_start_80270 = 0, time_end_80271 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_73436", global_work_sizze_80269[0],
                                local_work_sizze_80273[0], (int) 0);
                        time_start_80270 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_73436,
                                                                    1, NULL,
                                                                    global_work_sizze_80269,
                                                                    local_work_sizze_80273,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_73436_runs,
                                                                                                              &ctx->mainzisegmap_73436_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_80271 = get_wall_time();
                        
                        long time_diff_80272 = time_end_80271 -
                             time_start_80270;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_73436", time_diff_80272);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                struct memblock_device mem_77925;
                
                mem_77925.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77925, bytes_77827,
                                          "mem_77925")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77929;
                
                mem_77929.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77929, bytes_77827,
                                          "mem_77929")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        3,
                                                        (size_t) ((int64_t) 4 *
                                                                  q_65346),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        4,
                                                        (size_t) ((int64_t) 4 *
                                                                  q_65346),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        5,
                                                        (size_t) ((int64_t) 4 *
                                                                  q_65346),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        6,
                                                        (size_t) ((int64_t) 4 *
                                                                  q_65346),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        7,
                                                        (size_t) ((int64_t) 4 *
                                                                  q_65346),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        8, (size_t) bytes_77869,
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        9, (size_t) bytes_77869,
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        10, sizeof(m_65343),
                                                        &m_65343));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        11, sizeof(n_65344),
                                                        &n_65344));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        12, sizeof(q_65346),
                                                        &q_65346));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        13, sizeof(jump_65348),
                                                        &jump_65348));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        14, sizeof(n_m_65352),
                                                        &n_m_65352));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        15, sizeof(i_65358),
                                                        &i_65358));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        16, sizeof(x_65359),
                                                        &x_65359));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        17,
                                                        sizeof(min_res_65364),
                                                        &min_res_65364));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        18,
                                                        sizeof(loop_cond_65369),
                                                        &loop_cond_65369));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        19,
                                                        sizeof(mem_77880.mem),
                                                        &mem_77880.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        20,
                                                        sizeof(mem_77884.mem),
                                                        &mem_77884.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        21,
                                                        sizeof(mem_77888.mem),
                                                        &mem_77888.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        22,
                                                        sizeof(mem_77894.mem),
                                                        &mem_77894.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        23,
                                                        sizeof(mem_77898.mem),
                                                        &mem_77898.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        24,
                                                        sizeof(mem_77901.mem),
                                                        &mem_77901.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        25,
                                                        sizeof(mem_77904.mem),
                                                        &mem_77904.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        26,
                                                        sizeof(mem_77907.mem),
                                                        &mem_77907.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        27,
                                                        sizeof(mem_77912.mem),
                                                        &mem_77912.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        28,
                                                        sizeof(mem_77925.mem),
                                                        &mem_77925.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_73453,
                                                        29,
                                                        sizeof(mem_77929.mem),
                                                        &mem_77929.mem));
                if (1 * ((size_t) binop_x_77825 * (size_t) q_65346) != 0) {
                    const size_t global_work_sizze_80274[1] =
                                 {(size_t) binop_x_77825 * (size_t) q_65346};
                    const size_t local_work_sizze_80278[1] = {(size_t) q_65346};
                    int64_t time_start_80275 = 0, time_end_80276 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_intragroup_73453",
                                global_work_sizze_80274[0],
                                local_work_sizze_80278[0], (int) (0 +
                                                                  (int64_t) 4 *
                                                                  q_65346 +
                                                                  (int64_t) 4 *
                                                                  q_65346 +
                                                                  (int64_t) 4 *
                                                                  q_65346 +
                                                                  (int64_t) 4 *
                                                                  q_65346 +
                                                                  (int64_t) 4 *
                                                                  q_65346 +
                                                                  bytes_77869 +
                                                                  bytes_77869));
                        time_start_80275 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_intragroup_73453,
                                                                    1, NULL,
                                                                    global_work_sizze_80274,
                                                                    local_work_sizze_80278,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_intragroup_73453_runs,
                                                                                                              &ctx->mainzisegmap_intragroup_73453_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_80276 = get_wall_time();
                        
                        long time_diff_80277 = time_end_80276 -
                             time_start_80275;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_intragroup_73453",
                                time_diff_80277);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_77880, "mem_77880") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77884, "mem_77884") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77888, "mem_77888") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77894, "mem_77894") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77898, "mem_77898") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77901, "mem_77901") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77904, "mem_77904") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77907, "mem_77907") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77912, "mem_77912") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_77992, &mem_77925,
                                        "mem_77925") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_77991, &mem_77929,
                                        "mem_77929") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77929, "mem_77929") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77925, "mem_77925") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77912, "mem_77912") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77907, "mem_77907") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77904, "mem_77904") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77901, "mem_77901") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77898, "mem_77898") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77894, "mem_77894") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77888, "mem_77888") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77884, "mem_77884") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77880, "mem_77880") != 0)
                    return 1;
            } else {
                int64_t segscan_group_sizze_74083;
                
                segscan_group_sizze_74083 =
                    *ctx->tuning_params.mainzisegscan_group_sizze_74063;
                
                int64_t num_groups_74084;
                int32_t max_num_groups_79786;
                
                max_num_groups_79786 =
                    *ctx->tuning_params.mainzisegscan_num_groups_74065;
                num_groups_74084 = sext_i64_i32(smax64((int64_t) 1,
                                                       smin64(sdiv_up64(binop_x_77830,
                                                                        segscan_group_sizze_74083),
                                                              sext_i32_i64(max_num_groups_79786))));
                
                struct memblock_device mem_77934;
                
                mem_77934.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77934, bytes_77832,
                                          "mem_77934")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64((int64_t) 0, m_65343 * n_65344)) {
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegScan");
                    
                    int64_t stage1_max_num_groups_79787;
                    
                    stage1_max_num_groups_79787 = ctx->opencl.max_group_size;
                    
                    int64_t stage1_num_groups_79788 =
                            smin64(stage1_max_num_groups_79787,
                                   num_groups_74084);
                    int32_t num_threads_79789 =
                            sext_i64_i32(stage1_num_groups_79788 *
                            segscan_group_sizze_74083);
                    
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_74089,
                                                            1,
                                                            (size_t) smax64((int64_t) 1,
                                                                            (int64_t) 8 *
                                                                            segscan_group_sizze_74083),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_74089,
                                                            2, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_74089,
                                                            3, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_74089,
                                                            4,
                                                            sizeof(num_threads_79789),
                                                            &num_threads_79789));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_74089,
                                                            5,
                                                            sizeof(Y_mem_76976.mem),
                                                            &Y_mem_76976.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_74089,
                                                            6,
                                                            sizeof(mem_77934.mem),
                                                            &mem_77934.mem));
                    if (1 * ((size_t) stage1_num_groups_79788 *
                             (size_t) segscan_group_sizze_74083) != 0) {
                        const size_t global_work_sizze_80279[1] =
                                     {(size_t) stage1_num_groups_79788 *
                                     (size_t) segscan_group_sizze_74083};
                        const size_t local_work_sizze_80283[1] =
                                     {(size_t) segscan_group_sizze_74083};
                        int64_t time_start_80280 = 0, time_end_80281 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.scan_stage1_74089",
                                    global_work_sizze_80279[0],
                                    local_work_sizze_80283[0], (int) (0 +
                                                                      smax64((int64_t) 1,
                                                                             (int64_t) 8 *
                                                                             segscan_group_sizze_74083)));
                            time_start_80280 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainziscan_stage1_74089,
                                                                        1, NULL,
                                                                        global_work_sizze_80279,
                                                                        local_work_sizze_80283,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainziscan_stage1_74089_runs,
                                                                                                                  &ctx->mainziscan_stage1_74089_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_80281 = get_wall_time();
                            
                            long time_diff_80282 = time_end_80281 -
                                 time_start_80280;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.scan_stage1_74089", time_diff_80282);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                                (long long) (segscan_group_sizze_74083 *
                                             sdiv_up64(m_65343 * n_65344,
                                                       sext_i32_i64(num_threads_79789))),
                                '\n');
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_74089,
                                                            1,
                                                            (size_t) smax64((int64_t) 1,
                                                                            (int64_t) 8 *
                                                                            stage1_num_groups_79788),
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_74089,
                                                            2, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_74089,
                                                            3, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_74089,
                                                            4,
                                                            sizeof(stage1_num_groups_79788),
                                                            &stage1_num_groups_79788));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_74089,
                                                            5,
                                                            sizeof(num_threads_79789),
                                                            &num_threads_79789));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_74089,
                                                            6,
                                                            sizeof(mem_77934.mem),
                                                            &mem_77934.mem));
                    if (1 * ((size_t) (int64_t) 1 *
                             (size_t) stage1_num_groups_79788) != 0) {
                        const size_t global_work_sizze_80284[1] =
                                     {(size_t) (int64_t) 1 *
                                     (size_t) stage1_num_groups_79788};
                        const size_t local_work_sizze_80288[1] =
                                     {(size_t) stage1_num_groups_79788};
                        int64_t time_start_80285 = 0, time_end_80286 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.scan_stage2_74089",
                                    global_work_sizze_80284[0],
                                    local_work_sizze_80288[0], (int) (0 +
                                                                      smax64((int64_t) 1,
                                                                             (int64_t) 8 *
                                                                             stage1_num_groups_79788)));
                            time_start_80285 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainziscan_stage2_74089,
                                                                        1, NULL,
                                                                        global_work_sizze_80284,
                                                                        local_work_sizze_80288,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainziscan_stage2_74089_runs,
                                                                                                                  &ctx->mainziscan_stage2_74089_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_80286 = get_wall_time();
                            
                            long time_diff_80287 = time_end_80286 -
                                 time_start_80285;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.scan_stage2_74089", time_diff_80287);
                        }
                    }
                    
                    int32_t required_groups_79840 =
                            sext_i64_i32(sdiv_up64(m_65343 * n_65344,
                                                   segscan_group_sizze_74083));
                    
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_74089,
                                                            1, sizeof(m_65343),
                                                            &m_65343));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_74089,
                                                            2, sizeof(n_65344),
                                                            &n_65344));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_74089,
                                                            3,
                                                            sizeof(num_groups_74084),
                                                            &num_groups_74084));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_74089,
                                                            4,
                                                            sizeof(num_threads_79789),
                                                            &num_threads_79789));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_74089,
                                                            5,
                                                            sizeof(required_groups_79840),
                                                            &required_groups_79840));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_74089,
                                                            6,
                                                            sizeof(mem_77934.mem),
                                                            &mem_77934.mem));
                    if (1 * ((size_t) num_groups_74084 *
                             (size_t) segscan_group_sizze_74083) != 0) {
                        const size_t global_work_sizze_80289[1] =
                                     {(size_t) num_groups_74084 *
                                     (size_t) segscan_group_sizze_74083};
                        const size_t local_work_sizze_80293[1] =
                                     {(size_t) segscan_group_sizze_74083};
                        int64_t time_start_80290 = 0, time_end_80291 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                    "main.scan_stage3_74089",
                                    global_work_sizze_80289[0],
                                    local_work_sizze_80293[0], (int) 0);
                            time_start_80290 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainziscan_stage3_74089,
                                                                        1, NULL,
                                                                        global_work_sizze_80289,
                                                                        local_work_sizze_80293,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainziscan_stage3_74089_runs,
                                                                                                                  &ctx->mainziscan_stage3_74089_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_80291 = get_wall_time();
                            
                            long time_diff_80292 = time_end_80291 -
                                 time_start_80290;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.scan_stage3_74089", time_diff_80292);
                        }
                    }
                }
                
                struct memblock_device mem_77938;
                
                mem_77938.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77938, bytes_77836,
                                          "mem_77938")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_f32(ctx, mem_77938, m_65343 *
                                                  n_65344, 0.0F) != 0) {
                    if (memblock_unref_device(ctx, &mem_77938, "mem_77938") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77934, "mem_77934") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77991,
                                              "ext_mem_77991") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77992,
                                              "ext_mem_77992") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77993,
                                              "ext_mem_77993") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77994,
                                              "ext_mem_77994") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77995,
                                              "ext_mem_77995") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77996,
                                              "ext_mem_77996") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_78270,
                                              "mem_out_78270") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77942;
                
                mem_77942.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77942, bytes_77832,
                                          "mem_77942")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhreplicate_i64(ctx, mem_77942, m_65343 *
                                                  n_65344, (int64_t) -1) != 0) {
                    if (memblock_unref_device(ctx, &mem_77942, "mem_77942") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77938, "mem_77938") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_77934, "mem_77934") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77991,
                                              "ext_mem_77991") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77992,
                                              "ext_mem_77992") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77993,
                                              "ext_mem_77993") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77994,
                                              "ext_mem_77994") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77995,
                                              "ext_mem_77995") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &ext_mem_77996,
                                              "ext_mem_77996") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_out_78270,
                                              "mem_out_78270") != 0)
                        return 1;
                    err = 1;
                    goto cleanup;
                }
                
                int64_t segmap_group_sizze_74136;
                
                segmap_group_sizze_74136 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_73977;
                
                int64_t segmap_usable_groups_74137 = sdiv_up64(binop_x_77830,
                                                               segmap_group_sizze_74136);
                
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74142,
                                                        1, sizeof(m_65343),
                                                        &m_65343));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74142,
                                                        2, sizeof(n_65344),
                                                        &n_65344));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74142,
                                                        3,
                                                        sizeof(Y_mem_76976.mem),
                                                        &Y_mem_76976.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74142,
                                                        4,
                                                        sizeof(mem_77934.mem),
                                                        &mem_77934.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74142,
                                                        5,
                                                        sizeof(mem_77938.mem),
                                                        &mem_77938.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74142,
                                                        6,
                                                        sizeof(mem_77942.mem),
                                                        &mem_77942.mem));
                if (1 * ((size_t) segmap_usable_groups_74137 *
                         (size_t) segmap_group_sizze_74136) != 0) {
                    const size_t global_work_sizze_80294[1] =
                                 {(size_t) segmap_usable_groups_74137 *
                                 (size_t) segmap_group_sizze_74136};
                    const size_t local_work_sizze_80298[1] =
                                 {(size_t) segmap_group_sizze_74136};
                    int64_t time_start_80295 = 0, time_end_80296 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_74142", global_work_sizze_80294[0],
                                local_work_sizze_80298[0], (int) 0);
                        time_start_80295 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_74142,
                                                                    1, NULL,
                                                                    global_work_sizze_80294,
                                                                    local_work_sizze_80298,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_74142_runs,
                                                                                                              &ctx->mainzisegmap_74142_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_80296 = get_wall_time();
                        
                        long time_diff_80297 = time_end_80296 -
                             time_start_80295;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_74142", time_diff_80297);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_group_sizze_74156;
                
                segmap_group_sizze_74156 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_73951;
                
                int64_t segmap_usable_groups_74157 = sdiv_up64(binop_x_77830,
                                                               segmap_group_sizze_74156);
                struct memblock_device mem_77948;
                
                mem_77948.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77948, bytes_77832,
                                          "mem_77948")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74161,
                                                        1, sizeof(m_65343),
                                                        &m_65343));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74161,
                                                        2, sizeof(n_65344),
                                                        &n_65344));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74161,
                                                        3,
                                                        sizeof(mem_77942.mem),
                                                        &mem_77942.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74161,
                                                        4,
                                                        sizeof(mem_77948.mem),
                                                        &mem_77948.mem));
                if (1 * ((size_t) segmap_usable_groups_74157 *
                         (size_t) segmap_group_sizze_74156) != 0) {
                    const size_t global_work_sizze_80299[1] =
                                 {(size_t) segmap_usable_groups_74157 *
                                 (size_t) segmap_group_sizze_74156};
                    const size_t local_work_sizze_80303[1] =
                                 {(size_t) segmap_group_sizze_74156};
                    int64_t time_start_80300 = 0, time_end_80301 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_74161", global_work_sizze_80299[0],
                                local_work_sizze_80303[0], (int) 0);
                        time_start_80300 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_74161,
                                                                    1, NULL,
                                                                    global_work_sizze_80299,
                                                                    local_work_sizze_80303,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_74161_runs,
                                                                                                              &ctx->mainzisegmap_74161_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_80301 = get_wall_time();
                        
                        long time_diff_80302 = time_end_80301 -
                             time_start_80300;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_74161", time_diff_80302);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_group_sizze_74166;
                
                segmap_group_sizze_74166 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_73925;
                
                int64_t segmap_usable_groups_74167 = sdiv_up64(m_65343,
                                                               segmap_group_sizze_74166);
                struct memblock_device mem_77952;
                
                mem_77952.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77952, bytes_77850,
                                          "mem_77952")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77955;
                
                mem_77955.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77955, bytes_77850,
                                          "mem_77955")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77958;
                
                mem_77958.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77958, bytes_77850,
                                          "mem_77958")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77961;
                
                mem_77961.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77961, bytes_77859,
                                          "mem_77961")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74173,
                                                        1, sizeof(m_65343),
                                                        &m_65343));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74173,
                                                        2, sizeof(n_65344),
                                                        &n_65344));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74173,
                                                        3, sizeof(q_65346),
                                                        &q_65346));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74173,
                                                        4, sizeof(i_65358),
                                                        &i_65358));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74173,
                                                        5,
                                                        sizeof(min_res_65364),
                                                        &min_res_65364));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74173,
                                                        6,
                                                        sizeof(i64_res_65370),
                                                        &i64_res_65370));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74173,
                                                        7,
                                                        sizeof(mem_77934.mem),
                                                        &mem_77934.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74173,
                                                        8,
                                                        sizeof(mem_77952.mem),
                                                        &mem_77952.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74173,
                                                        9,
                                                        sizeof(mem_77955.mem),
                                                        &mem_77955.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74173,
                                                        10,
                                                        sizeof(mem_77958.mem),
                                                        &mem_77958.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74173,
                                                        11,
                                                        sizeof(mem_77961.mem),
                                                        &mem_77961.mem));
                if (1 * ((size_t) segmap_usable_groups_74167 *
                         (size_t) segmap_group_sizze_74166) != 0) {
                    const size_t global_work_sizze_80304[1] =
                                 {(size_t) segmap_usable_groups_74167 *
                                 (size_t) segmap_group_sizze_74166};
                    const size_t local_work_sizze_80308[1] =
                                 {(size_t) segmap_group_sizze_74166};
                    int64_t time_start_80305 = 0, time_end_80306 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_74173", global_work_sizze_80304[0],
                                local_work_sizze_80308[0], (int) 0);
                        time_start_80305 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_74173,
                                                                    1, NULL,
                                                                    global_work_sizze_80304,
                                                                    local_work_sizze_80308,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_74173_runs,
                                                                                                              &ctx->mainzisegmap_74173_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_80306 = get_wall_time();
                        
                        long time_diff_80307 = time_end_80306 -
                             time_start_80305;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_74173", time_diff_80307);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                int64_t segmap_group_sizze_74188;
                
                segmap_group_sizze_74188 =
                    *ctx->tuning_params.mainzisegmap_group_sizze_73900;
                
                int64_t segmap_usable_groups_74189 = sdiv_up64(binop_x_77862,
                                                               segmap_group_sizze_74188);
                struct memblock_device mem_77966;
                
                mem_77966.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77966, bytes_77864,
                                          "mem_77966")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74193,
                                                        1, sizeof(m_65343),
                                                        &m_65343));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74193,
                                                        2, sizeof(n_65344),
                                                        &n_65344));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74193,
                                                        3, sizeof(q_65346),
                                                        &q_65346));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74193,
                                                        4, sizeof(i_65358),
                                                        &i_65358));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74193,
                                                        5,
                                                        sizeof(mem_77934.mem),
                                                        &mem_77934.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74193,
                                                        6,
                                                        sizeof(mem_77966.mem),
                                                        &mem_77966.mem));
                if (1 * ((size_t) segmap_usable_groups_74189 *
                         (size_t) segmap_group_sizze_74188) != 0) {
                    const size_t global_work_sizze_80309[1] =
                                 {(size_t) segmap_usable_groups_74189 *
                                 (size_t) segmap_group_sizze_74188};
                    const size_t local_work_sizze_80313[1] =
                                 {(size_t) segmap_group_sizze_74188};
                    int64_t time_start_80310 = 0, time_end_80311 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_74193", global_work_sizze_80309[0],
                                local_work_sizze_80313[0], (int) 0);
                        time_start_80310 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_74193,
                                                                    1, NULL,
                                                                    global_work_sizze_80309,
                                                                    local_work_sizze_80313,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_74193_runs,
                                                                                                              &ctx->mainzisegmap_74193_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_80311 = get_wall_time();
                        
                        long time_diff_80312 = time_end_80311 -
                             time_start_80310;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_74193", time_diff_80312);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                struct memblock_device mem_77986;
                
                mem_77986.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77986, bytes_77827,
                                          "mem_77986")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_77990;
                
                mem_77990.references = NULL;
                if (memblock_alloc_device(ctx, &mem_77990, bytes_77827,
                                          "mem_77990")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        3,
                                                        (size_t) ((int64_t) 4 *
                                                                  q_65346),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        4,
                                                        (size_t) ((int64_t) 4 *
                                                                  q_65346),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        5,
                                                        (size_t) ((int64_t) 4 *
                                                                  q_65346),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        6,
                                                        (size_t) ((int64_t) 4 *
                                                                  q_65346),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        7,
                                                        (size_t) ((int64_t) 4 *
                                                                  q_65346),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        8,
                                                        (size_t) ((int64_t) 4 *
                                                                  q_65346),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        9,
                                                        (size_t) ((int64_t) 4 *
                                                                  q_65346),
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        10,
                                                        (size_t) bytes_77869,
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        11,
                                                        (size_t) bytes_77869,
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        12,
                                                        (size_t) bytes_77869,
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        13,
                                                        (size_t) bytes_77869,
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        14, sizeof(m_65343),
                                                        &m_65343));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        15, sizeof(n_65344),
                                                        &n_65344));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        16, sizeof(q_65346),
                                                        &q_65346));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        17, sizeof(jump_65348),
                                                        &jump_65348));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        18, sizeof(n_m_65352),
                                                        &n_m_65352));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        19, sizeof(i_65358),
                                                        &i_65358));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        20, sizeof(x_65359),
                                                        &x_65359));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        21,
                                                        sizeof(min_res_65364),
                                                        &min_res_65364));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        22,
                                                        sizeof(loop_cond_65369),
                                                        &loop_cond_65369));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        23,
                                                        sizeof(mem_77934.mem),
                                                        &mem_77934.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        24,
                                                        sizeof(mem_77938.mem),
                                                        &mem_77938.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        25,
                                                        sizeof(mem_77942.mem),
                                                        &mem_77942.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        26,
                                                        sizeof(mem_77948.mem),
                                                        &mem_77948.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        27,
                                                        sizeof(mem_77952.mem),
                                                        &mem_77952.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        28,
                                                        sizeof(mem_77955.mem),
                                                        &mem_77955.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        29,
                                                        sizeof(mem_77958.mem),
                                                        &mem_77958.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        30,
                                                        sizeof(mem_77961.mem),
                                                        &mem_77961.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        31,
                                                        sizeof(mem_77966.mem),
                                                        &mem_77966.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        32,
                                                        sizeof(mem_77986.mem),
                                                        &mem_77986.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_74210,
                                                        33,
                                                        sizeof(mem_77990.mem),
                                                        &mem_77990.mem));
                if (1 * ((size_t) binop_x_77825 * (size_t) q_65346) != 0) {
                    const size_t global_work_sizze_80314[1] =
                                 {(size_t) binop_x_77825 * (size_t) q_65346};
                    const size_t local_work_sizze_80318[1] = {(size_t) q_65346};
                    int64_t time_start_80315 = 0, time_end_80316 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                                "main.segmap_intragroup_74210",
                                global_work_sizze_80314[0],
                                local_work_sizze_80318[0], (int) (0 +
                                                                  (int64_t) 4 *
                                                                  q_65346 +
                                                                  (int64_t) 4 *
                                                                  q_65346 +
                                                                  (int64_t) 4 *
                                                                  q_65346 +
                                                                  (int64_t) 4 *
                                                                  q_65346 +
                                                                  (int64_t) 4 *
                                                                  q_65346 +
                                                                  (int64_t) 4 *
                                                                  q_65346 +
                                                                  (int64_t) 4 *
                                                                  q_65346 +
                                                                  bytes_77869 +
                                                                  bytes_77869 +
                                                                  bytes_77869 +
                                                                  bytes_77869));
                        time_start_80315 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_intragroup_74210,
                                                                    1, NULL,
                                                                    global_work_sizze_80314,
                                                                    local_work_sizze_80318,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_intragroup_74210_runs,
                                                                                                              &ctx->mainzisegmap_intragroup_74210_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_80316 = get_wall_time();
                        
                        long time_diff_80317 = time_end_80316 -
                             time_start_80315;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_intragroup_74210",
                                time_diff_80317);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_77934, "mem_77934") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77938, "mem_77938") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77942, "mem_77942") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77948, "mem_77948") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77952, "mem_77952") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77955, "mem_77955") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77958, "mem_77958") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77961, "mem_77961") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77966, "mem_77966") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_77992, &mem_77986,
                                        "mem_77986") != 0)
                    return 1;
                if (memblock_set_device(ctx, &ext_mem_77991, &mem_77990,
                                        "mem_77990") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77990, "mem_77990") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77986, "mem_77986") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77966, "mem_77966") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77961, "mem_77961") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77958, "mem_77958") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77955, "mem_77955") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77952, "mem_77952") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77948, "mem_77948") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77942, "mem_77942") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77938, "mem_77938") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_77934, "mem_77934") != 0)
                    return 1;
            }
            if (memblock_set_device(ctx, &ext_mem_77994, &ext_mem_77992,
                                    "ext_mem_77992") != 0)
                return 1;
            if (memblock_set_device(ctx, &ext_mem_77993, &ext_mem_77991,
                                    "ext_mem_77991") != 0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_77991, "ext_mem_77991") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_77992, "ext_mem_77992") !=
                0)
                return 1;
        }
        if (memblock_set_device(ctx, &ext_mem_77996, &ext_mem_77994,
                                "ext_mem_77994") != 0)
            return 1;
        if (memblock_set_device(ctx, &ext_mem_77995, &ext_mem_77993,
                                "ext_mem_77993") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_77993, "ext_mem_77993") != 0)
            return 1;
        if (memblock_unref_device(ctx, &ext_mem_77994, "ext_mem_77994") != 0)
            return 1;
    }
    
    bool cond_66632 = slt64((int64_t) 1, jump_65348);
    int64_t ext_78003;
    
    if (cond_66632) {
        ext_78003 = n_65344;
    } else {
        ext_78003 = n_m_65352;
    }
    
    int64_t binop_x_77998 = m_65343 * n_65344;
    int64_t binop_y_77999 = (int64_t) 4 * binop_x_77998;
    int64_t bytes_78000 = smax64((int64_t) 0, binop_y_77999);
    struct memblock_device ext_mem_78002;
    
    ext_mem_78002.references = NULL;
    if (cond_66632) {
        bool zzero_66634 = jump_65348 == (int64_t) 0;
        bool nonzzero_66635 = !zzero_66634;
        bool nonzzero_cert_66636;
        
        if (!nonzzero_66635) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  loess.fut:546:20-27\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  utils.fut:6:3-16\n   #4  loess.fut:545:3-549:9\n   #5  loess.fut:608:13-59\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  loess.fut:607:5-609:29\n   #9  loess.fut:572:1-611:26\n");
            if (memblock_unref_device(ctx, &ext_mem_78002, "ext_mem_78002") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_77995, "ext_mem_77995") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_77996, "ext_mem_77996") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_78270, "mem_out_78270") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        
        int64_t y_66637 = sub64(n_m_65352, (int64_t) 1);
        int64_t segmap_group_sizze_74550;
        
        segmap_group_sizze_74550 =
            *ctx->tuning_params.mainzisegmap_group_sizze_74432;
        
        int64_t segmap_usable_groups_74551 = sdiv_up64(binop_x_77998,
                                                       segmap_group_sizze_74550);
        struct memblock_device mem_78001;
        
        mem_78001.references = NULL;
        if (memblock_alloc_device(ctx, &mem_78001, bytes_78000, "mem_78001")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74555, 1,
                                                sizeof(ctx->failure_is_an_option),
                                                &ctx->failure_is_an_option));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74555, 3,
                                                sizeof(m_65343), &m_65343));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74555, 4,
                                                sizeof(n_65344), &n_65344));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74555, 5,
                                                sizeof(jump_65348),
                                                &jump_65348));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74555, 6,
                                                sizeof(n_m_65352), &n_m_65352));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74555, 7,
                                                sizeof(i_65358), &i_65358));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74555, 8,
                                                sizeof(y_66637), &y_66637));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74555, 9,
                                                sizeof(ext_mem_77995.mem),
                                                &ext_mem_77995.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74555, 10,
                                                sizeof(ext_mem_77996.mem),
                                                &ext_mem_77996.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_74555, 11,
                                                sizeof(mem_78001.mem),
                                                &mem_78001.mem));
        if (1 * ((size_t) segmap_usable_groups_74551 *
                 (size_t) segmap_group_sizze_74550) != 0) {
            const size_t global_work_sizze_80319[1] =
                         {(size_t) segmap_usable_groups_74551 *
                         (size_t) segmap_group_sizze_74550};
            const size_t local_work_sizze_80323[1] =
                         {(size_t) segmap_group_sizze_74550};
            int64_t time_start_80320 = 0, time_end_80321 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log,
                        "Launching %s with global work size [%zu] and local work size [%zu]; local memory: %d bytes.\n",
                        "main.segmap_74555", global_work_sizze_80319[0],
                        local_work_sizze_80323[0], (int) 0);
                time_start_80320 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_74555,
                                                            1, NULL,
                                                            global_work_sizze_80319,
                                                            local_work_sizze_80323,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_74555_runs,
                                                                                                      &ctx->mainzisegmap_74555_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_80321 = get_wall_time();
                
                long time_diff_80322 = time_end_80321 - time_start_80320;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_74555", time_diff_80322);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &ext_mem_78002, &mem_78001, "mem_78001") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_78001, "mem_78001") != 0)
            return 1;
    } else {
        bool dim_match_66689 = n_65344 == n_m_65352;
        bool empty_or_match_cert_66690;
        
        if (!dim_match_66689) {
            ctx->error =
                msgprintf("Error: %s%lld%s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                          "Value of (core language) shape (",
                          (long long) m_65343, ", ", (long long) n_m_65352,
                          ") cannot match shape of type `[",
                          (long long) m_65343, "][", (long long) n_65344,
                          "]f32`.",
                          "-> #0  loess.fut:611:5-26\n   #1  loess.fut:572:1-611:26\n");
            if (memblock_unref_device(ctx, &ext_mem_78002, "ext_mem_78002") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_77995, "ext_mem_77995") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &ext_mem_77996, "ext_mem_77996") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &mem_out_78270, "mem_out_78270") !=
                0)
                return 1;
            err = 1;
            goto cleanup;
        }
        if (memblock_set_device(ctx, &ext_mem_78002, &ext_mem_77996,
                                "ext_mem_77996") != 0)
            return 1;
    }
    if (memblock_unref_device(ctx, &ext_mem_77995, "ext_mem_77995") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_77996, "ext_mem_77996") != 0)
        return 1;
    
    struct memblock_device mem_78007;
    
    mem_78007.references = NULL;
    if (memblock_alloc_device(ctx, &mem_78007, bytes_78000, "mem_78007")) {
        err = 1;
        goto cleanup;
    }
    if (m_65343 * n_65344 * (int64_t) 4 > 0) {
        OPENCL_SUCCEED_OR_RETURN(clEnqueueCopyBuffer(ctx->opencl.queue,
                                                     ext_mem_78002.mem,
                                                     mem_78007.mem,
                                                     (size_t) (int64_t) 0,
                                                     (size_t) (int64_t) 0,
                                                     (size_t) (m_65343 *
                                                               n_65344 *
                                                               (int64_t) 4), 0,
                                                     NULL,
                                                     ctx->profiling_paused ||
                                                     !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                               &ctx->copy_dev_to_dev_runs,
                                                                                               &ctx->copy_dev_to_dev_total_runtime)));
        if (ctx->debugging)
            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
    }
    if (memblock_unref_device(ctx, &ext_mem_78002, "ext_mem_78002") != 0)
        return 1;
    if (memblock_set_device(ctx, &mem_out_78270, &mem_78007, "mem_78007") != 0)
        return 1;
    (*mem_out_p_79967).references = NULL;
    if (memblock_set_device(ctx, &*mem_out_p_79967, &mem_out_78270,
                            "mem_out_78270") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_78007, "mem_78007") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_78002, "ext_mem_78002") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_77995, "ext_mem_77995") != 0)
        return 1;
    if (memblock_unref_device(ctx, &ext_mem_77996, "ext_mem_77996") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_out_78270, "mem_out_78270") != 0)
        return 1;
    
  cleanup:
    { }
    return err;
}

int futhark_entry_main(struct futhark_context *ctx,
                       struct futhark_f32_2d **out0, const
                       struct futhark_f32_2d *in0, const int64_t in1, const
                       int64_t in2, const int64_t in3, const int64_t in4, const
                       int64_t in5)
{
    struct memblock_device Y_mem_76976;
    
    Y_mem_76976.references = NULL;
    
    int64_t m_65343;
    int64_t n_65344;
    int64_t q_65346;
    int64_t degree_65347;
    int64_t jump_65348;
    int64_t jump_threshold_65349;
    int64_t q_threshold_65350;
    struct memblock_device mem_out_78270;
    
    mem_out_78270.references = NULL;
    
    int ret = 0;
    
    lock_lock(&ctx->lock);
    Y_mem_76976 = in0->mem;
    m_65343 = in0->shape[0];
    n_65344 = in0->shape[1];
    q_65346 = in1;
    degree_65347 = in2;
    jump_65348 = in3;
    jump_threshold_65349 = in4;
    q_threshold_65350 = in5;
    if (!(m_65343 == in0->shape[0] && n_65344 == in0->shape[1])) {
        ret = 1;
        if (!ctx->error)
            ctx->error =
                msgprintf("Error: entry point arguments have invalid sizes.\n");
    }
    if (ret == 0) {
        ret = futrts_entry_main(ctx, &mem_out_78270, Y_mem_76976, m_65343,
                                n_65344, q_65346, degree_65347, jump_65348,
                                jump_threshold_65349, q_threshold_65350);
        if (ret == 0) {
            assert((*out0 =
                    (struct futhark_f32_2d *) malloc(sizeof(struct futhark_f32_2d))) !=
                NULL);
            (*out0)->mem = mem_out_78270;
            (*out0)->shape[0] = m_65343;
            (*out0)->shape[1] = n_65344;
        }
    }
    lock_unlock(&ctx->lock);
    return ret;
}
  
