// Generated by Futhark 0.20.0
// git: 5cc4d4b (Tue Jul 6 11:53:53 2021 -0700)
#ifndef _GNU_SOURCE
#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

#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_size(struct futhark_context_config *cfg, const
                                    char *size_name, size_t size_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_num_sizes(void);
const char *futhark_get_size_name(int);
const char *futhark_get_size_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, int 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,
                       struct futhark_f32_2d **out1,
                       struct futhark_f32_2d **out2, 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, const int64_t in6, const int64_t in7, const
                       int64_t in8, const int64_t in9, const int64_t in10, const
                       int64_t in11);

// 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>
#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, ...) {
  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, msg...) check_err(err, 0, __func__, __LINE__, msg)
#define CHECK_ERRNO(err, msg...) check_err(err, 1, __func__, __LINE__, msg)

// 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) {
  size_t start = ftell(f);
  fseek(f, 0, SEEK_END);
  size_t src_size = ftell(f)-start;
  fseek(f, start, SEEK_SET);
  unsigned char *s = (unsigned char*) malloc(src_size + 1);
  if (fread(s, 1, src_size, f) != src_size) {
    free(s);
    s = NULL;
  } else {
    s[src_size] = '\0';
  }

  if (size) {
    *size = 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 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.

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 x << y;
}
static inline uint16_t shl16(uint16_t x, uint16_t y)
{
    return 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 int8_t pow8(int8_t x, int8_t y)
{
    int8_t res = 1, rem = y;
    
    while (rem != 0) {
        if (rem & 1)
            res *= x;
        rem >>= 1;
        x *= x;
    }
    return res;
}
static inline int16_t pow16(int16_t x, int16_t y)
{
    int16_t res = 1, rem = y;
    
    while (rem != 0) {
        if (rem & 1)
            res *= x;
        rem >>= 1;
        x *= x;
    }
    return res;
}
static inline int32_t pow32(int32_t x, int32_t y)
{
    int32_t res = 1, rem = y;
    
    while (rem != 0) {
        if (rem & 1)
            res *= x;
        rem >>= 1;
        x *= x;
    }
    return res;
}
static inline int64_t pow64(int64_t x, int64_t y)
{
    int64_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)
#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
static int32_t futrts_popc8(int8_t x)
{
    int c = 0;
    
    for (; x; ++c)
        x &= x - 1;
    return c;
}
static int32_t futrts_popc16(int16_t x)
{
    int c = 0;
    
    for (; x; ++c)
        x &= x - 1;
    return c;
}
static int32_t futrts_popc32(int32_t x)
{
    int c = 0;
    
    for (; x; ++c)
        x &= x - 1;
    return c;
}
static int32_t futrts_popc64(int64_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
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
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
static int32_t futrts_clzz8(int8_t x)
{
    int n = 0;
    int bits = sizeof(x) * 8;
    
    for (int i = 0; i < bits; i++) {
        if (x < 0)
            break;
        n++;
        x <<= 1;
    }
    return n;
}
static int32_t futrts_clzz16(int16_t x)
{
    int n = 0;
    int bits = sizeof(x) * 8;
    
    for (int i = 0; i < bits; i++) {
        if (x < 0)
            break;
        n++;
        x <<= 1;
    }
    return n;
}
static int32_t futrts_clzz32(int32_t x)
{
    int n = 0;
    int bits = sizeof(x) * 8;
    
    for (int i = 0; i < bits; i++) {
        if (x < 0)
            break;
        n++;
        x <<= 1;
    }
    return n;
}
static int32_t futrts_clzz64(int64_t x)
{
    int n = 0;
    int bits = sizeof(x) * 8;
    
    for (int i = 0; i < bits; i++) {
        if (x < 0)
            break;
        n++;
        x <<= 1;
    }
    return n;
}
#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
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(x);
}
static int32_t futrts_ctzz64(int64_t x)
{
    return x == 0 ? 64 : __builtin_ctzll(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 float fmin32(float x, float y)
{
    return fmin(x, y);
}
static inline float fmax32(float x, float y)
{
    return fmax(x, y);
}
static inline float fpow32(float x, float y)
{
    return pow(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;
}
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 double fmin64(double x, double y)
{
    return fmin(x, y);
}
static inline double fmax64(double x, double y)
{
    return fmax(x, y);
}
static inline double fpow64(double x, double y)
{
    return pow(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 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;
}
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
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);
}
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);
}
#ifdef __OPENCL_VERSION__
static inline double futrts_lerp64(double v0, double v1, double t)
{
    return mix(v0, v1, t);
}
static inline double futrts_mad64(double a, double b, double c)
{
    return mad(a, b, c);
}
#else
static inline double futrts_lerp64(double v0, double v1, double t)
{
    return v0 + (v1 - v0) * t;
}
static inline double futrts_mad64(double a, double b, double c)
{
    return a * b + c;
}
#endif
static int init_constants(struct futhark_context *);
static int free_constants(struct futhark_context *);
static int32_t mainzicounter_mem_realtype_135524[10240];
static int32_t mainzicounter_mem_realtype_135585[10240];
static int32_t mainzicounter_mem_realtype_135646[10240];
static int32_t mainzicounter_mem_realtype_135677[10240];
static int32_t mainzicounter_mem_realtype_135708[10240];
static int32_t mainzicounter_mem_realtype_135734[10240];
static int32_t mainzicounter_mem_realtype_135760[10240];
static int32_t mainzicounter_mem_realtype_135801[10240];
static int32_t mainzicounter_mem_realtype_135817[10240];
static int32_t mainzicounter_mem_realtype_135838[10240];
static int32_t mainzicounter_mem_realtype_135854[10240];
static int32_t mainzicounter_mem_realtype_135875[10240];
static int32_t mainzicounter_mem_realtype_135891[10240];
static int32_t mainzicounter_mem_realtype_135952[10240];
static int32_t mainzicounter_mem_realtype_135968[10240];
static int32_t mainzicounter_mem_realtype_135989[10240];
static int32_t mainzicounter_mem_realtype_136005[10240];
static int32_t mainzicounter_mem_realtype_136026[10240];
static int32_t mainzicounter_mem_realtype_136042[10240];
static int32_t mainzicounter_mem_realtype_136123[10240];
struct memblock_device {
    int *references;
    cl_mem mem;
    int64_t size;
    const char *desc;
};
struct memblock {
    int *references;
    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(unsigned 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(unsigned 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]);
  }

  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, 1, 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[] =
                  {"#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__kernel void dummy_kernel(__global unsigned char *dummy, int n)\n{\n    const int thread_gid = get_global_id(0);\n    \n    if (thread_gid >= n)\n        return;\n}\n#pragma OPENCL EXTENSION cl_khr_int64_base_atomics : enable\n#pragma OPENCL EXTENSION cl_khr_int64_extended_atomics : enable\ntypedef char int8_t;\ntypedef short int16_t;\ntypedef int int32_t;\ntypedef long int64_t;\ntypedef uchar uint8_t;\ntypedef ushort uint16_t;\ntypedef uint uint32_t;\ntypedef ulong uint64_t;\n#ifdef cl_nv_pragma_unroll\nstatic inline void mem_fence_global()\n{\n    asm(\"membar.gl;\");\n}\n#else\nstatic inline void mem_fence_global()\n{\n    mem_fence(CLK_LOCAL_MEM_FENCE | CLK_GLOBAL_MEM_FENCE);\n}\n#endif\nstatic inline void mem_fence_local()\n{\n    mem_fence(CLK_LOCAL_MEM_FENCE);\n}\nstatic inline uint8_t add8(uint8_t x, uint8_t y)\n{\n    return x + y;\n}\nstatic inline uint16_t add16(uint16_t x, uint16_t y)\n{\n    return x + y;\n}\nstatic inline uint32_t add32(uint32_t x, uint32_t y)\n{\n    return x + y;\n}\nstatic inline uint64_t add64(uint64_t x, uint64_t y)\n{\n    return x + y;\n}\nstatic inline uint8_t sub8(uint8_t x, uint8_t y)\n{\n    return x - y;\n}\nstatic inline uint16_t sub16(uint16_t x, uint16_t y)\n{\n    return x - y;\n}\nstatic inline uint32_t sub32(uint32_t x, uint32_t y)\n{\n    return x - y;\n}\nstatic inline uint64_t sub64(uint64_t x, uint64_t y)\n{\n    return x - y;\n}\nstatic inline uint8_t mul8(uint8_t x, uint8_t y)\n{\n    return x * y;\n}\nstatic inline uint16_t mul16(uint16_t x, uint16_t y)\n{\n    return x * y;\n}\nstatic inline uint32_t mul32(uint32_t x, uint32_t y)\n{\n    return x * y;\n}\nstatic inline uint64_t mul64(uint64_t x, uint64_t y)\n{\n    return x * y;\n}\nstatic inline uint8_t udiv8(uint8_t x, uint8_t y)\n{\n    return x / y;\n}\nstatic inline uint16_t udiv16(uint16_t x, uint16_t y)\n{\n    return x / y;\n}\nstatic inline uint32_t udiv32(uint3",
                   "2_t x, uint32_t y)\n{\n    return x / y;\n}\nstatic inline uint64_t udiv64(uint64_t x, uint64_t y)\n{\n    return x / y;\n}\nstatic inline uint8_t udiv_up8(uint8_t x, uint8_t y)\n{\n    return (x + y - 1) / y;\n}\nstatic inline uint16_t udiv_up16(uint16_t x, uint16_t y)\n{\n    return (x + y - 1) / y;\n}\nstatic inline uint32_t udiv_up32(uint32_t x, uint32_t y)\n{\n    return (x + y - 1) / y;\n}\nstatic inline uint64_t udiv_up64(uint64_t x, uint64_t y)\n{\n    return (x + y - 1) / y;\n}\nstatic inline uint8_t umod8(uint8_t x, uint8_t y)\n{\n    return x % y;\n}\nstatic inline uint16_t umod16(uint16_t x, uint16_t y)\n{\n    return x % y;\n}\nstatic inline uint32_t umod32(uint32_t x, uint32_t y)\n{\n    return x % y;\n}\nstatic inline uint64_t umod64(uint64_t x, uint64_t y)\n{\n    return x % y;\n}\nstatic inline uint8_t udiv_safe8(uint8_t x, uint8_t y)\n{\n    return y == 0 ? 0 : x / y;\n}\nstatic inline uint16_t udiv_safe16(uint16_t x, uint16_t y)\n{\n    return y == 0 ? 0 : x / y;\n}\nstatic inline uint32_t udiv_safe32(uint32_t x, uint32_t y)\n{\n    return y == 0 ? 0 : x / y;\n}\nstatic inline uint64_t udiv_safe64(uint64_t x, uint64_t y)\n{\n    return y == 0 ? 0 : x / y;\n}\nstatic inline uint8_t udiv_up_safe8(uint8_t x, uint8_t y)\n{\n    return y == 0 ? 0 : (x + y - 1) / y;\n}\nstatic inline uint16_t udiv_up_safe16(uint16_t x, uint16_t y)\n{\n    return y == 0 ? 0 : (x + y - 1) / y;\n}\nstatic inline uint32_t udiv_up_safe32(uint32_t x, uint32_t y)\n{\n    return y == 0 ? 0 : (x + y - 1) / y;\n}\nstatic inline uint64_t udiv_up_safe64(uint64_t x, uint64_t y)\n{\n    return y == 0 ? 0 : (x + y - 1) / y;\n}\nstatic inline uint8_t umod_safe8(uint8_t x, uint8_t y)\n{\n    return y == 0 ? 0 : x % y;\n}\nstatic inline uint16_t umod_safe16(uint16_t x, uint16_t y)\n{\n    return y == 0 ? 0 : x % y;\n}\nstatic inline uint32_t umod_safe32(uint32_t x, uint32_t y)\n{\n    return y == 0 ? 0 : x % y;\n}\nstatic inline uint64_t umod_safe64(uint64_t x, uint64_t y)\n{\n    return y == 0 ? 0 : x % y;\n}\nstatic inline int8_t sdiv8(int8_t x, int8_t y)\n{\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}\nstatic inline int16_t sdiv16(int16_t x, int16_t y)\n{\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}\nstatic inline int32_t sdiv32(int32_t x, int32_t y)\n{\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}\nstatic inline int64_t sdiv64(int64_t x, int64_t y)\n{\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}\nstatic inline int8_t sdiv_up8(int8_t x, int8_t y)\n{\n    return sdiv8(x + y - 1, y);\n}\nstatic inline int16_t sdiv_up16(int16_t x, int16_t y)\n{\n    return sdiv16(x + y - 1, y);\n}\nstatic inline int32_t sdiv_up32(int32_t x, int32_t y)\n{\n    return sdiv32(x + y - 1, y);\n}\nstatic inline int64_t sdiv_up64(int64_t x, int64_t y)\n{\n    return sdiv64(x + y - 1, y);\n}\nstatic inline int8_t smod8(int8_t x, int8_t y)\n{\n    int8_t r = x % y;\n    \n    return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);\n}\nstatic inline int16_t smod16(int16_t x, int16_t y)\n{\n    int16_t r = x % y;\n    \n    return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);\n}\nstatic inline int32_t smod32(int32_t x, int32_t y)\n{\n    int32_t r = x % y;\n    \n    return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);\n}\nstatic inline int64_t smod64(int64_t x, int64_t y)\n{\n    int64_t r = x % y;\n    \n    return r + (r == 0 || (x > 0 && y > 0) || (x < 0 && y < 0) ? 0 : y);\n}\nstatic inline int8_t sdiv_safe8(int8_t x, int8_t y)\n{\n    return y == 0 ? 0 : sdiv8(x, y);\n}\nstatic inline int16_t sdiv_safe16(int16_t x, int16_t y)\n{\n    return y == 0 ? 0 : sdiv16(x, y);\n}\nstatic inline int32_t sdiv_safe32(int32_t x, int32_t y)\n{\n    return y == 0 ? 0 : sdiv32(x, y);\n}\nstatic inline int64_t sdiv_safe64(int64_t x, int64_t y)\n{\n    return y == 0 ? 0 : sdiv64(x, y);\n}\nstatic inline int8_t sdiv_up_safe8(int8_t x, int8_t y)\n{\n    return ",
                   "sdiv_safe8(x + y - 1, y);\n}\nstatic inline int16_t sdiv_up_safe16(int16_t x, int16_t y)\n{\n    return sdiv_safe16(x + y - 1, y);\n}\nstatic inline int32_t sdiv_up_safe32(int32_t x, int32_t y)\n{\n    return sdiv_safe32(x + y - 1, y);\n}\nstatic inline int64_t sdiv_up_safe64(int64_t x, int64_t y)\n{\n    return sdiv_safe64(x + y - 1, y);\n}\nstatic inline int8_t smod_safe8(int8_t x, int8_t y)\n{\n    return y == 0 ? 0 : smod8(x, y);\n}\nstatic inline int16_t smod_safe16(int16_t x, int16_t y)\n{\n    return y == 0 ? 0 : smod16(x, y);\n}\nstatic inline int32_t smod_safe32(int32_t x, int32_t y)\n{\n    return y == 0 ? 0 : smod32(x, y);\n}\nstatic inline int64_t smod_safe64(int64_t x, int64_t y)\n{\n    return y == 0 ? 0 : smod64(x, y);\n}\nstatic inline int8_t squot8(int8_t x, int8_t y)\n{\n    return x / y;\n}\nstatic inline int16_t squot16(int16_t x, int16_t y)\n{\n    return x / y;\n}\nstatic inline int32_t squot32(int32_t x, int32_t y)\n{\n    return x / y;\n}\nstatic inline int64_t squot64(int64_t x, int64_t y)\n{\n    return x / y;\n}\nstatic inline int8_t srem8(int8_t x, int8_t y)\n{\n    return x % y;\n}\nstatic inline int16_t srem16(int16_t x, int16_t y)\n{\n    return x % y;\n}\nstatic inline int32_t srem32(int32_t x, int32_t y)\n{\n    return x % y;\n}\nstatic inline int64_t srem64(int64_t x, int64_t y)\n{\n    return x % y;\n}\nstatic inline int8_t squot_safe8(int8_t x, int8_t y)\n{\n    return y == 0 ? 0 : x / y;\n}\nstatic inline int16_t squot_safe16(int16_t x, int16_t y)\n{\n    return y == 0 ? 0 : x / y;\n}\nstatic inline int32_t squot_safe32(int32_t x, int32_t y)\n{\n    return y == 0 ? 0 : x / y;\n}\nstatic inline int64_t squot_safe64(int64_t x, int64_t y)\n{\n    return y == 0 ? 0 : x / y;\n}\nstatic inline int8_t srem_safe8(int8_t x, int8_t y)\n{\n    return y == 0 ? 0 : x % y;\n}\nstatic inline int16_t srem_safe16(int16_t x, int16_t y)\n{\n    return y == 0 ? 0 : x % y;\n}\nstatic inline int32_t srem_safe32(int32_t x, int32_t y)\n{\n    return y == 0 ? 0 : x % y;\n}\nstatic inline int64_t srem_safe64(int64_t x, int64_t y)\n{\n    return ",
                   "y == 0 ? 0 : x % y;\n}\nstatic inline int8_t smin8(int8_t x, int8_t y)\n{\n    return x < y ? x : y;\n}\nstatic inline int16_t smin16(int16_t x, int16_t y)\n{\n    return x < y ? x : y;\n}\nstatic inline int32_t smin32(int32_t x, int32_t y)\n{\n    return x < y ? x : y;\n}\nstatic inline int64_t smin64(int64_t x, int64_t y)\n{\n    return x < y ? x : y;\n}\nstatic inline uint8_t umin8(uint8_t x, uint8_t y)\n{\n    return x < y ? x : y;\n}\nstatic inline uint16_t umin16(uint16_t x, uint16_t y)\n{\n    return x < y ? x : y;\n}\nstatic inline uint32_t umin32(uint32_t x, uint32_t y)\n{\n    return x < y ? x : y;\n}\nstatic inline uint64_t umin64(uint64_t x, uint64_t y)\n{\n    return x < y ? x : y;\n}\nstatic inline int8_t smax8(int8_t x, int8_t y)\n{\n    return x < y ? y : x;\n}\nstatic inline int16_t smax16(int16_t x, int16_t y)\n{\n    return x < y ? y : x;\n}\nstatic inline int32_t smax32(int32_t x, int32_t y)\n{\n    return x < y ? y : x;\n}\nstatic inline int64_t smax64(int64_t x, int64_t y)\n{\n    return x < y ? y : x;\n}\nstatic inline uint8_t umax8(uint8_t x, uint8_t y)\n{\n    return x < y ? y : x;\n}\nstatic inline uint16_t umax16(uint16_t x, uint16_t y)\n{\n    return x < y ? y : x;\n}\nstatic inline uint32_t umax32(uint32_t x, uint32_t y)\n{\n    return x < y ? y : x;\n}\nstatic inline uint64_t umax64(uint64_t x, uint64_t y)\n{\n    return x < y ? y : x;\n}\nstatic inline uint8_t shl8(uint8_t x, uint8_t y)\n{\n    return x << y;\n}\nstatic inline uint16_t shl16(uint16_t x, uint16_t y)\n{\n    return x << y;\n}\nstatic inline uint32_t shl32(uint32_t x, uint32_t y)\n{\n    return x << y;\n}\nstatic inline uint64_t shl64(uint64_t x, uint64_t y)\n{\n    return x << y;\n}\nstatic inline uint8_t lshr8(uint8_t x, uint8_t y)\n{\n    return x >> y;\n}\nstatic inline uint16_t lshr16(uint16_t x, uint16_t y)\n{\n    return x >> y;\n}\nstatic inline uint32_t lshr32(uint32_t x, uint32_t y)\n{\n    return x >> y;\n}\nstatic inline uint64_t lshr64(uint64_t x, uint64_t y)\n{\n    return x >> y;\n}\nstatic inline int8_t ashr8(int8_t x, int8_t y)\n{\n    return x >> y;\n}\n",
                   "static inline int16_t ashr16(int16_t x, int16_t y)\n{\n    return x >> y;\n}\nstatic inline int32_t ashr32(int32_t x, int32_t y)\n{\n    return x >> y;\n}\nstatic inline int64_t ashr64(int64_t x, int64_t y)\n{\n    return x >> y;\n}\nstatic inline uint8_t and8(uint8_t x, uint8_t y)\n{\n    return x & y;\n}\nstatic inline uint16_t and16(uint16_t x, uint16_t y)\n{\n    return x & y;\n}\nstatic inline uint32_t and32(uint32_t x, uint32_t y)\n{\n    return x & y;\n}\nstatic inline uint64_t and64(uint64_t x, uint64_t y)\n{\n    return x & y;\n}\nstatic inline uint8_t or8(uint8_t x, uint8_t y)\n{\n    return x | y;\n}\nstatic inline uint16_t or16(uint16_t x, uint16_t y)\n{\n    return x | y;\n}\nstatic inline uint32_t or32(uint32_t x, uint32_t y)\n{\n    return x | y;\n}\nstatic inline uint64_t or64(uint64_t x, uint64_t y)\n{\n    return x | y;\n}\nstatic inline uint8_t xor8(uint8_t x, uint8_t y)\n{\n    return x ^ y;\n}\nstatic inline uint16_t xor16(uint16_t x, uint16_t y)\n{\n    return x ^ y;\n}\nstatic inline uint32_t xor32(uint32_t x, uint32_t y)\n{\n    return x ^ y;\n}\nstatic inline uint64_t xor64(uint64_t x, uint64_t y)\n{\n    return x ^ y;\n}\nstatic inline bool ult8(uint8_t x, uint8_t y)\n{\n    return x < y;\n}\nstatic inline bool ult16(uint16_t x, uint16_t y)\n{\n    return x < y;\n}\nstatic inline bool ult32(uint32_t x, uint32_t y)\n{\n    return x < y;\n}\nstatic inline bool ult64(uint64_t x, uint64_t y)\n{\n    return x < y;\n}\nstatic inline bool ule8(uint8_t x, uint8_t y)\n{\n    return x <= y;\n}\nstatic inline bool ule16(uint16_t x, uint16_t y)\n{\n    return x <= y;\n}\nstatic inline bool ule32(uint32_t x, uint32_t y)\n{\n    return x <= y;\n}\nstatic inline bool ule64(uint64_t x, uint64_t y)\n{\n    return x <= y;\n}\nstatic inline bool slt8(int8_t x, int8_t y)\n{\n    return x < y;\n}\nstatic inline bool slt16(int16_t x, int16_t y)\n{\n    return x < y;\n}\nstatic inline bool slt32(int32_t x, int32_t y)\n{\n    return x < y;\n}\nstatic inline bool slt64(int64_t x, int64_t y)\n{\n    return x < y;\n}\nstatic inline bool sle8(int8_t x, int8_t y)\n{\n    retur",
                   "n x <= y;\n}\nstatic inline bool sle16(int16_t x, int16_t y)\n{\n    return x <= y;\n}\nstatic inline bool sle32(int32_t x, int32_t y)\n{\n    return x <= y;\n}\nstatic inline bool sle64(int64_t x, int64_t y)\n{\n    return x <= y;\n}\nstatic inline int8_t pow8(int8_t x, int8_t y)\n{\n    int8_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}\nstatic inline int16_t pow16(int16_t x, int16_t y)\n{\n    int16_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}\nstatic inline int32_t pow32(int32_t x, int32_t y)\n{\n    int32_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}\nstatic inline int64_t pow64(int64_t x, int64_t y)\n{\n    int64_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}\nstatic inline bool itob_i8_bool(int8_t x)\n{\n    return x;\n}\nstatic inline bool itob_i16_bool(int16_t x)\n{\n    return x;\n}\nstatic inline bool itob_i32_bool(int32_t x)\n{\n    return x;\n}\nstatic inline bool itob_i64_bool(int64_t x)\n{\n    return x;\n}\nstatic inline int8_t btoi_bool_i8(bool x)\n{\n    return x;\n}\nstatic inline int16_t btoi_bool_i16(bool x)\n{\n    return x;\n}\nstatic inline int32_t btoi_bool_i32(bool x)\n{\n    return x;\n}\nstatic inline int64_t btoi_bool_i64(bool x)\n{\n    return x;\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#if defined(__OPENCL_VERSION__)\nstatic int32_t futrts_popc8(int8_t x)\n{\n    return popcount(x);\n}\nstatic int32_t futrts_popc16(int16_t x)\n{\n    return popcount(x);\n}\nstatic int32_t futrts_popc32(int32_t x)\n{\n    return popcount(x);\n}\nstatic int32_t futrts_popc64(int64_t x)\n{\n    return popcount(x);\n}\n#elif defined(__CUDA_ARCH__)\nstatic int32_t futrts_popc8(int8_t x)\n{\n    return __popc(zext_i8_i32(x));\n}\nstatic int32_t futrts_popc16(int16_t x)\n{\n    return __popc(zext_i16_i32(x));\n}\nstatic int32_t futrts_popc32(int32_t x)\n{\n    return __popc(x);\n}\nstatic int32_t futrts_popc64(int64_t x)\n{\n    return __popcll(x);\n}\n#else\nstatic int32_t futrts_popc8(int8_t x)\n{\n    int c = 0;\n    \n    for (; x; ++c)\n        x &= x - 1;\n    return c;\n}\nstatic int32_t futrts_popc16(int16_t x)\n{\n    int c = 0;\n    \n    for (; x; ++c)\n        x &= x - 1;\n    return c;\n}\nstatic int32_t futrts_popc32(int32_t x)\n{\n    int c = 0;\n    \n ",
                   "   for (; x; ++c)\n        x &= x - 1;\n    return c;\n}\nstatic int32_t futrts_popc64(int64_t x)\n{\n    int c = 0;\n    \n    for (; x; ++c)\n        x &= x - 1;\n    return c;\n}\n#endif\n#if defined(__OPENCL_VERSION__)\nstatic uint8_t futrts_mul_hi8(uint8_t a, uint8_t b)\n{\n    return mul_hi(a, b);\n}\nstatic uint16_t futrts_mul_hi16(uint16_t a, uint16_t b)\n{\n    return mul_hi(a, b);\n}\nstatic uint32_t futrts_mul_hi32(uint32_t a, uint32_t b)\n{\n    return mul_hi(a, b);\n}\nstatic uint64_t futrts_mul_hi64(uint64_t a, uint64_t b)\n{\n    return mul_hi(a, b);\n}\n#elif defined(__CUDA_ARCH__)\nstatic uint8_t futrts_mul_hi8(uint8_t a, uint8_t b)\n{\n    uint16_t aa = a;\n    uint16_t bb = b;\n    \n    return aa * bb >> 8;\n}\nstatic uint16_t futrts_mul_hi16(uint16_t a, uint16_t b)\n{\n    uint32_t aa = a;\n    uint32_t bb = b;\n    \n    return aa * bb >> 16;\n}\nstatic uint32_t futrts_mul_hi32(uint32_t a, uint32_t b)\n{\n    return mulhi(a, b);\n}\nstatic uint64_t futrts_mul_hi64(uint64_t a, uint64_t b)\n{\n    return mul64hi(a, b);\n}\n#else\nstatic uint8_t futrts_mul_hi8(uint8_t a, uint8_t b)\n{\n    uint16_t aa = a;\n    uint16_t bb = b;\n    \n    return aa * bb >> 8;\n}\nstatic uint16_t futrts_mul_hi16(uint16_t a, uint16_t b)\n{\n    uint32_t aa = a;\n    uint32_t bb = b;\n    \n    return aa * bb >> 16;\n}\nstatic uint32_t futrts_mul_hi32(uint32_t a, uint32_t b)\n{\n    uint64_t aa = a;\n    uint64_t bb = b;\n    \n    return aa * bb >> 32;\n}\nstatic uint64_t futrts_mul_hi64(uint64_t a, uint64_t b)\n{\n    __uint128_t aa = a;\n    __uint128_t bb = b;\n    \n    return aa * bb >> 64;\n}\n#endif\n#if defined(__OPENCL_VERSION__)\nstatic uint8_t futrts_mad_hi8(uint8_t a, uint8_t b, uint8_t c)\n{\n    return mad_hi(a, b, c);\n}\nstatic uint16_t futrts_mad_hi16(uint16_t a, uint16_t b, uint16_t c)\n{\n    return mad_hi(a, b, c);\n}\nstatic uint32_t futrts_mad_hi32(uint32_t a, uint32_t b, uint32_t c)\n{\n    return mad_hi(a, b, c);\n}\nstatic uint64_t futrts_mad_hi64(uint64_t a, uint64_t b, uint64_t c)\n{\n    return mad_hi(a, b, c);\n}\n#else\nstatic uint8_t ",
                   "futrts_mad_hi8(uint8_t a, uint8_t b, uint8_t c)\n{\n    return futrts_mul_hi8(a, b) + c;\n}\nstatic uint16_t futrts_mad_hi16(uint16_t a, uint16_t b, uint16_t c)\n{\n    return futrts_mul_hi16(a, b) + c;\n}\nstatic uint32_t futrts_mad_hi32(uint32_t a, uint32_t b, uint32_t c)\n{\n    return futrts_mul_hi32(a, b) + c;\n}\nstatic uint64_t futrts_mad_hi64(uint64_t a, uint64_t b, uint64_t c)\n{\n    return futrts_mul_hi64(a, b) + c;\n}\n#endif\n#if defined(__OPENCL_VERSION__)\nstatic int32_t futrts_clzz8(int8_t x)\n{\n    return clz(x);\n}\nstatic int32_t futrts_clzz16(int16_t x)\n{\n    return clz(x);\n}\nstatic int32_t futrts_clzz32(int32_t x)\n{\n    return clz(x);\n}\nstatic int32_t futrts_clzz64(int64_t x)\n{\n    return clz(x);\n}\n#elif defined(__CUDA_ARCH__)\nstatic int32_t futrts_clzz8(int8_t x)\n{\n    return __clz(zext_i8_i32(x)) - 24;\n}\nstatic int32_t futrts_clzz16(int16_t x)\n{\n    return __clz(zext_i16_i32(x)) - 16;\n}\nstatic int32_t futrts_clzz32(int32_t x)\n{\n    return __clz(x);\n}\nstatic int32_t futrts_clzz64(int64_t x)\n{\n    return __clzll(x);\n}\n#else\nstatic int32_t futrts_clzz8(int8_t x)\n{\n    int n = 0;\n    int bits = sizeof(x) * 8;\n    \n    for (int i = 0; i < bits; i++) {\n        if (x < 0)\n            break;\n        n++;\n        x <<= 1;\n    }\n    return n;\n}\nstatic int32_t futrts_clzz16(int16_t x)\n{\n    int n = 0;\n    int bits = sizeof(x) * 8;\n    \n    for (int i = 0; i < bits; i++) {\n        if (x < 0)\n            break;\n        n++;\n        x <<= 1;\n    }\n    return n;\n}\nstatic int32_t futrts_clzz32(int32_t x)\n{\n    int n = 0;\n    int bits = sizeof(x) * 8;\n    \n    for (int i = 0; i < bits; i++) {\n        if (x < 0)\n            break;\n        n++;\n        x <<= 1;\n    }\n    return n;\n}\nstatic int32_t futrts_clzz64(int64_t x)\n{\n    int n = 0;\n    int bits = sizeof(x) * 8;\n    \n    for (int i = 0; i < bits; i++) {\n        if (x < 0)\n            break;\n        n++;\n        x <<= 1;\n    }\n    return n;\n}\n#endif\n#if defined(__OPENCL_VERSION__)\nstatic int32_t futrts_ctzz8(int8_t x)\n{\n    int",
                   " i = 0;\n    \n    for (; i < 8 && (x & 1) == 0; i++, x >>= 1)\n        ;\n    return i;\n}\nstatic int32_t futrts_ctzz16(int16_t x)\n{\n    int i = 0;\n    \n    for (; i < 16 && (x & 1) == 0; i++, x >>= 1)\n        ;\n    return i;\n}\nstatic int32_t futrts_ctzz32(int32_t x)\n{\n    int i = 0;\n    \n    for (; i < 32 && (x & 1) == 0; i++, x >>= 1)\n        ;\n    return i;\n}\nstatic int32_t futrts_ctzz64(int64_t x)\n{\n    int i = 0;\n    \n    for (; i < 64 && (x & 1) == 0; i++, x >>= 1)\n        ;\n    return i;\n}\n#elif defined(__CUDA_ARCH__)\nstatic int32_t futrts_ctzz8(int8_t x)\n{\n    int y = __ffs(x);\n    \n    return y == 0 ? 8 : y - 1;\n}\nstatic int32_t futrts_ctzz16(int16_t x)\n{\n    int y = __ffs(x);\n    \n    return y == 0 ? 16 : y - 1;\n}\nstatic int32_t futrts_ctzz32(int32_t x)\n{\n    int y = __ffs(x);\n    \n    return y == 0 ? 32 : y - 1;\n}\nstatic int32_t futrts_ctzz64(int64_t x)\n{\n    int y = __ffsll(x);\n    \n    return y == 0 ? 64 : y - 1;\n}\n#else\nstatic int32_t futrts_ctzz8(int8_t x)\n{\n    return x == 0 ? 8 : __builtin_ctz((uint32_t) x);\n}\nstatic int32_t futrts_ctzz16(int16_t x)\n{\n    return x == 0 ? 16 : __builtin_ctz((uint32_t) x);\n}\nstatic int32_t futrts_ctzz32(int32_t x)\n{\n    return x == 0 ? 32 : __builtin_ctz(x);\n}\nstatic int32_t futrts_ctzz64(int64_t x)\n{\n    return x == 0 ? 64 : __builtin_ctzll(x);\n}\n#endif\nstatic inline float fdiv32(float x, float y)\n{\n    return x / y;\n}\nstatic inline float fadd32(float x, float y)\n{\n    return x + y;\n}\nstatic inline float fsub32(float x, float y)\n{\n    return x - y;\n}\nstatic inline float fmul32(float x, float y)\n{\n    return x * y;\n}\nstatic inline float fmin32(float x, float y)\n{\n    return fmin(x, y);\n}\nstatic inline float fmax32(float x, float y)\n{\n    return fmax(x, y);\n}\nstatic inline float fpow32(float x, float y)\n{\n    return pow(x, y);\n}\nstatic inline bool cmplt32(float x, float y)\n{\n    return x < y;\n}\nstatic inline bool cmple32(float x, float y)\n{\n    return x <= y;\n}\nstatic inline float sitofp_i8_f32(int8_t x)\n{\n    return (floa",
                   "t) x;\n}\nstatic inline float sitofp_i16_f32(int16_t x)\n{\n    return (float) x;\n}\nstatic inline float sitofp_i32_f32(int32_t x)\n{\n    return (float) x;\n}\nstatic inline float sitofp_i64_f32(int64_t x)\n{\n    return (float) x;\n}\nstatic inline float uitofp_i8_f32(uint8_t x)\n{\n    return (float) x;\n}\nstatic inline float uitofp_i16_f32(uint16_t x)\n{\n    return (float) x;\n}\nstatic inline float uitofp_i32_f32(uint32_t x)\n{\n    return (float) x;\n}\nstatic inline float uitofp_i64_f32(uint64_t x)\n{\n    return (float) x;\n}\nstatic inline int8_t fptosi_f32_i8(float x)\n{\n    return (int8_t) x;\n}\nstatic inline int16_t fptosi_f32_i16(float x)\n{\n    return (int16_t) x;\n}\nstatic inline int32_t fptosi_f32_i32(float x)\n{\n    return (int32_t) x;\n}\nstatic inline int64_t fptosi_f32_i64(float x)\n{\n    return (int64_t) x;\n}\nstatic inline uint8_t fptoui_f32_i8(float x)\n{\n    return (uint8_t) x;\n}\nstatic inline uint16_t fptoui_f32_i16(float x)\n{\n    return (uint16_t) x;\n}\nstatic inline uint32_t fptoui_f32_i32(float x)\n{\n    return (uint32_t) x;\n}\nstatic inline uint64_t fptoui_f32_i64(float x)\n{\n    return (uint64_t) x;\n}\nstatic inline bool futrts_isnan32(float x)\n{\n    return isnan(x);\n}\nstatic inline bool futrts_isinf32(float x)\n{\n    return isinf(x);\n}\n#ifdef __OPENCL_VERSION__\nstatic inline float futrts_log32(float x)\n{\n    return log(x);\n}\nstatic inline float futrts_log2_32(float x)\n{\n    return log2(x);\n}\nstatic inline float futrts_log10_32(float x)\n{\n    return log10(x);\n}\nstatic inline float futrts_sqrt32(float x)\n{\n    return sqrt(x);\n}\nstatic inline float futrts_exp32(float x)\n{\n    return exp(x);\n}\nstatic inline float futrts_cos32(float x)\n{\n    return cos(x);\n}\nstatic inline float futrts_sin32(float x)\n{\n    return sin(x);\n}\nstatic inline float futrts_tan32(float x)\n{\n    return tan(x);\n}\nstatic inline float futrts_acos32(float x)\n{\n    return acos(x);\n}\nstatic inline float futrts_asin32(float x)\n{\n    return asin(x);\n}\nstatic inline float futrts_atan32(float x)\n{\n    return atan(x);\n}",
                   "\nstatic inline float futrts_cosh32(float x)\n{\n    return cosh(x);\n}\nstatic inline float futrts_sinh32(float x)\n{\n    return sinh(x);\n}\nstatic inline float futrts_tanh32(float x)\n{\n    return tanh(x);\n}\nstatic inline float futrts_acosh32(float x)\n{\n    return acosh(x);\n}\nstatic inline float futrts_asinh32(float x)\n{\n    return asinh(x);\n}\nstatic inline float futrts_atanh32(float x)\n{\n    return atanh(x);\n}\nstatic inline float futrts_atan2_32(float x, float y)\n{\n    return atan2(x, y);\n}\nstatic inline float futrts_hypot32(float x, float y)\n{\n    return hypot(x, y);\n}\nstatic inline float futrts_gamma32(float x)\n{\n    return tgamma(x);\n}\nstatic inline float futrts_lgamma32(float x)\n{\n    return lgamma(x);\n}\nstatic inline float fmod32(float x, float y)\n{\n    return fmod(x, y);\n}\nstatic inline float futrts_round32(float x)\n{\n    return rint(x);\n}\nstatic inline float futrts_floor32(float x)\n{\n    return floor(x);\n}\nstatic inline float futrts_ceil32(float x)\n{\n    return ceil(x);\n}\nstatic inline float futrts_lerp32(float v0, float v1, float t)\n{\n    return mix(v0, v1, t);\n}\nstatic inline float futrts_mad32(float a, float b, float c)\n{\n    return mad(a, b, c);\n}\nstatic inline float futrts_fma32(float a, float b, float c)\n{\n    return fma(a, b, c);\n}\n#else\nstatic inline float futrts_log32(float x)\n{\n    return logf(x);\n}\nstatic inline float futrts_log2_32(float x)\n{\n    return log2f(x);\n}\nstatic inline float futrts_log10_32(float x)\n{\n    return log10f(x);\n}\nstatic inline float futrts_sqrt32(float x)\n{\n    return sqrtf(x);\n}\nstatic inline float futrts_exp32(float x)\n{\n    return expf(x);\n}\nstatic inline float futrts_cos32(float x)\n{\n    return cosf(x);\n}\nstatic inline float futrts_sin32(float x)\n{\n    return sinf(x);\n}\nstatic inline float futrts_tan32(float x)\n{\n    return tanf(x);\n}\nstatic inline float futrts_acos32(float x)\n{\n    return acosf(x);\n}\nstatic inline float futrts_asin32(float x)\n{\n    return asinf(x);\n}\nstatic inline float futrts_atan32(float x)\n{\n    return ata",
                   "nf(x);\n}\nstatic inline float futrts_cosh32(float x)\n{\n    return coshf(x);\n}\nstatic inline float futrts_sinh32(float x)\n{\n    return sinhf(x);\n}\nstatic inline float futrts_tanh32(float x)\n{\n    return tanhf(x);\n}\nstatic inline float futrts_acosh32(float x)\n{\n    return acoshf(x);\n}\nstatic inline float futrts_asinh32(float x)\n{\n    return asinhf(x);\n}\nstatic inline float futrts_atanh32(float x)\n{\n    return atanhf(x);\n}\nstatic inline float futrts_atan2_32(float x, float y)\n{\n    return atan2f(x, y);\n}\nstatic inline float futrts_hypot32(float x, float y)\n{\n    return hypotf(x, y);\n}\nstatic inline float futrts_gamma32(float x)\n{\n    return tgammaf(x);\n}\nstatic inline float futrts_lgamma32(float x)\n{\n    return lgammaf(x);\n}\nstatic inline float fmod32(float x, float y)\n{\n    return fmodf(x, y);\n}\nstatic inline float futrts_round32(float x)\n{\n    return rintf(x);\n}\nstatic inline float futrts_floor32(float x)\n{\n    return floorf(x);\n}\nstatic inline float futrts_ceil32(float x)\n{\n    return ceilf(x);\n}\nstatic inline float futrts_lerp32(float v0, float v1, float t)\n{\n    return v0 + (v1 - v0) * t;\n}\nstatic inline float futrts_mad32(float a, float b, float c)\n{\n    return a * b + c;\n}\nstatic inline float futrts_fma32(float a, float b, float c)\n{\n    return fmaf(a, b, c);\n}\n#endif\nstatic inline int32_t futrts_to_bits32(float x)\n{\n    union {\n        float f;\n        int32_t t;\n    } p;\n    \n    p.f = x;\n    return p.t;\n}\nstatic inline float futrts_from_bits32(int32_t x)\n{\n    union {\n        int32_t f;\n        float t;\n    } p;\n    \n    p.f = x;\n    return p.t;\n}\nstatic inline float fsignum32(float x)\n{\n    return futrts_isnan32(x) ? x : (x > 0) - (x < 0);\n}\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#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_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  return 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, int3",
                   "2_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  return 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 int64_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\n__kernel void builtinzhreplicate_f32zireplicate_132958(int32_t num_elems_132955,\n                                                       float val_132956,\n                                                       __global\n                                                       unsigned char *mem_132954)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t replicate_gtid_132958;\n    int32_t replicate_ltid_132959;\n    int32_t replicate_gid_132960;\n    \n    replicate_gtid_132958 = get_global_id(0);\n    replicate_ltid_132959 = get_local_id(0);\n    replicate_gid_132960 = get_group_id(0);\n    if (slt64(replicate_gtid_132958, num_elems_132955)) {\n        ((__global float *) mem_132954)[sext_i32_i64(replicate_gtid_132958)] =\n            val_132956;\n    }\n    \n  error_0:\n    return;\n}\n__kernel void builtinzhreplicate_i64zireplicate_132369(int32_t num_elems_132366,\n                                                       int64_t val_132367,\n               ",
                   "                                        __global\n                                                       unsigned char *mem_132365)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t replicate_gtid_132369;\n    int32_t replicate_ltid_132370;\n    int32_t replicate_gid_132371;\n    \n    replicate_gtid_132369 = get_global_id(0);\n    replicate_ltid_132370 = get_local_id(0);\n    replicate_gid_132371 = get_group_id(0);\n    if (slt64(replicate_gtid_132369, num_elems_132366)) {\n        ((__global int64_t *) mem_132365)[sext_i32_i64(replicate_gtid_132369)] =\n            val_132367;\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 char *restrict block_9_backing_0 = (__local volatile\n                                                         char *) block_9_backing_aligned_0;\n    __local char *block_9;\n    \n    block_9 = (__local 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    \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                ((__local float *) block_9)[sext_i32_i64((get_local_id_1_39 +\n                                                          j_43 * 8) * 33 +\n                                            get_local_id_0_38)] = ((__global\n                                                                    float *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                                                                       index_in_35)];\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                ((__global float *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                               index_out_36)] = ((__local\n                                                                  float *) block_9)[sext_i32_i64(get_local_id_0_38 *\n                                                                                    33 +\n                                                                     ",
                   "               get_local_id_1_39 +\n                                                                                    j_43 *\n                                                                                    8)];\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 char *restrict block_9_backing_0 = (__local volatile\n                                                         char *) block_9_backing_aligned_0;\n    __local char *block_9;\n    \n    block_9 = (__local 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 = squo",
                   "t32(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    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        ((__local float *) block_9)[sext_i32_i64(get_local_id_1_39 * 17 +\n                                    get_local_id_0_38)] = ((__global\n                                                            float *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                                                               index_in_35)];\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        ((__global float *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                       index_out_36)] = ((__local\n                                                          float *) block_9)[sext_i32_i64(get_local_id_0_38 *\n                                                                            17 +\n                                                                            get_local_id_1_39)];\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 srcoffse",
                   "t_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 char *restrict block_9_backing_0 = (__local volatile\n                                                         char *) block_9_backing_aligned_0;\n    __local char *block_9;\n    \n    block_9 = (__local 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    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        ((__local float *) block_9)[sext_i32_i64(get_local_id_1_39 * 17",
                   " +\n                                    get_local_id_0_38)] = ((__global\n                                                            float *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                                                               index_in_35)];\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_index_31, y_elems_6) && slt32(y_index_32, x_elems_5)) {\n        ((__global float *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                       index_out_36)] = ((__local\n                                                          float *) block_9)[sext_i32_i64(get_local_id_0_38 *\n                                                                            17 +\n                                                                            get_local_id_1_39)];\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 char *restrict block_9_backing_0 = (__local volatile\n                                                         char *) block_9_backing_",
                   "aligned_0;\n    __local char *block_9;\n    \n    block_9 = (__local 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    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        ((__global float *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                       index_out_36)] = ((__global\n                                                          float *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                                                             index_in_35)];\n    }\n    \n  error_0:\n    return;\n}\n__kernel void gpu_map_transpose_i64(__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                                    i",
                   "nt32_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 char *restrict block_9_backing_0 = (__local volatile\n                                                         char *) block_9_backing_aligned_0;\n    __local char *block_9;\n    \n    block_9 = (__local 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, 8) + our_array_offset_30;\n    int32_t idata_offset_34 = squot32(srcoffset_3, 8) + 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    \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                ((__local int64_t *) block_9)[sext_i32_i64((get_local_id_1_39 +\n                                                            j_43 * 8) * 33 +\n                                              get_local_id_0_38)] = ((__global\n                                                                      int64_t *",
                   ") srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                                                                           index_in_35)];\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                ((__global int64_t *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                                 index_out_36)] = ((__local\n                                                                    int64_t *) block_9)[sext_i32_i64(get_local_id_0_38 *\n                                                                                        33 +\n                                                                                        get_local_id_1_39 +\n                                                                                        j_43 *\n                                                                                        8)];\n            }\n        }\n    }\n    \n  error_0:\n    return;\n}\n__kernel void gpu_map_transpose_i64_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                                               unsi",
                   "gned 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 char *restrict block_9_backing_0 = (__local volatile\n                                                         char *) block_9_backing_aligned_0;\n    __local char *block_9;\n    \n    block_9 = (__local 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, 8) + our_array_offset_30;\n    int32_t idata_offset_34 = squot32(srcoffset_3, 8) + 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    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        ((__local int64_t *) block_9)[sext_i32_i64(get_local_id_1_39 * 17 +\n                                      get_local_id_0_38)] = ((__global\n                                                              int64_t *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                                                                   index_in_35)];\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        ((__global int64_t *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                         index_out_36)] = ((__local\n                                                            int64_t *) block_9)[sext_i32_i64(get_local_id_0_38 *\n                                                                                17 +\n                                                                                get_local_id_1_39)];\n    }\n    \n  error_0:\n    return;\n}\n__kernel void gpu_map_transpose_i64_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 char *restrict block_9_backing_0 = (__local volatile\n                                                         char *) block_9_backing_aligned_0;\n    __local char *block_9;\n    \n    block_9 = (__local 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_lo",
                   "cal_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, 8) + our_array_offset_30;\n    int32_t idata_offset_34 = squot32(srcoffset_3, 8) + 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    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        ((__local int64_t *) block_9)[sext_i32_i64(get_local_id_1_39 * 17 +\n                                      get_local_id_0_38)] = ((__global\n                                                              int64_t *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                                                                   index_in_35)];\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_index_31, y_elems_6) && slt32(y_index_32, x_elems_5)) {\n        ((__global int64_t *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                         index_out_36)] = ((__local\n                                                            int64_t *) block_9)[sext_i32_i64(get_local_id_0",
                   "_38 *\n                                                                                17 +\n                                                                                get_local_id_1_39)];\n    }\n    \n  error_0:\n    return;\n}\n__kernel void gpu_map_transpose_i64_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 char *restrict block_9_backing_0 = (__local volatile\n                                                         char *) block_9_backing_aligned_0;\n    __local char *block_9;\n    \n    block_9 = (__local 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    int",
                   "32_t y_index_32 = srem32(get_global_id_0_37, y_elems_6);\n    int32_t odata_offset_33 = squot32(destoffset_1, 8) + our_array_offset_30;\n    int32_t idata_offset_34 = squot32(srcoffset_3, 8) + 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        ((__global int64_t *) destmem_0)[sext_i32_i64(odata_offset_33 +\n                                         index_out_36)] = ((__global\n                                                            int64_t *) srcmem_2)[sext_i32_i64(idata_offset_34 +\n                                                                                 index_in_35)];\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_132360(int64_t m_114533, int64_t n_114534,\n                                int64_t i_114610, __global\n                                unsigned char *mem_130107, __global\n                                unsigned char *mem_130110)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_132360;\n    int32_t copy_ltid_132361;\n    int32_t copy_gid_132362;\n    \n    copy_gtid_132360 = get_global_id(0);\n    copy_ltid_132361 = get_local_id(0);\n    copy_gid_132362 = get_group_id(0);\n    if (slt64(sext_i32_i64(copy_gtid_132360), m_114533)) {\n        ((__global int64_t *) mem_130110)[sext_i32_i64(copy_gtid_132360)] =\n            ((__global int64_t *) mem_130107)[i_114610 +\n                                              sext_i32_i64(copy_gtid_132360) *\n                                              n_114534];\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_132598(int64_t m_114533, int64_t n_114534,\n                                int64_t padded_sizze_129098,\n                                int64_t tmp_offs_132597, __global\n                                unsigned char *mem_130326, __global\n         ",
                   "                       unsigned char *mem_130341)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_132598;\n    int32_t copy_ltid_132599;\n    int32_t copy_gid_132600;\n    \n    copy_gtid_132598 = get_global_id(0);\n    copy_ltid_132599 = get_local_id(0);\n    copy_gid_132600 = get_group_id(0);\n    if (slt64(sext_i32_i64(copy_gtid_132598), m_114533 * n_114534)) {\n        ((__global\n          int64_t *) mem_130341)[squot64(sext_i32_i64(copy_gtid_132598),\n                                         n_114534) * padded_sizze_129098 +\n                                 (tmp_offs_132597 +\n                                  (sext_i32_i64(copy_gtid_132598) -\n                                   squot64(sext_i32_i64(copy_gtid_132598),\n                                           n_114534) * n_114534))] = ((__global\n                                                                       int64_t *) mem_130326)[squot64(sext_i32_i64(copy_gtid_132598),\n                                                                                                      n_114534) *\n                                                                                              n_114534 +\n                                                                                              (sext_i32_i64(copy_gtid_132598) -\n                                                                                               squot64(sext_i32_i64(copy_gtid_132598),\n                                                                                                       n_114534) *\n                                                                                               n_114534)];\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_132603(int64_t m_114533, int64_t y_129097,\n                                int64_t padded_sizze_129098,\n                                int64_t tmp_offs_132597, __global\n                                unsigned char *mem_130337, __gl",
                   "obal\n                                unsigned char *mem_130341)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_132603;\n    int32_t copy_ltid_132604;\n    int32_t copy_gid_132605;\n    \n    copy_gtid_132603 = get_global_id(0);\n    copy_ltid_132604 = get_local_id(0);\n    copy_gid_132605 = get_group_id(0);\n    if (slt64(sext_i32_i64(copy_gtid_132603), m_114533 * y_129097)) {\n        ((__global\n          int64_t *) mem_130341)[squot64(sext_i32_i64(copy_gtid_132603),\n                                         y_129097) * padded_sizze_129098 +\n                                 (tmp_offs_132597 +\n                                  (sext_i32_i64(copy_gtid_132603) -\n                                   squot64(sext_i32_i64(copy_gtid_132603),\n                                           y_129097) * y_129097))] = ((__global\n                                                                       int64_t *) mem_130337)[squot64(sext_i32_i64(copy_gtid_132603),\n                                                                                                      y_129097) *\n                                                                                              y_129097 +\n                                                                                              (sext_i32_i64(copy_gtid_132603) -\n                                                                                               squot64(sext_i32_i64(copy_gtid_132603),\n                                                                                                       y_129097) *\n                                                                                               y_129097)];\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_132816(int64_t m_114533, int64_t n_114534,\n                                int64_t padded_sizze_129119,\n                                int64_t tmp_offs_132815, __global\n                                unsigned char *me",
                   "m_130528, __global\n                                unsigned char *mem_130543)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_132816;\n    int32_t copy_ltid_132817;\n    int32_t copy_gid_132818;\n    \n    copy_gtid_132816 = get_global_id(0);\n    copy_ltid_132817 = get_local_id(0);\n    copy_gid_132818 = get_group_id(0);\n    if (slt64(sext_i32_i64(copy_gtid_132816), m_114533 * n_114534)) {\n        ((__global\n          int64_t *) mem_130543)[squot64(sext_i32_i64(copy_gtid_132816),\n                                         n_114534) * padded_sizze_129119 +\n                                 (tmp_offs_132815 +\n                                  (sext_i32_i64(copy_gtid_132816) -\n                                   squot64(sext_i32_i64(copy_gtid_132816),\n                                           n_114534) * n_114534))] = ((__global\n                                                                       int64_t *) mem_130528)[squot64(sext_i32_i64(copy_gtid_132816),\n                                                                                                      n_114534) *\n                                                                                              n_114534 +\n                                                                                              (sext_i32_i64(copy_gtid_132816) -\n                                                                                               squot64(sext_i32_i64(copy_gtid_132816),\n                                                                                                       n_114534) *\n                                                                                               n_114534)];\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainzicopy_132821(int64_t m_114533, int64_t y_129118,\n                                int64_t padded_sizze_129119,\n                                int64_t tmp_offs_132815, __global\n                                uns",
                   "igned char *mem_130539, __global\n                                unsigned char *mem_130543)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    int32_t copy_gtid_132821;\n    int32_t copy_ltid_132822;\n    int32_t copy_gid_132823;\n    \n    copy_gtid_132821 = get_global_id(0);\n    copy_ltid_132822 = get_local_id(0);\n    copy_gid_132823 = get_group_id(0);\n    if (slt64(sext_i32_i64(copy_gtid_132821), m_114533 * y_129118)) {\n        ((__global\n          int64_t *) mem_130543)[squot64(sext_i32_i64(copy_gtid_132821),\n                                         y_129118) * padded_sizze_129119 +\n                                 (tmp_offs_132815 +\n                                  (sext_i32_i64(copy_gtid_132821) -\n                                   squot64(sext_i32_i64(copy_gtid_132821),\n                                           y_129118) * y_129118))] = ((__global\n                                                                       int64_t *) mem_130539)[squot64(sext_i32_i64(copy_gtid_132821),\n                                                                                                      y_129118) *\n                                                                                              y_129118 +\n                                                                                              (sext_i32_i64(copy_gtid_132821) -\n                                                                                               squot64(sext_i32_i64(copy_gtid_132821),\n                                                                                                       y_129118) *\n                                                                                               y_129118)];\n    }\n    \n  error_0:\n    return;\n}\n__kernel void mainziscan_stage1_116849(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_132312_backing_aligned_0,\n    ",
                   "                                   int64_t m_114533, int64_t n_114534,\n                                       int32_t num_threads_132306, __global\n                                       unsigned char *Y_mem_130086, __global\n                                       unsigned char *mem_130107)\n{\n    #define segscan_group_sizze_116860 (mainzisegscan_group_sizze_116843)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict scan_arr_mem_132312_backing_0 =\n                          (__local volatile\n                           char *) scan_arr_mem_132312_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_132307;\n    int32_t local_tid_132308;\n    int64_t group_sizze_132311;\n    int32_t wave_sizze_132310;\n    int32_t group_tid_132309;\n    \n    global_tid_132307 = get_global_id(0);\n    local_tid_132308 = get_local_id(0);\n    group_sizze_132311 = get_local_size(0);\n    wave_sizze_132310 = LOCKSTEP_WIDTH;\n    group_tid_132309 = get_group_id(0);\n    \n    int32_t phys_tid_116849 = global_tid_132307;\n    __local char *scan_arr_mem_132312;\n    \n    scan_arr_mem_132312 = (__local char *) scan_arr_mem_132312_backing_0;\n    \n    int64_t x_116864;\n    int64_t x_116865;\n    \n    x_116864 = (int64_t) 0;\n    for (int64_t j_132314 = 0; j_132314 < sdiv_up64(m_114533 * n_114534,\n                                                    sext_i32_i64(num_threads_132306));\n         j_132314++) {\n        int64_t chunk_offset_132315 = segscan_group_sizze_116860 * j_132314 +\n                sext_i32_i64(group_tid_132309) * (segscan_group_sizze_116860 *\n                                                  sdiv_up64(m_114533 * n_114534,\n                                                            sext_i32_i64(num_threads_132306)));\n        int64_t flat_idx_132316 = chunk_offset_132315 +\n                sext_i32_i64(local_tid_132308);\n        int64_t gtid_116840 = squot64(flat_idx_132316, n_",
                   "114534);\n        int64_t gtid_116848 = flat_idx_132316 - squot64(flat_idx_132316,\n                                                        n_114534) * n_114534;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_116840, m_114533) && slt64(gtid_116848, n_114534)) {\n                float x_116868 = ((__global float *) Y_mem_130086)[gtid_116840 *\n                                                                   n_114534 +\n                                                                   gtid_116848];\n                bool isnan_res_116869;\n                \n                isnan_res_116869 = futrts_isnan32(x_116868);\n                \n                bool defunc_0_p_res_116870 = !isnan_res_116869;\n                int64_t defunc_0_f_res_116871 =\n                        btoi_bool_i64(defunc_0_p_res_116870);\n                \n                // write to-scan values to parameters\n                {\n                    x_116865 = defunc_0_f_res_116871;\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_116840, m_114533) && slt64(gtid_116848,\n                                                            n_114534))) {\n                    x_116865 = (int64_t) 0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                int64_t defunc_1_op_res_116866 = add64(x_116864, x_116865);\n                \n                ((__local\n                  int64_t *) scan_arr_mem_132312)[sext_i32_i64(local_tid_132308)] =\n                    defunc_1_op_res_116866;\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            int64_t x_132317;\n            int64_t x_132318;\n            int64_t x_132320;\n            int64_t x_132321;\n  ",
                   "          bool ltid_in_bounds_132323 = slt64(sext_i32_i64(local_tid_132308),\n                                               segscan_group_sizze_116860);\n            int32_t skip_threads_132324;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_132323) {\n                    x_132318 = ((volatile __local\n                                 int64_t *) scan_arr_mem_132312)[sext_i32_i64(local_tid_132308)];\n                    if ((local_tid_132308 - squot32(local_tid_132308, 32) *\n                         32) == 0) {\n                        x_132317 = x_132318;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_132324 = 1;\n                while (slt32(skip_threads_132324, 32)) {\n                    if (sle32(skip_threads_132324, local_tid_132308 -\n                              squot32(local_tid_132308, 32) * 32) &&\n                        ltid_in_bounds_132323) {\n                        // read operands\n                        {\n                            x_132317 = ((volatile __local\n                                         int64_t *) scan_arr_mem_132312)[sext_i32_i64(local_tid_132308) -\n                                                                         sext_i32_i64(skip_threads_132324)];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_132325 =\n                                 slt64(srem64(sext_i32_i64(local_tid_132308) +\n                                              chunk_offset_132315, n_114534),\n                                       sext_i32_i64(local_tid_132308) +\n                                       chunk_offset_132315 -\n                                       (sext_i32_i64(local_tid_132308 -\n                                        skip_threads_132324) +\n                                        chunk_offset_1323",
                   "15));\n                            \n                            if (inactive_132325) {\n                                x_132317 = x_132318;\n                            }\n                            if (!inactive_132325) {\n                                int64_t defunc_1_op_res_132319 = add64(x_132317,\n                                                                       x_132318);\n                                \n                                x_132317 = defunc_1_op_res_132319;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_132310, skip_threads_132324)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (sle32(skip_threads_132324, local_tid_132308 -\n                              squot32(local_tid_132308, 32) * 32) &&\n                        ltid_in_bounds_132323) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_132312)[sext_i32_i64(local_tid_132308)] =\n                                x_132317;\n                            x_132318 = x_132317;\n                        }\n                    }\n                    if (sle32(wave_sizze_132310, skip_threads_132324)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_132324 *= 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_132308 - squot32(local_tid_132308, 32) * 32) ==\n                    31 && ltid_in_bounds_132323) {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_132312)[sext_i32_i64(squot32(local_tid_132308,\n                                                                           32))] =\n                        x_132317;\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_132326;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_132308, 32) == 0 &&\n                        ltid_in_bounds_132323) {\n                        x_132321 = ((volatile __local\n                                     int64_t *) scan_arr_mem_132312)[sext_i32_i64(local_tid_132308)];\n                        if ((local_tid_132308 - squot32(local_tid_132308, 32) *\n                             32) == 0) {\n                            x_132320 = x_132321;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_132326 = 1;\n                    while (slt32(skip_threads_132326, 32)) {\n                        if (sle32(skip_threads_132326, local_tid_132308 -\n                                  squot32(local_tid_132308, 32) * 32) &&\n                            (squot32(local_tid_132308, 32) == 0 &&\n                             ltid_in_bounds_132323)) {\n                            // read operands\n                            {\n                                x_132320 = ((volatile __local\n                                             int64_t *) scan_arr_mem_132312)[sext_i32_i64(local_tid_132308) -\n                                                                             sext_i32_i64(skip_threads_132326)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_132327 =\n                                     slt64(srem64(sext_i32_i64(local_tid_132308 *\n                                                  32 + 32 - 1) +\n                                                  chunk_offset_132315,\n       ",
                   "                                           n_114534),\n                                           sext_i32_i64(local_tid_132308 * 32 +\n                                           32 - 1) + chunk_offset_132315 -\n                                           (sext_i32_i64((local_tid_132308 -\n                                                          skip_threads_132326) *\n                                            32 + 32 - 1) +\n                                            chunk_offset_132315));\n                                \n                                if (inactive_132327) {\n                                    x_132320 = x_132321;\n                                }\n                                if (!inactive_132327) {\n                                    int64_t defunc_1_op_res_132322 =\n                                            add64(x_132320, x_132321);\n                                    \n                                    x_132320 = defunc_1_op_res_132322;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_132310, skip_threads_132326)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_132326, local_tid_132308 -\n                                  squot32(local_tid_132308, 32) * 32) &&\n                            (squot32(local_tid_132308, 32) == 0 &&\n                             ltid_in_bounds_132323)) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_132312)[sext_i32_i64(local_tid_132308)] =\n                                    x_132320;\n                                x_132321 = x_132320;\n                            }\n                        }\n                        if (sle32(wave_sizze_132310, skip_threads_132326)) {\n                            barrier(CLK_LOCAL_M",
                   "EM_FENCE);\n                        }\n                        skip_threads_132326 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // carry-in for every block except the first\n            {\n                if (!(squot32(local_tid_132308, 32) == 0 ||\n                      !ltid_in_bounds_132323)) {\n                    // read operands\n                    {\n                        x_132318 = x_132317;\n                        x_132317 = ((__local\n                                     int64_t *) scan_arr_mem_132312)[sext_i32_i64(squot32(local_tid_132308,\n                                                                                          32)) -\n                                                                     (int64_t) 1];\n                    }\n                    // perform operation\n                    {\n                        bool inactive_132328 =\n                             slt64(srem64(sext_i32_i64(local_tid_132308) +\n                                          chunk_offset_132315, n_114534),\n                                   sext_i32_i64(local_tid_132308) +\n                                   chunk_offset_132315 -\n                                   (sext_i32_i64(squot32(local_tid_132308, 32) *\n                                    32 - 1) + chunk_offset_132315));\n                        \n                        if (inactive_132328) {\n                            x_132317 = x_132318;\n                        }\n                        if (!inactive_132328) {\n                            int64_t defunc_1_op_res_132319 = add64(x_132317,\n                                                                   x_132318);\n                            \n                            x_132317 = defunc_1_op_res_132319;\n                        }\n                    }\n                    // write final result\n                    {\n                        ((__local\n                          int64_t *) scan_arr_mem_132312",
                   ")[sext_i32_i64(local_tid_132308)] =\n                            x_132317;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_132308, 32) == 0) {\n                    ((__local\n                      int64_t *) scan_arr_mem_132312)[sext_i32_i64(local_tid_132308)] =\n                        x_132318;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_116840, m_114533) && slt64(gtid_116848,\n                                                          n_114534)) {\n                    ((__global int64_t *) mem_130107)[gtid_116840 * n_114534 +\n                                                      gtid_116848] = ((__local\n                                                                       int64_t *) scan_arr_mem_132312)[sext_i32_i64(local_tid_132308)];\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_132329 = slt64(srem64(chunk_offset_132315 +\n                                                           segscan_group_sizze_116860,\n                                                           n_114534),\n                                                    chunk_offset_132315 +\n                                                    segscan_group_sizze_116860 -\n                                                    (chunk_offset_132315 +\n                                                     segscan_group_sizze_116860 -\n                                                     (int64_t) 1));\n                bool should_load_carry_132330 = local_tid_132308 == 0 &&\n                     !crosses_segment_132329;\n                \n                if (should_load_carry_132330) {\n ",
                   "                   x_116864 = ((__local\n                                 int64_t *) scan_arr_mem_132312)[segscan_group_sizze_116860 -\n                                                                 (int64_t) 1];\n                }\n                if (!should_load_carry_132330) {\n                    x_116864 = (int64_t) 0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_116860\n}\n__kernel void mainziscan_stage1_120428(__global int *global_failure,\n                                       int failure_is_an_option, __global\n                                       int64_t *global_failure_args,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_133515_backing_aligned_0,\n                                       int64_t m_114533, int64_t n_114534,\n                                       int64_t lifted_single_ma_arg_114976,\n                                       int32_t num_threads_133509, __global\n                                       unsigned char *mem_130840, __global\n                                       unsigned char *mem_130844, __global\n                                       unsigned char *mem_130849)\n{\n    #define segscan_group_sizze_120702 (mainzisegscan_group_sizze_120422)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict scan_arr_mem_133515_backing_0 =\n                          (__local volatile\n                           char *) scan_arr_mem_133515_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_133510;\n    int32_t local_tid_133511;\n    int64_t group_sizze_133514;\n    int32_t wave_sizze_13351",
                   "3;\n    int32_t group_tid_133512;\n    \n    global_tid_133510 = get_global_id(0);\n    local_tid_133511 = get_local_id(0);\n    group_sizze_133514 = get_local_size(0);\n    wave_sizze_133513 = LOCKSTEP_WIDTH;\n    group_tid_133512 = get_group_id(0);\n    \n    int32_t phys_tid_120428 = global_tid_133510;\n    __local char *scan_arr_mem_133515;\n    \n    scan_arr_mem_133515 = (__local char *) scan_arr_mem_133515_backing_0;\n    \n    float x_120706;\n    float x_120707;\n    \n    x_120706 = 0.0F;\n    for (int64_t j_133517 = 0; j_133517 < sdiv_up64(m_114533 * n_114534,\n                                                    sext_i32_i64(num_threads_133509));\n         j_133517++) {\n        int64_t chunk_offset_133518 = segscan_group_sizze_120702 * j_133517 +\n                sext_i32_i64(group_tid_133512) * (segscan_group_sizze_120702 *\n                                                  sdiv_up64(m_114533 * n_114534,\n                                                            sext_i32_i64(num_threads_133509)));\n        int64_t flat_idx_133519 = chunk_offset_133518 +\n                sext_i32_i64(local_tid_133511);\n        int64_t gtid_120419 = squot64(flat_idx_133519, n_114534);\n        int64_t gtid_120427 = flat_idx_133519 - squot64(flat_idx_133519,\n                                                        n_114534) * n_114534;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_120419, m_114533) && slt64(gtid_120427, n_114534)) {\n                bool cond_120712 = gtid_120427 == (int64_t) 0;\n                float defunc_0_f_res_120713;\n                \n                if (cond_120712) {\n                    float defunc_2_reduce_res_120710 = ((__global\n                                                         float *) mem_130844)[gtid_120419];\n                    float defunc_0_f_res_t_res_120714 =\n                          defunc_2_reduce_res_120710 / 3.0F;\n                    \n                    defunc_0_f_res_120713 = defunc_0_f_res_t_res_120714;\n       ",
                   "         } else {\n                    int64_t x_120715 = add64((int64_t) 3, gtid_120427);\n                    int64_t i_120716 = sub64(x_120715, (int64_t) 1);\n                    bool x_120717 = sle64((int64_t) 0, i_120716);\n                    bool y_120718 = slt64(i_120716,\n                                          lifted_single_ma_arg_114976);\n                    bool bounds_check_120719 = x_120717 && y_120718;\n                    bool index_certs_120720;\n                    \n                    if (!bounds_check_120719) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          78) == -1) {\n                                global_failure_args[0] = i_120716;\n                                global_failure_args[1] =\n                                    lifted_single_ma_arg_114976;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    float x_120721 = ((__global\n                                       float *) mem_130840)[gtid_120419 *\n                                                            lifted_single_ma_arg_114976 +\n                                                            i_120716];\n                    int64_t i_120722 = sub64(gtid_120427, (int64_t) 1);\n                    bool x_120723 = sle64((int64_t) 0, i_120722);\n                    bool y_120724 = slt64(i_120722,\n                                          lifted_single_ma_arg_114976);\n                    bool bounds_check_120725 = x_120723 && y_120724;\n                    bool index_certs_120726;\n                    \n                    if (!bounds_check_120725) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                               ",
                   "           79) == -1) {\n                                global_failure_args[0] = i_120722;\n                                global_failure_args[1] =\n                                    lifted_single_ma_arg_114976;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    float y_120727 = ((__global\n                                       float *) mem_130840)[gtid_120419 *\n                                                            lifted_single_ma_arg_114976 +\n                                                            i_120722];\n                    float x_120728 = x_120721 - y_120727;\n                    float defunc_0_f_res_f_res_120729 = x_120728 / 3.0F;\n                    \n                    defunc_0_f_res_120713 = defunc_0_f_res_f_res_120729;\n                }\n                // write to-scan values to parameters\n                {\n                    x_120707 = defunc_0_f_res_120713;\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_120419, m_114533) && slt64(gtid_120427,\n                                                            n_114534))) {\n                    x_120707 = 0.0F;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                float defunc_1_op_res_120708 = x_120706 + x_120707;\n                \n                ((__local\n                  float *) scan_arr_mem_133515)[sext_i32_i64(local_tid_133511)] =\n                    defunc_1_op_res_120708;\n            }\n            \n          error_0:\n            barrier(CLK_LOCAL_MEM_FENCE);\n            if (loca",
                   "l_failure)\n                return;\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            float x_133520;\n            float x_133521;\n            float x_133523;\n            float x_133524;\n            bool ltid_in_bounds_133526 = slt64(sext_i32_i64(local_tid_133511),\n                                               segscan_group_sizze_120702);\n            int32_t skip_threads_133527;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_133526) {\n                    x_133521 = ((volatile __local\n                                 float *) scan_arr_mem_133515)[sext_i32_i64(local_tid_133511)];\n                    if ((local_tid_133511 - squot32(local_tid_133511, 32) *\n                         32) == 0) {\n                        x_133520 = x_133521;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_133527 = 1;\n                while (slt32(skip_threads_133527, 32)) {\n                    if (sle32(skip_threads_133527, local_tid_133511 -\n                              squot32(local_tid_133511, 32) * 32) &&\n                        ltid_in_bounds_133526) {\n                        // read operands\n                        {\n                            x_133520 = ((volatile __local\n                                         float *) scan_arr_mem_133515)[sext_i32_i64(local_tid_133511) -\n                                                                       sext_i32_i64(skip_threads_133527)];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_133528 =\n                                 slt64(srem64(sext_i32_i64(local_tid_133511) +\n                                              chunk_offset_133518, n_114534),\n                                       sext_i32_i64(local_tid_133511) +\n                                       chunk_offset_133",
                   "518 -\n                                       (sext_i32_i64(local_tid_133511 -\n                                        skip_threads_133527) +\n                                        chunk_offset_133518));\n                            \n                            if (inactive_133528) {\n                                x_133520 = x_133521;\n                            }\n                            if (!inactive_133528) {\n                                float defunc_1_op_res_133522 = x_133520 +\n                                      x_133521;\n                                \n                                x_133520 = defunc_1_op_res_133522;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_133513, skip_threads_133527)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (sle32(skip_threads_133527, local_tid_133511 -\n                              squot32(local_tid_133511, 32) * 32) &&\n                        ltid_in_bounds_133526) {\n                        // write result\n                        {\n                            ((volatile __local\n                              float *) scan_arr_mem_133515)[sext_i32_i64(local_tid_133511)] =\n                                x_133520;\n                            x_133521 = x_133520;\n                        }\n                    }\n                    if (sle32(wave_sizze_133513, skip_threads_133527)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_133527 *= 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_133511 - squot32(local_tid_133511, 32) * 32) ==\n                    31 && ltid_in_bounds_133526) {\n                    ((volatile __local\n                      float *) scan_arr_mem_133515)[sext_i32_i64(squot32(l",
                   "ocal_tid_133511,\n                                                                         32))] =\n                        x_133520;\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_133529;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_133511, 32) == 0 &&\n                        ltid_in_bounds_133526) {\n                        x_133524 = ((volatile __local\n                                     float *) scan_arr_mem_133515)[sext_i32_i64(local_tid_133511)];\n                        if ((local_tid_133511 - squot32(local_tid_133511, 32) *\n                             32) == 0) {\n                            x_133523 = x_133524;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_133529 = 1;\n                    while (slt32(skip_threads_133529, 32)) {\n                        if (sle32(skip_threads_133529, local_tid_133511 -\n                                  squot32(local_tid_133511, 32) * 32) &&\n                            (squot32(local_tid_133511, 32) == 0 &&\n                             ltid_in_bounds_133526)) {\n                            // read operands\n                            {\n                                x_133523 = ((volatile __local\n                                             float *) scan_arr_mem_133515)[sext_i32_i64(local_tid_133511) -\n                                                                           sext_i32_i64(skip_threads_133529)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_133530 =\n                                     slt64(srem64(sext_i32_i64(local_tid_133511 ",
                   "*\n                                                  32 + 32 - 1) +\n                                                  chunk_offset_133518,\n                                                  n_114534),\n                                           sext_i32_i64(local_tid_133511 * 32 +\n                                           32 - 1) + chunk_offset_133518 -\n                                           (sext_i32_i64((local_tid_133511 -\n                                                          skip_threads_133529) *\n                                            32 + 32 - 1) +\n                                            chunk_offset_133518));\n                                \n                                if (inactive_133530) {\n                                    x_133523 = x_133524;\n                                }\n                                if (!inactive_133530) {\n                                    float defunc_1_op_res_133525 = x_133523 +\n                                          x_133524;\n                                    \n                                    x_133523 = defunc_1_op_res_133525;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_133513, skip_threads_133529)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_133529, local_tid_133511 -\n                                  squot32(local_tid_133511, 32) * 32) &&\n                            (squot32(local_tid_133511, 32) == 0 &&\n                             ltid_in_bounds_133526)) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) scan_arr_mem_133515)[sext_i32_i64(local_tid_133511)] =\n                                    x_133523;\n                                x_133524 = x_133523;\n                            }\n                 ",
                   "       }\n                        if (sle32(wave_sizze_133513, skip_threads_133529)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_133529 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // carry-in for every block except the first\n            {\n                if (!(squot32(local_tid_133511, 32) == 0 ||\n                      !ltid_in_bounds_133526)) {\n                    // read operands\n                    {\n                        x_133521 = x_133520;\n                        x_133520 = ((__local\n                                     float *) scan_arr_mem_133515)[sext_i32_i64(squot32(local_tid_133511,\n                                                                                        32)) -\n                                                                   (int64_t) 1];\n                    }\n                    // perform operation\n                    {\n                        bool inactive_133531 =\n                             slt64(srem64(sext_i32_i64(local_tid_133511) +\n                                          chunk_offset_133518, n_114534),\n                                   sext_i32_i64(local_tid_133511) +\n                                   chunk_offset_133518 -\n                                   (sext_i32_i64(squot32(local_tid_133511, 32) *\n                                    32 - 1) + chunk_offset_133518));\n                        \n                        if (inactive_133531) {\n                            x_133520 = x_133521;\n                        }\n                        if (!inactive_133531) {\n                            float defunc_1_op_res_133522 = x_133520 + x_133521;\n                            \n                            x_133520 = defunc_1_op_res_133522;\n                        }\n                    }\n                    // write final result\n                    {\n                        ((__local\n    ",
                   "                      float *) scan_arr_mem_133515)[sext_i32_i64(local_tid_133511)] =\n                            x_133520;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_133511, 32) == 0) {\n                    ((__local\n                      float *) scan_arr_mem_133515)[sext_i32_i64(local_tid_133511)] =\n                        x_133521;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_120419, m_114533) && slt64(gtid_120427,\n                                                          n_114534)) {\n                    ((__global float *) mem_130849)[gtid_120419 * n_114534 +\n                                                    gtid_120427] = ((__local\n                                                                     float *) scan_arr_mem_133515)[sext_i32_i64(local_tid_133511)];\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_133532 = slt64(srem64(chunk_offset_133518 +\n                                                           segscan_group_sizze_120702,\n                                                           n_114534),\n                                                    chunk_offset_133518 +\n                                                    segscan_group_sizze_120702 -\n                                                    (chunk_offset_133518 +\n                                                     segscan_group_sizze_120702 -\n                                                     (int64_t) 1));\n                bool should_load_carry_133533 = local_tid_133511 == 0 &&\n                     !crosses_segment_133532;\n                \n         ",
                   "       if (should_load_carry_133533) {\n                    x_120706 = ((__local\n                                 float *) scan_arr_mem_133515)[segscan_group_sizze_120702 -\n                                                               (int64_t) 1];\n                }\n                if (!should_load_carry_133533) {\n                    x_120706 = 0.0F;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_120702\n}\n__kernel void mainziscan_stage1_120491(__global int *global_failure,\n                                       int failure_is_an_option, __global\n                                       int64_t *global_failure_args,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_133395_backing_aligned_0,\n                                       int64_t m_114533, int64_t n_p_114536,\n                                       float i64_res_114576,\n                                       int64_t lifted_single_ma_arg_114959,\n                                       int64_t lifted_single_ma_arg_114976,\n                                       int32_t num_threads_133389, __global\n                                       unsigned char *mem_130831, __global\n                                       unsigned char *mem_130835, __global\n                                       unsigned char *mem_130840)\n{\n    #define segscan_group_sizze_120654 (mainzisegscan_group_sizze_120485)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict scan_arr_mem_133395_backing_0 =\n                          (__local volatile\n                           char *) scan_arr_mem_133395_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_133390;\n    int32_t local_tid_133391;\n    int64_t group_sizze_133394;\n    int32_t wave_sizze_133393;\n    int32_t group_tid_133392;\n    \n    global_tid_133390 = get_global_id(0);\n    local_tid_133391 = get_local_id(0);\n    group_sizze_133394 = get_local_size(0);\n    wave_sizze_133393 = LOCKSTEP_WIDTH;\n    group_tid_133392 = get_group_id(0);\n    \n    int32_t phys_tid_120491 = global_tid_133390;\n    __local char *scan_arr_mem_133395;\n    \n    scan_arr_mem_133395 = (__local char *) scan_arr_mem_133395_backing_0;\n    \n    float x_120658;\n    float x_120659;\n    \n    x_120658 = 0.0F;\n    for (int64_t j_133397 = 0; j_133397 < sdiv_up64(m_114533 *\n                                                    lifted_single_ma_arg_114976,\n                                                    sext_i32_i64(num_threads_133389));\n         j_133397++) {\n        int64_t chunk_offset_133398 = segscan_group_sizze_120654 * j_133397 +\n                sext_i32_i64(group_tid_133392) * (segscan_group_sizze_120654 *\n                                                  sdiv_up64(m_114533 *\n                                                            lifted_single_ma_arg_114976,\n                                                            sext_i32_i64(num_threads_133389)));\n        int64_t flat_idx_133399 = chunk_offset_133398 +\n                sext_i32_i64(local_tid_133391);\n        int64_t gtid_120482 = squot64(flat_idx_133399,\n                                      lifted_single_ma_arg_114976);\n        int64_t gtid_120490 = flat_idx_133399 - squot64(flat_idx_133399,\n                                                        lifted_single_ma_arg_114976) *\n                lifted_single_ma_arg_114976;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_120482, m_114533) && slt64(gtid_120490,\n                                                      lifted_single_ma_arg_114976)) {\n                bool cond_120664 =",
                   " gtid_120490 == (int64_t) 0;\n                float defunc_0_f_res_120665;\n                \n                if (cond_120664) {\n                    float defunc_2_reduce_res_120662 = ((__global\n                                                         float *) mem_130835)[gtid_120482];\n                    float defunc_0_f_res_t_res_120666 =\n                          defunc_2_reduce_res_120662 / i64_res_114576;\n                    \n                    defunc_0_f_res_120665 = defunc_0_f_res_t_res_120666;\n                } else {\n                    int64_t x_120667 = add64(n_p_114536, gtid_120490);\n                    int64_t i_120668 = sub64(x_120667, (int64_t) 1);\n                    bool x_120669 = sle64((int64_t) 0, i_120668);\n                    bool y_120670 = slt64(i_120668,\n                                          lifted_single_ma_arg_114959);\n                    bool bounds_check_120671 = x_120669 && y_120670;\n                    bool index_certs_120672;\n                    \n                    if (!bounds_check_120671) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          76) == -1) {\n                                global_failure_args[0] = i_120668;\n                                global_failure_args[1] =\n                                    lifted_single_ma_arg_114959;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    float x_120673 = ((__global\n                                       float *) mem_130831)[gtid_120482 *\n                                                            lifted_single_ma_arg_114959 +\n                                                            i_120668];\n                    int64_t i_120674 = sub64(gtid_120490, (int64_t) 1);\n             ",
                   "       bool x_120675 = sle64((int64_t) 0, i_120674);\n                    bool y_120676 = slt64(i_120674,\n                                          lifted_single_ma_arg_114959);\n                    bool bounds_check_120677 = x_120675 && y_120676;\n                    bool index_certs_120678;\n                    \n                    if (!bounds_check_120677) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          77) == -1) {\n                                global_failure_args[0] = i_120674;\n                                global_failure_args[1] =\n                                    lifted_single_ma_arg_114959;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    float y_120679 = ((__global\n                                       float *) mem_130831)[gtid_120482 *\n                                                            lifted_single_ma_arg_114959 +\n                                                            i_120674];\n                    float x_120680 = x_120673 - y_120679;\n                    float defunc_0_f_res_f_res_120681 = x_120680 /\n                          i64_res_114576;\n                    \n                    defunc_0_f_res_120665 = defunc_0_f_res_f_res_120681;\n                }\n                // write to-scan values to parameters\n                {\n                    x_120659 = defunc_0_f_res_120665;\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_120482, m_114533) && slt64(gtid_120490,\n               ",
                   "                                             lifted_single_ma_arg_114976))) {\n                    x_120659 = 0.0F;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                float defunc_1_op_res_120660 = x_120658 + x_120659;\n                \n                ((__local\n                  float *) scan_arr_mem_133395)[sext_i32_i64(local_tid_133391)] =\n                    defunc_1_op_res_120660;\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            float x_133400;\n            float x_133401;\n            float x_133403;\n            float x_133404;\n            bool ltid_in_bounds_133406 = slt64(sext_i32_i64(local_tid_133391),\n                                               segscan_group_sizze_120654);\n            int32_t skip_threads_133407;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_133406) {\n                    x_133401 = ((volatile __local\n                                 float *) scan_arr_mem_133395)[sext_i32_i64(local_tid_133391)];\n                    if ((local_tid_133391 - squot32(local_tid_133391, 32) *\n                         32) == 0) {\n                        x_133400 = x_133401;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_133407 = 1;\n                while (slt32(skip_threads_133407, 32)) {\n                    if (sle32(skip_threads_133407, local_tid_133391 -\n                              squot32(local_tid_133391, 32) * 32) &&\n                        ltid_in_bounds_133406) {\n                        // read operands\n                        {\n                            x_133400 = ((volatile __local\n                                         float *) scan_arr_mem_133395)[sext_i",
                   "32_i64(local_tid_133391) -\n                                                                       sext_i32_i64(skip_threads_133407)];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_133408 =\n                                 slt64(srem64(sext_i32_i64(local_tid_133391) +\n                                              chunk_offset_133398,\n                                              lifted_single_ma_arg_114976),\n                                       sext_i32_i64(local_tid_133391) +\n                                       chunk_offset_133398 -\n                                       (sext_i32_i64(local_tid_133391 -\n                                        skip_threads_133407) +\n                                        chunk_offset_133398));\n                            \n                            if (inactive_133408) {\n                                x_133400 = x_133401;\n                            }\n                            if (!inactive_133408) {\n                                float defunc_1_op_res_133402 = x_133400 +\n                                      x_133401;\n                                \n                                x_133400 = defunc_1_op_res_133402;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_133393, skip_threads_133407)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (sle32(skip_threads_133407, local_tid_133391 -\n                              squot32(local_tid_133391, 32) * 32) &&\n                        ltid_in_bounds_133406) {\n                        // write result\n                        {\n                            ((volatile __local\n                              float *) scan_arr_mem_133395)[sext_i32_i64(local_tid_133391)] =\n                                x_133400;\n                            x_133401 = x_133400;\n               ",
                   "         }\n                    }\n                    if (sle32(wave_sizze_133393, skip_threads_133407)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_133407 *= 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_133391 - squot32(local_tid_133391, 32) * 32) ==\n                    31 && ltid_in_bounds_133406) {\n                    ((volatile __local\n                      float *) scan_arr_mem_133395)[sext_i32_i64(squot32(local_tid_133391,\n                                                                         32))] =\n                        x_133400;\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_133409;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_133391, 32) == 0 &&\n                        ltid_in_bounds_133406) {\n                        x_133404 = ((volatile __local\n                                     float *) scan_arr_mem_133395)[sext_i32_i64(local_tid_133391)];\n                        if ((local_tid_133391 - squot32(local_tid_133391, 32) *\n                             32) == 0) {\n                            x_133403 = x_133404;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_133409 = 1;\n                    while (slt32(skip_threads_133409, 32)) {\n                        if (sle32(skip_threads_133409, local_tid_133391 -\n                                  squot32(local_tid_133391, 32) * 32) &&\n                            (squot32(local_tid_133391, 32) == 0 &&\n                        ",
                   "     ltid_in_bounds_133406)) {\n                            // read operands\n                            {\n                                x_133403 = ((volatile __local\n                                             float *) scan_arr_mem_133395)[sext_i32_i64(local_tid_133391) -\n                                                                           sext_i32_i64(skip_threads_133409)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_133410 =\n                                     slt64(srem64(sext_i32_i64(local_tid_133391 *\n                                                  32 + 32 - 1) +\n                                                  chunk_offset_133398,\n                                                  lifted_single_ma_arg_114976),\n                                           sext_i32_i64(local_tid_133391 * 32 +\n                                           32 - 1) + chunk_offset_133398 -\n                                           (sext_i32_i64((local_tid_133391 -\n                                                          skip_threads_133409) *\n                                            32 + 32 - 1) +\n                                            chunk_offset_133398));\n                                \n                                if (inactive_133410) {\n                                    x_133403 = x_133404;\n                                }\n                                if (!inactive_133410) {\n                                    float defunc_1_op_res_133405 = x_133403 +\n                                          x_133404;\n                                    \n                                    x_133403 = defunc_1_op_res_133405;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_133393, skip_threads_133409)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n              ",
                   "          }\n                        if (sle32(skip_threads_133409, local_tid_133391 -\n                                  squot32(local_tid_133391, 32) * 32) &&\n                            (squot32(local_tid_133391, 32) == 0 &&\n                             ltid_in_bounds_133406)) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) scan_arr_mem_133395)[sext_i32_i64(local_tid_133391)] =\n                                    x_133403;\n                                x_133404 = x_133403;\n                            }\n                        }\n                        if (sle32(wave_sizze_133393, skip_threads_133409)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_133409 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // carry-in for every block except the first\n            {\n                if (!(squot32(local_tid_133391, 32) == 0 ||\n                      !ltid_in_bounds_133406)) {\n                    // read operands\n                    {\n                        x_133401 = x_133400;\n                        x_133400 = ((__local\n                                     float *) scan_arr_mem_133395)[sext_i32_i64(squot32(local_tid_133391,\n                                                                                        32)) -\n                                                                   (int64_t) 1];\n                    }\n                    // perform operation\n                    {\n                        bool inactive_133411 =\n                             slt64(srem64(sext_i32_i64(local_tid_133391) +\n                                          chunk_offset_133398,\n                                          lifted_single_ma_arg_114976),\n                                   sext_i32_i64(local_tid_133391) +\n             ",
                   "                      chunk_offset_133398 -\n                                   (sext_i32_i64(squot32(local_tid_133391, 32) *\n                                    32 - 1) + chunk_offset_133398));\n                        \n                        if (inactive_133411) {\n                            x_133400 = x_133401;\n                        }\n                        if (!inactive_133411) {\n                            float defunc_1_op_res_133402 = x_133400 + x_133401;\n                            \n                            x_133400 = defunc_1_op_res_133402;\n                        }\n                    }\n                    // write final result\n                    {\n                        ((__local\n                          float *) scan_arr_mem_133395)[sext_i32_i64(local_tid_133391)] =\n                            x_133400;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_133391, 32) == 0) {\n                    ((__local\n                      float *) scan_arr_mem_133395)[sext_i32_i64(local_tid_133391)] =\n                        x_133401;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_120482, m_114533) && slt64(gtid_120490,\n                                                          lifted_single_ma_arg_114976)) {\n                    ((__global float *) mem_130840)[gtid_120482 *\n                                                    lifted_single_ma_arg_114976 +\n                                                    gtid_120490] = ((__local\n                                                                     float *) scan_arr_mem_133395)[sext_i32_i64(local_tid_133391)];\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // first thread reads last element as carr",
                   "y-in for next iteration\n            {\n                bool crosses_segment_133412 = slt64(srem64(chunk_offset_133398 +\n                                                           segscan_group_sizze_120654,\n                                                           lifted_single_ma_arg_114976),\n                                                    chunk_offset_133398 +\n                                                    segscan_group_sizze_120654 -\n                                                    (chunk_offset_133398 +\n                                                     segscan_group_sizze_120654 -\n                                                     (int64_t) 1));\n                bool should_load_carry_133413 = local_tid_133391 == 0 &&\n                     !crosses_segment_133412;\n                \n                if (should_load_carry_133413) {\n                    x_120658 = ((__local\n                                 float *) scan_arr_mem_133395)[segscan_group_sizze_120654 -\n                                                               (int64_t) 1];\n                }\n                if (!should_load_carry_133413) {\n                    x_120658 = 0.0F;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_120654\n}\n__kernel void mainziscan_stage1_120553(__global int *global_failure,\n                                       int failure_is_an_option, __global\n                                       int64_t *global_failure_args,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_133275_backing_aligned_0,\n                                       int64_t m_114533, int64_t n_p_114536,\n                                       float i64_res_114576,\n                                       int64_t C_len_114582,\n                                       int64_t lifted_single_ma_arg_114959,\n                                       ",
                   "int32_t num_threads_133269, __global\n                                       unsigned char *mem_130750, __global\n                                       unsigned char *mem_130826, __global\n                                       unsigned char *mem_130831)\n{\n    #define segscan_group_sizze_120606 (mainzisegscan_group_sizze_120547)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict scan_arr_mem_133275_backing_0 =\n                          (__local volatile\n                           char *) scan_arr_mem_133275_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_133270;\n    int32_t local_tid_133271;\n    int64_t group_sizze_133274;\n    int32_t wave_sizze_133273;\n    int32_t group_tid_133272;\n    \n    global_tid_133270 = get_global_id(0);\n    local_tid_133271 = get_local_id(0);\n    group_sizze_133274 = get_local_size(0);\n    wave_sizze_133273 = LOCKSTEP_WIDTH;\n    group_tid_133272 = get_group_id(0);\n    \n    int32_t phys_tid_120553 = global_tid_133270;\n    __local char *scan_arr_mem_133275;\n    \n    scan_arr_mem_133275 = (__local char *) scan_arr_mem_133275_backing_0;\n    \n    float x_120610;\n    float x_120611;\n    \n    x_120610 = 0.0F;\n    for (int64_t j_133277 = 0; j_133277 < sdiv_up64(m_114533 *\n                                                    lifted_single_ma_arg_114959,\n                                                    sext_i32_i64(num_threads_133269));\n         j_133277++) {\n        int64_t chunk_offset_133278 = segscan_group_sizze_120606 * j_133277 +\n                sext_i32_i64(group_tid_133272) * (segscan_group_sizze_120606 *\n                                                  sdiv_up64(m_114533 *\n                                                          ",
                   "  lifted_single_ma_arg_114959,\n                                                            sext_i32_i64(num_threads_133269)));\n        int64_t flat_idx_133279 = chunk_offset_133278 +\n                sext_i32_i64(local_tid_133271);\n        int64_t gtid_120544 = squot64(flat_idx_133279,\n                                      lifted_single_ma_arg_114959);\n        int64_t gtid_120552 = flat_idx_133279 - squot64(flat_idx_133279,\n                                                        lifted_single_ma_arg_114959) *\n                lifted_single_ma_arg_114959;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_120544, m_114533) && slt64(gtid_120552,\n                                                      lifted_single_ma_arg_114959)) {\n                bool cond_120616 = gtid_120552 == (int64_t) 0;\n                float defunc_0_f_res_120617;\n                \n                if (cond_120616) {\n                    float defunc_2_reduce_res_120614 = ((__global\n                                                         float *) mem_130826)[gtid_120544];\n                    float defunc_0_f_res_t_res_120618 =\n                          defunc_2_reduce_res_120614 / i64_res_114576;\n                    \n                    defunc_0_f_res_120617 = defunc_0_f_res_t_res_120618;\n                } else {\n                    int64_t x_120619 = add64(n_p_114536, gtid_120552);\n                    int64_t i_120620 = sub64(x_120619, (int64_t) 1);\n                    bool x_120621 = sle64((int64_t) 0, i_120620);\n                    bool y_120622 = slt64(i_120620, C_len_114582);\n                    bool bounds_check_120623 = x_120621 && y_120622;\n                    bool index_certs_120624;\n                    \n                    if (!bounds_check_120623) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          74) == -1) {\n                                gl",
                   "obal_failure_args[0] = i_120620;\n                                global_failure_args[1] = C_len_114582;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    float x_120625 = ((__global\n                                       float *) mem_130750)[gtid_120544 *\n                                                            C_len_114582 +\n                                                            i_120620];\n                    int64_t i_120626 = sub64(gtid_120552, (int64_t) 1);\n                    bool x_120627 = sle64((int64_t) 0, i_120626);\n                    bool y_120628 = slt64(i_120626, C_len_114582);\n                    bool bounds_check_120629 = x_120627 && y_120628;\n                    bool index_certs_120630;\n                    \n                    if (!bounds_check_120629) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          75) == -1) {\n                                global_failure_args[0] = i_120626;\n                                global_failure_args[1] = C_len_114582;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    float y_120631 = ((__global\n                                       float *) mem_130750)[gtid_120544 *\n                                                            C_len_114582 +\n                                                            i_120626];\n                    float x_120632 = x_120625 - y_120631;\n                    float defunc_0_f_res_f_res_120633 = x_120632 /\n                          i64_res_114576;\n                    \n                    d",
                   "efunc_0_f_res_120617 = defunc_0_f_res_f_res_120633;\n                }\n                // write to-scan values to parameters\n                {\n                    x_120611 = defunc_0_f_res_120617;\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_120544, m_114533) && slt64(gtid_120552,\n                                                            lifted_single_ma_arg_114959))) {\n                    x_120611 = 0.0F;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                float defunc_1_op_res_120612 = x_120610 + x_120611;\n                \n                ((__local\n                  float *) scan_arr_mem_133275)[sext_i32_i64(local_tid_133271)] =\n                    defunc_1_op_res_120612;\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            float x_133280;\n            float x_133281;\n            float x_133283;\n            float x_133284;\n            bool ltid_in_bounds_133286 = slt64(sext_i32_i64(local_tid_133271),\n                                               segscan_group_sizze_120606);\n            int32_t skip_threads_133287;\n            \n            // read input for in-block scan\n            {\n                if (ltid_in_bounds_133286) {\n                    x_133281 = ((volatile __local\n                                 float *) scan_arr_mem_133275)[sext_i32_i64(local_tid_133271)];\n                    if ((local_tid_133271 - squot32(local_tid_133271, 32) *\n                         32) == 0) {\n                        x_133280 = x_133281;\n                    }\n                }\n            }\n   ",
                   "         // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_133287 = 1;\n                while (slt32(skip_threads_133287, 32)) {\n                    if (sle32(skip_threads_133287, local_tid_133271 -\n                              squot32(local_tid_133271, 32) * 32) &&\n                        ltid_in_bounds_133286) {\n                        // read operands\n                        {\n                            x_133280 = ((volatile __local\n                                         float *) scan_arr_mem_133275)[sext_i32_i64(local_tid_133271) -\n                                                                       sext_i32_i64(skip_threads_133287)];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_133288 =\n                                 slt64(srem64(sext_i32_i64(local_tid_133271) +\n                                              chunk_offset_133278,\n                                              lifted_single_ma_arg_114959),\n                                       sext_i32_i64(local_tid_133271) +\n                                       chunk_offset_133278 -\n                                       (sext_i32_i64(local_tid_133271 -\n                                        skip_threads_133287) +\n                                        chunk_offset_133278));\n                            \n                            if (inactive_133288) {\n                                x_133280 = x_133281;\n                            }\n                            if (!inactive_133288) {\n                                float defunc_1_op_res_133282 = x_133280 +\n                                      x_133281;\n                                \n                                x_133280 = defunc_1_op_res_133282;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_133273, skip_threads_133287)) {\n                  ",
                   "      barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (sle32(skip_threads_133287, local_tid_133271 -\n                              squot32(local_tid_133271, 32) * 32) &&\n                        ltid_in_bounds_133286) {\n                        // write result\n                        {\n                            ((volatile __local\n                              float *) scan_arr_mem_133275)[sext_i32_i64(local_tid_133271)] =\n                                x_133280;\n                            x_133281 = x_133280;\n                        }\n                    }\n                    if (sle32(wave_sizze_133273, skip_threads_133287)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_133287 *= 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_133271 - squot32(local_tid_133271, 32) * 32) ==\n                    31 && ltid_in_bounds_133286) {\n                    ((volatile __local\n                      float *) scan_arr_mem_133275)[sext_i32_i64(squot32(local_tid_133271,\n                                                                         32))] =\n                        x_133280;\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_133289;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_133271, 32) == 0 &&\n                        ltid_in_bounds_133286) {\n                        x_133284 = ((volatile __local\n                                     float *) scan_arr_mem_133275)[sext_i32_i64(local_tid_133271)];\n                        if ((local_tid_133271 - squot32(local_tid_133271, 32) *\n                       ",
                   "      32) == 0) {\n                            x_133283 = x_133284;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_133289 = 1;\n                    while (slt32(skip_threads_133289, 32)) {\n                        if (sle32(skip_threads_133289, local_tid_133271 -\n                                  squot32(local_tid_133271, 32) * 32) &&\n                            (squot32(local_tid_133271, 32) == 0 &&\n                             ltid_in_bounds_133286)) {\n                            // read operands\n                            {\n                                x_133283 = ((volatile __local\n                                             float *) scan_arr_mem_133275)[sext_i32_i64(local_tid_133271) -\n                                                                           sext_i32_i64(skip_threads_133289)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_133290 =\n                                     slt64(srem64(sext_i32_i64(local_tid_133271 *\n                                                  32 + 32 - 1) +\n                                                  chunk_offset_133278,\n                                                  lifted_single_ma_arg_114959),\n                                           sext_i32_i64(local_tid_133271 * 32 +\n                                           32 - 1) + chunk_offset_133278 -\n                                           (sext_i32_i64((local_tid_133271 -\n                                                          skip_threads_133289) *\n                                            32 + 32 - 1) +\n                                            chunk_offset_133278));\n                                \n                                if (inactive_133290) {\n                                    x_133283 = x_133284;\n        ",
                   "                        }\n                                if (!inactive_133290) {\n                                    float defunc_1_op_res_133285 = x_133283 +\n                                          x_133284;\n                                    \n                                    x_133283 = defunc_1_op_res_133285;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_133273, skip_threads_133289)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_133289, local_tid_133271 -\n                                  squot32(local_tid_133271, 32) * 32) &&\n                            (squot32(local_tid_133271, 32) == 0 &&\n                             ltid_in_bounds_133286)) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) scan_arr_mem_133275)[sext_i32_i64(local_tid_133271)] =\n                                    x_133283;\n                                x_133284 = x_133283;\n                            }\n                        }\n                        if (sle32(wave_sizze_133273, skip_threads_133289)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_133289 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // carry-in for every block except the first\n            {\n                if (!(squot32(local_tid_133271, 32) == 0 ||\n                      !ltid_in_bounds_133286)) {\n                    // read operands\n                    {\n                        x_133281 = x_133280;\n                        x_133280 = ((__local\n                                     float *) scan_arr_mem_133275)[sext_i32_i64(squot32(local_tid_133271,\n                                        ",
                   "                                                32)) -\n                                                                   (int64_t) 1];\n                    }\n                    // perform operation\n                    {\n                        bool inactive_133291 =\n                             slt64(srem64(sext_i32_i64(local_tid_133271) +\n                                          chunk_offset_133278,\n                                          lifted_single_ma_arg_114959),\n                                   sext_i32_i64(local_tid_133271) +\n                                   chunk_offset_133278 -\n                                   (sext_i32_i64(squot32(local_tid_133271, 32) *\n                                    32 - 1) + chunk_offset_133278));\n                        \n                        if (inactive_133291) {\n                            x_133280 = x_133281;\n                        }\n                        if (!inactive_133291) {\n                            float defunc_1_op_res_133282 = x_133280 + x_133281;\n                            \n                            x_133280 = defunc_1_op_res_133282;\n                        }\n                    }\n                    // write final result\n                    {\n                        ((__local\n                          float *) scan_arr_mem_133275)[sext_i32_i64(local_tid_133271)] =\n                            x_133280;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_133271, 32) == 0) {\n                    ((__local\n                      float *) scan_arr_mem_133275)[sext_i32_i64(local_tid_133271)] =\n                        x_133281;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_120544, m_114533) && slt64(gtid_120552,\n                ",
                   "                                          lifted_single_ma_arg_114959)) {\n                    ((__global float *) mem_130831)[gtid_120544 *\n                                                    lifted_single_ma_arg_114959 +\n                                                    gtid_120552] = ((__local\n                                                                     float *) scan_arr_mem_133275)[sext_i32_i64(local_tid_133271)];\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_133292 = slt64(srem64(chunk_offset_133278 +\n                                                           segscan_group_sizze_120606,\n                                                           lifted_single_ma_arg_114959),\n                                                    chunk_offset_133278 +\n                                                    segscan_group_sizze_120606 -\n                                                    (chunk_offset_133278 +\n                                                     segscan_group_sizze_120606 -\n                                                     (int64_t) 1));\n                bool should_load_carry_133293 = local_tid_133271 == 0 &&\n                     !crosses_segment_133292;\n                \n                if (should_load_carry_133293) {\n                    x_120610 = ((__local\n                                 float *) scan_arr_mem_133275)[segscan_group_sizze_120606 -\n                                                               (int64_t) 1];\n                }\n                if (!should_load_carry_133293) {\n                    x_120610 = 0.0F;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_120606\n}\n__kernel void mainziscan_stage1_128143(__global int *global_failure,\n                                       __",
                   "local volatile\n                                       int64_t *scan_arr_mem_135219_backing_aligned_0,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_135217_backing_aligned_1,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_135215_backing_aligned_2,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_135213_backing_aligned_3,\n                                       int64_t m_114533, int64_t n_114534,\n                                       int32_t defunc_2_radix_sort_step_arg_128292,\n                                       int32_t defunc_0_get_bit_arg_128293,\n                                       unsigned char cond_f_res_128294,\n                                       unsigned char cond_f_res_128295,\n                                       int32_t num_threads_135207, __global\n                                       unsigned char *mem_param_131846, __global\n                                       unsigned char *mem_131882, __global\n                                       unsigned char *mem_131886, __global\n                                       unsigned char *mem_131890, __global\n                                       unsigned char *mem_131894, __global\n                                       unsigned char *mem_131898)\n{\n    #define segscan_group_sizze_128388 (mainzisegscan_group_sizze_128137)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict scan_arr_mem_135219_backing_3 =\n                          (__local volatile\n                           char *) scan_arr_mem_135219_backing_aligned_0;\n    __local volatile char *restrict scan_arr_mem_135217_backing_2 =\n                          (__local volatile\n                           char *) scan_arr_mem_135217_backing_aligned_1;\n    __local volatile cha",
                   "r *restrict scan_arr_mem_135215_backing_1 =\n                          (__local volatile\n                           char *) scan_arr_mem_135215_backing_aligned_2;\n    __local volatile char *restrict scan_arr_mem_135213_backing_0 =\n                          (__local volatile\n                           char *) scan_arr_mem_135213_backing_aligned_3;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_135208;\n    int32_t local_tid_135209;\n    int64_t group_sizze_135212;\n    int32_t wave_sizze_135211;\n    int32_t group_tid_135210;\n    \n    global_tid_135208 = get_global_id(0);\n    local_tid_135209 = get_local_id(0);\n    group_sizze_135212 = get_local_size(0);\n    wave_sizze_135211 = LOCKSTEP_WIDTH;\n    group_tid_135210 = get_group_id(0);\n    \n    int32_t phys_tid_128143 = global_tid_135208;\n    __local char *scan_arr_mem_135213;\n    __local char *scan_arr_mem_135215;\n    __local char *scan_arr_mem_135217;\n    __local char *scan_arr_mem_135219;\n    \n    scan_arr_mem_135213 = (__local char *) scan_arr_mem_135213_backing_0;\n    scan_arr_mem_135215 = (__local char *) scan_arr_mem_135215_backing_1;\n    scan_arr_mem_135217 = (__local char *) scan_arr_mem_135217_backing_2;\n    scan_arr_mem_135219 = (__local char *) scan_arr_mem_135219_backing_3;\n    \n    int64_t x_128396;\n    int64_t x_128397;\n    int64_t x_128398;\n    int64_t x_128399;\n    int64_t x_128400;\n    int64_t x_128401;\n    int64_t x_128402;\n    int64_t x_128403;\n    \n    x_128396 = (int64_t) 0;\n    x_128397 = (int64_t) 0;\n    x_128398 = (int64_t) 0;\n    x_128399 = (int64_t) 0;\n    for (int64_t j_135221 = 0; j_135221 < sdiv_up64(m_114533 * n_114534,\n                                                    sext_i32_i64(num_threads_135207));\n         j_135221++) {\n        int64_t chunk_offset_135222 = segscan_group_sizze_128388 * j_135221 +\n                sext_i32_i64(group_tid_135210) * (segscan_group_sizze_128388 *\n                                                  sdiv_up64(m_114533 * n_114534,\n ",
                   "                                                           sext_i32_i64(num_threads_135207)));\n        int64_t flat_idx_135223 = chunk_offset_135222 +\n                sext_i32_i64(local_tid_135209);\n        int64_t gtid_128134 = squot64(flat_idx_135223, n_114534);\n        int64_t gtid_128142 = flat_idx_135223 - squot64(flat_idx_135223,\n                                                        n_114534) * n_114534;\n        \n        // threads in bounds read input\n        {\n            if (slt64(gtid_128134, m_114533) && slt64(gtid_128142, n_114534)) {\n                float x_128409 = ((__global\n                                   float *) mem_param_131846)[gtid_128134 *\n                                                              n_114534 +\n                                                              gtid_128142];\n                int32_t i32_arg_128410;\n                \n                i32_arg_128410 = futrts_to_bits32(x_128409);\n                \n                int32_t unsign_arg_128411 = ashr32(i32_arg_128410,\n                                                   defunc_0_get_bit_arg_128293);\n                int32_t unsign_arg_128412 = 1 & unsign_arg_128411;\n                int32_t unsign_arg_128413 = ashr32(i32_arg_128410, 31);\n                int32_t unsign_arg_128414 = 1 & unsign_arg_128413;\n                bool cond_128415 = unsign_arg_128414 == 1;\n                bool x_128416 = !cond_128415;\n                bool y_128417 = cond_f_res_128294 && x_128416;\n                bool cond_128418 = cond_128415 || y_128417;\n                int32_t defunc_1_get_bit_res_128419;\n                \n                if (cond_128418) {\n                    int32_t defunc_1_get_bit_res_t_res_128420 = 1 ^\n                            unsign_arg_128412;\n                    \n                    defunc_1_get_bit_res_128419 =\n                        defunc_1_get_bit_res_t_res_128420;\n                } else {\n                    defunc_1_get_bit_res_128419 = unsign_arg_128412;\n               ",
                   " }\n                \n                int32_t x_128421 = mul32(2, defunc_1_get_bit_res_128419);\n                int32_t unsign_arg_128422 = ashr32(i32_arg_128410,\n                                                   defunc_2_radix_sort_step_arg_128292);\n                int32_t unsign_arg_128423 = 1 & unsign_arg_128422;\n                bool y_128424 = cond_f_res_128295 && x_128416;\n                bool cond_128425 = cond_128415 || y_128424;\n                int32_t defunc_1_get_bit_res_128426;\n                \n                if (cond_128425) {\n                    int32_t defunc_1_get_bit_res_t_res_128427 = 1 ^\n                            unsign_arg_128423;\n                    \n                    defunc_1_get_bit_res_128426 =\n                        defunc_1_get_bit_res_t_res_128427;\n                } else {\n                    defunc_1_get_bit_res_128426 = unsign_arg_128423;\n                }\n                \n                int32_t defunc_0_f_res_128428 = add32(x_128421,\n                                                      defunc_1_get_bit_res_128426);\n                bool cond_128429 = defunc_0_f_res_128428 == 0;\n                int64_t defunc_0_f_res_128430 = btoi_bool_i64(cond_128429);\n                int64_t defunc_0_f_res_128431;\n                int64_t defunc_0_f_res_128432;\n                int64_t defunc_0_f_res_128433;\n                \n                if (cond_128429) {\n                    defunc_0_f_res_128431 = (int64_t) 0;\n                    defunc_0_f_res_128432 = (int64_t) 0;\n                    defunc_0_f_res_128433 = (int64_t) 0;\n                } else {\n                    bool cond_128434 = defunc_0_f_res_128428 == 1;\n                    int64_t defunc_0_f_res_f_res_128435 =\n                            btoi_bool_i64(cond_128434);\n                    int64_t defunc_0_f_res_f_res_128436;\n                    int64_t defunc_0_f_res_f_res_128437;\n                    \n                    if (cond_128434) {\n                        defunc_0_f_res_f_res_12843",
                   "6 = (int64_t) 0;\n                        defunc_0_f_res_f_res_128437 = (int64_t) 0;\n                    } else {\n                        bool cond_128438 = defunc_0_f_res_128428 == 2;\n                        int64_t defunc_0_f_res_f_res_f_res_128439 =\n                                btoi_bool_i64(cond_128438);\n                        bool cond_neg_128440 = !cond_128438;\n                        int64_t defunc_0_f_res_f_res_f_res_128441 =\n                                btoi_bool_i64(cond_neg_128440);\n                        \n                        defunc_0_f_res_f_res_128436 =\n                            defunc_0_f_res_f_res_f_res_128439;\n                        defunc_0_f_res_f_res_128437 =\n                            defunc_0_f_res_f_res_f_res_128441;\n                    }\n                    defunc_0_f_res_128431 = defunc_0_f_res_f_res_128435;\n                    defunc_0_f_res_128432 = defunc_0_f_res_f_res_128436;\n                    defunc_0_f_res_128433 = defunc_0_f_res_f_res_128437;\n                }\n                // write to-scan values to parameters\n                {\n                    x_128400 = defunc_0_f_res_128430;\n                    x_128401 = defunc_0_f_res_128431;\n                    x_128402 = defunc_0_f_res_128432;\n                    x_128403 = defunc_0_f_res_128433;\n                }\n                // write mapped values results to global memory\n                {\n                    ((__global int32_t *) mem_131898)[gtid_128134 * n_114534 +\n                                                      gtid_128142] =\n                        defunc_0_f_res_128428;\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_128134, m_114533) && slt64(gtid_128142,\n                                                            n_114534))) {\n                    x_128400 = (int64_t) 0;\n            ",
                   "        x_128401 = (int64_t) 0;\n                    x_128402 = (int64_t) 0;\n                    x_128403 = (int64_t) 0;\n                }\n            }\n            // combine with carry and write to local memory\n            {\n                int64_t defunc_1_op_res_128404 = add64(x_128396, x_128400);\n                int64_t defunc_1_op_res_128405 = add64(x_128397, x_128401);\n                int64_t defunc_1_op_res_128406 = add64(x_128398, x_128402);\n                int64_t defunc_1_op_res_128407 = add64(x_128399, x_128403);\n                \n                ((__local\n                  int64_t *) scan_arr_mem_135213)[sext_i32_i64(local_tid_135209)] =\n                    defunc_1_op_res_128404;\n                ((__local\n                  int64_t *) scan_arr_mem_135215)[sext_i32_i64(local_tid_135209)] =\n                    defunc_1_op_res_128405;\n                ((__local\n                  int64_t *) scan_arr_mem_135217)[sext_i32_i64(local_tid_135209)] =\n                    defunc_1_op_res_128406;\n                ((__local\n                  int64_t *) scan_arr_mem_135219)[sext_i32_i64(local_tid_135209)] =\n                    defunc_1_op_res_128407;\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            \n            int64_t x_135224;\n            int64_t x_135225;\n            int64_t x_135226;\n            int64_t x_135227;\n            int64_t x_135228;\n            int64_t x_135229;\n            int64_t x_135230;\n            int64_t x_135231;\n            int64_t x_135236;\n            int64_t x_135237;\n            int64_t x_135238;\n            int64_t x_135239;\n            int64_t x_135240;\n            int64_t x_135241;\n            int64_t x_135242;\n            int64_t x_135243;\n            bool ltid_in_bounds_135248 = slt64(sext_i32_i64(local_tid_135209),\n                                               segscan_group_sizze_128388);\n            int32_t skip_threads_135249;\n            \n            // read input for in-block scan\n            {\n                if (l",
                   "tid_in_bounds_135248) {\n                    x_135228 = ((volatile __local\n                                 int64_t *) scan_arr_mem_135213)[sext_i32_i64(local_tid_135209)];\n                    x_135229 = ((volatile __local\n                                 int64_t *) scan_arr_mem_135215)[sext_i32_i64(local_tid_135209)];\n                    x_135230 = ((volatile __local\n                                 int64_t *) scan_arr_mem_135217)[sext_i32_i64(local_tid_135209)];\n                    x_135231 = ((volatile __local\n                                 int64_t *) scan_arr_mem_135219)[sext_i32_i64(local_tid_135209)];\n                    if ((local_tid_135209 - squot32(local_tid_135209, 32) *\n                         32) == 0) {\n                        x_135224 = x_135228;\n                        x_135225 = x_135229;\n                        x_135226 = x_135230;\n                        x_135227 = x_135231;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_135249 = 1;\n                while (slt32(skip_threads_135249, 32)) {\n                    if (sle32(skip_threads_135249, local_tid_135209 -\n                              squot32(local_tid_135209, 32) * 32) &&\n                        ltid_in_bounds_135248) {\n                        // read operands\n                        {\n                            x_135224 = ((volatile __local\n                                         int64_t *) scan_arr_mem_135213)[sext_i32_i64(local_tid_135209) -\n                                                                         sext_i32_i64(skip_threads_135249)];\n                            x_135225 = ((volatile __local\n                                         int64_t *) scan_arr_mem_135215)[sext_i32_i64(local_tid_135209) -\n                                                                         sext_i32_i64(skip_threads_135249)];\n                            x_135226 = ((volatile __local\n      ",
                   "                                   int64_t *) scan_arr_mem_135217)[sext_i32_i64(local_tid_135209) -\n                                                                         sext_i32_i64(skip_threads_135249)];\n                            x_135227 = ((volatile __local\n                                         int64_t *) scan_arr_mem_135219)[sext_i32_i64(local_tid_135209) -\n                                                                         sext_i32_i64(skip_threads_135249)];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_135250 =\n                                 slt64(srem64(sext_i32_i64(local_tid_135209) +\n                                              chunk_offset_135222, n_114534),\n                                       sext_i32_i64(local_tid_135209) +\n                                       chunk_offset_135222 -\n                                       (sext_i32_i64(local_tid_135209 -\n                                        skip_threads_135249) +\n                                        chunk_offset_135222));\n                            \n                            if (inactive_135250) {\n                                x_135224 = x_135228;\n                                x_135225 = x_135229;\n                                x_135226 = x_135230;\n                                x_135227 = x_135231;\n                            }\n                            if (!inactive_135250) {\n                                int64_t defunc_1_op_res_135232 = add64(x_135224,\n                                                                       x_135228);\n                                int64_t defunc_1_op_res_135233 = add64(x_135225,\n                                                                       x_135229);\n                                int64_t defunc_1_op_res_135234 = add64(x_135226,\n                                                                       x_135230);\n                   ",
                   "             int64_t defunc_1_op_res_135235 = add64(x_135227,\n                                                                       x_135231);\n                                \n                                x_135224 = defunc_1_op_res_135232;\n                                x_135225 = defunc_1_op_res_135233;\n                                x_135226 = defunc_1_op_res_135234;\n                                x_135227 = defunc_1_op_res_135235;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_135211, skip_threads_135249)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (sle32(skip_threads_135249, local_tid_135209 -\n                              squot32(local_tid_135209, 32) * 32) &&\n                        ltid_in_bounds_135248) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_135213)[sext_i32_i64(local_tid_135209)] =\n                                x_135224;\n                            x_135228 = x_135224;\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_135215)[sext_i32_i64(local_tid_135209)] =\n                                x_135225;\n                            x_135229 = x_135225;\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_135217)[sext_i32_i64(local_tid_135209)] =\n                                x_135226;\n                            x_135230 = x_135226;\n                            ((volatile __local\n                              int64_t *) scan_arr_mem_135219)[sext_i32_i64(local_tid_135209)] =\n                                x_135227;\n                            x_135231 = x_135227;\n                        }\n                    }\n                    if (sle32(wave_sizze_135211, skip_threads_135249)) {\n                 ",
                   "       barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_135249 *= 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_135209 - squot32(local_tid_135209, 32) * 32) ==\n                    31 && ltid_in_bounds_135248) {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_135213)[sext_i32_i64(squot32(local_tid_135209,\n                                                                           32))] =\n                        x_135224;\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_135215)[sext_i32_i64(squot32(local_tid_135209,\n                                                                           32))] =\n                        x_135225;\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_135217)[sext_i32_i64(squot32(local_tid_135209,\n                                                                           32))] =\n                        x_135226;\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_135219)[sext_i32_i64(squot32(local_tid_135209,\n                                                                           32))] =\n                        x_135227;\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_135251;\n                \n                // read input for in-block scan\n                {\n                    if (squot32(local_tid_135209, 32) == 0 &&\n                        ltid_in_bounds_135248) {\n                        x_135240 = ((volatile __local\n                                     int64_t *) scan_arr_mem_135213)[sext_i32_i64(local_tid_135209)];\n                        x_135241",
                   " = ((volatile __local\n                                     int64_t *) scan_arr_mem_135215)[sext_i32_i64(local_tid_135209)];\n                        x_135242 = ((volatile __local\n                                     int64_t *) scan_arr_mem_135217)[sext_i32_i64(local_tid_135209)];\n                        x_135243 = ((volatile __local\n                                     int64_t *) scan_arr_mem_135219)[sext_i32_i64(local_tid_135209)];\n                        if ((local_tid_135209 - squot32(local_tid_135209, 32) *\n                             32) == 0) {\n                            x_135236 = x_135240;\n                            x_135237 = x_135241;\n                            x_135238 = x_135242;\n                            x_135239 = x_135243;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_135251 = 1;\n                    while (slt32(skip_threads_135251, 32)) {\n                        if (sle32(skip_threads_135251, local_tid_135209 -\n                                  squot32(local_tid_135209, 32) * 32) &&\n                            (squot32(local_tid_135209, 32) == 0 &&\n                             ltid_in_bounds_135248)) {\n                            // read operands\n                            {\n                                x_135236 = ((volatile __local\n                                             int64_t *) scan_arr_mem_135213)[sext_i32_i64(local_tid_135209) -\n                                                                             sext_i32_i64(skip_threads_135251)];\n                                x_135237 = ((volatile __local\n                                             int64_t *) scan_arr_mem_135215)[sext_i32_i64(local_tid_135209) -\n                                                                             sext_i32_i64(skip_threads_135251)];\n                                x_135238 = ((volatile __local\n                 ",
                   "                            int64_t *) scan_arr_mem_135217)[sext_i32_i64(local_tid_135209) -\n                                                                             sext_i32_i64(skip_threads_135251)];\n                                x_135239 = ((volatile __local\n                                             int64_t *) scan_arr_mem_135219)[sext_i32_i64(local_tid_135209) -\n                                                                             sext_i32_i64(skip_threads_135251)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_135252 =\n                                     slt64(srem64(sext_i32_i64(local_tid_135209 *\n                                                  32 + 32 - 1) +\n                                                  chunk_offset_135222,\n                                                  n_114534),\n                                           sext_i32_i64(local_tid_135209 * 32 +\n                                           32 - 1) + chunk_offset_135222 -\n                                           (sext_i32_i64((local_tid_135209 -\n                                                          skip_threads_135251) *\n                                            32 + 32 - 1) +\n                                            chunk_offset_135222));\n                                \n                                if (inactive_135252) {\n                                    x_135236 = x_135240;\n                                    x_135237 = x_135241;\n                                    x_135238 = x_135242;\n                                    x_135239 = x_135243;\n                                }\n                                if (!inactive_135252) {\n                                    int64_t defunc_1_op_res_135244 =\n                                            add64(x_135236, x_135240);\n                                    int64_t defunc_1_op_res_135245 =\n            ",
                   "                                add64(x_135237, x_135241);\n                                    int64_t defunc_1_op_res_135246 =\n                                            add64(x_135238, x_135242);\n                                    int64_t defunc_1_op_res_135247 =\n                                            add64(x_135239, x_135243);\n                                    \n                                    x_135236 = defunc_1_op_res_135244;\n                                    x_135237 = defunc_1_op_res_135245;\n                                    x_135238 = defunc_1_op_res_135246;\n                                    x_135239 = defunc_1_op_res_135247;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_135211, skip_threads_135251)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_135251, local_tid_135209 -\n                                  squot32(local_tid_135209, 32) * 32) &&\n                            (squot32(local_tid_135209, 32) == 0 &&\n                             ltid_in_bounds_135248)) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_135213)[sext_i32_i64(local_tid_135209)] =\n                                    x_135236;\n                                x_135240 = x_135236;\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_135215)[sext_i32_i64(local_tid_135209)] =\n                                    x_135237;\n                                x_135241 = x_135237;\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_135217)[sext_i32_i64(local_tid_135209)] =\n                                    x_135238;\n                                x_135242 = x_1352",
                   "38;\n                                ((volatile __local\n                                  int64_t *) scan_arr_mem_135219)[sext_i32_i64(local_tid_135209)] =\n                                    x_135239;\n                                x_135243 = x_135239;\n                            }\n                        }\n                        if (sle32(wave_sizze_135211, skip_threads_135251)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_135251 *= 2;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // carry-in for every block except the first\n            {\n                if (!(squot32(local_tid_135209, 32) == 0 ||\n                      !ltid_in_bounds_135248)) {\n                    // read operands\n                    {\n                        x_135228 = x_135224;\n                        x_135229 = x_135225;\n                        x_135230 = x_135226;\n                        x_135231 = x_135227;\n                        x_135224 = ((__local\n                                     int64_t *) scan_arr_mem_135213)[sext_i32_i64(squot32(local_tid_135209,\n                                                                                          32)) -\n                                                                     (int64_t) 1];\n                        x_135225 = ((__local\n                                     int64_t *) scan_arr_mem_135215)[sext_i32_i64(squot32(local_tid_135209,\n                                                                                          32)) -\n                                                                     (int64_t) 1];\n                        x_135226 = ((__local\n                                     int64_t *) scan_arr_mem_135217)[sext_i32_i64(squot32(local_tid_135209,\n                                                                                          32)) -\n                                                ",
                   "                     (int64_t) 1];\n                        x_135227 = ((__local\n                                     int64_t *) scan_arr_mem_135219)[sext_i32_i64(squot32(local_tid_135209,\n                                                                                          32)) -\n                                                                     (int64_t) 1];\n                    }\n                    // perform operation\n                    {\n                        bool inactive_135253 =\n                             slt64(srem64(sext_i32_i64(local_tid_135209) +\n                                          chunk_offset_135222, n_114534),\n                                   sext_i32_i64(local_tid_135209) +\n                                   chunk_offset_135222 -\n                                   (sext_i32_i64(squot32(local_tid_135209, 32) *\n                                    32 - 1) + chunk_offset_135222));\n                        \n                        if (inactive_135253) {\n                            x_135224 = x_135228;\n                            x_135225 = x_135229;\n                            x_135226 = x_135230;\n                            x_135227 = x_135231;\n                        }\n                        if (!inactive_135253) {\n                            int64_t defunc_1_op_res_135232 = add64(x_135224,\n                                                                   x_135228);\n                            int64_t defunc_1_op_res_135233 = add64(x_135225,\n                                                                   x_135229);\n                            int64_t defunc_1_op_res_135234 = add64(x_135226,\n                                                                   x_135230);\n                            int64_t defunc_1_op_res_135235 = add64(x_135227,\n                                                                   x_135231);\n                            \n                            x_135224 = defunc_1_op_res_135232;\n                      ",
                   "      x_135225 = defunc_1_op_res_135233;\n                            x_135226 = defunc_1_op_res_135234;\n                            x_135227 = defunc_1_op_res_135235;\n                        }\n                    }\n                    // write final result\n                    {\n                        ((__local\n                          int64_t *) scan_arr_mem_135213)[sext_i32_i64(local_tid_135209)] =\n                            x_135224;\n                        ((__local\n                          int64_t *) scan_arr_mem_135215)[sext_i32_i64(local_tid_135209)] =\n                            x_135225;\n                        ((__local\n                          int64_t *) scan_arr_mem_135217)[sext_i32_i64(local_tid_135209)] =\n                            x_135226;\n                        ((__local\n                          int64_t *) scan_arr_mem_135219)[sext_i32_i64(local_tid_135209)] =\n                            x_135227;\n                    }\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // restore correct values for first block\n            {\n                if (squot32(local_tid_135209, 32) == 0) {\n                    ((__local\n                      int64_t *) scan_arr_mem_135213)[sext_i32_i64(local_tid_135209)] =\n                        x_135228;\n                    ((__local\n                      int64_t *) scan_arr_mem_135215)[sext_i32_i64(local_tid_135209)] =\n                        x_135229;\n                    ((__local\n                      int64_t *) scan_arr_mem_135217)[sext_i32_i64(local_tid_135209)] =\n                        x_135230;\n                    ((__local\n                      int64_t *) scan_arr_mem_135219)[sext_i32_i64(local_tid_135209)] =\n                        x_135231;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n            // threads in bounds write partial scan result\n            {\n                if (slt64(gtid_128134, m_114533) && slt64(gtid_128142,\n                 ",
                   "                                         n_114534)) {\n                    ((__global int64_t *) mem_131882)[gtid_128134 * n_114534 +\n                                                      gtid_128142] = ((__local\n                                                                       int64_t *) scan_arr_mem_135213)[sext_i32_i64(local_tid_135209)];\n                    ((__global int64_t *) mem_131886)[gtid_128134 * n_114534 +\n                                                      gtid_128142] = ((__local\n                                                                       int64_t *) scan_arr_mem_135215)[sext_i32_i64(local_tid_135209)];\n                    ((__global int64_t *) mem_131890)[gtid_128134 * n_114534 +\n                                                      gtid_128142] = ((__local\n                                                                       int64_t *) scan_arr_mem_135217)[sext_i32_i64(local_tid_135209)];\n                    ((__global int64_t *) mem_131894)[gtid_128134 * n_114534 +\n                                                      gtid_128142] = ((__local\n                                                                       int64_t *) scan_arr_mem_135219)[sext_i32_i64(local_tid_135209)];\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_135254 = slt64(srem64(chunk_offset_135222 +\n                                                           segscan_group_sizze_128388,\n                                                           n_114534),\n                                                    chunk_offset_135222 +\n                                                    segscan_group_sizze_128388 -\n                                                    (chunk_offset_135222 +\n                                                     segscan_group_sizze_128388 -\n                                                     (",
                   "int64_t) 1));\n                bool should_load_carry_135255 = local_tid_135209 == 0 &&\n                     !crosses_segment_135254;\n                \n                if (should_load_carry_135255) {\n                    x_128396 = ((__local\n                                 int64_t *) scan_arr_mem_135213)[segscan_group_sizze_128388 -\n                                                                 (int64_t) 1];\n                    x_128397 = ((__local\n                                 int64_t *) scan_arr_mem_135215)[segscan_group_sizze_128388 -\n                                                                 (int64_t) 1];\n                    x_128398 = ((__local\n                                 int64_t *) scan_arr_mem_135217)[segscan_group_sizze_128388 -\n                                                                 (int64_t) 1];\n                    x_128399 = ((__local\n                                 int64_t *) scan_arr_mem_135219)[segscan_group_sizze_128388 -\n                                                                 (int64_t) 1];\n                }\n                if (!should_load_carry_135255) {\n                    x_128396 = (int64_t) 0;\n                    x_128397 = (int64_t) 0;\n                    x_128398 = (int64_t) 0;\n                    x_128399 = (int64_t) 0;\n                }\n            }\n            barrier(CLK_LOCAL_MEM_FENCE);\n        }\n    }\n    \n  error_1:\n    return;\n    #undef segscan_group_sizze_128388\n}\n__kernel void mainziscan_stage2_116849(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_132336_backing_aligned_0,\n                                       int64_t m_114533, int64_t n_114534,\n                                       int64_t stage1_num_groups_132305,\n                                       int32_t num_threads_132306, __global\n                                       unsigned char *mem_130107)\n{\n    #define segscan_group_sizze_116860 (m",
                   "ainzisegscan_group_sizze_116843)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict scan_arr_mem_132336_backing_0 =\n                          (__local volatile\n                           char *) scan_arr_mem_132336_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_132331;\n    int32_t local_tid_132332;\n    int64_t group_sizze_132335;\n    int32_t wave_sizze_132334;\n    int32_t group_tid_132333;\n    \n    global_tid_132331 = get_global_id(0);\n    local_tid_132332 = get_local_id(0);\n    group_sizze_132335 = get_local_size(0);\n    wave_sizze_132334 = LOCKSTEP_WIDTH;\n    group_tid_132333 = get_group_id(0);\n    \n    int32_t phys_tid_116849 = global_tid_132331;\n    __local char *scan_arr_mem_132336;\n    \n    scan_arr_mem_132336 = (__local char *) scan_arr_mem_132336_backing_0;\n    \n    int64_t flat_idx_132338 = (sext_i32_i64(local_tid_132332) + (int64_t) 1) *\n            (segscan_group_sizze_116860 * sdiv_up64(m_114533 * n_114534,\n                                                    sext_i32_i64(num_threads_132306))) -\n            (int64_t) 1;\n    int64_t gtid_116840 = squot64(flat_idx_132338, n_114534);\n    int64_t gtid_116848 = flat_idx_132338 - squot64(flat_idx_132338, n_114534) *\n            n_114534;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_116840, m_114533) && slt64(gtid_116848, n_114534)) {\n            ((__local\n              int64_t *) scan_arr_mem_132336)[sext_i32_i64(local_tid_132332)] =\n                ((__global int64_t *) mem_130107)[gtid_116840 * n_114534 +\n                                                  gtid_116848];\n        } else {\n            ((__local\n              int64_t *) scan_arr_mem_132336)[sext_i32_i64(local_tid_132332)] =\n                (int64_t) 0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t x_116864;\n    int64_t x_116865;\n    int64_t x_132",
                   "339;\n    int64_t x_132340;\n    bool ltid_in_bounds_132342 = slt64(sext_i32_i64(local_tid_132332),\n                                       stage1_num_groups_132305);\n    int32_t skip_threads_132343;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_132342) {\n            x_116865 = ((volatile __local\n                         int64_t *) scan_arr_mem_132336)[sext_i32_i64(local_tid_132332)];\n            if ((local_tid_132332 - squot32(local_tid_132332, 32) * 32) == 0) {\n                x_116864 = x_116865;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_132343 = 1;\n        while (slt32(skip_threads_132343, 32)) {\n            if (sle32(skip_threads_132343, local_tid_132332 -\n                      squot32(local_tid_132332, 32) * 32) &&\n                ltid_in_bounds_132342) {\n                // read operands\n                {\n                    x_116864 = ((volatile __local\n                                 int64_t *) scan_arr_mem_132336)[sext_i32_i64(local_tid_132332) -\n                                                                 sext_i32_i64(skip_threads_132343)];\n                }\n                // perform operation\n                {\n                    bool inactive_132344 =\n                         slt64(srem64((sext_i32_i64(local_tid_132332) +\n                                       (int64_t) 1) *\n                                      (segscan_group_sizze_116860 *\n                                       sdiv_up64(m_114533 * n_114534,\n                                                 sext_i32_i64(num_threads_132306))) -\n                                      (int64_t) 1, n_114534),\n                               (sext_i32_i64(local_tid_132332) + (int64_t) 1) *\n                               (segscan_group_sizze_116860 *\n                                sdiv_up64(m_114533 * n_114534,\n                                          sext_i32_i64(num_threads_132306))) -\n                         ",
                   "      (int64_t) 1 - ((sext_i32_i64(local_tid_132332 -\n                                               skip_threads_132343) +\n                                               (int64_t) 1) *\n                                              (segscan_group_sizze_116860 *\n                                               sdiv_up64(m_114533 * n_114534,\n                                                         sext_i32_i64(num_threads_132306))) -\n                                              (int64_t) 1));\n                    \n                    if (inactive_132344) {\n                        x_116864 = x_116865;\n                    }\n                    if (!inactive_132344) {\n                        int64_t defunc_1_op_res_116866 = add64(x_116864,\n                                                               x_116865);\n                        \n                        x_116864 = defunc_1_op_res_116866;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_132334, skip_threads_132343)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (sle32(skip_threads_132343, local_tid_132332 -\n                      squot32(local_tid_132332, 32) * 32) &&\n                ltid_in_bounds_132342) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_132336)[sext_i32_i64(local_tid_132332)] =\n                        x_116864;\n                    x_116865 = x_116864;\n                }\n            }\n            if (sle32(wave_sizze_132334, skip_threads_132343)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_132343 *= 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_132332 - squot32(local_tid_132332, 32) * 32) == 31 &&\n            ltid_in_bounds_132342) {\n            ((volatile __local\n              int64_t *) scan_arr_mem_132336",
                   ")[sext_i32_i64(squot32(local_tid_132332,\n                                                                   32))] =\n                x_116864;\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_132345;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_132332, 32) == 0 && ltid_in_bounds_132342) {\n                x_132340 = ((volatile __local\n                             int64_t *) scan_arr_mem_132336)[sext_i32_i64(local_tid_132332)];\n                if ((local_tid_132332 - squot32(local_tid_132332, 32) * 32) ==\n                    0) {\n                    x_132339 = x_132340;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_132345 = 1;\n            while (slt32(skip_threads_132345, 32)) {\n                if (sle32(skip_threads_132345, local_tid_132332 -\n                          squot32(local_tid_132332, 32) * 32) &&\n                    (squot32(local_tid_132332, 32) == 0 &&\n                     ltid_in_bounds_132342)) {\n                    // read operands\n                    {\n                        x_132339 = ((volatile __local\n                                     int64_t *) scan_arr_mem_132336)[sext_i32_i64(local_tid_132332) -\n                                                                     sext_i32_i64(skip_threads_132345)];\n                    }\n                    // perform operation\n                    {\n                        bool inactive_132346 =\n                             slt64(srem64((sext_i32_i64(local_tid_132332 * 32 +\n                                           32 - 1) + (int64_t) 1) *\n                                          (segscan_group_sizze_116860 *\n                                           sdiv_up64(m_114533 * n_114534,\n                                                     sext_i32_i64(num_threa",
                   "ds_132306))) -\n                                          (int64_t) 1, n_114534),\n                                   (sext_i32_i64(local_tid_132332 * 32 + 32 -\n                                    1) + (int64_t) 1) *\n                                   (segscan_group_sizze_116860 *\n                                    sdiv_up64(m_114533 * n_114534,\n                                              sext_i32_i64(num_threads_132306))) -\n                                   (int64_t) 1 -\n                                   ((sext_i32_i64((local_tid_132332 -\n                                                   skip_threads_132345) * 32 +\n                                     32 - 1) + (int64_t) 1) *\n                                    (segscan_group_sizze_116860 *\n                                     sdiv_up64(m_114533 * n_114534,\n                                               sext_i32_i64(num_threads_132306))) -\n                                    (int64_t) 1));\n                        \n                        if (inactive_132346) {\n                            x_132339 = x_132340;\n                        }\n                        if (!inactive_132346) {\n                            int64_t defunc_1_op_res_132341 = add64(x_132339,\n                                                                   x_132340);\n                            \n                            x_132339 = defunc_1_op_res_132341;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_132334, skip_threads_132345)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (sle32(skip_threads_132345, local_tid_132332 -\n                          squot32(local_tid_132332, 32) * 32) &&\n                    (squot32(local_tid_132332, 32) == 0 &&\n                     ltid_in_bounds_132342)) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_132336)[",
                   "sext_i32_i64(local_tid_132332)] =\n                            x_132339;\n                        x_132340 = x_132339;\n                    }\n                }\n                if (sle32(wave_sizze_132334, skip_threads_132345)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_132345 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // carry-in for every block except the first\n    {\n        if (!(squot32(local_tid_132332, 32) == 0 || !ltid_in_bounds_132342)) {\n            // read operands\n            {\n                x_116865 = x_116864;\n                x_116864 = ((__local\n                             int64_t *) scan_arr_mem_132336)[sext_i32_i64(squot32(local_tid_132332,\n                                                                                  32)) -\n                                                             (int64_t) 1];\n            }\n            // perform operation\n            {\n                bool inactive_132347 =\n                     slt64(srem64((sext_i32_i64(local_tid_132332) +\n                                   (int64_t) 1) * (segscan_group_sizze_116860 *\n                                                   sdiv_up64(m_114533 *\n                                                             n_114534,\n                                                             sext_i32_i64(num_threads_132306))) -\n                                  (int64_t) 1, n_114534),\n                           (sext_i32_i64(local_tid_132332) + (int64_t) 1) *\n                           (segscan_group_sizze_116860 * sdiv_up64(m_114533 *\n                                                                   n_114534,\n                                                                   sext_i32_i64(num_threads_132306))) -\n                           (int64_t) 1 -\n                           ((sext_i32_i64(squot32(local_tid_132332, 32) * 32 -\n                             1) + (int64_t) 1) * (segscan_group_sizze_116860 *\n    ",
                   "                                              sdiv_up64(m_114533 * n_114534,\n                                                            sext_i32_i64(num_threads_132306))) -\n                            (int64_t) 1));\n                \n                if (inactive_132347) {\n                    x_116864 = x_116865;\n                }\n                if (!inactive_132347) {\n                    int64_t defunc_1_op_res_116866 = add64(x_116864, x_116865);\n                    \n                    x_116864 = defunc_1_op_res_116866;\n                }\n            }\n            // write final result\n            {\n                ((__local\n                  int64_t *) scan_arr_mem_132336)[sext_i32_i64(local_tid_132332)] =\n                    x_116864;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_132332, 32) == 0) {\n            ((__local\n              int64_t *) scan_arr_mem_132336)[sext_i32_i64(local_tid_132332)] =\n                x_116865;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_116840, m_114533) && slt64(gtid_116848, n_114534)) {\n            ((__global int64_t *) mem_130107)[gtid_116840 * n_114534 +\n                                              gtid_116848] = ((__local\n                                                               int64_t *) scan_arr_mem_132336)[sext_i32_i64(local_tid_132332)];\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_116860\n}\n__kernel void mainziscan_stage2_120428(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_133539_backing_aligned_0,\n                                       int64_t m_114533, int64_t n_114534,\n                                       int64_t stage1_num_groups_133508,\n                                       int32_t num_threads_133509",
                   ", __global\n                                       unsigned char *mem_130849)\n{\n    #define segscan_group_sizze_120702 (mainzisegscan_group_sizze_120422)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict scan_arr_mem_133539_backing_0 =\n                          (__local volatile\n                           char *) scan_arr_mem_133539_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_133534;\n    int32_t local_tid_133535;\n    int64_t group_sizze_133538;\n    int32_t wave_sizze_133537;\n    int32_t group_tid_133536;\n    \n    global_tid_133534 = get_global_id(0);\n    local_tid_133535 = get_local_id(0);\n    group_sizze_133538 = get_local_size(0);\n    wave_sizze_133537 = LOCKSTEP_WIDTH;\n    group_tid_133536 = get_group_id(0);\n    \n    int32_t phys_tid_120428 = global_tid_133534;\n    __local char *scan_arr_mem_133539;\n    \n    scan_arr_mem_133539 = (__local char *) scan_arr_mem_133539_backing_0;\n    \n    int64_t flat_idx_133541 = (sext_i32_i64(local_tid_133535) + (int64_t) 1) *\n            (segscan_group_sizze_120702 * sdiv_up64(m_114533 * n_114534,\n                                                    sext_i32_i64(num_threads_133509))) -\n            (int64_t) 1;\n    int64_t gtid_120419 = squot64(flat_idx_133541, n_114534);\n    int64_t gtid_120427 = flat_idx_133541 - squot64(flat_idx_133541, n_114534) *\n            n_114534;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_120419, m_114533) && slt64(gtid_120427, n_114534)) {\n            ((__local\n              float *) scan_arr_mem_133539)[sext_i32_i64(local_tid_133535)] =\n                ((__global float *) mem_130849)[gtid_120419 * n_114534 +\n                                                gtid_120427];\n        } else {\n            ((__local\n              float *) scan_arr_mem_133539)[sext_i32_i64(local_tid_133535)] =\n                0.0F;\n        }\n ",
                   "   }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    float x_120706;\n    float x_120707;\n    float x_133542;\n    float x_133543;\n    bool ltid_in_bounds_133545 = slt64(sext_i32_i64(local_tid_133535),\n                                       stage1_num_groups_133508);\n    int32_t skip_threads_133546;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_133545) {\n            x_120707 = ((volatile __local\n                         float *) scan_arr_mem_133539)[sext_i32_i64(local_tid_133535)];\n            if ((local_tid_133535 - squot32(local_tid_133535, 32) * 32) == 0) {\n                x_120706 = x_120707;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_133546 = 1;\n        while (slt32(skip_threads_133546, 32)) {\n            if (sle32(skip_threads_133546, local_tid_133535 -\n                      squot32(local_tid_133535, 32) * 32) &&\n                ltid_in_bounds_133545) {\n                // read operands\n                {\n                    x_120706 = ((volatile __local\n                                 float *) scan_arr_mem_133539)[sext_i32_i64(local_tid_133535) -\n                                                               sext_i32_i64(skip_threads_133546)];\n                }\n                // perform operation\n                {\n                    bool inactive_133547 =\n                         slt64(srem64((sext_i32_i64(local_tid_133535) +\n                                       (int64_t) 1) *\n                                      (segscan_group_sizze_120702 *\n                                       sdiv_up64(m_114533 * n_114534,\n                                                 sext_i32_i64(num_threads_133509))) -\n                                      (int64_t) 1, n_114534),\n                               (sext_i32_i64(local_tid_133535) + (int64_t) 1) *\n                               (segscan_group_sizze_120702 *\n                                sdiv_up64(m_114533 * n_114534,\n             ",
                   "                             sext_i32_i64(num_threads_133509))) -\n                               (int64_t) 1 - ((sext_i32_i64(local_tid_133535 -\n                                               skip_threads_133546) +\n                                               (int64_t) 1) *\n                                              (segscan_group_sizze_120702 *\n                                               sdiv_up64(m_114533 * n_114534,\n                                                         sext_i32_i64(num_threads_133509))) -\n                                              (int64_t) 1));\n                    \n                    if (inactive_133547) {\n                        x_120706 = x_120707;\n                    }\n                    if (!inactive_133547) {\n                        float defunc_1_op_res_120708 = x_120706 + x_120707;\n                        \n                        x_120706 = defunc_1_op_res_120708;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_133537, skip_threads_133546)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (sle32(skip_threads_133546, local_tid_133535 -\n                      squot32(local_tid_133535, 32) * 32) &&\n                ltid_in_bounds_133545) {\n                // write result\n                {\n                    ((volatile __local\n                      float *) scan_arr_mem_133539)[sext_i32_i64(local_tid_133535)] =\n                        x_120706;\n                    x_120707 = x_120706;\n                }\n            }\n            if (sle32(wave_sizze_133537, skip_threads_133546)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_133546 *= 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_133535 - squot32(local_tid_133535, 32) * 32) == 31 &&\n            ltid_in_bounds_133545) {\n            ((volatile __local\n              float *) sca",
                   "n_arr_mem_133539)[sext_i32_i64(squot32(local_tid_133535,\n                                                                 32))] =\n                x_120706;\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_133548;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_133535, 32) == 0 && ltid_in_bounds_133545) {\n                x_133543 = ((volatile __local\n                             float *) scan_arr_mem_133539)[sext_i32_i64(local_tid_133535)];\n                if ((local_tid_133535 - squot32(local_tid_133535, 32) * 32) ==\n                    0) {\n                    x_133542 = x_133543;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_133548 = 1;\n            while (slt32(skip_threads_133548, 32)) {\n                if (sle32(skip_threads_133548, local_tid_133535 -\n                          squot32(local_tid_133535, 32) * 32) &&\n                    (squot32(local_tid_133535, 32) == 0 &&\n                     ltid_in_bounds_133545)) {\n                    // read operands\n                    {\n                        x_133542 = ((volatile __local\n                                     float *) scan_arr_mem_133539)[sext_i32_i64(local_tid_133535) -\n                                                                   sext_i32_i64(skip_threads_133548)];\n                    }\n                    // perform operation\n                    {\n                        bool inactive_133549 =\n                             slt64(srem64((sext_i32_i64(local_tid_133535 * 32 +\n                                           32 - 1) + (int64_t) 1) *\n                                          (segscan_group_sizze_120702 *\n                                           sdiv_up64(m_114533 * n_114534,\n                                                     sext_i32_i64(n",
                   "um_threads_133509))) -\n                                          (int64_t) 1, n_114534),\n                                   (sext_i32_i64(local_tid_133535 * 32 + 32 -\n                                    1) + (int64_t) 1) *\n                                   (segscan_group_sizze_120702 *\n                                    sdiv_up64(m_114533 * n_114534,\n                                              sext_i32_i64(num_threads_133509))) -\n                                   (int64_t) 1 -\n                                   ((sext_i32_i64((local_tid_133535 -\n                                                   skip_threads_133548) * 32 +\n                                     32 - 1) + (int64_t) 1) *\n                                    (segscan_group_sizze_120702 *\n                                     sdiv_up64(m_114533 * n_114534,\n                                               sext_i32_i64(num_threads_133509))) -\n                                    (int64_t) 1));\n                        \n                        if (inactive_133549) {\n                            x_133542 = x_133543;\n                        }\n                        if (!inactive_133549) {\n                            float defunc_1_op_res_133544 = x_133542 + x_133543;\n                            \n                            x_133542 = defunc_1_op_res_133544;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_133537, skip_threads_133548)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (sle32(skip_threads_133548, local_tid_133535 -\n                          squot32(local_tid_133535, 32) * 32) &&\n                    (squot32(local_tid_133535, 32) == 0 &&\n                     ltid_in_bounds_133545)) {\n                    // write result\n                    {\n                        ((volatile __local\n                          float *) scan_arr_mem_133539)[sext_i32_i64(local_tid_133535)] =\n                            x_13354",
                   "2;\n                        x_133543 = x_133542;\n                    }\n                }\n                if (sle32(wave_sizze_133537, skip_threads_133548)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_133548 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // carry-in for every block except the first\n    {\n        if (!(squot32(local_tid_133535, 32) == 0 || !ltid_in_bounds_133545)) {\n            // read operands\n            {\n                x_120707 = x_120706;\n                x_120706 = ((__local\n                             float *) scan_arr_mem_133539)[sext_i32_i64(squot32(local_tid_133535,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n            // perform operation\n            {\n                bool inactive_133550 =\n                     slt64(srem64((sext_i32_i64(local_tid_133535) +\n                                   (int64_t) 1) * (segscan_group_sizze_120702 *\n                                                   sdiv_up64(m_114533 *\n                                                             n_114534,\n                                                             sext_i32_i64(num_threads_133509))) -\n                                  (int64_t) 1, n_114534),\n                           (sext_i32_i64(local_tid_133535) + (int64_t) 1) *\n                           (segscan_group_sizze_120702 * sdiv_up64(m_114533 *\n                                                                   n_114534,\n                                                                   sext_i32_i64(num_threads_133509))) -\n                           (int64_t) 1 -\n                           ((sext_i32_i64(squot32(local_tid_133535, 32) * 32 -\n                             1) + (int64_t) 1) * (segscan_group_sizze_120702 *\n                                                  sdiv_up64(m_114533 * n_114534",
                   ",\n                                                            sext_i32_i64(num_threads_133509))) -\n                            (int64_t) 1));\n                \n                if (inactive_133550) {\n                    x_120706 = x_120707;\n                }\n                if (!inactive_133550) {\n                    float defunc_1_op_res_120708 = x_120706 + x_120707;\n                    \n                    x_120706 = defunc_1_op_res_120708;\n                }\n            }\n            // write final result\n            {\n                ((__local\n                  float *) scan_arr_mem_133539)[sext_i32_i64(local_tid_133535)] =\n                    x_120706;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_133535, 32) == 0) {\n            ((__local\n              float *) scan_arr_mem_133539)[sext_i32_i64(local_tid_133535)] =\n                x_120707;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_120419, m_114533) && slt64(gtid_120427, n_114534)) {\n            ((__global float *) mem_130849)[gtid_120419 * n_114534 +\n                                            gtid_120427] = ((__local\n                                                             float *) scan_arr_mem_133539)[sext_i32_i64(local_tid_133535)];\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_120702\n}\n__kernel void mainziscan_stage2_120491(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_133419_backing_aligned_0,\n                                       int64_t m_114533,\n                                       int64_t lifted_single_ma_arg_114976,\n                                       int64_t stage1_num_groups_133388,\n                                       int32_t num_threads_133389, __global\n                          ",
                   "             unsigned char *mem_130840)\n{\n    #define segscan_group_sizze_120654 (mainzisegscan_group_sizze_120485)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict scan_arr_mem_133419_backing_0 =\n                          (__local volatile\n                           char *) scan_arr_mem_133419_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_133414;\n    int32_t local_tid_133415;\n    int64_t group_sizze_133418;\n    int32_t wave_sizze_133417;\n    int32_t group_tid_133416;\n    \n    global_tid_133414 = get_global_id(0);\n    local_tid_133415 = get_local_id(0);\n    group_sizze_133418 = get_local_size(0);\n    wave_sizze_133417 = LOCKSTEP_WIDTH;\n    group_tid_133416 = get_group_id(0);\n    \n    int32_t phys_tid_120491 = global_tid_133414;\n    __local char *scan_arr_mem_133419;\n    \n    scan_arr_mem_133419 = (__local char *) scan_arr_mem_133419_backing_0;\n    \n    int64_t flat_idx_133421 = (sext_i32_i64(local_tid_133415) + (int64_t) 1) *\n            (segscan_group_sizze_120654 * sdiv_up64(m_114533 *\n                                                    lifted_single_ma_arg_114976,\n                                                    sext_i32_i64(num_threads_133389))) -\n            (int64_t) 1;\n    int64_t gtid_120482 = squot64(flat_idx_133421, lifted_single_ma_arg_114976);\n    int64_t gtid_120490 = flat_idx_133421 - squot64(flat_idx_133421,\n                                                    lifted_single_ma_arg_114976) *\n            lifted_single_ma_arg_114976;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_120482, m_114533) && slt64(gtid_120490,\n                                                  lifted_single_ma_arg_114976)) {\n            ((__local\n              float *) scan_arr_mem_133419)[sext_i32_i64(local_tid_133415)] =\n                ((__global float *) mem_130840)[gtid_120482 *\n           ",
                   "                                     lifted_single_ma_arg_114976 +\n                                                gtid_120490];\n        } else {\n            ((__local\n              float *) scan_arr_mem_133419)[sext_i32_i64(local_tid_133415)] =\n                0.0F;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    float x_120658;\n    float x_120659;\n    float x_133422;\n    float x_133423;\n    bool ltid_in_bounds_133425 = slt64(sext_i32_i64(local_tid_133415),\n                                       stage1_num_groups_133388);\n    int32_t skip_threads_133426;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_133425) {\n            x_120659 = ((volatile __local\n                         float *) scan_arr_mem_133419)[sext_i32_i64(local_tid_133415)];\n            if ((local_tid_133415 - squot32(local_tid_133415, 32) * 32) == 0) {\n                x_120658 = x_120659;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_133426 = 1;\n        while (slt32(skip_threads_133426, 32)) {\n            if (sle32(skip_threads_133426, local_tid_133415 -\n                      squot32(local_tid_133415, 32) * 32) &&\n                ltid_in_bounds_133425) {\n                // read operands\n                {\n                    x_120658 = ((volatile __local\n                                 float *) scan_arr_mem_133419)[sext_i32_i64(local_tid_133415) -\n                                                               sext_i32_i64(skip_threads_133426)];\n                }\n                // perform operation\n                {\n                    bool inactive_133427 =\n                         slt64(srem64((sext_i32_i64(local_tid_133415) +\n                                       (int64_t) 1) *\n                                      (segscan_group_sizze_120654 *\n                                       sdiv_up64(m_114533 *\n                                                 lifted_single_ma_arg_114976,\n                  ",
                   "                               sext_i32_i64(num_threads_133389))) -\n                                      (int64_t) 1, lifted_single_ma_arg_114976),\n                               (sext_i32_i64(local_tid_133415) + (int64_t) 1) *\n                               (segscan_group_sizze_120654 *\n                                sdiv_up64(m_114533 *\n                                          lifted_single_ma_arg_114976,\n                                          sext_i32_i64(num_threads_133389))) -\n                               (int64_t) 1 - ((sext_i32_i64(local_tid_133415 -\n                                               skip_threads_133426) +\n                                               (int64_t) 1) *\n                                              (segscan_group_sizze_120654 *\n                                               sdiv_up64(m_114533 *\n                                                         lifted_single_ma_arg_114976,\n                                                         sext_i32_i64(num_threads_133389))) -\n                                              (int64_t) 1));\n                    \n                    if (inactive_133427) {\n                        x_120658 = x_120659;\n                    }\n                    if (!inactive_133427) {\n                        float defunc_1_op_res_120660 = x_120658 + x_120659;\n                        \n                        x_120658 = defunc_1_op_res_120660;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_133417, skip_threads_133426)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (sle32(skip_threads_133426, local_tid_133415 -\n                      squot32(local_tid_133415, 32) * 32) &&\n                ltid_in_bounds_133425) {\n                // write result\n                {\n                    ((volatile __local\n                      float *) scan_arr_mem_133419)[sext_i32_i64(local_tid_133415)] =\n                        x_120658;\n                    x_12",
                   "0659 = x_120658;\n                }\n            }\n            if (sle32(wave_sizze_133417, skip_threads_133426)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_133426 *= 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_133415 - squot32(local_tid_133415, 32) * 32) == 31 &&\n            ltid_in_bounds_133425) {\n            ((volatile __local\n              float *) scan_arr_mem_133419)[sext_i32_i64(squot32(local_tid_133415,\n                                                                 32))] =\n                x_120658;\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_133428;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_133415, 32) == 0 && ltid_in_bounds_133425) {\n                x_133423 = ((volatile __local\n                             float *) scan_arr_mem_133419)[sext_i32_i64(local_tid_133415)];\n                if ((local_tid_133415 - squot32(local_tid_133415, 32) * 32) ==\n                    0) {\n                    x_133422 = x_133423;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_133428 = 1;\n            while (slt32(skip_threads_133428, 32)) {\n                if (sle32(skip_threads_133428, local_tid_133415 -\n                          squot32(local_tid_133415, 32) * 32) &&\n                    (squot32(local_tid_133415, 32) == 0 &&\n                     ltid_in_bounds_133425)) {\n                    // read operands\n                    {\n                        x_133422 = ((volatile __local\n                                     float *) scan_arr_mem_133419)[sext_i32_i64(local_tid_133415) -\n                                                                   sext_i32_i64(skip_threads_",
                   "133428)];\n                    }\n                    // perform operation\n                    {\n                        bool inactive_133429 =\n                             slt64(srem64((sext_i32_i64(local_tid_133415 * 32 +\n                                           32 - 1) + (int64_t) 1) *\n                                          (segscan_group_sizze_120654 *\n                                           sdiv_up64(m_114533 *\n                                                     lifted_single_ma_arg_114976,\n                                                     sext_i32_i64(num_threads_133389))) -\n                                          (int64_t) 1,\n                                          lifted_single_ma_arg_114976),\n                                   (sext_i32_i64(local_tid_133415 * 32 + 32 -\n                                    1) + (int64_t) 1) *\n                                   (segscan_group_sizze_120654 *\n                                    sdiv_up64(m_114533 *\n                                              lifted_single_ma_arg_114976,\n                                              sext_i32_i64(num_threads_133389))) -\n                                   (int64_t) 1 -\n                                   ((sext_i32_i64((local_tid_133415 -\n                                                   skip_threads_133428) * 32 +\n                                     32 - 1) + (int64_t) 1) *\n                                    (segscan_group_sizze_120654 *\n                                     sdiv_up64(m_114533 *\n                                               lifted_single_ma_arg_114976,\n                                               sext_i32_i64(num_threads_133389))) -\n                                    (int64_t) 1));\n                        \n                        if (inactive_133429) {\n                            x_133422 = x_133423;\n                        }\n                        if (!inactive_133429) {\n                            float defunc_1_op_res_133424 = x_133422 + x",
                   "_133423;\n                            \n                            x_133422 = defunc_1_op_res_133424;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_133417, skip_threads_133428)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (sle32(skip_threads_133428, local_tid_133415 -\n                          squot32(local_tid_133415, 32) * 32) &&\n                    (squot32(local_tid_133415, 32) == 0 &&\n                     ltid_in_bounds_133425)) {\n                    // write result\n                    {\n                        ((volatile __local\n                          float *) scan_arr_mem_133419)[sext_i32_i64(local_tid_133415)] =\n                            x_133422;\n                        x_133423 = x_133422;\n                    }\n                }\n                if (sle32(wave_sizze_133417, skip_threads_133428)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_133428 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // carry-in for every block except the first\n    {\n        if (!(squot32(local_tid_133415, 32) == 0 || !ltid_in_bounds_133425)) {\n            // read operands\n            {\n                x_120659 = x_120658;\n                x_120658 = ((__local\n                             float *) scan_arr_mem_133419)[sext_i32_i64(squot32(local_tid_133415,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n            // perform operation\n            {\n                bool inactive_133430 =\n                     slt64(srem64((sext_i32_i64(local_tid_133415) +\n                                   (int64_t) 1) * (segscan_group_sizze_120654 *\n                                                   sdiv_up64(m_114533 *\n                                                             lifted_singl",
                   "e_ma_arg_114976,\n                                                             sext_i32_i64(num_threads_133389))) -\n                                  (int64_t) 1, lifted_single_ma_arg_114976),\n                           (sext_i32_i64(local_tid_133415) + (int64_t) 1) *\n                           (segscan_group_sizze_120654 * sdiv_up64(m_114533 *\n                                                                   lifted_single_ma_arg_114976,\n                                                                   sext_i32_i64(num_threads_133389))) -\n                           (int64_t) 1 -\n                           ((sext_i32_i64(squot32(local_tid_133415, 32) * 32 -\n                             1) + (int64_t) 1) * (segscan_group_sizze_120654 *\n                                                  sdiv_up64(m_114533 *\n                                                            lifted_single_ma_arg_114976,\n                                                            sext_i32_i64(num_threads_133389))) -\n                            (int64_t) 1));\n                \n                if (inactive_133430) {\n                    x_120658 = x_120659;\n                }\n                if (!inactive_133430) {\n                    float defunc_1_op_res_120660 = x_120658 + x_120659;\n                    \n                    x_120658 = defunc_1_op_res_120660;\n                }\n            }\n            // write final result\n            {\n                ((__local\n                  float *) scan_arr_mem_133419)[sext_i32_i64(local_tid_133415)] =\n                    x_120658;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_133415, 32) == 0) {\n            ((__local\n              float *) scan_arr_mem_133419)[sext_i32_i64(local_tid_133415)] =\n                x_120659;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_120482, m_114533",
                   ") && slt64(gtid_120490,\n                                                  lifted_single_ma_arg_114976)) {\n            ((__global float *) mem_130840)[gtid_120482 *\n                                            lifted_single_ma_arg_114976 +\n                                            gtid_120490] = ((__local\n                                                             float *) scan_arr_mem_133419)[sext_i32_i64(local_tid_133415)];\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_120654\n}\n__kernel void mainziscan_stage2_120553(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_133299_backing_aligned_0,\n                                       int64_t m_114533,\n                                       int64_t lifted_single_ma_arg_114959,\n                                       int64_t stage1_num_groups_133268,\n                                       int32_t num_threads_133269, __global\n                                       unsigned char *mem_130831)\n{\n    #define segscan_group_sizze_120606 (mainzisegscan_group_sizze_120547)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict scan_arr_mem_133299_backing_0 =\n                          (__local volatile\n                           char *) scan_arr_mem_133299_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_133294;\n    int32_t local_tid_133295;\n    int64_t group_sizze_133298;\n    int32_t wave_sizze_133297;\n    int32_t group_tid_133296;\n    \n    global_tid_133294 = get_global_id(0);\n    local_tid_133295 = get_local_id(0);\n    group_sizze_133298 = get_local_size(0);\n    wave_sizze_133297 = LOCKSTEP_WIDTH;\n    group_tid_133296 = get_group_id(0);\n    \n    int32_t phys_tid_120553 = global_tid_133294;\n    __local char *scan_arr_mem_133299;\n    \n    scan_arr_mem_133299 = (__local char *) scan_a",
                   "rr_mem_133299_backing_0;\n    \n    int64_t flat_idx_133301 = (sext_i32_i64(local_tid_133295) + (int64_t) 1) *\n            (segscan_group_sizze_120606 * sdiv_up64(m_114533 *\n                                                    lifted_single_ma_arg_114959,\n                                                    sext_i32_i64(num_threads_133269))) -\n            (int64_t) 1;\n    int64_t gtid_120544 = squot64(flat_idx_133301, lifted_single_ma_arg_114959);\n    int64_t gtid_120552 = flat_idx_133301 - squot64(flat_idx_133301,\n                                                    lifted_single_ma_arg_114959) *\n            lifted_single_ma_arg_114959;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_120544, m_114533) && slt64(gtid_120552,\n                                                  lifted_single_ma_arg_114959)) {\n            ((__local\n              float *) scan_arr_mem_133299)[sext_i32_i64(local_tid_133295)] =\n                ((__global float *) mem_130831)[gtid_120544 *\n                                                lifted_single_ma_arg_114959 +\n                                                gtid_120552];\n        } else {\n            ((__local\n              float *) scan_arr_mem_133299)[sext_i32_i64(local_tid_133295)] =\n                0.0F;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    float x_120610;\n    float x_120611;\n    float x_133302;\n    float x_133303;\n    bool ltid_in_bounds_133305 = slt64(sext_i32_i64(local_tid_133295),\n                                       stage1_num_groups_133268);\n    int32_t skip_threads_133306;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_133305) {\n            x_120611 = ((volatile __local\n                         float *) scan_arr_mem_133299)[sext_i32_i64(local_tid_133295)];\n            if ((local_tid_133295 - squot32(local_tid_133295, 32) * 32) == 0) {\n                x_120610 = x_120611;\n            }\n        }\n    }\n    // in-block scan (hopefully",
                   " no barriers needed)\n    {\n        skip_threads_133306 = 1;\n        while (slt32(skip_threads_133306, 32)) {\n            if (sle32(skip_threads_133306, local_tid_133295 -\n                      squot32(local_tid_133295, 32) * 32) &&\n                ltid_in_bounds_133305) {\n                // read operands\n                {\n                    x_120610 = ((volatile __local\n                                 float *) scan_arr_mem_133299)[sext_i32_i64(local_tid_133295) -\n                                                               sext_i32_i64(skip_threads_133306)];\n                }\n                // perform operation\n                {\n                    bool inactive_133307 =\n                         slt64(srem64((sext_i32_i64(local_tid_133295) +\n                                       (int64_t) 1) *\n                                      (segscan_group_sizze_120606 *\n                                       sdiv_up64(m_114533 *\n                                                 lifted_single_ma_arg_114959,\n                                                 sext_i32_i64(num_threads_133269))) -\n                                      (int64_t) 1, lifted_single_ma_arg_114959),\n                               (sext_i32_i64(local_tid_133295) + (int64_t) 1) *\n                               (segscan_group_sizze_120606 *\n                                sdiv_up64(m_114533 *\n                                          lifted_single_ma_arg_114959,\n                                          sext_i32_i64(num_threads_133269))) -\n                               (int64_t) 1 - ((sext_i32_i64(local_tid_133295 -\n                                               skip_threads_133306) +\n                                               (int64_t) 1) *\n                                              (segscan_group_sizze_120606 *\n                                               sdiv_up64(m_114533 *\n                                                         lifted_single_ma_arg_114959,\n                               ",
                   "                          sext_i32_i64(num_threads_133269))) -\n                                              (int64_t) 1));\n                    \n                    if (inactive_133307) {\n                        x_120610 = x_120611;\n                    }\n                    if (!inactive_133307) {\n                        float defunc_1_op_res_120612 = x_120610 + x_120611;\n                        \n                        x_120610 = defunc_1_op_res_120612;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_133297, skip_threads_133306)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (sle32(skip_threads_133306, local_tid_133295 -\n                      squot32(local_tid_133295, 32) * 32) &&\n                ltid_in_bounds_133305) {\n                // write result\n                {\n                    ((volatile __local\n                      float *) scan_arr_mem_133299)[sext_i32_i64(local_tid_133295)] =\n                        x_120610;\n                    x_120611 = x_120610;\n                }\n            }\n            if (sle32(wave_sizze_133297, skip_threads_133306)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_133306 *= 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_133295 - squot32(local_tid_133295, 32) * 32) == 31 &&\n            ltid_in_bounds_133305) {\n            ((volatile __local\n              float *) scan_arr_mem_133299)[sext_i32_i64(squot32(local_tid_133295,\n                                                                 32))] =\n                x_120610;\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_133308;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_133295, 32) == 0 && ltid_in_bounds",
                   "_133305) {\n                x_133303 = ((volatile __local\n                             float *) scan_arr_mem_133299)[sext_i32_i64(local_tid_133295)];\n                if ((local_tid_133295 - squot32(local_tid_133295, 32) * 32) ==\n                    0) {\n                    x_133302 = x_133303;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_133308 = 1;\n            while (slt32(skip_threads_133308, 32)) {\n                if (sle32(skip_threads_133308, local_tid_133295 -\n                          squot32(local_tid_133295, 32) * 32) &&\n                    (squot32(local_tid_133295, 32) == 0 &&\n                     ltid_in_bounds_133305)) {\n                    // read operands\n                    {\n                        x_133302 = ((volatile __local\n                                     float *) scan_arr_mem_133299)[sext_i32_i64(local_tid_133295) -\n                                                                   sext_i32_i64(skip_threads_133308)];\n                    }\n                    // perform operation\n                    {\n                        bool inactive_133309 =\n                             slt64(srem64((sext_i32_i64(local_tid_133295 * 32 +\n                                           32 - 1) + (int64_t) 1) *\n                                          (segscan_group_sizze_120606 *\n                                           sdiv_up64(m_114533 *\n                                                     lifted_single_ma_arg_114959,\n                                                     sext_i32_i64(num_threads_133269))) -\n                                          (int64_t) 1,\n                                          lifted_single_ma_arg_114959),\n                                   (sext_i32_i64(local_tid_133295 * 32 + 32 -\n                                    1) + (int64_t) 1) *\n                                   (segscan_group_sizze_120606 *\n                                    sdiv_",
                   "up64(m_114533 *\n                                              lifted_single_ma_arg_114959,\n                                              sext_i32_i64(num_threads_133269))) -\n                                   (int64_t) 1 -\n                                   ((sext_i32_i64((local_tid_133295 -\n                                                   skip_threads_133308) * 32 +\n                                     32 - 1) + (int64_t) 1) *\n                                    (segscan_group_sizze_120606 *\n                                     sdiv_up64(m_114533 *\n                                               lifted_single_ma_arg_114959,\n                                               sext_i32_i64(num_threads_133269))) -\n                                    (int64_t) 1));\n                        \n                        if (inactive_133309) {\n                            x_133302 = x_133303;\n                        }\n                        if (!inactive_133309) {\n                            float defunc_1_op_res_133304 = x_133302 + x_133303;\n                            \n                            x_133302 = defunc_1_op_res_133304;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_133297, skip_threads_133308)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (sle32(skip_threads_133308, local_tid_133295 -\n                          squot32(local_tid_133295, 32) * 32) &&\n                    (squot32(local_tid_133295, 32) == 0 &&\n                     ltid_in_bounds_133305)) {\n                    // write result\n                    {\n                        ((volatile __local\n                          float *) scan_arr_mem_133299)[sext_i32_i64(local_tid_133295)] =\n                            x_133302;\n                        x_133303 = x_133302;\n                    }\n                }\n                if (sle32(wave_sizze_133297, skip_threads_133308)) {\n                    barrier(CLK_LOCAL_MEM",
                   "_FENCE);\n                }\n                skip_threads_133308 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // carry-in for every block except the first\n    {\n        if (!(squot32(local_tid_133295, 32) == 0 || !ltid_in_bounds_133305)) {\n            // read operands\n            {\n                x_120611 = x_120610;\n                x_120610 = ((__local\n                             float *) scan_arr_mem_133299)[sext_i32_i64(squot32(local_tid_133295,\n                                                                                32)) -\n                                                           (int64_t) 1];\n            }\n            // perform operation\n            {\n                bool inactive_133310 =\n                     slt64(srem64((sext_i32_i64(local_tid_133295) +\n                                   (int64_t) 1) * (segscan_group_sizze_120606 *\n                                                   sdiv_up64(m_114533 *\n                                                             lifted_single_ma_arg_114959,\n                                                             sext_i32_i64(num_threads_133269))) -\n                                  (int64_t) 1, lifted_single_ma_arg_114959),\n                           (sext_i32_i64(local_tid_133295) + (int64_t) 1) *\n                           (segscan_group_sizze_120606 * sdiv_up64(m_114533 *\n                                                                   lifted_single_ma_arg_114959,\n                                                                   sext_i32_i64(num_threads_133269))) -\n                           (int64_t) 1 -\n                           ((sext_i32_i64(squot32(local_tid_133295, 32) * 32 -\n                             1) + (int64_t) 1) * (segscan_group_sizze_120606 *\n                                                  sdiv_up64(m_114533 *\n                                                            lifted_single_ma_arg_114959,\n                                                            ",
                   "sext_i32_i64(num_threads_133269))) -\n                            (int64_t) 1));\n                \n                if (inactive_133310) {\n                    x_120610 = x_120611;\n                }\n                if (!inactive_133310) {\n                    float defunc_1_op_res_120612 = x_120610 + x_120611;\n                    \n                    x_120610 = defunc_1_op_res_120612;\n                }\n            }\n            // write final result\n            {\n                ((__local\n                  float *) scan_arr_mem_133299)[sext_i32_i64(local_tid_133295)] =\n                    x_120610;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_133295, 32) == 0) {\n            ((__local\n              float *) scan_arr_mem_133299)[sext_i32_i64(local_tid_133295)] =\n                x_120611;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_120544, m_114533) && slt64(gtid_120552,\n                                                  lifted_single_ma_arg_114959)) {\n            ((__global float *) mem_130831)[gtid_120544 *\n                                            lifted_single_ma_arg_114959 +\n                                            gtid_120552] = ((__local\n                                                             float *) scan_arr_mem_133299)[sext_i32_i64(local_tid_133295)];\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_120606\n}\n__kernel void mainziscan_stage2_128143(__global int *global_failure,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_135267_backing_aligned_0,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_135265_backing_aligned_1,\n                                       __local volatile\n                                       ",
                   "int64_t *scan_arr_mem_135263_backing_aligned_2,\n                                       __local volatile\n                                       int64_t *scan_arr_mem_135261_backing_aligned_3,\n                                       int64_t m_114533, int64_t n_114534,\n                                       int64_t stage1_num_groups_135206,\n                                       int32_t num_threads_135207, __global\n                                       unsigned char *mem_131882, __global\n                                       unsigned char *mem_131886, __global\n                                       unsigned char *mem_131890, __global\n                                       unsigned char *mem_131894)\n{\n    #define segscan_group_sizze_128388 (mainzisegscan_group_sizze_128137)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict scan_arr_mem_135267_backing_3 =\n                          (__local volatile\n                           char *) scan_arr_mem_135267_backing_aligned_0;\n    __local volatile char *restrict scan_arr_mem_135265_backing_2 =\n                          (__local volatile\n                           char *) scan_arr_mem_135265_backing_aligned_1;\n    __local volatile char *restrict scan_arr_mem_135263_backing_1 =\n                          (__local volatile\n                           char *) scan_arr_mem_135263_backing_aligned_2;\n    __local volatile char *restrict scan_arr_mem_135261_backing_0 =\n                          (__local volatile\n                           char *) scan_arr_mem_135261_backing_aligned_3;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_135256;\n    int32_t local_tid_135257;\n    int64_t group_sizze_135260;\n    int32_t wave_sizze_135259;\n    int32_t group_tid_135258;\n    \n    global_tid_135256 = get_global_id(0);\n    local_tid_135257 = get_local_id(0);\n    group_sizze_135260 = get_local_size(0);\n    wave_sizze_135259 = LOCKSTEP_WIDTH",
                   ";\n    group_tid_135258 = get_group_id(0);\n    \n    int32_t phys_tid_128143 = global_tid_135256;\n    __local char *scan_arr_mem_135261;\n    __local char *scan_arr_mem_135263;\n    __local char *scan_arr_mem_135265;\n    __local char *scan_arr_mem_135267;\n    \n    scan_arr_mem_135261 = (__local char *) scan_arr_mem_135261_backing_0;\n    scan_arr_mem_135263 = (__local char *) scan_arr_mem_135263_backing_1;\n    scan_arr_mem_135265 = (__local char *) scan_arr_mem_135265_backing_2;\n    scan_arr_mem_135267 = (__local char *) scan_arr_mem_135267_backing_3;\n    \n    int64_t flat_idx_135269 = (sext_i32_i64(local_tid_135257) + (int64_t) 1) *\n            (segscan_group_sizze_128388 * sdiv_up64(m_114533 * n_114534,\n                                                    sext_i32_i64(num_threads_135207))) -\n            (int64_t) 1;\n    int64_t gtid_128134 = squot64(flat_idx_135269, n_114534);\n    int64_t gtid_128142 = flat_idx_135269 - squot64(flat_idx_135269, n_114534) *\n            n_114534;\n    \n    // threads in bound read carries; others get neutral element\n    {\n        if (slt64(gtid_128134, m_114533) && slt64(gtid_128142, n_114534)) {\n            ((__local\n              int64_t *) scan_arr_mem_135261)[sext_i32_i64(local_tid_135257)] =\n                ((__global int64_t *) mem_131882)[gtid_128134 * n_114534 +\n                                                  gtid_128142];\n            ((__local\n              int64_t *) scan_arr_mem_135263)[sext_i32_i64(local_tid_135257)] =\n                ((__global int64_t *) mem_131886)[gtid_128134 * n_114534 +\n                                                  gtid_128142];\n            ((__local\n              int64_t *) scan_arr_mem_135265)[sext_i32_i64(local_tid_135257)] =\n                ((__global int64_t *) mem_131890)[gtid_128134 * n_114534 +\n                                                  gtid_128142];\n            ((__local\n              int64_t *) scan_arr_mem_135267)[sext_i32_i64(local_tid_135257)] =\n                ((__global int64_t",
                   " *) mem_131894)[gtid_128134 * n_114534 +\n                                                  gtid_128142];\n        } else {\n            ((__local\n              int64_t *) scan_arr_mem_135261)[sext_i32_i64(local_tid_135257)] =\n                (int64_t) 0;\n            ((__local\n              int64_t *) scan_arr_mem_135263)[sext_i32_i64(local_tid_135257)] =\n                (int64_t) 0;\n            ((__local\n              int64_t *) scan_arr_mem_135265)[sext_i32_i64(local_tid_135257)] =\n                (int64_t) 0;\n            ((__local\n              int64_t *) scan_arr_mem_135267)[sext_i32_i64(local_tid_135257)] =\n                (int64_t) 0;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t x_128396;\n    int64_t x_128397;\n    int64_t x_128398;\n    int64_t x_128399;\n    int64_t x_128400;\n    int64_t x_128401;\n    int64_t x_128402;\n    int64_t x_128403;\n    int64_t x_135270;\n    int64_t x_135271;\n    int64_t x_135272;\n    int64_t x_135273;\n    int64_t x_135274;\n    int64_t x_135275;\n    int64_t x_135276;\n    int64_t x_135277;\n    bool ltid_in_bounds_135282 = slt64(sext_i32_i64(local_tid_135257),\n                                       stage1_num_groups_135206);\n    int32_t skip_threads_135283;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_135282) {\n            x_128400 = ((volatile __local\n                         int64_t *) scan_arr_mem_135261)[sext_i32_i64(local_tid_135257)];\n            x_128401 = ((volatile __local\n                         int64_t *) scan_arr_mem_135263)[sext_i32_i64(local_tid_135257)];\n            x_128402 = ((volatile __local\n                         int64_t *) scan_arr_mem_135265)[sext_i32_i64(local_tid_135257)];\n            x_128403 = ((volatile __local\n                         int64_t *) scan_arr_mem_135267)[sext_i32_i64(local_tid_135257)];\n            if ((local_tid_135257 - squot32(local_tid_135257, 32) * 32) == 0) {\n                x_128396 = x_128400;\n                x_128397 = x_128401;\n           ",
                   "     x_128398 = x_128402;\n                x_128399 = x_128403;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_135283 = 1;\n        while (slt32(skip_threads_135283, 32)) {\n            if (sle32(skip_threads_135283, local_tid_135257 -\n                      squot32(local_tid_135257, 32) * 32) &&\n                ltid_in_bounds_135282) {\n                // read operands\n                {\n                    x_128396 = ((volatile __local\n                                 int64_t *) scan_arr_mem_135261)[sext_i32_i64(local_tid_135257) -\n                                                                 sext_i32_i64(skip_threads_135283)];\n                    x_128397 = ((volatile __local\n                                 int64_t *) scan_arr_mem_135263)[sext_i32_i64(local_tid_135257) -\n                                                                 sext_i32_i64(skip_threads_135283)];\n                    x_128398 = ((volatile __local\n                                 int64_t *) scan_arr_mem_135265)[sext_i32_i64(local_tid_135257) -\n                                                                 sext_i32_i64(skip_threads_135283)];\n                    x_128399 = ((volatile __local\n                                 int64_t *) scan_arr_mem_135267)[sext_i32_i64(local_tid_135257) -\n                                                                 sext_i32_i64(skip_threads_135283)];\n                }\n                // perform operation\n                {\n                    bool inactive_135284 =\n                         slt64(srem64((sext_i32_i64(local_tid_135257) +\n                                       (int64_t) 1) *\n                                      (segscan_group_sizze_128388 *\n                                       sdiv_up64(m_114533 * n_114534,\n                                                 sext_i32_i64(num_threads_135207))) -\n                                      (int64_t) 1, n_114534),\n                            ",
                   "   (sext_i32_i64(local_tid_135257) + (int64_t) 1) *\n                               (segscan_group_sizze_128388 *\n                                sdiv_up64(m_114533 * n_114534,\n                                          sext_i32_i64(num_threads_135207))) -\n                               (int64_t) 1 - ((sext_i32_i64(local_tid_135257 -\n                                               skip_threads_135283) +\n                                               (int64_t) 1) *\n                                              (segscan_group_sizze_128388 *\n                                               sdiv_up64(m_114533 * n_114534,\n                                                         sext_i32_i64(num_threads_135207))) -\n                                              (int64_t) 1));\n                    \n                    if (inactive_135284) {\n                        x_128396 = x_128400;\n                        x_128397 = x_128401;\n                        x_128398 = x_128402;\n                        x_128399 = x_128403;\n                    }\n                    if (!inactive_135284) {\n                        int64_t defunc_1_op_res_128404 = add64(x_128396,\n                                                               x_128400);\n                        int64_t defunc_1_op_res_128405 = add64(x_128397,\n                                                               x_128401);\n                        int64_t defunc_1_op_res_128406 = add64(x_128398,\n                                                               x_128402);\n                        int64_t defunc_1_op_res_128407 = add64(x_128399,\n                                                               x_128403);\n                        \n                        x_128396 = defunc_1_op_res_128404;\n                        x_128397 = defunc_1_op_res_128405;\n                        x_128398 = defunc_1_op_res_128406;\n                        x_128399 = defunc_1_op_res_128407;\n                    }\n                }\n            }\n            ",
                   "if (sle32(wave_sizze_135259, skip_threads_135283)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (sle32(skip_threads_135283, local_tid_135257 -\n                      squot32(local_tid_135257, 32) * 32) &&\n                ltid_in_bounds_135282) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_135261)[sext_i32_i64(local_tid_135257)] =\n                        x_128396;\n                    x_128400 = x_128396;\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_135263)[sext_i32_i64(local_tid_135257)] =\n                        x_128397;\n                    x_128401 = x_128397;\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_135265)[sext_i32_i64(local_tid_135257)] =\n                        x_128398;\n                    x_128402 = x_128398;\n                    ((volatile __local\n                      int64_t *) scan_arr_mem_135267)[sext_i32_i64(local_tid_135257)] =\n                        x_128399;\n                    x_128403 = x_128399;\n                }\n            }\n            if (sle32(wave_sizze_135259, skip_threads_135283)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_135283 *= 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_135257 - squot32(local_tid_135257, 32) * 32) == 31 &&\n            ltid_in_bounds_135282) {\n            ((volatile __local\n              int64_t *) scan_arr_mem_135261)[sext_i32_i64(squot32(local_tid_135257,\n                                                                   32))] =\n                x_128396;\n            ((volatile __local\n              int64_t *) scan_arr_mem_135263)[sext_i32_i64(squot32(local_tid_135257,\n                                                                   32))] =\n                x_128397;\n  ",
                   "          ((volatile __local\n              int64_t *) scan_arr_mem_135265)[sext_i32_i64(squot32(local_tid_135257,\n                                                                   32))] =\n                x_128398;\n            ((volatile __local\n              int64_t *) scan_arr_mem_135267)[sext_i32_i64(squot32(local_tid_135257,\n                                                                   32))] =\n                x_128399;\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_135285;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_135257, 32) == 0 && ltid_in_bounds_135282) {\n                x_135274 = ((volatile __local\n                             int64_t *) scan_arr_mem_135261)[sext_i32_i64(local_tid_135257)];\n                x_135275 = ((volatile __local\n                             int64_t *) scan_arr_mem_135263)[sext_i32_i64(local_tid_135257)];\n                x_135276 = ((volatile __local\n                             int64_t *) scan_arr_mem_135265)[sext_i32_i64(local_tid_135257)];\n                x_135277 = ((volatile __local\n                             int64_t *) scan_arr_mem_135267)[sext_i32_i64(local_tid_135257)];\n                if ((local_tid_135257 - squot32(local_tid_135257, 32) * 32) ==\n                    0) {\n                    x_135270 = x_135274;\n                    x_135271 = x_135275;\n                    x_135272 = x_135276;\n                    x_135273 = x_135277;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_135285 = 1;\n            while (slt32(skip_threads_135285, 32)) {\n                if (sle32(skip_threads_135285, local_tid_135257 -\n                          squot32(local_tid_135257, 32) * 32) &&\n                    (squot32(local_tid_135257, 32) == 0 &&\n                     ltid_in_bounds",
                   "_135282)) {\n                    // read operands\n                    {\n                        x_135270 = ((volatile __local\n                                     int64_t *) scan_arr_mem_135261)[sext_i32_i64(local_tid_135257) -\n                                                                     sext_i32_i64(skip_threads_135285)];\n                        x_135271 = ((volatile __local\n                                     int64_t *) scan_arr_mem_135263)[sext_i32_i64(local_tid_135257) -\n                                                                     sext_i32_i64(skip_threads_135285)];\n                        x_135272 = ((volatile __local\n                                     int64_t *) scan_arr_mem_135265)[sext_i32_i64(local_tid_135257) -\n                                                                     sext_i32_i64(skip_threads_135285)];\n                        x_135273 = ((volatile __local\n                                     int64_t *) scan_arr_mem_135267)[sext_i32_i64(local_tid_135257) -\n                                                                     sext_i32_i64(skip_threads_135285)];\n                    }\n                    // perform operation\n                    {\n                        bool inactive_135286 =\n                             slt64(srem64((sext_i32_i64(local_tid_135257 * 32 +\n                                           32 - 1) + (int64_t) 1) *\n                                          (segscan_group_sizze_128388 *\n                                           sdiv_up64(m_114533 * n_114534,\n                                                     sext_i32_i64(num_threads_135207))) -\n                                          (int64_t) 1, n_114534),\n                                   (sext_i32_i64(local_tid_135257 * 32 + 32 -\n                                    1) + (int64_t) 1) *\n                                   (segscan_group_sizze_128388 *\n                                    sdiv_up64(m_114533 * n_114534,\n                                     ",
                   "         sext_i32_i64(num_threads_135207))) -\n                                   (int64_t) 1 -\n                                   ((sext_i32_i64((local_tid_135257 -\n                                                   skip_threads_135285) * 32 +\n                                     32 - 1) + (int64_t) 1) *\n                                    (segscan_group_sizze_128388 *\n                                     sdiv_up64(m_114533 * n_114534,\n                                               sext_i32_i64(num_threads_135207))) -\n                                    (int64_t) 1));\n                        \n                        if (inactive_135286) {\n                            x_135270 = x_135274;\n                            x_135271 = x_135275;\n                            x_135272 = x_135276;\n                            x_135273 = x_135277;\n                        }\n                        if (!inactive_135286) {\n                            int64_t defunc_1_op_res_135278 = add64(x_135270,\n                                                                   x_135274);\n                            int64_t defunc_1_op_res_135279 = add64(x_135271,\n                                                                   x_135275);\n                            int64_t defunc_1_op_res_135280 = add64(x_135272,\n                                                                   x_135276);\n                            int64_t defunc_1_op_res_135281 = add64(x_135273,\n                                                                   x_135277);\n                            \n                            x_135270 = defunc_1_op_res_135278;\n                            x_135271 = defunc_1_op_res_135279;\n                            x_135272 = defunc_1_op_res_135280;\n                            x_135273 = defunc_1_op_res_135281;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_135259, skip_threads_135285)) {\n                    barrier(CLK_LOCAL_MEM_FENCE",
                   ");\n                }\n                if (sle32(skip_threads_135285, local_tid_135257 -\n                          squot32(local_tid_135257, 32) * 32) &&\n                    (squot32(local_tid_135257, 32) == 0 &&\n                     ltid_in_bounds_135282)) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_135261)[sext_i32_i64(local_tid_135257)] =\n                            x_135270;\n                        x_135274 = x_135270;\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_135263)[sext_i32_i64(local_tid_135257)] =\n                            x_135271;\n                        x_135275 = x_135271;\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_135265)[sext_i32_i64(local_tid_135257)] =\n                            x_135272;\n                        x_135276 = x_135272;\n                        ((volatile __local\n                          int64_t *) scan_arr_mem_135267)[sext_i32_i64(local_tid_135257)] =\n                            x_135273;\n                        x_135277 = x_135273;\n                    }\n                }\n                if (sle32(wave_sizze_135259, skip_threads_135285)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_135285 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // carry-in for every block except the first\n    {\n        if (!(squot32(local_tid_135257, 32) == 0 || !ltid_in_bounds_135282)) {\n            // read operands\n            {\n                x_128400 = x_128396;\n                x_128401 = x_128397;\n                x_128402 = x_128398;\n                x_128403 = x_128399;\n                x_128396 = ((__local\n                             int64_t *) scan_arr_mem_135261)[sext_i32_i64(squot32(local_tid_135257,\n                                                                   ",
                   "               32)) -\n                                                             (int64_t) 1];\n                x_128397 = ((__local\n                             int64_t *) scan_arr_mem_135263)[sext_i32_i64(squot32(local_tid_135257,\n                                                                                  32)) -\n                                                             (int64_t) 1];\n                x_128398 = ((__local\n                             int64_t *) scan_arr_mem_135265)[sext_i32_i64(squot32(local_tid_135257,\n                                                                                  32)) -\n                                                             (int64_t) 1];\n                x_128399 = ((__local\n                             int64_t *) scan_arr_mem_135267)[sext_i32_i64(squot32(local_tid_135257,\n                                                                                  32)) -\n                                                             (int64_t) 1];\n            }\n            // perform operation\n            {\n                bool inactive_135287 =\n                     slt64(srem64((sext_i32_i64(local_tid_135257) +\n                                   (int64_t) 1) * (segscan_group_sizze_128388 *\n                                                   sdiv_up64(m_114533 *\n                                                             n_114534,\n                                                             sext_i32_i64(num_threads_135207))) -\n                                  (int64_t) 1, n_114534),\n                           (sext_i32_i64(local_tid_135257) + (int64_t) 1) *\n                           (segscan_group_sizze_128388 * sdiv_up64(m_114533 *\n                                                                   n_114534,\n                                                                   sext_i32_i64(num_threads_135207))) -\n                           (int64_t) 1 -\n                           ((sext_i32_i64(squot32(local_tid_135257, 32) * 32 ",
                   "-\n                             1) + (int64_t) 1) * (segscan_group_sizze_128388 *\n                                                  sdiv_up64(m_114533 * n_114534,\n                                                            sext_i32_i64(num_threads_135207))) -\n                            (int64_t) 1));\n                \n                if (inactive_135287) {\n                    x_128396 = x_128400;\n                    x_128397 = x_128401;\n                    x_128398 = x_128402;\n                    x_128399 = x_128403;\n                }\n                if (!inactive_135287) {\n                    int64_t defunc_1_op_res_128404 = add64(x_128396, x_128400);\n                    int64_t defunc_1_op_res_128405 = add64(x_128397, x_128401);\n                    int64_t defunc_1_op_res_128406 = add64(x_128398, x_128402);\n                    int64_t defunc_1_op_res_128407 = add64(x_128399, x_128403);\n                    \n                    x_128396 = defunc_1_op_res_128404;\n                    x_128397 = defunc_1_op_res_128405;\n                    x_128398 = defunc_1_op_res_128406;\n                    x_128399 = defunc_1_op_res_128407;\n                }\n            }\n            // write final result\n            {\n                ((__local\n                  int64_t *) scan_arr_mem_135261)[sext_i32_i64(local_tid_135257)] =\n                    x_128396;\n                ((__local\n                  int64_t *) scan_arr_mem_135263)[sext_i32_i64(local_tid_135257)] =\n                    x_128397;\n                ((__local\n                  int64_t *) scan_arr_mem_135265)[sext_i32_i64(local_tid_135257)] =\n                    x_128398;\n                ((__local\n                  int64_t *) scan_arr_mem_135267)[sext_i32_i64(local_tid_135257)] =\n                    x_128399;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_135257, 32) == 0) {\n            ((__local\n              int64_t *) scan_a",
                   "rr_mem_135261)[sext_i32_i64(local_tid_135257)] =\n                x_128400;\n            ((__local\n              int64_t *) scan_arr_mem_135263)[sext_i32_i64(local_tid_135257)] =\n                x_128401;\n            ((__local\n              int64_t *) scan_arr_mem_135265)[sext_i32_i64(local_tid_135257)] =\n                x_128402;\n            ((__local\n              int64_t *) scan_arr_mem_135267)[sext_i32_i64(local_tid_135257)] =\n                x_128403;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // threads in bounds write scanned carries\n    {\n        if (slt64(gtid_128134, m_114533) && slt64(gtid_128142, n_114534)) {\n            ((__global int64_t *) mem_131882)[gtid_128134 * n_114534 +\n                                              gtid_128142] = ((__local\n                                                               int64_t *) scan_arr_mem_135261)[sext_i32_i64(local_tid_135257)];\n            ((__global int64_t *) mem_131886)[gtid_128134 * n_114534 +\n                                              gtid_128142] = ((__local\n                                                               int64_t *) scan_arr_mem_135263)[sext_i32_i64(local_tid_135257)];\n            ((__global int64_t *) mem_131890)[gtid_128134 * n_114534 +\n                                              gtid_128142] = ((__local\n                                                               int64_t *) scan_arr_mem_135265)[sext_i32_i64(local_tid_135257)];\n            ((__global int64_t *) mem_131894)[gtid_128134 * n_114534 +\n                                              gtid_128142] = ((__local\n                                                               int64_t *) scan_arr_mem_135267)[sext_i32_i64(local_tid_135257)];\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_128388\n}\n__kernel void mainziscan_stage3_116849(__global int *global_failure,\n                                       int64_t m_114533, int64_t n_114534,\n                                       int64_t num_gro",
                   "ups_116861,\n                                       int32_t num_threads_132306,\n                                       int32_t required_groups_132348, __global\n                                       unsigned char *mem_130107)\n{\n    #define segscan_group_sizze_116860 (mainzisegscan_group_sizze_116843)\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_132349;\n    int32_t local_tid_132350;\n    int64_t group_sizze_132353;\n    int32_t wave_sizze_132352;\n    int32_t group_tid_132351;\n    \n    global_tid_132349 = get_global_id(0);\n    local_tid_132350 = get_local_id(0);\n    group_sizze_132353 = get_local_size(0);\n    wave_sizze_132352 = LOCKSTEP_WIDTH;\n    group_tid_132351 = get_group_id(0);\n    \n    int32_t phys_tid_116849 = global_tid_132349;\n    int32_t phys_group_id_132354;\n    \n    phys_group_id_132354 = get_group_id(0);\n    for (int32_t i_132355 = 0; i_132355 < sdiv_up32(required_groups_132348 -\n                                                    phys_group_id_132354,\n                                                    sext_i64_i32(num_groups_116861));\n         i_132355++) {\n        int32_t virt_group_id_132356 = phys_group_id_132354 + i_132355 *\n                sext_i64_i32(num_groups_116861);\n        int64_t flat_idx_132357 = sext_i32_i64(virt_group_id_132356) *\n                segscan_group_sizze_116860 + sext_i32_i64(local_tid_132350);\n        int64_t gtid_116840 = squot64(flat_idx_132357, n_114534);\n        int64_t gtid_116848 = flat_idx_132357 - squot64(flat_idx_132357,\n                                                        n_114534) * n_114534;\n        int64_t orig_group_132358 = squot64(flat_idx_132357,\n                                            segscan_group_sizze_116860 *\n                                            sdiv_up64(m_114533 * n_114534,\n                                                      sext_i32_i64(num_threads_132306)));\n",
                   "        int64_t carry_in_flat_idx_132359 = orig_group_132358 *\n                (segscan_group_sizze_116860 * sdiv_up64(m_114533 * n_114534,\n                                                        sext_i32_i64(num_threads_132306))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_116840, m_114533) && slt64(gtid_116848, n_114534)) {\n            if (!(orig_group_132358 == (int64_t) 0 || (flat_idx_132357 ==\n                                                       (orig_group_132358 +\n                                                        (int64_t) 1) *\n                                                       (segscan_group_sizze_116860 *\n                                                        sdiv_up64(m_114533 *\n                                                                  n_114534,\n                                                                  sext_i32_i64(num_threads_132306))) -\n                                                       (int64_t) 1 ||\n                                                       slt64(srem64(flat_idx_132357,\n                                                                    n_114534),\n                                                             flat_idx_132357 -\n                                                             carry_in_flat_idx_132359)))) {\n                int64_t x_116864;\n                int64_t x_116865;\n                \n                x_116864 = ((__global\n                             int64_t *) mem_130107)[squot64(carry_in_flat_idx_132359,\n                                                            n_114534) *\n                                                    n_114534 +\n                                                    (carry_in_flat_idx_132359 -\n                                                     squot64(carry_in_flat_idx_132359,\n                                                             n_114534) *\n                                                     n_114534)];\n                x_116865 = ((__global",
                   " int64_t *) mem_130107)[gtid_116840 *\n                                                             n_114534 +\n                                                             gtid_116848];\n                \n                int64_t defunc_1_op_res_116866 = add64(x_116864, x_116865);\n                \n                x_116864 = defunc_1_op_res_116866;\n                ((__global int64_t *) mem_130107)[gtid_116840 * n_114534 +\n                                                  gtid_116848] = x_116864;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_116860\n}\n__kernel void mainziscan_stage3_120428(__global int *global_failure,\n                                       int64_t m_114533, int64_t n_114534,\n                                       int64_t num_groups_120703,\n                                       int32_t num_threads_133509,\n                                       int32_t required_groups_133551, __global\n                                       unsigned char *mem_130849)\n{\n    #define segscan_group_sizze_120702 (mainzisegscan_group_sizze_120422)\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_133552;\n    int32_t local_tid_133553;\n    int64_t group_sizze_133556;\n    int32_t wave_sizze_133555;\n    int32_t group_tid_133554;\n    \n    global_tid_133552 = get_global_id(0);\n    local_tid_133553 = get_local_id(0);\n    group_sizze_133556 = get_local_size(0);\n    wave_sizze_133555 = LOCKSTEP_WIDTH;\n    group_tid_133554 = get_group_id(0);\n    \n    int32_t phys_tid_120428 = global_tid_133552;\n    int32_t phys_group_id_133557;\n    \n    phys_group_id_133557 = get_group_id(0);\n    for (int32_t i_133558 = 0; i_133558 < sdiv_up32(required_groups_133551 -\n                                                    phys_group_id_133557,\n                                          ",
                   "          sext_i64_i32(num_groups_120703));\n         i_133558++) {\n        int32_t virt_group_id_133559 = phys_group_id_133557 + i_133558 *\n                sext_i64_i32(num_groups_120703);\n        int64_t flat_idx_133560 = sext_i32_i64(virt_group_id_133559) *\n                segscan_group_sizze_120702 + sext_i32_i64(local_tid_133553);\n        int64_t gtid_120419 = squot64(flat_idx_133560, n_114534);\n        int64_t gtid_120427 = flat_idx_133560 - squot64(flat_idx_133560,\n                                                        n_114534) * n_114534;\n        int64_t orig_group_133561 = squot64(flat_idx_133560,\n                                            segscan_group_sizze_120702 *\n                                            sdiv_up64(m_114533 * n_114534,\n                                                      sext_i32_i64(num_threads_133509)));\n        int64_t carry_in_flat_idx_133562 = orig_group_133561 *\n                (segscan_group_sizze_120702 * sdiv_up64(m_114533 * n_114534,\n                                                        sext_i32_i64(num_threads_133509))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_120419, m_114533) && slt64(gtid_120427, n_114534)) {\n            if (!(orig_group_133561 == (int64_t) 0 || (flat_idx_133560 ==\n                                                       (orig_group_133561 +\n                                                        (int64_t) 1) *\n                                                       (segscan_group_sizze_120702 *\n                                                        sdiv_up64(m_114533 *\n                                                                  n_114534,\n                                                                  sext_i32_i64(num_threads_133509))) -\n                                                       (int64_t) 1 ||\n                                                       slt64(srem64(flat_idx_133560,\n                                                                    n_114534),\n    ",
                   "                                                         flat_idx_133560 -\n                                                             carry_in_flat_idx_133562)))) {\n                float x_120706;\n                float x_120707;\n                \n                x_120706 = ((__global\n                             float *) mem_130849)[squot64(carry_in_flat_idx_133562,\n                                                          n_114534) * n_114534 +\n                                                  (carry_in_flat_idx_133562 -\n                                                   squot64(carry_in_flat_idx_133562,\n                                                           n_114534) *\n                                                   n_114534)];\n                x_120707 = ((__global float *) mem_130849)[gtid_120419 *\n                                                           n_114534 +\n                                                           gtid_120427];\n                \n                float defunc_1_op_res_120708 = x_120706 + x_120707;\n                \n                x_120706 = defunc_1_op_res_120708;\n                ((__global float *) mem_130849)[gtid_120419 * n_114534 +\n                                                gtid_120427] = x_120706;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_120702\n}\n__kernel void mainziscan_stage3_120491(__global int *global_failure,\n                                       int64_t m_114533,\n                                       int64_t lifted_single_ma_arg_114976,\n                                       int64_t num_groups_120655,\n                                       int32_t num_threads_133389,\n                                       int32_t required_groups_133431, __global\n                                       unsigned char *mem_130840)\n{\n    #define segscan_group_sizze_120654 (mainzisegscan_group_sizze_120485)\n    \n    const int bl",
                   "ock_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_133432;\n    int32_t local_tid_133433;\n    int64_t group_sizze_133436;\n    int32_t wave_sizze_133435;\n    int32_t group_tid_133434;\n    \n    global_tid_133432 = get_global_id(0);\n    local_tid_133433 = get_local_id(0);\n    group_sizze_133436 = get_local_size(0);\n    wave_sizze_133435 = LOCKSTEP_WIDTH;\n    group_tid_133434 = get_group_id(0);\n    \n    int32_t phys_tid_120491 = global_tid_133432;\n    int32_t phys_group_id_133437;\n    \n    phys_group_id_133437 = get_group_id(0);\n    for (int32_t i_133438 = 0; i_133438 < sdiv_up32(required_groups_133431 -\n                                                    phys_group_id_133437,\n                                                    sext_i64_i32(num_groups_120655));\n         i_133438++) {\n        int32_t virt_group_id_133439 = phys_group_id_133437 + i_133438 *\n                sext_i64_i32(num_groups_120655);\n        int64_t flat_idx_133440 = sext_i32_i64(virt_group_id_133439) *\n                segscan_group_sizze_120654 + sext_i32_i64(local_tid_133433);\n        int64_t gtid_120482 = squot64(flat_idx_133440,\n                                      lifted_single_ma_arg_114976);\n        int64_t gtid_120490 = flat_idx_133440 - squot64(flat_idx_133440,\n                                                        lifted_single_ma_arg_114976) *\n                lifted_single_ma_arg_114976;\n        int64_t orig_group_133441 = squot64(flat_idx_133440,\n                                            segscan_group_sizze_120654 *\n                                            sdiv_up64(m_114533 *\n                                                      lifted_single_ma_arg_114976,\n                                                      sext_i32_i64(num_threads_133389)));\n        int64_t carry_in_flat_idx_133442 = orig_group_133441 *\n                (segscan_group_sizze_120654 * sdiv_up64(m_114533 *\n        ",
                   "                                                lifted_single_ma_arg_114976,\n                                                        sext_i32_i64(num_threads_133389))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_120482, m_114533) && slt64(gtid_120490,\n                                                  lifted_single_ma_arg_114976)) {\n            if (!(orig_group_133441 == (int64_t) 0 || (flat_idx_133440 ==\n                                                       (orig_group_133441 +\n                                                        (int64_t) 1) *\n                                                       (segscan_group_sizze_120654 *\n                                                        sdiv_up64(m_114533 *\n                                                                  lifted_single_ma_arg_114976,\n                                                                  sext_i32_i64(num_threads_133389))) -\n                                                       (int64_t) 1 ||\n                                                       slt64(srem64(flat_idx_133440,\n                                                                    lifted_single_ma_arg_114976),\n                                                             flat_idx_133440 -\n                                                             carry_in_flat_idx_133442)))) {\n                float x_120658;\n                float x_120659;\n                \n                x_120658 = ((__global\n                             float *) mem_130840)[squot64(carry_in_flat_idx_133442,\n                                                          lifted_single_ma_arg_114976) *\n                                                  lifted_single_ma_arg_114976 +\n                                                  (carry_in_flat_idx_133442 -\n                                                   squot64(carry_in_flat_idx_133442,\n                                                           lifted_single_ma_arg_114976) *\n                 ",
                   "                                  lifted_single_ma_arg_114976)];\n                x_120659 = ((__global float *) mem_130840)[gtid_120482 *\n                                                           lifted_single_ma_arg_114976 +\n                                                           gtid_120490];\n                \n                float defunc_1_op_res_120660 = x_120658 + x_120659;\n                \n                x_120658 = defunc_1_op_res_120660;\n                ((__global float *) mem_130840)[gtid_120482 *\n                                                lifted_single_ma_arg_114976 +\n                                                gtid_120490] = x_120658;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_120654\n}\n__kernel void mainziscan_stage3_120553(__global int *global_failure,\n                                       int64_t m_114533,\n                                       int64_t lifted_single_ma_arg_114959,\n                                       int64_t num_groups_120607,\n                                       int32_t num_threads_133269,\n                                       int32_t required_groups_133311, __global\n                                       unsigned char *mem_130831)\n{\n    #define segscan_group_sizze_120606 (mainzisegscan_group_sizze_120547)\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_133312;\n    int32_t local_tid_133313;\n    int64_t group_sizze_133316;\n    int32_t wave_sizze_133315;\n    int32_t group_tid_133314;\n    \n    global_tid_133312 = get_global_id(0);\n    local_tid_133313 = get_local_id(0);\n    group_sizze_133316 = get_local_size(0);\n    wave_sizze_133315 = LOCKSTEP_WIDTH;\n    group_tid_133314 = get_group_id(0);\n    \n    int32_t phys_tid_120553 = global_tid_133312;\n    int32_t phys_group_id_133317;\n    \n    phys_",
                   "group_id_133317 = get_group_id(0);\n    for (int32_t i_133318 = 0; i_133318 < sdiv_up32(required_groups_133311 -\n                                                    phys_group_id_133317,\n                                                    sext_i64_i32(num_groups_120607));\n         i_133318++) {\n        int32_t virt_group_id_133319 = phys_group_id_133317 + i_133318 *\n                sext_i64_i32(num_groups_120607);\n        int64_t flat_idx_133320 = sext_i32_i64(virt_group_id_133319) *\n                segscan_group_sizze_120606 + sext_i32_i64(local_tid_133313);\n        int64_t gtid_120544 = squot64(flat_idx_133320,\n                                      lifted_single_ma_arg_114959);\n        int64_t gtid_120552 = flat_idx_133320 - squot64(flat_idx_133320,\n                                                        lifted_single_ma_arg_114959) *\n                lifted_single_ma_arg_114959;\n        int64_t orig_group_133321 = squot64(flat_idx_133320,\n                                            segscan_group_sizze_120606 *\n                                            sdiv_up64(m_114533 *\n                                                      lifted_single_ma_arg_114959,\n                                                      sext_i32_i64(num_threads_133269)));\n        int64_t carry_in_flat_idx_133322 = orig_group_133321 *\n                (segscan_group_sizze_120606 * sdiv_up64(m_114533 *\n                                                        lifted_single_ma_arg_114959,\n                                                        sext_i32_i64(num_threads_133269))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_120544, m_114533) && slt64(gtid_120552,\n                                                  lifted_single_ma_arg_114959)) {\n            if (!(orig_group_133321 == (int64_t) 0 || (flat_idx_133320 ==\n                                                       (orig_group_133321 +\n                                                        (int64_t) 1) *\n                       ",
                   "                                (segscan_group_sizze_120606 *\n                                                        sdiv_up64(m_114533 *\n                                                                  lifted_single_ma_arg_114959,\n                                                                  sext_i32_i64(num_threads_133269))) -\n                                                       (int64_t) 1 ||\n                                                       slt64(srem64(flat_idx_133320,\n                                                                    lifted_single_ma_arg_114959),\n                                                             flat_idx_133320 -\n                                                             carry_in_flat_idx_133322)))) {\n                float x_120610;\n                float x_120611;\n                \n                x_120610 = ((__global\n                             float *) mem_130831)[squot64(carry_in_flat_idx_133322,\n                                                          lifted_single_ma_arg_114959) *\n                                                  lifted_single_ma_arg_114959 +\n                                                  (carry_in_flat_idx_133322 -\n                                                   squot64(carry_in_flat_idx_133322,\n                                                           lifted_single_ma_arg_114959) *\n                                                   lifted_single_ma_arg_114959)];\n                x_120611 = ((__global float *) mem_130831)[gtid_120544 *\n                                                           lifted_single_ma_arg_114959 +\n                                                           gtid_120552];\n                \n                float defunc_1_op_res_120612 = x_120610 + x_120611;\n                \n                x_120610 = defunc_1_op_res_120612;\n                ((__global float *) mem_130831)[gtid_120544 *\n                                                lifted_single_ma_arg_114959 +\n    ",
                   "                                            gtid_120552] = x_120610;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_120606\n}\n__kernel void mainziscan_stage3_128143(__global int *global_failure,\n                                       int64_t m_114533, int64_t n_114534,\n                                       int64_t num_groups_128389,\n                                       int32_t num_threads_135207,\n                                       int32_t required_groups_135288, __global\n                                       unsigned char *mem_131882, __global\n                                       unsigned char *mem_131886, __global\n                                       unsigned char *mem_131890, __global\n                                       unsigned char *mem_131894)\n{\n    #define segscan_group_sizze_128388 (mainzisegscan_group_sizze_128137)\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_135289;\n    int32_t local_tid_135290;\n    int64_t group_sizze_135293;\n    int32_t wave_sizze_135292;\n    int32_t group_tid_135291;\n    \n    global_tid_135289 = get_global_id(0);\n    local_tid_135290 = get_local_id(0);\n    group_sizze_135293 = get_local_size(0);\n    wave_sizze_135292 = LOCKSTEP_WIDTH;\n    group_tid_135291 = get_group_id(0);\n    \n    int32_t phys_tid_128143 = global_tid_135289;\n    int32_t phys_group_id_135294;\n    \n    phys_group_id_135294 = get_group_id(0);\n    for (int32_t i_135295 = 0; i_135295 < sdiv_up32(required_groups_135288 -\n                                                    phys_group_id_135294,\n                                                    sext_i64_i32(num_groups_128389));\n         i_135295++) {\n        int32_t virt_group_id_135296 = phys_group_id_135294 + i_135295 *\n                sext_i64_i32(num_groups_128389);\n        int64",
                   "_t flat_idx_135297 = sext_i32_i64(virt_group_id_135296) *\n                segscan_group_sizze_128388 + sext_i32_i64(local_tid_135290);\n        int64_t gtid_128134 = squot64(flat_idx_135297, n_114534);\n        int64_t gtid_128142 = flat_idx_135297 - squot64(flat_idx_135297,\n                                                        n_114534) * n_114534;\n        int64_t orig_group_135298 = squot64(flat_idx_135297,\n                                            segscan_group_sizze_128388 *\n                                            sdiv_up64(m_114533 * n_114534,\n                                                      sext_i32_i64(num_threads_135207)));\n        int64_t carry_in_flat_idx_135299 = orig_group_135298 *\n                (segscan_group_sizze_128388 * sdiv_up64(m_114533 * n_114534,\n                                                        sext_i32_i64(num_threads_135207))) -\n                (int64_t) 1;\n        \n        if (slt64(gtid_128134, m_114533) && slt64(gtid_128142, n_114534)) {\n            if (!(orig_group_135298 == (int64_t) 0 || (flat_idx_135297 ==\n                                                       (orig_group_135298 +\n                                                        (int64_t) 1) *\n                                                       (segscan_group_sizze_128388 *\n                                                        sdiv_up64(m_114533 *\n                                                                  n_114534,\n                                                                  sext_i32_i64(num_threads_135207))) -\n                                                       (int64_t) 1 ||\n                                                       slt64(srem64(flat_idx_135297,\n                                                                    n_114534),\n                                                             flat_idx_135297 -\n                                                             carry_in_flat_idx_135299)))) {\n                int64_t x_128396;\n ",
                   "               int64_t x_128397;\n                int64_t x_128398;\n                int64_t x_128399;\n                int64_t x_128400;\n                int64_t x_128401;\n                int64_t x_128402;\n                int64_t x_128403;\n                \n                x_128396 = ((__global\n                             int64_t *) mem_131882)[squot64(carry_in_flat_idx_135299,\n                                                            n_114534) *\n                                                    n_114534 +\n                                                    (carry_in_flat_idx_135299 -\n                                                     squot64(carry_in_flat_idx_135299,\n                                                             n_114534) *\n                                                     n_114534)];\n                x_128397 = ((__global\n                             int64_t *) mem_131886)[squot64(carry_in_flat_idx_135299,\n                                                            n_114534) *\n                                                    n_114534 +\n                                                    (carry_in_flat_idx_135299 -\n                                                     squot64(carry_in_flat_idx_135299,\n                                                             n_114534) *\n                                                     n_114534)];\n                x_128398 = ((__global\n                             int64_t *) mem_131890)[squot64(carry_in_flat_idx_135299,\n                                                            n_114534) *\n                                                    n_114534 +\n                                                    (carry_in_flat_idx_135299 -\n                                                     squot64(carry_in_flat_idx_135299,\n                                                             n_114534) *\n                                                     n_114534)];\n                x_128399 = ((__global\n                ",
                   "             int64_t *) mem_131894)[squot64(carry_in_flat_idx_135299,\n                                                            n_114534) *\n                                                    n_114534 +\n                                                    (carry_in_flat_idx_135299 -\n                                                     squot64(carry_in_flat_idx_135299,\n                                                             n_114534) *\n                                                     n_114534)];\n                x_128400 = ((__global int64_t *) mem_131882)[gtid_128134 *\n                                                             n_114534 +\n                                                             gtid_128142];\n                x_128401 = ((__global int64_t *) mem_131886)[gtid_128134 *\n                                                             n_114534 +\n                                                             gtid_128142];\n                x_128402 = ((__global int64_t *) mem_131890)[gtid_128134 *\n                                                             n_114534 +\n                                                             gtid_128142];\n                x_128403 = ((__global int64_t *) mem_131894)[gtid_128134 *\n                                                             n_114534 +\n                                                             gtid_128142];\n                \n                int64_t defunc_1_op_res_128404 = add64(x_128396, x_128400);\n                int64_t defunc_1_op_res_128405 = add64(x_128397, x_128401);\n                int64_t defunc_1_op_res_128406 = add64(x_128398, x_128402);\n                int64_t defunc_1_op_res_128407 = add64(x_128399, x_128403);\n                \n                x_128396 = defunc_1_op_res_128404;\n                x_128397 = defunc_1_op_res_128405;\n                x_128398 = defunc_1_op_res_128406;\n                x_128399 = defunc_1_op_res_128407;\n                ((__global int64_t *) mem_131882)[gtid_12813",
                   "4 * n_114534 +\n                                                  gtid_128142] = x_128396;\n                ((__global int64_t *) mem_131886)[gtid_128134 * n_114534 +\n                                                  gtid_128142] = x_128397;\n                ((__global int64_t *) mem_131890)[gtid_128134 * n_114534 +\n                                                  gtid_128142] = x_128398;\n                ((__global int64_t *) mem_131894)[gtid_128134 * n_114534 +\n                                                  gtid_128142] = x_128399;\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segscan_group_sizze_128388\n}\n__kernel void mainzisegmap_116795(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534, __global\n                                  unsigned char *Y_mem_130086, __global\n                                  unsigned char *mem_130107, __global\n                                  unsigned char *mem_130114)\n{\n    #define segmap_group_sizze_116891 (mainzisegmap_group_sizze_116798)\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_132374;\n    int32_t local_tid_132375;\n    int64_t group_sizze_132378;\n    int32_t wave_sizze_132377;\n    int32_t group_tid_132376;\n    \n    global_tid_132374 = get_global_id(0);\n    local_tid_132375 = get_local_id(0);\n    group_sizze_132378 = get_local_size(0);\n    wave_sizze_132377 = LOCKSTEP_WIDTH;\n    group_tid_132376 = get_group_id(0);\n    \n    int32_t phys_tid_116795 = global_tid_132374;\n    int64_t global_tid_132379 = sext_i32_i64(group_tid_132376) *\n            segmap_group_sizze_116891 + sext_i32_i64(local_tid_132375);\n    int64_t slice_132380 = n_114534;\n    int64_t slice_132381 = m_114533 * slice_132380;\n    int64_t gtid_116793 = squot64(global_tid_132379, slice_132380);\n    int64_t remna",
                   "nt_132382 = global_tid_132379 - gtid_116793 * slice_132380;\n    int64_t gtid_116794 = remnant_132382;\n    int64_t remnant_132383 = remnant_132382 - gtid_116794;\n    \n    if (slt64(gtid_116793, m_114533) && slt64(gtid_116794, n_114534)) {\n        float x_116894 = ((__global float *) Y_mem_130086)[gtid_116793 *\n                                                           n_114534 +\n                                                           gtid_116794];\n        bool isnan_res_116897;\n        \n        isnan_res_116897 = futrts_isnan32(x_116894);\n        \n        bool defunc_0_p_res_116898 = !isnan_res_116897;\n        int64_t defunc_1_f_res_116899;\n        \n        if (defunc_0_p_res_116898) {\n            int64_t x_116895 = ((__global int64_t *) mem_130107)[gtid_116793 *\n                                                                 n_114534 +\n                                                                 gtid_116794];\n            int64_t defunc_1_f_res_t_res_116900 = sub64(x_116895, (int64_t) 1);\n            \n            defunc_1_f_res_116899 = defunc_1_f_res_t_res_116900;\n        } else {\n            defunc_1_f_res_116899 = (int64_t) -1;\n        }\n        if ((sle64((int64_t) 0, gtid_116793) && slt64(gtid_116793, m_114533)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_116899) &&\n             slt64(defunc_1_f_res_116899, n_114534))) {\n            ((__global int64_t *) mem_130114)[gtid_116793 * n_114534 +\n                                              defunc_1_f_res_116899] =\n                gtid_116794;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_116891\n}\n__kernel void mainzisegmap_116913(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534, __global\n                                  unsigned char *defunc_3_map_res_mem_130116,\n                                  __global unsigned char *mem_130122)\n{\n    #define segmap_group_sizze_116934 (mainzisegmap_group_sizze_116916)\n    \n    const int b",
                   "lock_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_132385;\n    int32_t local_tid_132386;\n    int64_t group_sizze_132389;\n    int32_t wave_sizze_132388;\n    int32_t group_tid_132387;\n    \n    global_tid_132385 = get_global_id(0);\n    local_tid_132386 = get_local_id(0);\n    group_sizze_132389 = get_local_size(0);\n    wave_sizze_132388 = LOCKSTEP_WIDTH;\n    group_tid_132387 = get_group_id(0);\n    \n    int32_t phys_tid_116913 = global_tid_132385;\n    int64_t global_tid_132390 = sext_i32_i64(group_tid_132387) *\n            segmap_group_sizze_116934 + sext_i32_i64(local_tid_132386);\n    int64_t slice_132391 = n_114534;\n    int64_t slice_132392 = m_114533 * slice_132391;\n    int64_t gtid_116911 = squot64(global_tid_132390, slice_132391);\n    int64_t remnant_132393 = global_tid_132390 - gtid_116911 * slice_132391;\n    int64_t gtid_116912 = remnant_132393;\n    int64_t remnant_132394 = remnant_132393 - gtid_116912;\n    \n    if (slt64(gtid_116911, m_114533) && slt64(gtid_116912, n_114534)) {\n        int64_t x_116937 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130116)[gtid_116911 *\n                                                                     n_114534 +\n                                                                     gtid_116912];\n        float i64_res_116938 = sitofp_i64_f32(x_116937);\n        \n        ((__global float *) mem_130122)[gtid_116911 * n_114534 + gtid_116912] =\n            i64_res_116938;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_116934\n}\n__kernel void mainzisegmap_116950(__global int *global_failure,\n                                  int64_t n_p_114536,\n                                  int64_t css_chunk_len_114580,\n                                  int64_t i_114610, __global\n                                  unsigned char *mem_130127)\n{\n    #define segmap_group_sizze_116979 (mainzisegmap_group_sizze_",
                   "116953)\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_132395;\n    int32_t local_tid_132396;\n    int64_t group_sizze_132399;\n    int32_t wave_sizze_132398;\n    int32_t group_tid_132397;\n    \n    global_tid_132395 = get_global_id(0);\n    local_tid_132396 = get_local_id(0);\n    group_sizze_132399 = get_local_size(0);\n    wave_sizze_132398 = LOCKSTEP_WIDTH;\n    group_tid_132397 = get_group_id(0);\n    \n    int32_t phys_tid_116950 = global_tid_132395;\n    int64_t global_tid_132400 = sext_i32_i64(group_tid_132397) *\n            segmap_group_sizze_116979 + sext_i32_i64(local_tid_132396);\n    int64_t slice_132401 = css_chunk_len_114580;\n    int64_t slice_132402 = n_p_114536 * slice_132401;\n    int64_t gtid_116948 = squot64(global_tid_132400, slice_132401);\n    int64_t remnant_132403 = global_tid_132400 - gtid_116948 * slice_132401;\n    int64_t gtid_116949 = remnant_132403;\n    int64_t remnant_132404 = remnant_132403 - gtid_116949;\n    \n    if (slt64(gtid_116948, n_p_114536) && slt64(gtid_116949,\n                                                css_chunk_len_114580)) {\n        int64_t y_116984 = mul64(n_p_114536, gtid_116949);\n        int64_t res_idx_116985 = add64(gtid_116948, y_116984);\n        bool cond_116986 = slt64(i_114610, res_idx_116985);\n        int64_t defunc_0_f_res_116987;\n        \n        if (cond_116986) {\n            defunc_0_f_res_116987 = (int64_t) -1;\n        } else {\n            defunc_0_f_res_116987 = res_idx_116985;\n        }\n        ((__global int64_t *) mem_130127)[gtid_116948 * css_chunk_len_114580 +\n                                          gtid_116949] = defunc_0_f_res_116987;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_116979\n}\n__kernel void mainzisegmap_116992(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *glo",
                   "bal_failure_args,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t n_p_114536,\n                                  int64_t css_chunk_len_114580,\n                                  int64_t num_groups_117020,\n                                  int64_t num_threads_132160, __global\n                                  unsigned char *mem_130127, __global\n                                  unsigned char *mem_130130, __global\n                                  unsigned char *mem_130149, __global\n                                  unsigned char *color_132065)\n{\n    #define segmap_group_sizze_117019 (mainzisegmap_group_sizze_116994)\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_132407;\n    int32_t local_tid_132408;\n    int64_t group_sizze_132411;\n    int32_t wave_sizze_132410;\n    int32_t group_tid_132409;\n    \n    global_tid_132407 = get_global_id(0);\n    local_tid_132408 = get_local_id(0);\n    group_sizze_132411 = get_local_size(0);\n    wave_sizze_132410 = LOCKSTEP_WIDTH;\n    group_tid_132409 = get_group_id(0);\n    \n    int32_t phys_tid_116992 = global_tid_132407;\n    int32_t phys_group_id_132412;\n    \n    phys_group_id_132412 = get_group_id(0);\n    for (int32_t i_132413 = 0; i_132413 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533,\n                                          segmap_group_sizze_117019)) -\n                   phys_group_id_132412, sext_i64_i32(num_groups_117020));\n         i_132413++) {\n        int32_t virt_group_id_132414 = phys_group_id_132412 + i_132413 *\n                sext_i64_i32(num_groups_117020);\n        int64_t global_tid_132415 = sext_i32_i64(virt_group_id_132414) *\n                s",
                   "egmap_group_sizze_117019 + sext_i32_i64(local_tid_132408);\n        int64_t slice_132416 = m_114533;\n        int64_t gtid_116991 = global_tid_132415;\n        int64_t remnant_132417 = global_tid_132415 - gtid_116991;\n        \n        if (slt64(gtid_116991, m_114533)) {\n            for (int64_t i_129838 = 0; i_129838 < n_p_114536; i_129838++) {\n                float defunc_2_reduce_res_117026;\n                float redout_129840 = 0.0F;\n                \n                for (int64_t i_129841 = 0; i_129841 < css_chunk_len_114580;\n                     i_129841++) {\n                    int64_t x_117030 = ((__global\n                                         int64_t *) mem_130127)[i_129838 *\n                                                                css_chunk_len_114580 +\n                                                                i_129841];\n                    bool cond_117031 = sle64((int64_t) 0, x_117030);\n                    float defunc_0_f_res_117032;\n                    \n                    if (cond_117031) {\n                        bool y_117033 = slt64(x_117030, n_114534);\n                        bool bounds_check_117034 = cond_117031 && y_117033;\n                        bool index_certs_117035;\n                        \n                        if (!bounds_check_117034) {\n                            {\n                                if (atomic_cmpxchg_i32_global(global_failure,\n                                                              -1, 0) == -1) {\n                                    global_failure_args[0] = x_117030;\n                                    global_failure_args[1] = n_114534;\n                                    ;\n                                }\n                                local_failure = true;\n                                goto error_0;\n                            }\n                        }\n                        \n                        float defunc_0_f_res_t_res_117036 = ((__global\n                                                ",
                   "              float *) mem_130130)[x_117030 *\n                                                                                   m_114533 +\n                                                                                   gtid_116991];\n                        \n                        defunc_0_f_res_117032 = defunc_0_f_res_t_res_117036;\n                    } else {\n                        defunc_0_f_res_117032 = NAN;\n                    }\n                    \n                    bool isnan_res_117037;\n                    \n                    isnan_res_117037 = futrts_isnan32(defunc_0_f_res_117032);\n                    \n                    float defunc_0_f_res_117038;\n                    \n                    if (isnan_res_117037) {\n                        defunc_0_f_res_117038 = 0.0F;\n                    } else {\n                        defunc_0_f_res_117038 = 1.0F;\n                    }\n                    \n                    float defunc_1_op_res_117029 = defunc_0_f_res_117038 +\n                          redout_129840;\n                    float redout_tmp_132419 = defunc_1_op_res_117029;\n                    \n                    redout_129840 = redout_tmp_132419;\n                }\n                defunc_2_reduce_res_117026 = redout_129840;\n                \n                bool sub_series_is_not_all_nan_117039 = 0.0F <\n                     defunc_2_reduce_res_117026;\n                bool assert_c_117040;\n                \n                if (!sub_series_is_not_all_nan_117039) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 1) ==\n                            -1) {\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                ((__global float *) color_132065)[phys_tid_116992 + i_129838 *\n                                                  num_threads_132160] =\n                    defunc_2_re",
                   "duce_res_117026;\n            }\n            for (int64_t i_132420 = 0; i_132420 < n_p_114536; i_132420++) {\n                ((__global float *) mem_130149)[i_132420 * m_114533 +\n                                                gtid_116991] = ((__global\n                                                                 float *) color_132065)[phys_tid_116992 +\n                                                                                        i_132420 *\n                                                                                        num_threads_132160];\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_117019\n}\n__kernel void mainzisegmap_117076(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t m_114533, int64_t n_p_114536, __global\n                                  unsigned char *mem_130191, __global\n                                  unsigned char *mem_130196)\n{\n    #define segmap_group_sizze_117193 (mainzisegmap_group_sizze_117079)\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_132506;\n    int32_t local_tid_132507;\n    int64_t group_sizze_132510;\n    int32_t wave_sizze_132509;\n    int32_t group_tid_132508;\n    \n    global_tid_132506 = get_global_id(0);\n    local_tid_132507 = get_local_id(0);\n    group_sizze_132510 = get_local_size(0);\n    wave_sizze_132509 = LOCKSTEP_WIDTH;\n    group_tid_132508 = get_group_id(0);\n    \n    int32_t phys_tid_117076 = global_tid_132506;\n    int64_t global_tid_132511 = sext_i32_i64(group_tid_132508) *\n            segmap_group_sizze_117193 + sext_i32_i64(local_tid_132507);\n    int64_t slice_132512 = n_p_114536;\n    int64_t slice_132513 = m_114533 * slice_1325",
                   "12;\n    int64_t gtid_117074 = squot64(global_tid_132511, slice_132512);\n    int64_t remnant_132514 = global_tid_132511 - gtid_117074 * slice_132512;\n    int64_t gtid_117075 = remnant_132514;\n    int64_t remnant_132515 = remnant_132514 - gtid_117075;\n    \n    if (slt64(gtid_117074, m_114533) && slt64(gtid_117075, n_p_114536)) {\n        float defunc_2_reduce_res_117196 = ((__global\n                                             float *) mem_130191)[gtid_117074 *\n                                                                  n_p_114536 +\n                                                                  gtid_117075];\n        bool sub_series_is_not_all_nan_117197 = 0.0F <\n             defunc_2_reduce_res_117196;\n        bool assert_c_117198;\n        \n        if (!sub_series_is_not_all_nan_117197) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 7) == -1) {\n                    ;\n                }\n                return;\n            }\n        }\n        \n        float lam_res_117199 = defunc_2_reduce_res_117196;\n        \n        ((__global float *) mem_130196)[gtid_117074 * n_p_114536 +\n                                        gtid_117075] = lam_res_117199;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_117193\n}\n__kernel void mainzisegmap_117350(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t l_jump_114542, int64_t l_n_m_114584,\n                                  int64_t i_114610, unsigned char x_114611,\n                                  int64_t min_res_114683,\n                                  unsigned char empty_slice_114688,\n                                  int64_t m_114689, float i64_res_114690,\n                                  int64_t num_groups_117473,\n                                  int64_t n",
                   "um_threads_132165, __global\n                                  unsigned char *defunc_3_map_res_mem_130116,\n                                  __global\n                                  unsigned char *defunc_3_map_res_mem_130117,\n                                  __global unsigned char *mem_130206, __global\n                                  unsigned char *mem_130270, __global\n                                  unsigned char *mem_130273, __global\n                                  unsigned char *color_132070, __global\n                                  unsigned char *color_132071, __global\n                                  unsigned char *color_132072, __global\n                                  unsigned char *color_132073)\n{\n    #define segmap_group_sizze_117472 (mainzisegmap_group_sizze_117352)\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_132520;\n    int32_t local_tid_132521;\n    int64_t group_sizze_132524;\n    int32_t wave_sizze_132523;\n    int32_t group_tid_132522;\n    \n    global_tid_132520 = get_global_id(0);\n    local_tid_132521 = get_local_id(0);\n    group_sizze_132524 = get_local_size(0);\n    wave_sizze_132523 = LOCKSTEP_WIDTH;\n    group_tid_132522 = get_group_id(0);\n    \n    int32_t phys_tid_117350 = global_tid_132520;\n    int32_t phys_group_id_132525;\n    \n    phys_group_id_132525 = get_group_id(0);\n    for (int32_t i_132526 = 0; i_132526 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533,\n                                          segmap_group_sizze_117472)) -\n                   phys_group_id_132525, sext_i64_i32(num_groups_117473));\n         i_132526++) {\n        int32_t virt_group_id_132527 = phys_group_id_132525 + i_132526 *\n                sext_i64_",
                   "i32(num_groups_117473);\n        int64_t global_tid_132528 = sext_i32_i64(virt_group_id_132527) *\n                segmap_group_sizze_117472 + sext_i32_i64(local_tid_132521);\n        int64_t slice_132529 = m_114533;\n        int64_t gtid_117349 = global_tid_132528;\n        int64_t remnant_132530 = global_tid_132528 - gtid_117349;\n        \n        if (slt64(gtid_117349, m_114533)) {\n            int64_t x_117478 = ((__global\n                                 int64_t *) defunc_3_map_res_mem_130117)[gtid_117349];\n            \n            for (int64_t i_129850 = 0; i_129850 < n_114534; i_129850++) {\n                int64_t x_117481 = ((__global int64_t *) mem_130206)[i_129850 *\n                                                                     m_114533 +\n                                                                     gtid_117349];\n                int64_t defunc_0_f_res_117482 = add64((int64_t) 1, x_117481);\n                bool cond_117483 = slt64(defunc_0_f_res_117482, (int64_t) 0);\n                int64_t defunc_0_f_res_117484;\n                \n                if (cond_117483) {\n                    defunc_0_f_res_117484 = (int64_t) 9223372036854775807;\n                } else {\n                    defunc_0_f_res_117484 = defunc_0_f_res_117482;\n                }\n                ((__global int64_t *) color_132073)[phys_tid_117350 + i_129850 *\n                                                    num_threads_132165] =\n                    defunc_0_f_res_117484;\n                ((__global int64_t *) color_132072)[phys_tid_117350 + i_129850 *\n                                                    num_threads_132165] =\n                    defunc_0_f_res_117482;\n            }\n            \n            int64_t min_arg_117485 = sub64(x_117478, min_res_114683);\n            float i64_res_117486 = sitofp_i64_f32(x_117478);\n            float x_117487 = i64_res_114690 - i64_res_117486;\n            float max_arg_117488 = x_117487 / 2.0F;\n            float max_res_117489 = fmax32(0.0F, max",
                   "_arg_117488);\n            \n            for (int64_t i_129857 = 0; i_129857 < l_n_m_114584; i_129857++) {\n                int64_t min_arg_117493 = mul64(l_jump_114542, i_129857);\n                int64_t min_res_117494 = smin64(i_114610, min_arg_117493);\n                int64_t defunc_0_g_res_117495 = add64((int64_t) 1,\n                                                      min_res_117494);\n                bool nearest_idx_117496;\n                int64_t nearest_idx_117497;\n                int64_t nearest_idx_117498;\n                bool loop_while_117499;\n                int64_t low_117500;\n                int64_t high_117501;\n                \n                loop_while_117499 = x_114611;\n                low_117500 = (int64_t) 0;\n                high_117501 = i_114610;\n                while (loop_while_117499) {\n                    int64_t x_117502 = add64(low_117500, high_117501);\n                    int64_t mid_117503 = sdiv64(x_117502, (int64_t) 2);\n                    bool x_117504 = sle64((int64_t) 0, mid_117503);\n                    bool y_117505 = slt64(mid_117503, n_114534);\n                    bool bounds_check_117506 = x_117504 && y_117505;\n                    bool index_certs_117507;\n                    \n                    if (!bounds_check_117506) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          8) == -1) {\n                                global_failure_args[0] = mid_117503;\n                                global_failure_args[1] = n_114534;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t x_117508 = ((__global\n                                         int64_t *) color_132073)[phys_tid_117350 +\n                                                  ",
                   "                mid_117503 *\n                                                                  num_threads_132165];\n                    bool cond_117509 = sle64(defunc_0_g_res_117495, x_117508);\n                    int64_t loopres_117510;\n                    int64_t loopres_117511;\n                    \n                    if (cond_117509) {\n                        int64_t loopres_t_res_117512 = sub64(mid_117503,\n                                                             (int64_t) 1);\n                        \n                        loopres_117510 = low_117500;\n                        loopres_117511 = loopres_t_res_117512;\n                    } else {\n                        int64_t loopres_f_res_117513 = add64((int64_t) 1,\n                                                             mid_117503);\n                        \n                        loopres_117510 = loopres_f_res_117513;\n                        loopres_117511 = high_117501;\n                    }\n                    \n                    bool loop_cond_117514 = sle64(loopres_117510,\n                                                  loopres_117511);\n                    bool loop_while_tmp_132535 = loop_cond_117514;\n                    int64_t low_tmp_132536 = loopres_117510;\n                    int64_t high_tmp_132537 = loopres_117511;\n                    \n                    loop_while_117499 = loop_while_tmp_132535;\n                    low_117500 = low_tmp_132536;\n                    high_117501 = high_tmp_132537;\n                }\n                nearest_idx_117496 = loop_while_117499;\n                nearest_idx_117497 = low_117500;\n                nearest_idx_117498 = high_117501;\n                \n                int64_t max_arg_117515 = sub64(nearest_idx_117497,\n                                               min_res_114683);\n                int64_t max_res_117516 = smax64((int64_t) 0, max_arg_117515);\n                int64_t j_117517 = add64(min_res_114683, max_res_117516);\n                int64_t i_",
                   "p_m_t_s_117518 = add64(m_114689, max_res_117516);\n                bool zzero_leq_i_p_m_t_s_117519 = sle64((int64_t) 0,\n                                                        i_p_m_t_s_117518);\n                bool i_p_m_t_s_leq_w_117520 = slt64(i_p_m_t_s_117518, n_114534);\n                bool zzero_lte_i_117521 = sle64((int64_t) 0, max_res_117516);\n                bool i_lte_j_117522 = sle64(max_res_117516, j_117517);\n                bool y_117523 = i_p_m_t_s_leq_w_117520 && zzero_lte_i_117521;\n                bool y_117524 = zzero_leq_i_p_m_t_s_117519 && y_117523;\n                bool y_117525 = i_lte_j_117522 && y_117524;\n                bool forwards_ok_117526 = zzero_lte_i_117521 && y_117525;\n                bool ok_or_empty_117527 = empty_slice_114688 ||\n                     forwards_ok_117526;\n                bool index_certs_117528;\n                \n                if (!ok_or_empty_117527) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 9) ==\n                            -1) {\n                            global_failure_args[0] = max_res_117516;\n                            global_failure_args[1] = j_117517;\n                            global_failure_args[2] = n_114534;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t defunc_2_reduce_res_117530;\n                int64_t redout_129860 = (int64_t) 0;\n                \n                for (int64_t i_129861 = 0; i_129861 < min_res_114683;\n                     i_129861++) {\n                    int64_t slice_129987 = max_res_117516 + i_129861;\n                    int64_t x_117534 = ((__global\n                                         int64_t *) color_132072)[phys_tid_117350 +\n                                                                  slice_129987 *\n                                              ",
                   "                    num_threads_132165];\n                    int64_t abs_arg_117535 = sub64(x_117534,\n                                                   defunc_0_g_res_117495);\n                    int64_t abs_res_117536 = abs(abs_arg_117535);\n                    int64_t defunc_1_op_res_117533 = add64(abs_res_117536,\n                                                           redout_129860);\n                    int64_t redout_tmp_132538 = defunc_1_op_res_117533;\n                    \n                    redout_129860 = redout_tmp_132538;\n                }\n                defunc_2_reduce_res_117530 = redout_129860;\n                \n                int64_t idx_117537;\n                int64_t idx_117538;\n                int64_t idx_117539;\n                int64_t idx_117540;\n                int64_t best_idx_117542;\n                int64_t last_idx_117543;\n                int64_t best_sum_117544;\n                int64_t curr_sum_117545;\n                \n                best_idx_117542 = max_res_117516;\n                last_idx_117543 = max_res_117516;\n                best_sum_117544 = defunc_2_reduce_res_117530;\n                curr_sum_117545 = defunc_2_reduce_res_117530;\n                for (int64_t j_117541 = 0; j_117541 < min_res_114683;\n                     j_117541++) {\n                    int64_t new_idx_117546 = add64(max_res_117516, j_117541);\n                    int64_t x_117547 = add64(min_res_114683, new_idx_117546);\n                    bool cond_117548 = slt64(x_117478, x_117547);\n                    int64_t new_sum_117549;\n                    \n                    if (cond_117548) {\n                        new_sum_117549 = (int64_t) 9223372036854775807;\n                    } else {\n                        bool x_117550 = sle64((int64_t) 0, last_idx_117543);\n                        bool y_117551 = slt64(last_idx_117543, n_114534);\n                        bool bounds_check_117552 = x_117550 && y_117551;\n                        bool index_certs_117553;\n          ",
                   "              \n                        if (!bounds_check_117552) {\n                            {\n                                if (atomic_cmpxchg_i32_global(global_failure,\n                                                              -1, 10) == -1) {\n                                    global_failure_args[0] = last_idx_117543;\n                                    global_failure_args[1] = n_114534;\n                                    ;\n                                }\n                                local_failure = true;\n                                goto error_0;\n                            }\n                        }\n                        \n                        int64_t y_117554 = ((__global\n                                             int64_t *) color_132072)[phys_tid_117350 +\n                                                                      last_idx_117543 *\n                                                                      num_threads_132165];\n                        int64_t binop_p_117555 = sub64(defunc_0_g_res_117495,\n                                                       y_117554);\n                        int64_t defunc_0_f_res_117556 = abs(binop_p_117555);\n                        int64_t x_117557 = sub64(curr_sum_117545,\n                                                 defunc_0_f_res_117556);\n                        int64_t min_arg_117558 = add64(min_res_114683,\n                                                       last_idx_117543);\n                        int64_t min_res_117559 = smin64(i_114610,\n                                                        min_arg_117558);\n                        bool x_117560 = sle64((int64_t) 0, min_res_117559);\n                        bool y_117561 = slt64(min_res_117559, n_114534);\n                        bool bounds_check_117562 = x_117560 && y_117561;\n                        bool index_certs_117563;\n                        \n                        if (!bounds_check_117562) {\n                            {\n  ",
                   "                              if (atomic_cmpxchg_i32_global(global_failure,\n                                                              -1, 11) == -1) {\n                                    global_failure_args[0] = min_res_117559;\n                                    global_failure_args[1] = n_114534;\n                                    ;\n                                }\n                                local_failure = true;\n                                goto error_0;\n                            }\n                        }\n                        \n                        int64_t y_117564 = ((__global\n                                             int64_t *) color_132072)[phys_tid_117350 +\n                                                                      min_res_117559 *\n                                                                      num_threads_132165];\n                        int64_t binop_p_117565 = sub64(defunc_0_g_res_117495,\n                                                       y_117564);\n                        int64_t defunc_0_f_res_117566 = abs(binop_p_117565);\n                        int64_t new_sum_f_res_117567 = add64(x_117557,\n                                                             defunc_0_f_res_117566);\n                        \n                        new_sum_117549 = new_sum_f_res_117567;\n                    }\n                    \n                    bool cond_117568 = sle64(new_sum_117549, best_sum_117544);\n                    int64_t loopres_117569;\n                    \n                    if (cond_117568) {\n                        loopres_117569 = new_idx_117546;\n                    } else {\n                        loopres_117569 = best_idx_117542;\n                    }\n                    \n                    int64_t loopres_117570;\n                    \n                    if (cond_117568) {\n                        loopres_117570 = new_sum_117549;\n                    } else {\n                        loopres_117570 = best_sum_117544",
                   ";\n                    }\n                    \n                    int64_t best_idx_tmp_132539 = loopres_117569;\n                    int64_t last_idx_tmp_132540 = new_idx_117546;\n                    int64_t best_sum_tmp_132541 = loopres_117570;\n                    int64_t curr_sum_tmp_132542 = new_sum_117549;\n                    \n                    best_idx_117542 = best_idx_tmp_132539;\n                    last_idx_117543 = last_idx_tmp_132540;\n                    best_sum_117544 = best_sum_tmp_132541;\n                    curr_sum_117545 = curr_sum_tmp_132542;\n                }\n                idx_117537 = best_idx_117542;\n                idx_117538 = last_idx_117543;\n                idx_117539 = best_sum_117544;\n                idx_117540 = curr_sum_117545;\n                \n                int64_t min_res_117571 = smin64(min_arg_117485, idx_117537);\n                int64_t x_117572 = add64(min_res_114683, min_res_117571);\n                int64_t r_117573 = sub64(x_117572, (int64_t) 1);\n                bool x_117574 = sle64((int64_t) 0, r_117573);\n                bool y_117575 = slt64(r_117573, n_114534);\n                bool bounds_check_117576 = x_117574 && y_117575;\n                bool index_certs_117577;\n                \n                if (!bounds_check_117576) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 12) ==\n                            -1) {\n                            global_failure_args[0] = r_117573;\n                            global_failure_args[1] = n_114534;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_117578 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130116)[gtid_117349 *\n                                                                             n_114534 +\n                          ",
                   "                                                   r_117573];\n                int64_t abs_arg_117579 = sub64(x_117578, min_res_117494);\n                int64_t abs_res_117580 = abs(abs_arg_117579);\n                bool x_117581 = sle64((int64_t) 0, min_res_117571);\n                bool y_117582 = slt64(min_res_117571, n_114534);\n                bool bounds_check_117583 = x_117581 && y_117582;\n                bool index_certs_117584;\n                \n                if (!bounds_check_117583) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 13) ==\n                            -1) {\n                            global_failure_args[0] = min_res_117571;\n                            global_failure_args[1] = n_114534;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_117585 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130116)[gtid_117349 *\n                                                                             n_114534 +\n                                                                             min_res_117571];\n                int64_t abs_arg_117586 = sub64(x_117585, min_res_117494);\n                int64_t abs_res_117587 = abs(abs_arg_117586);\n                int64_t max_res_117588 = smax64(abs_res_117580, abs_res_117587);\n                float defunc_0_f_res_117589 = sitofp_i64_f32(max_res_117588);\n                float defunc_1_f_res_117590 = max_res_117489 +\n                      defunc_0_f_res_117589;\n                \n                ((__global float *) color_132071)[phys_tid_117350 + i_129857 *\n                                                  num_threads_132165] =\n                    defunc_1_f_res_117590;\n                ((__global int64_t *) color_132070)[phys_tid_117350 + i_129857 *\n                      ",
                   "                              num_threads_132165] =\n                    min_res_117571;\n            }\n            for (int64_t i_132543 = 0; i_132543 < l_n_m_114584; i_132543++) {\n                ((__global int64_t *) mem_130270)[i_132543 * m_114533 +\n                                                  gtid_117349] = ((__global\n                                                                   int64_t *) color_132070)[phys_tid_117350 +\n                                                                                            i_132543 *\n                                                                                            num_threads_132165];\n            }\n            for (int64_t i_132544 = 0; i_132544 < l_n_m_114584; i_132544++) {\n                ((__global float *) mem_130273)[i_132544 * m_114533 +\n                                                gtid_117349] = ((__global\n                                                                 float *) color_132071)[phys_tid_117350 +\n                                                                                        i_132544 *\n                                                                                        num_threads_132165];\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_117472\n}\n__kernel void mainzisegmap_117733(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t l_jump_114542, int64_t l_n_m_114584,\n                                  int64_t i_114610, unsigned char x_114611,\n                                  int64_t min_res_114683,\n                                  unsigned char empty_slice_114688,\n                                  int64_t m_114689, int64_t padded_sizze_129098,\n         ",
                   "                         int64_t per_chunk_129100,\n                                  int64_t binop_y_130018, __global\n                                  unsigned char *defunc_3_map_res_mem_130116,\n                                  __global\n                                  unsigned char *defunc_3_map_res_mem_130117,\n                                  __global unsigned char *mem_130322, __global\n                                  unsigned char *mem_130326, __global\n                                  unsigned char *mem_130330, __global\n                                  unsigned char *mem_130333, __global\n                                  unsigned char *mem_130345, __global\n                                  unsigned char *mem_130350, __global\n                                  unsigned char *mem_130354)\n{\n    #define segmap_group_sizze_118237 (mainzisegmap_group_sizze_117736)\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_132608;\n    int32_t local_tid_132609;\n    int64_t group_sizze_132612;\n    int32_t wave_sizze_132611;\n    int32_t group_tid_132610;\n    \n    global_tid_132608 = get_global_id(0);\n    local_tid_132609 = get_local_id(0);\n    group_sizze_132612 = get_local_size(0);\n    wave_sizze_132611 = LOCKSTEP_WIDTH;\n    group_tid_132610 = get_group_id(0);\n    \n    int32_t phys_tid_117733 = global_tid_132608;\n    int64_t global_tid_132613 = sext_i32_i64(group_tid_132610) *\n            segmap_group_sizze_118237 + sext_i32_i64(local_tid_132609);\n    int64_t slice_132614 = l_n_m_114584;\n    int64_t slice_132615 = m_114533 * slice_132614;\n    int64_t gtid_117731 = squot64(global_tid_132613, slice_132614);\n    int64_t remnant_132616 = global_tid_132613 - gtid_117731 * slice_132614;\n    int64_t gtid_117732 = remnant_132616;\n    int64_t remnant_132617 = remnant_132616 - gtid_117732;\n    \n    if (slt64(gtid_117731, m_114533) && slt64(gtid_117732, l_n_m_114",
                   "584)) {\n        int64_t x_118247 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130117)[gtid_117731];\n        int64_t min_arg_118250 = ((__global int64_t *) mem_130330)[gtid_117731];\n        float max_res_118251 = ((__global float *) mem_130333)[gtid_117731];\n        int64_t min_arg_118253 = mul64(l_jump_114542, gtid_117732);\n        int64_t min_res_118254 = smin64(i_114610, min_arg_118253);\n        int64_t defunc_0_g_res_118255 = add64((int64_t) 1, min_res_118254);\n        bool nearest_idx_118256;\n        int64_t nearest_idx_118257;\n        int64_t nearest_idx_118258;\n        bool loop_while_118259;\n        int64_t low_118260;\n        int64_t high_118261;\n        \n        loop_while_118259 = x_114611;\n        low_118260 = (int64_t) 0;\n        high_118261 = i_114610;\n        while (loop_while_118259) {\n            int64_t x_118262 = add64(low_118260, high_118261);\n            int64_t mid_118263 = sdiv64(x_118262, (int64_t) 2);\n            bool x_118264 = sle64((int64_t) 0, mid_118263);\n            bool y_118265 = slt64(mid_118263, n_114534);\n            bool bounds_check_118266 = x_118264 && y_118265;\n            bool index_certs_118267;\n            \n            if (!bounds_check_118266) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 20) ==\n                        -1) {\n                        global_failure_args[0] = mid_118263;\n                        global_failure_args[1] = n_114534;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_118268 = ((__global int64_t *) mem_130322)[gtid_117731 *\n                                                                 n_114534 +\n                                                                 mid_118263];\n            bool cond_118269 = sle64(defunc_0_g_res_118255, x_118268);\n            int64_t loopres_118270;\n            int64_t loopres_118271;\n            \n         ",
                   "   if (cond_118269) {\n                int64_t loopres_t_res_118272 = sub64(mid_118263, (int64_t) 1);\n                \n                loopres_118270 = low_118260;\n                loopres_118271 = loopres_t_res_118272;\n            } else {\n                int64_t loopres_f_res_118273 = add64((int64_t) 1, mid_118263);\n                \n                loopres_118270 = loopres_f_res_118273;\n                loopres_118271 = high_118261;\n            }\n            \n            bool loop_cond_118274 = sle64(loopres_118270, loopres_118271);\n            bool loop_while_tmp_132618 = loop_cond_118274;\n            int64_t low_tmp_132619 = loopres_118270;\n            int64_t high_tmp_132620 = loopres_118271;\n            \n            loop_while_118259 = loop_while_tmp_132618;\n            low_118260 = low_tmp_132619;\n            high_118261 = high_tmp_132620;\n        }\n        nearest_idx_118256 = loop_while_118259;\n        nearest_idx_118257 = low_118260;\n        nearest_idx_118258 = high_118261;\n        \n        int64_t max_arg_118275 = sub64(nearest_idx_118257, min_res_114683);\n        int64_t max_res_118276 = smax64((int64_t) 0, max_arg_118275);\n        int64_t j_118277 = add64(min_res_114683, max_res_118276);\n        int64_t i_p_m_t_s_118278 = add64(m_114689, max_res_118276);\n        bool zzero_leq_i_p_m_t_s_118279 = sle64((int64_t) 0, i_p_m_t_s_118278);\n        bool i_p_m_t_s_leq_w_118280 = slt64(i_p_m_t_s_118278, n_114534);\n        bool zzero_lte_i_118281 = sle64((int64_t) 0, max_res_118276);\n        bool i_lte_j_118282 = sle64(max_res_118276, j_118277);\n        bool y_118283 = i_p_m_t_s_leq_w_118280 && zzero_lte_i_118281;\n        bool y_118284 = zzero_leq_i_p_m_t_s_118279 && y_118283;\n        bool y_118285 = i_lte_j_118282 && y_118284;\n        bool forwards_ok_118286 = zzero_lte_i_118281 && y_118285;\n        bool ok_or_empty_118287 = empty_slice_114688 || forwards_ok_118286;\n        bool index_certs_118288;\n        \n        if (!ok_or_empty_118287) {\n            {\n         ",
                   "       if (atomic_cmpxchg_i32_global(global_failure, -1, 21) == -1) {\n                    global_failure_args[0] = max_res_118276;\n                    global_failure_args[1] = j_118277;\n                    global_failure_args[2] = n_114534;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t binop_x_130016 = gtid_117731 * padded_sizze_129098;\n        int64_t defunc_2_reduce_res_118290;\n        int64_t redout_129862 = (int64_t) 0;\n        \n        for (int64_t i_129863 = 0; i_129863 < min_res_114683; i_129863++) {\n            int64_t slice_129990 = max_res_118276 + i_129863;\n            int64_t binop_x_130017 = slice_129990 + binop_x_130016;\n            int64_t new_index_130019 = squot64(binop_x_130017, binop_y_130018);\n            int64_t binop_y_130027 = binop_y_130018 * new_index_130019;\n            int64_t binop_x_130028 = binop_x_130017 - binop_y_130027;\n            int64_t new_index_130029 = squot64(binop_x_130028,\n                                               per_chunk_129100);\n            int64_t binop_y_130049 = per_chunk_129100 * new_index_130029;\n            int64_t new_index_130050 = binop_x_130028 - binop_y_130049;\n            int64_t x_118294 = ((__global\n                                 int64_t *) mem_130345)[new_index_130019 *\n                                                        (l_n_m_114584 *\n                                                         per_chunk_129100) +\n                                                        new_index_130050 *\n                                                        l_n_m_114584 +\n                                                        new_index_130029];\n            int64_t abs_arg_118295 = sub64(x_118294, defunc_0_g_res_118255);\n            int64_t abs_res_118296 = abs(abs_arg_118295);\n            int64_t defunc_1_op_res_118293 = add64(abs_res_118296,\n                                                   redout_129862);\n            int64_t redout_tmp_132621",
                   " = defunc_1_op_res_118293;\n            \n            redout_129862 = redout_tmp_132621;\n        }\n        defunc_2_reduce_res_118290 = redout_129862;\n        \n        int64_t idx_118297;\n        int64_t idx_118298;\n        int64_t idx_118299;\n        int64_t idx_118300;\n        int64_t best_idx_118302;\n        int64_t last_idx_118303;\n        int64_t best_sum_118304;\n        int64_t curr_sum_118305;\n        \n        best_idx_118302 = max_res_118276;\n        last_idx_118303 = max_res_118276;\n        best_sum_118304 = defunc_2_reduce_res_118290;\n        curr_sum_118305 = defunc_2_reduce_res_118290;\n        for (int64_t j_118301 = 0; j_118301 < min_res_114683; j_118301++) {\n            int64_t new_idx_118306 = add64(max_res_118276, j_118301);\n            int64_t x_118307 = add64(min_res_114683, new_idx_118306);\n            bool cond_118308 = slt64(x_118247, x_118307);\n            int64_t new_sum_118309;\n            \n            if (cond_118308) {\n                new_sum_118309 = (int64_t) 9223372036854775807;\n            } else {\n                bool x_118310 = sle64((int64_t) 0, last_idx_118303);\n                bool y_118311 = slt64(last_idx_118303, n_114534);\n                bool bounds_check_118312 = x_118310 && y_118311;\n                bool index_certs_118313;\n                \n                if (!bounds_check_118312) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 22) ==\n                            -1) {\n                            global_failure_args[0] = last_idx_118303;\n                            global_failure_args[1] = n_114534;\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                int64_t y_118314 = ((__global\n                                     int64_t *) mem_130326)[gtid_117731 *\n                                                            n_114534 +\n                                                  ",
                   "          last_idx_118303];\n                int64_t binop_p_118315 = sub64(defunc_0_g_res_118255, y_118314);\n                int64_t defunc_0_f_res_118316 = abs(binop_p_118315);\n                int64_t x_118317 = sub64(curr_sum_118305,\n                                         defunc_0_f_res_118316);\n                int64_t min_arg_118318 = add64(min_res_114683, last_idx_118303);\n                int64_t min_res_118319 = smin64(i_114610, min_arg_118318);\n                bool x_118320 = sle64((int64_t) 0, min_res_118319);\n                bool y_118321 = slt64(min_res_118319, n_114534);\n                bool bounds_check_118322 = x_118320 && y_118321;\n                bool index_certs_118323;\n                \n                if (!bounds_check_118322) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 23) ==\n                            -1) {\n                            global_failure_args[0] = min_res_118319;\n                            global_failure_args[1] = n_114534;\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                int64_t y_118324 = ((__global\n                                     int64_t *) mem_130326)[gtid_117731 *\n                                                            n_114534 +\n                                                            min_res_118319];\n                int64_t binop_p_118325 = sub64(defunc_0_g_res_118255, y_118324);\n                int64_t defunc_0_f_res_118326 = abs(binop_p_118325);\n                int64_t new_sum_f_res_118327 = add64(x_118317,\n                                                     defunc_0_f_res_118326);\n                \n                new_sum_118309 = new_sum_f_res_118327;\n            }\n            \n            bool cond_118328 = sle64(new_sum_118309, best_sum_118304);\n            int64_t loopres_118329;\n            \n            if (cond_118328) {\n                loopr",
                   "es_118329 = new_idx_118306;\n            } else {\n                loopres_118329 = best_idx_118302;\n            }\n            \n            int64_t loopres_118330;\n            \n            if (cond_118328) {\n                loopres_118330 = new_sum_118309;\n            } else {\n                loopres_118330 = best_sum_118304;\n            }\n            \n            int64_t best_idx_tmp_132622 = loopres_118329;\n            int64_t last_idx_tmp_132623 = new_idx_118306;\n            int64_t best_sum_tmp_132624 = loopres_118330;\n            int64_t curr_sum_tmp_132625 = new_sum_118309;\n            \n            best_idx_118302 = best_idx_tmp_132622;\n            last_idx_118303 = last_idx_tmp_132623;\n            best_sum_118304 = best_sum_tmp_132624;\n            curr_sum_118305 = curr_sum_tmp_132625;\n        }\n        idx_118297 = best_idx_118302;\n        idx_118298 = last_idx_118303;\n        idx_118299 = best_sum_118304;\n        idx_118300 = curr_sum_118305;\n        \n        int64_t min_res_118331 = smin64(min_arg_118250, idx_118297);\n        int64_t x_118332 = add64(min_res_114683, min_res_118331);\n        int64_t r_118333 = sub64(x_118332, (int64_t) 1);\n        bool x_118334 = sle64((int64_t) 0, r_118333);\n        bool y_118335 = slt64(r_118333, n_114534);\n        bool bounds_check_118336 = x_118334 && y_118335;\n        bool index_certs_118337;\n        \n        if (!bounds_check_118336) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 24) == -1) {\n                    global_failure_args[0] = r_118333;\n                    global_failure_args[1] = n_114534;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_118338 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130116)[gtid_117731 *\n                                                                     n_114534 +\n                                                                     r_118333];\n        int64_",
                   "t abs_arg_118339 = sub64(x_118338, min_res_118254);\n        int64_t abs_res_118340 = abs(abs_arg_118339);\n        bool x_118341 = sle64((int64_t) 0, min_res_118331);\n        bool y_118342 = slt64(min_res_118331, n_114534);\n        bool bounds_check_118343 = x_118341 && y_118342;\n        bool index_certs_118344;\n        \n        if (!bounds_check_118343) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 25) == -1) {\n                    global_failure_args[0] = min_res_118331;\n                    global_failure_args[1] = n_114534;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_118345 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130116)[gtid_117731 *\n                                                                     n_114534 +\n                                                                     min_res_118331];\n        int64_t abs_arg_118346 = sub64(x_118345, min_res_118254);\n        int64_t abs_res_118347 = abs(abs_arg_118346);\n        int64_t max_res_118348 = smax64(abs_res_118340, abs_res_118347);\n        float defunc_0_f_res_118349 = sitofp_i64_f32(max_res_118348);\n        float defunc_1_f_res_118350 = max_res_118251 + defunc_0_f_res_118349;\n        \n        ((__global int64_t *) mem_130350)[gtid_117731 * l_n_m_114584 +\n                                          gtid_117732] = min_res_118331;\n        ((__global float *) mem_130354)[gtid_117731 * l_n_m_114584 +\n                                        gtid_117732] = defunc_1_f_res_118350;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_118237\n}\n__kernel void mainzisegmap_117859(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t l_jump_114542, int64_t l_n",
                   "_m_114584,\n                                  int64_t i_114610, int64_t min_res_114683,\n                                  __global\n                                  unsigned char *defunc_3_map_res_mem_130116,\n                                  __global\n                                  unsigned char *defunc_3_map_res_mem_130117,\n                                  __global unsigned char *mem_130326, __global\n                                  unsigned char *mem_130330, __global\n                                  unsigned char *mem_130333, __global\n                                  unsigned char *mem_130369, __global\n                                  unsigned char *mem_130380, __global\n                                  unsigned char *mem_130385, __global\n                                  unsigned char *mem_130389)\n{\n    #define segmap_group_sizze_118429 (mainzisegmap_group_sizze_117862)\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_132719;\n    int32_t local_tid_132720;\n    int64_t group_sizze_132723;\n    int32_t wave_sizze_132722;\n    int32_t group_tid_132721;\n    \n    global_tid_132719 = get_global_id(0);\n    local_tid_132720 = get_local_id(0);\n    group_sizze_132723 = get_local_size(0);\n    wave_sizze_132722 = LOCKSTEP_WIDTH;\n    group_tid_132721 = get_group_id(0);\n    \n    int32_t phys_tid_117859 = global_tid_132719;\n    int64_t global_tid_132724 = sext_i32_i64(group_tid_132721) *\n            segmap_group_sizze_118429 + sext_i32_i64(local_tid_132720);\n    int64_t slice_132725 = l_n_m_114584;\n    int64_t slice_132726 = m_114533 * slice_132725;\n    int64_t gtid_117857 = squot64(global_tid_132724, slice_132725);\n    int64_t remnant_132727 = global_tid_132724 - gtid_117857 * slice_132725;\n    int64_t gtid_117858 = remnant_132727;\n    int64_t remnant_132728 = remnant_132727 - gtid_117858;\n    \n    if (slt64(gtid_117857, m_114533) && slt64(gtid_11785",
                   "8, l_n_m_114584)) {\n        int64_t x_118434 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130117)[gtid_117857];\n        int64_t min_arg_118436 = ((__global int64_t *) mem_130330)[gtid_117857];\n        float max_res_118437 = ((__global float *) mem_130333)[gtid_117857];\n        int64_t binop_y_128747 = mul64(l_jump_114542, gtid_117858);\n        int64_t index_primexp_128748 = smin64(i_114610, binop_y_128747);\n        int64_t index_primexp_128744 = add64((int64_t) 1, index_primexp_128748);\n        int64_t max_res_118440 = ((__global int64_t *) mem_130369)[gtid_117857 *\n                                                                   l_n_m_114584 +\n                                                                   gtid_117858];\n        int64_t defunc_2_reduce_res_118441 = ((__global\n                                               int64_t *) mem_130380)[gtid_117857 *\n                                                                      l_n_m_114584 +\n                                                                      gtid_117858];\n        int64_t idx_118442;\n        int64_t idx_118443;\n        int64_t idx_118444;\n        int64_t idx_118445;\n        int64_t best_idx_118447;\n        int64_t last_idx_118448;\n        int64_t best_sum_118449;\n        int64_t curr_sum_118450;\n        \n        best_idx_118447 = max_res_118440;\n        last_idx_118448 = max_res_118440;\n        best_sum_118449 = defunc_2_reduce_res_118441;\n        curr_sum_118450 = defunc_2_reduce_res_118441;\n        for (int64_t j_118446 = 0; j_118446 < min_res_114683; j_118446++) {\n            int64_t new_idx_118451 = add64(max_res_118440, j_118446);\n            int64_t x_118452 = add64(min_res_114683, new_idx_118451);\n            bool cond_118453 = slt64(x_118434, x_118452);\n            int64_t new_sum_118454;\n            \n            if (cond_118453) {\n                new_sum_118454 = (int64_t) 9223372036854775807;\n            } else {\n                bool x_118455 = sle64((int",
                   "64_t) 0, last_idx_118448);\n                bool y_118456 = slt64(last_idx_118448, n_114534);\n                bool bounds_check_118457 = x_118455 && y_118456;\n                bool index_certs_118458;\n                \n                if (!bounds_check_118457) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 28) ==\n                            -1) {\n                            global_failure_args[0] = last_idx_118448;\n                            global_failure_args[1] = n_114534;\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                int64_t y_118459 = ((__global\n                                     int64_t *) mem_130326)[gtid_117857 *\n                                                            n_114534 +\n                                                            last_idx_118448];\n                int64_t binop_p_118460 = sub64(index_primexp_128744, y_118459);\n                int64_t defunc_0_f_res_118461 = abs(binop_p_118460);\n                int64_t x_118462 = sub64(curr_sum_118450,\n                                         defunc_0_f_res_118461);\n                int64_t min_arg_118463 = add64(min_res_114683, last_idx_118448);\n                int64_t min_res_118464 = smin64(i_114610, min_arg_118463);\n                bool x_118465 = sle64((int64_t) 0, min_res_118464);\n                bool y_118466 = slt64(min_res_118464, n_114534);\n                bool bounds_check_118467 = x_118465 && y_118466;\n                bool index_certs_118468;\n                \n                if (!bounds_check_118467) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 29) ==\n                            -1) {\n                            global_failure_args[0] = min_res_118464;\n                            global_failure_args[1] = n_114534;\n                            ;\n                        }\n   ",
                   "                     return;\n                    }\n                }\n                \n                int64_t y_118469 = ((__global\n                                     int64_t *) mem_130326)[gtid_117857 *\n                                                            n_114534 +\n                                                            min_res_118464];\n                int64_t binop_p_118470 = sub64(index_primexp_128744, y_118469);\n                int64_t defunc_0_f_res_118471 = abs(binop_p_118470);\n                int64_t new_sum_f_res_118472 = add64(x_118462,\n                                                     defunc_0_f_res_118471);\n                \n                new_sum_118454 = new_sum_f_res_118472;\n            }\n            \n            bool cond_118473 = sle64(new_sum_118454, best_sum_118449);\n            int64_t loopres_118474;\n            \n            if (cond_118473) {\n                loopres_118474 = new_idx_118451;\n            } else {\n                loopres_118474 = best_idx_118447;\n            }\n            \n            int64_t loopres_118475;\n            \n            if (cond_118473) {\n                loopres_118475 = new_sum_118454;\n            } else {\n                loopres_118475 = best_sum_118449;\n            }\n            \n            int64_t best_idx_tmp_132729 = loopres_118474;\n            int64_t last_idx_tmp_132730 = new_idx_118451;\n            int64_t best_sum_tmp_132731 = loopres_118475;\n            int64_t curr_sum_tmp_132732 = new_sum_118454;\n            \n            best_idx_118447 = best_idx_tmp_132729;\n            last_idx_118448 = last_idx_tmp_132730;\n            best_sum_118449 = best_sum_tmp_132731;\n            curr_sum_118450 = curr_sum_tmp_132732;\n        }\n        idx_118442 = best_idx_118447;\n        idx_118443 = last_idx_118448;\n        idx_118444 = best_sum_118449;\n        idx_118445 = curr_sum_118450;\n        \n        int64_t min_res_118476 = smin64(min_arg_118436, idx_118442);\n        int64_t x_118477 = add64(min_res_114",
                   "683, min_res_118476);\n        int64_t r_118478 = sub64(x_118477, (int64_t) 1);\n        bool x_118479 = sle64((int64_t) 0, r_118478);\n        bool y_118480 = slt64(r_118478, n_114534);\n        bool bounds_check_118481 = x_118479 && y_118480;\n        bool index_certs_118482;\n        \n        if (!bounds_check_118481) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 30) == -1) {\n                    global_failure_args[0] = r_118478;\n                    global_failure_args[1] = n_114534;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_118483 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130116)[gtid_117857 *\n                                                                     n_114534 +\n                                                                     r_118478];\n        int64_t abs_arg_118484 = sub64(x_118483, index_primexp_128748);\n        int64_t abs_res_118485 = abs(abs_arg_118484);\n        bool x_118486 = sle64((int64_t) 0, min_res_118476);\n        bool y_118487 = slt64(min_res_118476, n_114534);\n        bool bounds_check_118488 = x_118486 && y_118487;\n        bool index_certs_118489;\n        \n        if (!bounds_check_118488) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 31) == -1) {\n                    global_failure_args[0] = min_res_118476;\n                    global_failure_args[1] = n_114534;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_118490 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130116)[gtid_117857 *\n                                                                     n_114534 +\n                                                                     min_res_118476];\n        int64_t abs_arg_118491 = sub64(x_118490, index_primexp_128748);\n        int64_t abs_res_118492 = abs(abs_arg_118491);\n   ",
                   "     int64_t max_res_118493 = smax64(abs_res_118485, abs_res_118492);\n        float defunc_0_f_res_118494 = sitofp_i64_f32(max_res_118493);\n        float defunc_1_f_res_118495 = max_res_118437 + defunc_0_f_res_118494;\n        \n        ((__global float *) mem_130385)[gtid_117857 * l_n_m_114584 +\n                                        gtid_117858] = defunc_1_f_res_118495;\n        ((__global int64_t *) mem_130389)[gtid_117857 * l_n_m_114584 +\n                                          gtid_117858] = min_res_118476;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_118429\n}\n__kernel void mainzisegmap_117959(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t l_n_m_114584, int64_t min_res_114683,\n                                  __global unsigned char *mem_130326, __global\n                                  unsigned char *mem_130357, __global\n                                  unsigned char *mem_130369, __global\n                                  unsigned char *mem_130375)\n{\n    #define segmap_group_sizze_118400 (mainzisegmap_group_sizze_117963)\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_132639;\n    int32_t local_tid_132640;\n    int64_t group_sizze_132643;\n    int32_t wave_sizze_132642;\n    int32_t group_tid_132641;\n    \n    global_tid_132639 = get_global_id(0);\n    local_tid_132640 = get_local_id(0);\n    group_sizze_132643 = get_local_size(0);\n    wave_sizze_132642 = LOCKSTEP_WIDTH;\n    group_tid_132641 = get_group_id(0);\n    \n    int32_t phys_tid_117959 = global_tid_132639;\n    int64_t global_tid_132644 = sext_i32_i64(group_tid_132641) *\n            segmap_group_sizze_118400 + sext_i32_i64(local_tid_132640);\n    int64_t slice_132645 = min_res_114683;\n    int64_t slice_132646 = l_n_m_114584 * slice_132645;\n    int64_t slice_132647 = m_114533",
                   " * slice_132646;\n    int64_t gtid_117955 = squot64(global_tid_132644, slice_132646);\n    int64_t remnant_132648 = global_tid_132644 - gtid_117955 * slice_132646;\n    int64_t gtid_117956 = squot64(remnant_132648, slice_132645);\n    int64_t remnant_132649 = remnant_132648 - gtid_117956 * slice_132645;\n    int64_t gtid_slice_117954 = remnant_132649;\n    int64_t remnant_132650 = remnant_132649 - gtid_slice_117954;\n    \n    if ((slt64(gtid_117955, m_114533) && slt64(gtid_117956, l_n_m_114584)) &&\n        slt64(gtid_slice_117954, min_res_114683)) {\n        int64_t max_res_118406 = ((__global int64_t *) mem_130369)[gtid_117955 *\n                                                                   l_n_m_114584 +\n                                                                   gtid_117956];\n        bool index_certs_118407 = 0;\n        int64_t slice_118408 = gtid_slice_117954 + max_res_118406;\n        int64_t v_118409 = ((__global int64_t *) mem_130326)[gtid_117955 *\n                                                             n_114534 +\n                                                             slice_118408];\n        \n        ((__global int64_t *) mem_130375)[gtid_117955 * (min_res_114683 *\n                                                         l_n_m_114584) +\n                                          gtid_117956 * min_res_114683 +\n                                          gtid_slice_117954] = v_118409;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_118400\n}\n__kernel void mainzisegmap_117975(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t l_jump_114542, int64_t l_n_m_114584,\n                                  int64_t i_114610, unsigned char x_114611,\n                                  int64_t min_res_114683,\n                         ",
                   "         unsigned char empty_slice_114688,\n                                  int64_t m_114689, __global\n                                  unsigned char *mem_130322, __global\n                                  unsigned char *mem_130357, __global\n                                  unsigned char *mem_130361, __global\n                                  unsigned char *mem_130365, __global\n                                  unsigned char *mem_130369)\n{\n    #define segmap_group_sizze_118353 (mainzisegmap_group_sizze_117978)\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_132626;\n    int32_t local_tid_132627;\n    int64_t group_sizze_132630;\n    int32_t wave_sizze_132629;\n    int32_t group_tid_132628;\n    \n    global_tid_132626 = get_global_id(0);\n    local_tid_132627 = get_local_id(0);\n    group_sizze_132630 = get_local_size(0);\n    wave_sizze_132629 = LOCKSTEP_WIDTH;\n    group_tid_132628 = get_group_id(0);\n    \n    int32_t phys_tid_117975 = global_tid_132626;\n    int64_t global_tid_132631 = sext_i32_i64(group_tid_132628) *\n            segmap_group_sizze_118353 + sext_i32_i64(local_tid_132627);\n    int64_t slice_132632 = l_n_m_114584;\n    int64_t slice_132633 = m_114533 * slice_132632;\n    int64_t gtid_117973 = squot64(global_tid_132631, slice_132632);\n    int64_t remnant_132634 = global_tid_132631 - gtid_117973 * slice_132632;\n    int64_t gtid_117974 = remnant_132634;\n    int64_t remnant_132635 = remnant_132634 - gtid_117974;\n    \n    if (slt64(gtid_117973, m_114533) && slt64(gtid_117974, l_n_m_114584)) {\n        int64_t min_arg_118361 = mul64(l_jump_114542, gtid_117974);\n        int64_t min_res_118362 = smin64(i_114610, min_arg_118361);\n        int64_t defunc_0_g_res_118363 = add64((int64_t) 1, min_res_118362);\n        bool nearest_idx_118364;\n        int64_t nearest_idx_118365;\n        int64_t nearest_idx_118366;\n        bool loop_while_118367;\n      ",
                   "  int64_t low_118368;\n        int64_t high_118369;\n        \n        loop_while_118367 = x_114611;\n        low_118368 = (int64_t) 0;\n        high_118369 = i_114610;\n        while (loop_while_118367) {\n            int64_t x_118370 = add64(low_118368, high_118369);\n            int64_t mid_118371 = sdiv64(x_118370, (int64_t) 2);\n            bool x_118372 = sle64((int64_t) 0, mid_118371);\n            bool y_118373 = slt64(mid_118371, n_114534);\n            bool bounds_check_118374 = x_118372 && y_118373;\n            bool index_certs_118375;\n            \n            if (!bounds_check_118374) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 26) ==\n                        -1) {\n                        global_failure_args[0] = mid_118371;\n                        global_failure_args[1] = n_114534;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_118376 = ((__global int64_t *) mem_130322)[gtid_117973 *\n                                                                 n_114534 +\n                                                                 mid_118371];\n            bool cond_118377 = sle64(defunc_0_g_res_118363, x_118376);\n            int64_t loopres_118378;\n            int64_t loopres_118379;\n            \n            if (cond_118377) {\n                int64_t loopres_t_res_118380 = sub64(mid_118371, (int64_t) 1);\n                \n                loopres_118378 = low_118368;\n                loopres_118379 = loopres_t_res_118380;\n            } else {\n                int64_t loopres_f_res_118381 = add64((int64_t) 1, mid_118371);\n                \n                loopres_118378 = loopres_f_res_118381;\n                loopres_118379 = high_118369;\n            }\n            \n            bool loop_cond_118382 = sle64(loopres_118378, loopres_118379);\n            bool loop_while_tmp_132636 = loop_cond_118382;\n            int64_t low_tmp_132637 = loopres",
                   "_118378;\n            int64_t high_tmp_132638 = loopres_118379;\n            \n            loop_while_118367 = loop_while_tmp_132636;\n            low_118368 = low_tmp_132637;\n            high_118369 = high_tmp_132638;\n        }\n        nearest_idx_118364 = loop_while_118367;\n        nearest_idx_118365 = low_118368;\n        nearest_idx_118366 = high_118369;\n        \n        int64_t max_arg_118383 = sub64(nearest_idx_118365, min_res_114683);\n        int64_t max_res_118384 = smax64((int64_t) 0, max_arg_118383);\n        int64_t j_118385 = add64(min_res_114683, max_res_118384);\n        int64_t i_p_m_t_s_118386 = add64(m_114689, max_res_118384);\n        bool zzero_leq_i_p_m_t_s_118387 = sle64((int64_t) 0, i_p_m_t_s_118386);\n        bool i_p_m_t_s_leq_w_118388 = slt64(i_p_m_t_s_118386, n_114534);\n        bool zzero_lte_i_118389 = sle64((int64_t) 0, max_res_118384);\n        bool i_lte_j_118390 = sle64(max_res_118384, j_118385);\n        bool y_118391 = i_p_m_t_s_leq_w_118388 && zzero_lte_i_118389;\n        bool y_118392 = zzero_leq_i_p_m_t_s_118387 && y_118391;\n        bool y_118393 = i_lte_j_118390 && y_118392;\n        bool forwards_ok_118394 = zzero_lte_i_118389 && y_118393;\n        bool ok_or_empty_118395 = empty_slice_114688 || forwards_ok_118394;\n        bool index_certs_118396;\n        \n        if (!ok_or_empty_118395) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 27) == -1) {\n                    global_failure_args[0] = max_res_118384;\n                    global_failure_args[1] = j_118385;\n                    global_failure_args[2] = n_114534;\n                    ;\n                }\n                return;\n            }\n        }\n        ((__global int64_t *) mem_130361)[gtid_117973 * l_n_m_114584 +\n                                          gtid_117974] = min_res_118362;\n        ((__global int64_t *) mem_130365)[gtid_117973 * l_n_m_114584 +\n                                          gtid_117974] = defunc_0_g_res_118363;\n        ((__globa",
                   "l int64_t *) mem_130369)[gtid_117973 * l_n_m_114584 +\n                                          gtid_117974] = max_res_118384;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_118353\n}\n__kernel void mainzisegmap_118167(__global int *global_failure,\n                                  int64_t m_114533, int64_t min_res_114683,\n                                  float i64_res_114690, __global\n                                  unsigned char *defunc_3_map_res_mem_130117,\n                                  __global unsigned char *mem_130330, __global\n                                  unsigned char *mem_130333)\n{\n    #define segmap_group_sizze_118225 (mainzisegmap_group_sizze_118169)\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_132589;\n    int32_t local_tid_132590;\n    int64_t group_sizze_132593;\n    int32_t wave_sizze_132592;\n    int32_t group_tid_132591;\n    \n    global_tid_132589 = get_global_id(0);\n    local_tid_132590 = get_local_id(0);\n    group_sizze_132593 = get_local_size(0);\n    wave_sizze_132592 = LOCKSTEP_WIDTH;\n    group_tid_132591 = get_group_id(0);\n    \n    int32_t phys_tid_118167 = global_tid_132589;\n    int64_t global_tid_132594 = sext_i32_i64(group_tid_132591) *\n            segmap_group_sizze_118225 + sext_i32_i64(local_tid_132590);\n    int64_t slice_132595 = m_114533;\n    int64_t gtid_118166 = global_tid_132594;\n    int64_t remnant_132596 = global_tid_132594 - gtid_118166;\n    \n    if (slt64(gtid_118166, m_114533)) {\n        int64_t x_118229 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130117)[gtid_118166];\n        int64_t min_arg_118230 = sub64(x_118229, min_res_114683);\n        float i64_res_118231 = sitofp_i64_f32(x_118229);\n        float x_118232 = i64_res_114690 - i64_res_118231;\n        float max_arg_118233 = x_118232 / 2.0F;\n        float max_res_118234 = fmax32(0.0F, max_arg_11823",
                   "3);\n        \n        ((__global int64_t *) mem_130330)[gtid_118166] = min_arg_118230;\n        ((__global float *) mem_130333)[gtid_118166] = max_res_118234;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_118225\n}\n__kernel void mainzisegmap_118188(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534, __global\n                                  unsigned char *defunc_3_map_res_mem_130116,\n                                  __global unsigned char *mem_130322, __global\n                                  unsigned char *mem_130326)\n{\n    #define segmap_group_sizze_118214 (mainzisegmap_group_sizze_118191)\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_132579;\n    int32_t local_tid_132580;\n    int64_t group_sizze_132583;\n    int32_t wave_sizze_132582;\n    int32_t group_tid_132581;\n    \n    global_tid_132579 = get_global_id(0);\n    local_tid_132580 = get_local_id(0);\n    group_sizze_132583 = get_local_size(0);\n    wave_sizze_132582 = LOCKSTEP_WIDTH;\n    group_tid_132581 = get_group_id(0);\n    \n    int32_t phys_tid_118188 = global_tid_132579;\n    int64_t global_tid_132584 = sext_i32_i64(group_tid_132581) *\n            segmap_group_sizze_118214 + sext_i32_i64(local_tid_132580);\n    int64_t slice_132585 = n_114534;\n    int64_t slice_132586 = m_114533 * slice_132585;\n    int64_t gtid_118186 = squot64(global_tid_132584, slice_132585);\n    int64_t remnant_132587 = global_tid_132584 - gtid_118186 * slice_132585;\n    int64_t gtid_118187 = remnant_132587;\n    int64_t remnant_132588 = remnant_132587 - gtid_118187;\n    \n    if (slt64(gtid_118186, m_114533) && slt64(gtid_118187, n_114534)) {\n        int64_t x_118218 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130116)[gtid_118186 *\n                                                                     n_114534 +\n               ",
                   "                                                      gtid_118187];\n        int64_t defunc_0_f_res_118219 = add64((int64_t) 1, x_118218);\n        bool cond_118220 = slt64(defunc_0_f_res_118219, (int64_t) 0);\n        int64_t defunc_0_f_res_118221;\n        \n        if (cond_118220) {\n            defunc_0_f_res_118221 = (int64_t) 9223372036854775807;\n        } else {\n            defunc_0_f_res_118221 = defunc_0_f_res_118219;\n        }\n        ((__global int64_t *) mem_130322)[gtid_118186 * n_114534 +\n                                          gtid_118187] = defunc_0_f_res_118221;\n        ((__global int64_t *) mem_130326)[gtid_118186 * n_114534 +\n                                          gtid_118187] = defunc_0_f_res_118219;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_118214\n}\n__kernel void mainzisegmap_118650(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t t_jump_114541, int64_t t_n_m_114591,\n                                  int64_t i_114610, unsigned char x_114611,\n                                  int64_t min_res_114809,\n                                  unsigned char empty_slice_114814,\n                                  int64_t m_114815, float i64_res_114816,\n                                  int64_t num_groups_118773,\n                                  int64_t num_threads_132178, __global\n                                  unsigned char *defunc_3_map_res_mem_130116,\n                                  __global\n                                  unsigned char *defunc_3_map_res_mem_130117,\n                                  __global unsigned char *mem_130408, __global\n                                  unsigned char *mem_130472, __global\n                                  unsigned char *mem_130475, __global\n                         ",
                   "         unsigned char *color_132084, __global\n                                  unsigned char *color_132085, __global\n                                  unsigned char *color_132086, __global\n                                  unsigned char *color_132087)\n{\n    #define segmap_group_sizze_118772 (mainzisegmap_group_sizze_118652)\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_132738;\n    int32_t local_tid_132739;\n    int64_t group_sizze_132742;\n    int32_t wave_sizze_132741;\n    int32_t group_tid_132740;\n    \n    global_tid_132738 = get_global_id(0);\n    local_tid_132739 = get_local_id(0);\n    group_sizze_132742 = get_local_size(0);\n    wave_sizze_132741 = LOCKSTEP_WIDTH;\n    group_tid_132740 = get_group_id(0);\n    \n    int32_t phys_tid_118650 = global_tid_132738;\n    int32_t phys_group_id_132743;\n    \n    phys_group_id_132743 = get_group_id(0);\n    for (int32_t i_132744 = 0; i_132744 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533,\n                                          segmap_group_sizze_118772)) -\n                   phys_group_id_132743, sext_i64_i32(num_groups_118773));\n         i_132744++) {\n        int32_t virt_group_id_132745 = phys_group_id_132743 + i_132744 *\n                sext_i64_i32(num_groups_118773);\n        int64_t global_tid_132746 = sext_i32_i64(virt_group_id_132745) *\n                segmap_group_sizze_118772 + sext_i32_i64(local_tid_132739);\n        int64_t slice_132747 = m_114533;\n        int64_t gtid_118649 = global_tid_132746;\n        int64_t remnant_132748 = global_tid_132746 - gtid_118649;\n        \n        if (slt64(gtid_118649, m_114533)) {\n            int64_t x_118778 = ((__global\n                                 int64_t *) def",
                   "unc_3_map_res_mem_130117)[gtid_118649];\n            \n            for (int64_t i_129868 = 0; i_129868 < n_114534; i_129868++) {\n                int64_t x_118781 = ((__global int64_t *) mem_130408)[i_129868 *\n                                                                     m_114533 +\n                                                                     gtid_118649];\n                int64_t defunc_0_f_res_118782 = add64((int64_t) 1, x_118781);\n                bool cond_118783 = slt64(defunc_0_f_res_118782, (int64_t) 0);\n                int64_t defunc_0_f_res_118784;\n                \n                if (cond_118783) {\n                    defunc_0_f_res_118784 = (int64_t) 9223372036854775807;\n                } else {\n                    defunc_0_f_res_118784 = defunc_0_f_res_118782;\n                }\n                ((__global int64_t *) color_132087)[phys_tid_118650 + i_129868 *\n                                                    num_threads_132178] =\n                    defunc_0_f_res_118784;\n                ((__global int64_t *) color_132086)[phys_tid_118650 + i_129868 *\n                                                    num_threads_132178] =\n                    defunc_0_f_res_118782;\n            }\n            \n            int64_t min_arg_118785 = sub64(x_118778, min_res_114809);\n            float i64_res_118786 = sitofp_i64_f32(x_118778);\n            float x_118787 = i64_res_114816 - i64_res_118786;\n            float max_arg_118788 = x_118787 / 2.0F;\n            float max_res_118789 = fmax32(0.0F, max_arg_118788);\n            \n            for (int64_t i_129875 = 0; i_129875 < t_n_m_114591; i_129875++) {\n                int64_t min_arg_118793 = mul64(t_jump_114541, i_129875);\n                int64_t min_res_118794 = smin64(i_114610, min_arg_118793);\n                int64_t defunc_0_g_res_118795 = add64((int64_t) 1,\n                                                      min_res_118794);\n                bool nearest_idx_118796;\n                int64_t nearest_idx_118",
                   "797;\n                int64_t nearest_idx_118798;\n                bool loop_while_118799;\n                int64_t low_118800;\n                int64_t high_118801;\n                \n                loop_while_118799 = x_114611;\n                low_118800 = (int64_t) 0;\n                high_118801 = i_114610;\n                while (loop_while_118799) {\n                    int64_t x_118802 = add64(low_118800, high_118801);\n                    int64_t mid_118803 = sdiv64(x_118802, (int64_t) 2);\n                    bool x_118804 = sle64((int64_t) 0, mid_118803);\n                    bool y_118805 = slt64(mid_118803, n_114534);\n                    bool bounds_check_118806 = x_118804 && y_118805;\n                    bool index_certs_118807;\n                    \n                    if (!bounds_check_118806) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          32) == -1) {\n                                global_failure_args[0] = mid_118803;\n                                global_failure_args[1] = n_114534;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    int64_t x_118808 = ((__global\n                                         int64_t *) color_132087)[phys_tid_118650 +\n                                                                  mid_118803 *\n                                                                  num_threads_132178];\n                    bool cond_118809 = sle64(defunc_0_g_res_118795, x_118808);\n                    int64_t loopres_118810;\n                    int64_t loopres_118811;\n                    \n                    if (cond_118809) {\n                        int64_t loopres_t_res_118812 = sub64(mid_118803,\n                                                      ",
                   "       (int64_t) 1);\n                        \n                        loopres_118810 = low_118800;\n                        loopres_118811 = loopres_t_res_118812;\n                    } else {\n                        int64_t loopres_f_res_118813 = add64((int64_t) 1,\n                                                             mid_118803);\n                        \n                        loopres_118810 = loopres_f_res_118813;\n                        loopres_118811 = high_118801;\n                    }\n                    \n                    bool loop_cond_118814 = sle64(loopres_118810,\n                                                  loopres_118811);\n                    bool loop_while_tmp_132753 = loop_cond_118814;\n                    int64_t low_tmp_132754 = loopres_118810;\n                    int64_t high_tmp_132755 = loopres_118811;\n                    \n                    loop_while_118799 = loop_while_tmp_132753;\n                    low_118800 = low_tmp_132754;\n                    high_118801 = high_tmp_132755;\n                }\n                nearest_idx_118796 = loop_while_118799;\n                nearest_idx_118797 = low_118800;\n                nearest_idx_118798 = high_118801;\n                \n                int64_t max_arg_118815 = sub64(nearest_idx_118797,\n                                               min_res_114809);\n                int64_t max_res_118816 = smax64((int64_t) 0, max_arg_118815);\n                int64_t j_118817 = add64(min_res_114809, max_res_118816);\n                int64_t i_p_m_t_s_118818 = add64(m_114815, max_res_118816);\n                bool zzero_leq_i_p_m_t_s_118819 = sle64((int64_t) 0,\n                                                        i_p_m_t_s_118818);\n                bool i_p_m_t_s_leq_w_118820 = slt64(i_p_m_t_s_118818, n_114534);\n                bool zzero_lte_i_118821 = sle64((int64_t) 0, max_res_118816);\n                bool i_lte_j_118822 = sle64(max_res_118816, j_118817);\n                bool y_118823 = i_p_m_t_s_leq_",
                   "w_118820 && zzero_lte_i_118821;\n                bool y_118824 = zzero_leq_i_p_m_t_s_118819 && y_118823;\n                bool y_118825 = i_lte_j_118822 && y_118824;\n                bool forwards_ok_118826 = zzero_lte_i_118821 && y_118825;\n                bool ok_or_empty_118827 = empty_slice_114814 ||\n                     forwards_ok_118826;\n                bool index_certs_118828;\n                \n                if (!ok_or_empty_118827) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 33) ==\n                            -1) {\n                            global_failure_args[0] = max_res_118816;\n                            global_failure_args[1] = j_118817;\n                            global_failure_args[2] = n_114534;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t defunc_2_reduce_res_118830;\n                int64_t redout_129878 = (int64_t) 0;\n                \n                for (int64_t i_129879 = 0; i_129879 < min_res_114809;\n                     i_129879++) {\n                    int64_t slice_129991 = max_res_118816 + i_129879;\n                    int64_t x_118834 = ((__global\n                                         int64_t *) color_132086)[phys_tid_118650 +\n                                                                  slice_129991 *\n                                                                  num_threads_132178];\n                    int64_t abs_arg_118835 = sub64(x_118834,\n                                                   defunc_0_g_res_118795);\n                    int64_t abs_res_118836 = abs(abs_arg_118835);\n                    int64_t defunc_1_op_res_118833 = add64(abs_res_118836,\n                                                           redout_129878);\n                    int64_t redout_tmp_132756 = defunc_1_op_res_118833;\n    ",
                   "                \n                    redout_129878 = redout_tmp_132756;\n                }\n                defunc_2_reduce_res_118830 = redout_129878;\n                \n                int64_t idx_118837;\n                int64_t idx_118838;\n                int64_t idx_118839;\n                int64_t idx_118840;\n                int64_t best_idx_118842;\n                int64_t last_idx_118843;\n                int64_t best_sum_118844;\n                int64_t curr_sum_118845;\n                \n                best_idx_118842 = max_res_118816;\n                last_idx_118843 = max_res_118816;\n                best_sum_118844 = defunc_2_reduce_res_118830;\n                curr_sum_118845 = defunc_2_reduce_res_118830;\n                for (int64_t j_118841 = 0; j_118841 < min_res_114809;\n                     j_118841++) {\n                    int64_t new_idx_118846 = add64(max_res_118816, j_118841);\n                    int64_t x_118847 = add64(min_res_114809, new_idx_118846);\n                    bool cond_118848 = slt64(x_118778, x_118847);\n                    int64_t new_sum_118849;\n                    \n                    if (cond_118848) {\n                        new_sum_118849 = (int64_t) 9223372036854775807;\n                    } else {\n                        bool x_118850 = sle64((int64_t) 0, last_idx_118843);\n                        bool y_118851 = slt64(last_idx_118843, n_114534);\n                        bool bounds_check_118852 = x_118850 && y_118851;\n                        bool index_certs_118853;\n                        \n                        if (!bounds_check_118852) {\n                            {\n                                if (atomic_cmpxchg_i32_global(global_failure,\n                                                              -1, 34) == -1) {\n                                    global_failure_args[0] = last_idx_118843;\n                                    global_failure_args[1] = n_114534;\n                                    ;\n                            ",
                   "    }\n                                local_failure = true;\n                                goto error_0;\n                            }\n                        }\n                        \n                        int64_t y_118854 = ((__global\n                                             int64_t *) color_132086)[phys_tid_118650 +\n                                                                      last_idx_118843 *\n                                                                      num_threads_132178];\n                        int64_t binop_p_118855 = sub64(defunc_0_g_res_118795,\n                                                       y_118854);\n                        int64_t defunc_0_f_res_118856 = abs(binop_p_118855);\n                        int64_t x_118857 = sub64(curr_sum_118845,\n                                                 defunc_0_f_res_118856);\n                        int64_t min_arg_118858 = add64(min_res_114809,\n                                                       last_idx_118843);\n                        int64_t min_res_118859 = smin64(i_114610,\n                                                        min_arg_118858);\n                        bool x_118860 = sle64((int64_t) 0, min_res_118859);\n                        bool y_118861 = slt64(min_res_118859, n_114534);\n                        bool bounds_check_118862 = x_118860 && y_118861;\n                        bool index_certs_118863;\n                        \n                        if (!bounds_check_118862) {\n                            {\n                                if (atomic_cmpxchg_i32_global(global_failure,\n                                                              -1, 35) == -1) {\n                                    global_failure_args[0] = min_res_118859;\n                                    global_failure_args[1] = n_114534;\n                                    ;\n                                }\n                                local_failure = true;\n                                goto err",
                   "or_0;\n                            }\n                        }\n                        \n                        int64_t y_118864 = ((__global\n                                             int64_t *) color_132086)[phys_tid_118650 +\n                                                                      min_res_118859 *\n                                                                      num_threads_132178];\n                        int64_t binop_p_118865 = sub64(defunc_0_g_res_118795,\n                                                       y_118864);\n                        int64_t defunc_0_f_res_118866 = abs(binop_p_118865);\n                        int64_t new_sum_f_res_118867 = add64(x_118857,\n                                                             defunc_0_f_res_118866);\n                        \n                        new_sum_118849 = new_sum_f_res_118867;\n                    }\n                    \n                    bool cond_118868 = sle64(new_sum_118849, best_sum_118844);\n                    int64_t loopres_118869;\n                    \n                    if (cond_118868) {\n                        loopres_118869 = new_idx_118846;\n                    } else {\n                        loopres_118869 = best_idx_118842;\n                    }\n                    \n                    int64_t loopres_118870;\n                    \n                    if (cond_118868) {\n                        loopres_118870 = new_sum_118849;\n                    } else {\n                        loopres_118870 = best_sum_118844;\n                    }\n                    \n                    int64_t best_idx_tmp_132757 = loopres_118869;\n                    int64_t last_idx_tmp_132758 = new_idx_118846;\n                    int64_t best_sum_tmp_132759 = loopres_118870;\n                    int64_t curr_sum_tmp_132760 = new_sum_118849;\n                    \n                    best_idx_118842 = best_idx_tmp_132757;\n                    last_idx_118843 = last_idx_tmp_132758;\n                    b",
                   "est_sum_118844 = best_sum_tmp_132759;\n                    curr_sum_118845 = curr_sum_tmp_132760;\n                }\n                idx_118837 = best_idx_118842;\n                idx_118838 = last_idx_118843;\n                idx_118839 = best_sum_118844;\n                idx_118840 = curr_sum_118845;\n                \n                int64_t min_res_118871 = smin64(min_arg_118785, idx_118837);\n                int64_t x_118872 = add64(min_res_114809, min_res_118871);\n                int64_t r_118873 = sub64(x_118872, (int64_t) 1);\n                bool x_118874 = sle64((int64_t) 0, r_118873);\n                bool y_118875 = slt64(r_118873, n_114534);\n                bool bounds_check_118876 = x_118874 && y_118875;\n                bool index_certs_118877;\n                \n                if (!bounds_check_118876) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 36) ==\n                            -1) {\n                            global_failure_args[0] = r_118873;\n                            global_failure_args[1] = n_114534;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_118878 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130116)[gtid_118649 *\n                                                                             n_114534 +\n                                                                             r_118873];\n                int64_t abs_arg_118879 = sub64(x_118878, min_res_118794);\n                int64_t abs_res_118880 = abs(abs_arg_118879);\n                bool x_118881 = sle64((int64_t) 0, min_res_118871);\n                bool y_118882 = slt64(min_res_118871, n_114534);\n                bool bounds_check_118883 = x_118881 && y_118882;\n                bool index_certs_118884;\n                \n               ",
                   " if (!bounds_check_118883) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 37) ==\n                            -1) {\n                            global_failure_args[0] = min_res_118871;\n                            global_failure_args[1] = n_114534;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_0;\n                    }\n                }\n                \n                int64_t x_118885 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130116)[gtid_118649 *\n                                                                             n_114534 +\n                                                                             min_res_118871];\n                int64_t abs_arg_118886 = sub64(x_118885, min_res_118794);\n                int64_t abs_res_118887 = abs(abs_arg_118886);\n                int64_t max_res_118888 = smax64(abs_res_118880, abs_res_118887);\n                float defunc_0_f_res_118889 = sitofp_i64_f32(max_res_118888);\n                float defunc_1_f_res_118890 = max_res_118789 +\n                      defunc_0_f_res_118889;\n                \n                ((__global float *) color_132085)[phys_tid_118650 + i_129875 *\n                                                  num_threads_132178] =\n                    defunc_1_f_res_118890;\n                ((__global int64_t *) color_132084)[phys_tid_118650 + i_129875 *\n                                                    num_threads_132178] =\n                    min_res_118871;\n            }\n            for (int64_t i_132761 = 0; i_132761 < t_n_m_114591; i_132761++) {\n                ((__global int64_t *) mem_130472)[i_132761 * m_114533 +\n                                                  gtid_118649] = ((__global\n                                                                   int64_t *) color_132084)[phys_tid_118650 +\n                               ",
                   "                                                             i_132761 *\n                                                                                            num_threads_132178];\n            }\n            for (int64_t i_132762 = 0; i_132762 < t_n_m_114591; i_132762++) {\n                ((__global float *) mem_130475)[i_132762 * m_114533 +\n                                                gtid_118649] = ((__global\n                                                                 float *) color_132085)[phys_tid_118650 +\n                                                                                        i_132762 *\n                                                                                        num_threads_132178];\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_118772\n}\n__kernel void mainzisegmap_119033(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t t_jump_114541, int64_t t_n_m_114591,\n                                  int64_t i_114610, unsigned char x_114611,\n                                  int64_t min_res_114809,\n                                  unsigned char empty_slice_114814,\n                                  int64_t m_114815, int64_t padded_sizze_129119,\n                                  int64_t per_chunk_129121,\n                                  int64_t binop_y_130053, __global\n                                  unsigned char *defunc_3_map_res_mem_130116,\n                                  __global\n                                  unsigned char *defunc_3_map_res_mem_130117,\n                                  __global unsigned char *mem_130524, __global\n                                  unsigned char *mem_130528, __global\n   ",
                   "                               unsigned char *mem_130532, __global\n                                  unsigned char *mem_130535, __global\n                                  unsigned char *mem_130547, __global\n                                  unsigned char *mem_130552, __global\n                                  unsigned char *mem_130556)\n{\n    #define segmap_group_sizze_119537 (mainzisegmap_group_sizze_119036)\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_132826;\n    int32_t local_tid_132827;\n    int64_t group_sizze_132830;\n    int32_t wave_sizze_132829;\n    int32_t group_tid_132828;\n    \n    global_tid_132826 = get_global_id(0);\n    local_tid_132827 = get_local_id(0);\n    group_sizze_132830 = get_local_size(0);\n    wave_sizze_132829 = LOCKSTEP_WIDTH;\n    group_tid_132828 = get_group_id(0);\n    \n    int32_t phys_tid_119033 = global_tid_132826;\n    int64_t global_tid_132831 = sext_i32_i64(group_tid_132828) *\n            segmap_group_sizze_119537 + sext_i32_i64(local_tid_132827);\n    int64_t slice_132832 = t_n_m_114591;\n    int64_t slice_132833 = m_114533 * slice_132832;\n    int64_t gtid_119031 = squot64(global_tid_132831, slice_132832);\n    int64_t remnant_132834 = global_tid_132831 - gtid_119031 * slice_132832;\n    int64_t gtid_119032 = remnant_132834;\n    int64_t remnant_132835 = remnant_132834 - gtid_119032;\n    \n    if (slt64(gtid_119031, m_114533) && slt64(gtid_119032, t_n_m_114591)) {\n        int64_t x_119547 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130117)[gtid_119031];\n        int64_t min_arg_119550 = ((__global int64_t *) mem_130532)[gtid_119031];\n        float max_res_119551 = ((__global float *) mem_130535)[gtid_119031];\n        int64_t min_arg_119553 = mul64(t_jump_114541, gtid_119032);\n        int64_t min_res_119554 = smin64(i_114610, min_arg_119553);\n        int64_t defunc_0_g_res_119555 = add64((",
                   "int64_t) 1, min_res_119554);\n        bool nearest_idx_119556;\n        int64_t nearest_idx_119557;\n        int64_t nearest_idx_119558;\n        bool loop_while_119559;\n        int64_t low_119560;\n        int64_t high_119561;\n        \n        loop_while_119559 = x_114611;\n        low_119560 = (int64_t) 0;\n        high_119561 = i_114610;\n        while (loop_while_119559) {\n            int64_t x_119562 = add64(low_119560, high_119561);\n            int64_t mid_119563 = sdiv64(x_119562, (int64_t) 2);\n            bool x_119564 = sle64((int64_t) 0, mid_119563);\n            bool y_119565 = slt64(mid_119563, n_114534);\n            bool bounds_check_119566 = x_119564 && y_119565;\n            bool index_certs_119567;\n            \n            if (!bounds_check_119566) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 44) ==\n                        -1) {\n                        global_failure_args[0] = mid_119563;\n                        global_failure_args[1] = n_114534;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_119568 = ((__global int64_t *) mem_130524)[gtid_119031 *\n                                                                 n_114534 +\n                                                                 mid_119563];\n            bool cond_119569 = sle64(defunc_0_g_res_119555, x_119568);\n            int64_t loopres_119570;\n            int64_t loopres_119571;\n            \n            if (cond_119569) {\n                int64_t loopres_t_res_119572 = sub64(mid_119563, (int64_t) 1);\n                \n                loopres_119570 = low_119560;\n                loopres_119571 = loopres_t_res_119572;\n            } else {\n                int64_t loopres_f_res_119573 = add64((int64_t) 1, mid_119563);\n                \n                loopres_119570 = loopres_f_res_119573;\n                loopres_119571 = high_119561;\n            }\n            \n      ",
                   "      bool loop_cond_119574 = sle64(loopres_119570, loopres_119571);\n            bool loop_while_tmp_132836 = loop_cond_119574;\n            int64_t low_tmp_132837 = loopres_119570;\n            int64_t high_tmp_132838 = loopres_119571;\n            \n            loop_while_119559 = loop_while_tmp_132836;\n            low_119560 = low_tmp_132837;\n            high_119561 = high_tmp_132838;\n        }\n        nearest_idx_119556 = loop_while_119559;\n        nearest_idx_119557 = low_119560;\n        nearest_idx_119558 = high_119561;\n        \n        int64_t max_arg_119575 = sub64(nearest_idx_119557, min_res_114809);\n        int64_t max_res_119576 = smax64((int64_t) 0, max_arg_119575);\n        int64_t j_119577 = add64(min_res_114809, max_res_119576);\n        int64_t i_p_m_t_s_119578 = add64(m_114815, max_res_119576);\n        bool zzero_leq_i_p_m_t_s_119579 = sle64((int64_t) 0, i_p_m_t_s_119578);\n        bool i_p_m_t_s_leq_w_119580 = slt64(i_p_m_t_s_119578, n_114534);\n        bool zzero_lte_i_119581 = sle64((int64_t) 0, max_res_119576);\n        bool i_lte_j_119582 = sle64(max_res_119576, j_119577);\n        bool y_119583 = i_p_m_t_s_leq_w_119580 && zzero_lte_i_119581;\n        bool y_119584 = zzero_leq_i_p_m_t_s_119579 && y_119583;\n        bool y_119585 = i_lte_j_119582 && y_119584;\n        bool forwards_ok_119586 = zzero_lte_i_119581 && y_119585;\n        bool ok_or_empty_119587 = empty_slice_114814 || forwards_ok_119586;\n        bool index_certs_119588;\n        \n        if (!ok_or_empty_119587) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 45) == -1) {\n                    global_failure_args[0] = max_res_119576;\n                    global_failure_args[1] = j_119577;\n                    global_failure_args[2] = n_114534;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t binop_x_130051 = gtid_119031 * padded_sizze_129119;\n        int64_t defunc_2_reduce_res_119590;\n        int64_t red",
                   "out_129880 = (int64_t) 0;\n        \n        for (int64_t i_129881 = 0; i_129881 < min_res_114809; i_129881++) {\n            int64_t slice_129994 = max_res_119576 + i_129881;\n            int64_t binop_x_130052 = slice_129994 + binop_x_130051;\n            int64_t new_index_130054 = squot64(binop_x_130052, binop_y_130053);\n            int64_t binop_y_130062 = binop_y_130053 * new_index_130054;\n            int64_t binop_x_130063 = binop_x_130052 - binop_y_130062;\n            int64_t new_index_130064 = squot64(binop_x_130063,\n                                               per_chunk_129121);\n            int64_t binop_y_130084 = per_chunk_129121 * new_index_130064;\n            int64_t new_index_130085 = binop_x_130063 - binop_y_130084;\n            int64_t x_119594 = ((__global\n                                 int64_t *) mem_130547)[new_index_130054 *\n                                                        (t_n_m_114591 *\n                                                         per_chunk_129121) +\n                                                        new_index_130085 *\n                                                        t_n_m_114591 +\n                                                        new_index_130064];\n            int64_t abs_arg_119595 = sub64(x_119594, defunc_0_g_res_119555);\n            int64_t abs_res_119596 = abs(abs_arg_119595);\n            int64_t defunc_1_op_res_119593 = add64(abs_res_119596,\n                                                   redout_129880);\n            int64_t redout_tmp_132839 = defunc_1_op_res_119593;\n            \n            redout_129880 = redout_tmp_132839;\n        }\n        defunc_2_reduce_res_119590 = redout_129880;\n        \n        int64_t idx_119597;\n        int64_t idx_119598;\n        int64_t idx_119599;\n        int64_t idx_119600;\n        int64_t best_idx_119602;\n        int64_t last_idx_119603;\n        int64_t best_sum_119604;\n        int64_t curr_sum_119605;\n        \n        best_idx_119602 = max_res_119576;\n        last_idx",
                   "_119603 = max_res_119576;\n        best_sum_119604 = defunc_2_reduce_res_119590;\n        curr_sum_119605 = defunc_2_reduce_res_119590;\n        for (int64_t j_119601 = 0; j_119601 < min_res_114809; j_119601++) {\n            int64_t new_idx_119606 = add64(max_res_119576, j_119601);\n            int64_t x_119607 = add64(min_res_114809, new_idx_119606);\n            bool cond_119608 = slt64(x_119547, x_119607);\n            int64_t new_sum_119609;\n            \n            if (cond_119608) {\n                new_sum_119609 = (int64_t) 9223372036854775807;\n            } else {\n                bool x_119610 = sle64((int64_t) 0, last_idx_119603);\n                bool y_119611 = slt64(last_idx_119603, n_114534);\n                bool bounds_check_119612 = x_119610 && y_119611;\n                bool index_certs_119613;\n                \n                if (!bounds_check_119612) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 46) ==\n                            -1) {\n                            global_failure_args[0] = last_idx_119603;\n                            global_failure_args[1] = n_114534;\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                int64_t y_119614 = ((__global\n                                     int64_t *) mem_130528)[gtid_119031 *\n                                                            n_114534 +\n                                                            last_idx_119603];\n                int64_t binop_p_119615 = sub64(defunc_0_g_res_119555, y_119614);\n                int64_t defunc_0_f_res_119616 = abs(binop_p_119615);\n                int64_t x_119617 = sub64(curr_sum_119605,\n                                         defunc_0_f_res_119616);\n                int64_t min_arg_119618 = add64(min_res_114809, last_idx_119603);\n                int64_t min_res_119619 = smin64(i_114610, min_arg_119618);\n            ",
                   "    bool x_119620 = sle64((int64_t) 0, min_res_119619);\n                bool y_119621 = slt64(min_res_119619, n_114534);\n                bool bounds_check_119622 = x_119620 && y_119621;\n                bool index_certs_119623;\n                \n                if (!bounds_check_119622) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 47) ==\n                            -1) {\n                            global_failure_args[0] = min_res_119619;\n                            global_failure_args[1] = n_114534;\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                int64_t y_119624 = ((__global\n                                     int64_t *) mem_130528)[gtid_119031 *\n                                                            n_114534 +\n                                                            min_res_119619];\n                int64_t binop_p_119625 = sub64(defunc_0_g_res_119555, y_119624);\n                int64_t defunc_0_f_res_119626 = abs(binop_p_119625);\n                int64_t new_sum_f_res_119627 = add64(x_119617,\n                                                     defunc_0_f_res_119626);\n                \n                new_sum_119609 = new_sum_f_res_119627;\n            }\n            \n            bool cond_119628 = sle64(new_sum_119609, best_sum_119604);\n            int64_t loopres_119629;\n            \n            if (cond_119628) {\n                loopres_119629 = new_idx_119606;\n            } else {\n                loopres_119629 = best_idx_119602;\n            }\n            \n            int64_t loopres_119630;\n            \n            if (cond_119628) {\n                loopres_119630 = new_sum_119609;\n            } else {\n                loopres_119630 = best_sum_119604;\n            }\n            \n            int64_t best_idx_tmp_132840 = loopres_119629;\n            int64_t last_idx_tmp_132841 = new_idx_119606;\n",
                   "            int64_t best_sum_tmp_132842 = loopres_119630;\n            int64_t curr_sum_tmp_132843 = new_sum_119609;\n            \n            best_idx_119602 = best_idx_tmp_132840;\n            last_idx_119603 = last_idx_tmp_132841;\n            best_sum_119604 = best_sum_tmp_132842;\n            curr_sum_119605 = curr_sum_tmp_132843;\n        }\n        idx_119597 = best_idx_119602;\n        idx_119598 = last_idx_119603;\n        idx_119599 = best_sum_119604;\n        idx_119600 = curr_sum_119605;\n        \n        int64_t min_res_119631 = smin64(min_arg_119550, idx_119597);\n        int64_t x_119632 = add64(min_res_114809, min_res_119631);\n        int64_t r_119633 = sub64(x_119632, (int64_t) 1);\n        bool x_119634 = sle64((int64_t) 0, r_119633);\n        bool y_119635 = slt64(r_119633, n_114534);\n        bool bounds_check_119636 = x_119634 && y_119635;\n        bool index_certs_119637;\n        \n        if (!bounds_check_119636) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 48) == -1) {\n                    global_failure_args[0] = r_119633;\n                    global_failure_args[1] = n_114534;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_119638 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130116)[gtid_119031 *\n                                                                     n_114534 +\n                                                                     r_119633];\n        int64_t abs_arg_119639 = sub64(x_119638, min_res_119554);\n        int64_t abs_res_119640 = abs(abs_arg_119639);\n        bool x_119641 = sle64((int64_t) 0, min_res_119631);\n        bool y_119642 = slt64(min_res_119631, n_114534);\n        bool bounds_check_119643 = x_119641 && y_119642;\n        bool index_certs_119644;\n        \n        if (!bounds_check_119643) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 49) == -1) {\n                  ",
                   "  global_failure_args[0] = min_res_119631;\n                    global_failure_args[1] = n_114534;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_119645 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130116)[gtid_119031 *\n                                                                     n_114534 +\n                                                                     min_res_119631];\n        int64_t abs_arg_119646 = sub64(x_119645, min_res_119554);\n        int64_t abs_res_119647 = abs(abs_arg_119646);\n        int64_t max_res_119648 = smax64(abs_res_119640, abs_res_119647);\n        float defunc_0_f_res_119649 = sitofp_i64_f32(max_res_119648);\n        float defunc_1_f_res_119650 = max_res_119551 + defunc_0_f_res_119649;\n        \n        ((__global int64_t *) mem_130552)[gtid_119031 * t_n_m_114591 +\n                                          gtid_119032] = min_res_119631;\n        ((__global float *) mem_130556)[gtid_119031 * t_n_m_114591 +\n                                        gtid_119032] = defunc_1_f_res_119650;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_119537\n}\n__kernel void mainzisegmap_119159(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t t_jump_114541, int64_t t_n_m_114591,\n                                  int64_t i_114610, int64_t min_res_114809,\n                                  __global\n                                  unsigned char *defunc_3_map_res_mem_130116,\n                                  __global\n                                  unsigned char *defunc_3_map_res_mem_130117,\n                                  __global unsigned char *mem_130528, __global\n                                  unsigned char *mem_130532, ",
                   "__global\n                                  unsigned char *mem_130535, __global\n                                  unsigned char *mem_130571, __global\n                                  unsigned char *mem_130582, __global\n                                  unsigned char *mem_130587, __global\n                                  unsigned char *mem_130591)\n{\n    #define segmap_group_sizze_119729 (mainzisegmap_group_sizze_119162)\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_132937;\n    int32_t local_tid_132938;\n    int64_t group_sizze_132941;\n    int32_t wave_sizze_132940;\n    int32_t group_tid_132939;\n    \n    global_tid_132937 = get_global_id(0);\n    local_tid_132938 = get_local_id(0);\n    group_sizze_132941 = get_local_size(0);\n    wave_sizze_132940 = LOCKSTEP_WIDTH;\n    group_tid_132939 = get_group_id(0);\n    \n    int32_t phys_tid_119159 = global_tid_132937;\n    int64_t global_tid_132942 = sext_i32_i64(group_tid_132939) *\n            segmap_group_sizze_119729 + sext_i32_i64(local_tid_132938);\n    int64_t slice_132943 = t_n_m_114591;\n    int64_t slice_132944 = m_114533 * slice_132943;\n    int64_t gtid_119157 = squot64(global_tid_132942, slice_132943);\n    int64_t remnant_132945 = global_tid_132942 - gtid_119157 * slice_132943;\n    int64_t gtid_119158 = remnant_132945;\n    int64_t remnant_132946 = remnant_132945 - gtid_119158;\n    \n    if (slt64(gtid_119157, m_114533) && slt64(gtid_119158, t_n_m_114591)) {\n        int64_t x_119734 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130117)[gtid_119157];\n        int64_t min_arg_119736 = ((__global int64_t *) mem_130532)[gtid_119157];\n        float max_res_119737 = ((__global float *) mem_130535)[gtid_119157];\n        int64_t binop_y_128781 = mul64(t_jump_114541, gtid_119158);\n        int64_t index_primexp_128782 = smin64(i_114610, binop_y_128781);\n        int64_t index_primexp",
                   "_128778 = add64((int64_t) 1, index_primexp_128782);\n        int64_t max_res_119740 = ((__global int64_t *) mem_130571)[gtid_119157 *\n                                                                   t_n_m_114591 +\n                                                                   gtid_119158];\n        int64_t defunc_2_reduce_res_119741 = ((__global\n                                               int64_t *) mem_130582)[gtid_119157 *\n                                                                      t_n_m_114591 +\n                                                                      gtid_119158];\n        int64_t idx_119742;\n        int64_t idx_119743;\n        int64_t idx_119744;\n        int64_t idx_119745;\n        int64_t best_idx_119747;\n        int64_t last_idx_119748;\n        int64_t best_sum_119749;\n        int64_t curr_sum_119750;\n        \n        best_idx_119747 = max_res_119740;\n        last_idx_119748 = max_res_119740;\n        best_sum_119749 = defunc_2_reduce_res_119741;\n        curr_sum_119750 = defunc_2_reduce_res_119741;\n        for (int64_t j_119746 = 0; j_119746 < min_res_114809; j_119746++) {\n            int64_t new_idx_119751 = add64(max_res_119740, j_119746);\n            int64_t x_119752 = add64(min_res_114809, new_idx_119751);\n            bool cond_119753 = slt64(x_119734, x_119752);\n            int64_t new_sum_119754;\n            \n            if (cond_119753) {\n                new_sum_119754 = (int64_t) 9223372036854775807;\n            } else {\n                bool x_119755 = sle64((int64_t) 0, last_idx_119748);\n                bool y_119756 = slt64(last_idx_119748, n_114534);\n                bool bounds_check_119757 = x_119755 && y_119756;\n                bool index_certs_119758;\n                \n                if (!bounds_check_119757) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 52) ==\n                            -1) {\n                            global_failure_args[0] = last_idx_119748;\n  ",
                   "                          global_failure_args[1] = n_114534;\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                int64_t y_119759 = ((__global\n                                     int64_t *) mem_130528)[gtid_119157 *\n                                                            n_114534 +\n                                                            last_idx_119748];\n                int64_t binop_p_119760 = sub64(index_primexp_128778, y_119759);\n                int64_t defunc_0_f_res_119761 = abs(binop_p_119760);\n                int64_t x_119762 = sub64(curr_sum_119750,\n                                         defunc_0_f_res_119761);\n                int64_t min_arg_119763 = add64(min_res_114809, last_idx_119748);\n                int64_t min_res_119764 = smin64(i_114610, min_arg_119763);\n                bool x_119765 = sle64((int64_t) 0, min_res_119764);\n                bool y_119766 = slt64(min_res_119764, n_114534);\n                bool bounds_check_119767 = x_119765 && y_119766;\n                bool index_certs_119768;\n                \n                if (!bounds_check_119767) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 53) ==\n                            -1) {\n                            global_failure_args[0] = min_res_119764;\n                            global_failure_args[1] = n_114534;\n                            ;\n                        }\n                        return;\n                    }\n                }\n                \n                int64_t y_119769 = ((__global\n                                     int64_t *) mem_130528)[gtid_119157 *\n                                                            n_114534 +\n                                                            min_res_119764];\n                int64_t binop_p_119770 = sub64(index_primexp_128778, y_119769);\n                int64_t defunc_0_f_",
                   "res_119771 = abs(binop_p_119770);\n                int64_t new_sum_f_res_119772 = add64(x_119762,\n                                                     defunc_0_f_res_119771);\n                \n                new_sum_119754 = new_sum_f_res_119772;\n            }\n            \n            bool cond_119773 = sle64(new_sum_119754, best_sum_119749);\n            int64_t loopres_119774;\n            \n            if (cond_119773) {\n                loopres_119774 = new_idx_119751;\n            } else {\n                loopres_119774 = best_idx_119747;\n            }\n            \n            int64_t loopres_119775;\n            \n            if (cond_119773) {\n                loopres_119775 = new_sum_119754;\n            } else {\n                loopres_119775 = best_sum_119749;\n            }\n            \n            int64_t best_idx_tmp_132947 = loopres_119774;\n            int64_t last_idx_tmp_132948 = new_idx_119751;\n            int64_t best_sum_tmp_132949 = loopres_119775;\n            int64_t curr_sum_tmp_132950 = new_sum_119754;\n            \n            best_idx_119747 = best_idx_tmp_132947;\n            last_idx_119748 = last_idx_tmp_132948;\n            best_sum_119749 = best_sum_tmp_132949;\n            curr_sum_119750 = curr_sum_tmp_132950;\n        }\n        idx_119742 = best_idx_119747;\n        idx_119743 = last_idx_119748;\n        idx_119744 = best_sum_119749;\n        idx_119745 = curr_sum_119750;\n        \n        int64_t min_res_119776 = smin64(min_arg_119736, idx_119742);\n        int64_t x_119777 = add64(min_res_114809, min_res_119776);\n        int64_t r_119778 = sub64(x_119777, (int64_t) 1);\n        bool x_119779 = sle64((int64_t) 0, r_119778);\n        bool y_119780 = slt64(r_119778, n_114534);\n        bool bounds_check_119781 = x_119779 && y_119780;\n        bool index_certs_119782;\n        \n        if (!bounds_check_119781) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 54) == -1) {\n                    global_failure_args[0] = r_119778;\n  ",
                   "                  global_failure_args[1] = n_114534;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_119783 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130116)[gtid_119157 *\n                                                                     n_114534 +\n                                                                     r_119778];\n        int64_t abs_arg_119784 = sub64(x_119783, index_primexp_128782);\n        int64_t abs_res_119785 = abs(abs_arg_119784);\n        bool x_119786 = sle64((int64_t) 0, min_res_119776);\n        bool y_119787 = slt64(min_res_119776, n_114534);\n        bool bounds_check_119788 = x_119786 && y_119787;\n        bool index_certs_119789;\n        \n        if (!bounds_check_119788) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 55) == -1) {\n                    global_failure_args[0] = min_res_119776;\n                    global_failure_args[1] = n_114534;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        int64_t x_119790 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130116)[gtid_119157 *\n                                                                     n_114534 +\n                                                                     min_res_119776];\n        int64_t abs_arg_119791 = sub64(x_119790, index_primexp_128782);\n        int64_t abs_res_119792 = abs(abs_arg_119791);\n        int64_t max_res_119793 = smax64(abs_res_119785, abs_res_119792);\n        float defunc_0_f_res_119794 = sitofp_i64_f32(max_res_119793);\n        float defunc_1_f_res_119795 = max_res_119737 + defunc_0_f_res_119794;\n        \n        ((__global float *) mem_130587)[gtid_119157 * t_n_m_114591 +\n                                        gtid_119158] = defunc_1_f_res_119795;\n        ((__global int64_t *) mem_130591)[gtid_119157 * t_n_m_114591 +\n                        ",
                   "                  gtid_119158] = min_res_119776;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_119729\n}\n__kernel void mainzisegmap_119259(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t t_n_m_114591, int64_t min_res_114809,\n                                  __global unsigned char *mem_130528, __global\n                                  unsigned char *mem_130559, __global\n                                  unsigned char *mem_130571, __global\n                                  unsigned char *mem_130577)\n{\n    #define segmap_group_sizze_119700 (mainzisegmap_group_sizze_119263)\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_132857;\n    int32_t local_tid_132858;\n    int64_t group_sizze_132861;\n    int32_t wave_sizze_132860;\n    int32_t group_tid_132859;\n    \n    global_tid_132857 = get_global_id(0);\n    local_tid_132858 = get_local_id(0);\n    group_sizze_132861 = get_local_size(0);\n    wave_sizze_132860 = LOCKSTEP_WIDTH;\n    group_tid_132859 = get_group_id(0);\n    \n    int32_t phys_tid_119259 = global_tid_132857;\n    int64_t global_tid_132862 = sext_i32_i64(group_tid_132859) *\n            segmap_group_sizze_119700 + sext_i32_i64(local_tid_132858);\n    int64_t slice_132863 = min_res_114809;\n    int64_t slice_132864 = t_n_m_114591 * slice_132863;\n    int64_t slice_132865 = m_114533 * slice_132864;\n    int64_t gtid_119255 = squot64(global_tid_132862, slice_132864);\n    int64_t remnant_132866 = global_tid_132862 - gtid_119255 * slice_132864;\n    int64_t gtid_119256 = squot64(remnant_132866, slice_132863);\n    int64_t remnant_132867 = remnant_132866 - gtid_119256 * slice_132863;\n    int64_t gtid_slice_119254 = remnant_132867;\n    int64_t remnant_132868 = remnant_132867 - gtid_slice_119254;\n    \n    if ((slt64(gtid_119255, m_114533) && slt64(gti",
                   "d_119256, t_n_m_114591)) &&\n        slt64(gtid_slice_119254, min_res_114809)) {\n        int64_t max_res_119706 = ((__global int64_t *) mem_130571)[gtid_119255 *\n                                                                   t_n_m_114591 +\n                                                                   gtid_119256];\n        bool index_certs_119707 = 0;\n        int64_t slice_119708 = gtid_slice_119254 + max_res_119706;\n        int64_t v_119709 = ((__global int64_t *) mem_130528)[gtid_119255 *\n                                                             n_114534 +\n                                                             slice_119708];\n        \n        ((__global int64_t *) mem_130577)[gtid_119255 * (min_res_114809 *\n                                                         t_n_m_114591) +\n                                          gtid_119256 * min_res_114809 +\n                                          gtid_slice_119254] = v_119709;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_119700\n}\n__kernel void mainzisegmap_119275(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t t_jump_114541, int64_t t_n_m_114591,\n                                  int64_t i_114610, unsigned char x_114611,\n                                  int64_t min_res_114809,\n                                  unsigned char empty_slice_114814,\n                                  int64_t m_114815, __global\n                                  unsigned char *mem_130524, __global\n                                  unsigned char *mem_130559, __global\n                                  unsigned char *mem_130563, __global\n                                  unsigned char *mem_130567, __global\n                                  unsigned char *mem_130571)\n{\n    #define segmap_gro",
                   "up_sizze_119653 (mainzisegmap_group_sizze_119278)\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_132844;\n    int32_t local_tid_132845;\n    int64_t group_sizze_132848;\n    int32_t wave_sizze_132847;\n    int32_t group_tid_132846;\n    \n    global_tid_132844 = get_global_id(0);\n    local_tid_132845 = get_local_id(0);\n    group_sizze_132848 = get_local_size(0);\n    wave_sizze_132847 = LOCKSTEP_WIDTH;\n    group_tid_132846 = get_group_id(0);\n    \n    int32_t phys_tid_119275 = global_tid_132844;\n    int64_t global_tid_132849 = sext_i32_i64(group_tid_132846) *\n            segmap_group_sizze_119653 + sext_i32_i64(local_tid_132845);\n    int64_t slice_132850 = t_n_m_114591;\n    int64_t slice_132851 = m_114533 * slice_132850;\n    int64_t gtid_119273 = squot64(global_tid_132849, slice_132850);\n    int64_t remnant_132852 = global_tid_132849 - gtid_119273 * slice_132850;\n    int64_t gtid_119274 = remnant_132852;\n    int64_t remnant_132853 = remnant_132852 - gtid_119274;\n    \n    if (slt64(gtid_119273, m_114533) && slt64(gtid_119274, t_n_m_114591)) {\n        int64_t min_arg_119661 = mul64(t_jump_114541, gtid_119274);\n        int64_t min_res_119662 = smin64(i_114610, min_arg_119661);\n        int64_t defunc_0_g_res_119663 = add64((int64_t) 1, min_res_119662);\n        bool nearest_idx_119664;\n        int64_t nearest_idx_119665;\n        int64_t nearest_idx_119666;\n        bool loop_while_119667;\n        int64_t low_119668;\n        int64_t high_119669;\n        \n        loop_while_119667 = x_114611;\n        low_119668 = (int64_t) 0;\n        high_119669 = i_114610;\n        while (loop_while_119667) {\n            int64_t x_119670 = add64(low_119668, high_119669);\n            int64_t mid_119671 = sdiv64(x_119670, (int64_t) 2);\n            bool x_119672 = sle64((int64_t) 0, mid_119671);\n            bool y_119673 = slt64(mid_119671, n_114534);\n            bool bounds_c",
                   "heck_119674 = x_119672 && y_119673;\n            bool index_certs_119675;\n            \n            if (!bounds_check_119674) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 50) ==\n                        -1) {\n                        global_failure_args[0] = mid_119671;\n                        global_failure_args[1] = n_114534;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            int64_t x_119676 = ((__global int64_t *) mem_130524)[gtid_119273 *\n                                                                 n_114534 +\n                                                                 mid_119671];\n            bool cond_119677 = sle64(defunc_0_g_res_119663, x_119676);\n            int64_t loopres_119678;\n            int64_t loopres_119679;\n            \n            if (cond_119677) {\n                int64_t loopres_t_res_119680 = sub64(mid_119671, (int64_t) 1);\n                \n                loopres_119678 = low_119668;\n                loopres_119679 = loopres_t_res_119680;\n            } else {\n                int64_t loopres_f_res_119681 = add64((int64_t) 1, mid_119671);\n                \n                loopres_119678 = loopres_f_res_119681;\n                loopres_119679 = high_119669;\n            }\n            \n            bool loop_cond_119682 = sle64(loopres_119678, loopres_119679);\n            bool loop_while_tmp_132854 = loop_cond_119682;\n            int64_t low_tmp_132855 = loopres_119678;\n            int64_t high_tmp_132856 = loopres_119679;\n            \n            loop_while_119667 = loop_while_tmp_132854;\n            low_119668 = low_tmp_132855;\n            high_119669 = high_tmp_132856;\n        }\n        nearest_idx_119664 = loop_while_119667;\n        nearest_idx_119665 = low_119668;\n        nearest_idx_119666 = high_119669;\n        \n        int64_t max_arg_119683 = sub64(nearest_idx_119665, min_res_114809);\n        int64_t max_res_1196",
                   "84 = smax64((int64_t) 0, max_arg_119683);\n        int64_t j_119685 = add64(min_res_114809, max_res_119684);\n        int64_t i_p_m_t_s_119686 = add64(m_114815, max_res_119684);\n        bool zzero_leq_i_p_m_t_s_119687 = sle64((int64_t) 0, i_p_m_t_s_119686);\n        bool i_p_m_t_s_leq_w_119688 = slt64(i_p_m_t_s_119686, n_114534);\n        bool zzero_lte_i_119689 = sle64((int64_t) 0, max_res_119684);\n        bool i_lte_j_119690 = sle64(max_res_119684, j_119685);\n        bool y_119691 = i_p_m_t_s_leq_w_119688 && zzero_lte_i_119689;\n        bool y_119692 = zzero_leq_i_p_m_t_s_119687 && y_119691;\n        bool y_119693 = i_lte_j_119690 && y_119692;\n        bool forwards_ok_119694 = zzero_lte_i_119689 && y_119693;\n        bool ok_or_empty_119695 = empty_slice_114814 || forwards_ok_119694;\n        bool index_certs_119696;\n        \n        if (!ok_or_empty_119695) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 51) == -1) {\n                    global_failure_args[0] = max_res_119684;\n                    global_failure_args[1] = j_119685;\n                    global_failure_args[2] = n_114534;\n                    ;\n                }\n                return;\n            }\n        }\n        ((__global int64_t *) mem_130563)[gtid_119273 * t_n_m_114591 +\n                                          gtid_119274] = min_res_119662;\n        ((__global int64_t *) mem_130567)[gtid_119273 * t_n_m_114591 +\n                                          gtid_119274] = defunc_0_g_res_119663;\n        ((__global int64_t *) mem_130571)[gtid_119273 * t_n_m_114591 +\n                                          gtid_119274] = max_res_119684;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_119653\n}\n__kernel void mainzisegmap_119467(__global int *global_failure,\n                                  int64_t m_114533, int64_t min_res_114809,\n                                  float i64_res_114816, __global\n                                  unsigned char *defunc_3_map_re",
                   "s_mem_130117,\n                                  __global unsigned char *mem_130532, __global\n                                  unsigned char *mem_130535)\n{\n    #define segmap_group_sizze_119525 (mainzisegmap_group_sizze_119469)\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_132807;\n    int32_t local_tid_132808;\n    int64_t group_sizze_132811;\n    int32_t wave_sizze_132810;\n    int32_t group_tid_132809;\n    \n    global_tid_132807 = get_global_id(0);\n    local_tid_132808 = get_local_id(0);\n    group_sizze_132811 = get_local_size(0);\n    wave_sizze_132810 = LOCKSTEP_WIDTH;\n    group_tid_132809 = get_group_id(0);\n    \n    int32_t phys_tid_119467 = global_tid_132807;\n    int64_t global_tid_132812 = sext_i32_i64(group_tid_132809) *\n            segmap_group_sizze_119525 + sext_i32_i64(local_tid_132808);\n    int64_t slice_132813 = m_114533;\n    int64_t gtid_119466 = global_tid_132812;\n    int64_t remnant_132814 = global_tid_132812 - gtid_119466;\n    \n    if (slt64(gtid_119466, m_114533)) {\n        int64_t x_119529 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130117)[gtid_119466];\n        int64_t min_arg_119530 = sub64(x_119529, min_res_114809);\n        float i64_res_119531 = sitofp_i64_f32(x_119529);\n        float x_119532 = i64_res_114816 - i64_res_119531;\n        float max_arg_119533 = x_119532 / 2.0F;\n        float max_res_119534 = fmax32(0.0F, max_arg_119533);\n        \n        ((__global int64_t *) mem_130532)[gtid_119466] = min_arg_119530;\n        ((__global float *) mem_130535)[gtid_119466] = max_res_119534;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_119525\n}\n__kernel void mainzisegmap_119488(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534, __global\n                                  unsigned char *defunc_3_map_res_mem_130116,\n                  ",
                   "                __global unsigned char *mem_130524, __global\n                                  unsigned char *mem_130528)\n{\n    #define segmap_group_sizze_119514 (mainzisegmap_group_sizze_119491)\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_132797;\n    int32_t local_tid_132798;\n    int64_t group_sizze_132801;\n    int32_t wave_sizze_132800;\n    int32_t group_tid_132799;\n    \n    global_tid_132797 = get_global_id(0);\n    local_tid_132798 = get_local_id(0);\n    group_sizze_132801 = get_local_size(0);\n    wave_sizze_132800 = LOCKSTEP_WIDTH;\n    group_tid_132799 = get_group_id(0);\n    \n    int32_t phys_tid_119488 = global_tid_132797;\n    int64_t global_tid_132802 = sext_i32_i64(group_tid_132799) *\n            segmap_group_sizze_119514 + sext_i32_i64(local_tid_132798);\n    int64_t slice_132803 = n_114534;\n    int64_t slice_132804 = m_114533 * slice_132803;\n    int64_t gtid_119486 = squot64(global_tid_132802, slice_132803);\n    int64_t remnant_132805 = global_tid_132802 - gtid_119486 * slice_132803;\n    int64_t gtid_119487 = remnant_132805;\n    int64_t remnant_132806 = remnant_132805 - gtid_119487;\n    \n    if (slt64(gtid_119486, m_114533) && slt64(gtid_119487, n_114534)) {\n        int64_t x_119518 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130116)[gtid_119486 *\n                                                                     n_114534 +\n                                                                     gtid_119487];\n        int64_t defunc_0_f_res_119519 = add64((int64_t) 1, x_119518);\n        bool cond_119520 = slt64(defunc_0_f_res_119519, (int64_t) 0);\n        int64_t defunc_0_f_res_119521;\n        \n        if (cond_119520) {\n            defunc_0_f_res_119521 = (int64_t) 9223372036854775807;\n        } else {\n            defunc_0_f_res_119521 = defunc_0_f_res_119519;\n        }\n        ((__global int64_t *) mem",
                   "_130524)[gtid_119486 * n_114534 +\n                                          gtid_119487] = defunc_0_f_res_119521;\n        ((__global int64_t *) mem_130528)[gtid_119486 * n_114534 +\n                                          gtid_119487] = defunc_0_f_res_119519;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_119514\n}\n__kernel void mainzisegmap_119812(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t ctx_param_ext_130663, __global\n                                  unsigned char *Y_mem_130086, __global\n                                  unsigned char *mem_param_130667, __global\n                                  unsigned char *mem_130672)\n{\n    #define segmap_group_sizze_119835 (mainzisegmap_group_sizze_119815)\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_132993;\n    int32_t local_tid_132994;\n    int64_t group_sizze_132997;\n    int32_t wave_sizze_132996;\n    int32_t group_tid_132995;\n    \n    global_tid_132993 = get_global_id(0);\n    local_tid_132994 = get_local_id(0);\n    group_sizze_132997 = get_local_size(0);\n    wave_sizze_132996 = LOCKSTEP_WIDTH;\n    group_tid_132995 = get_group_id(0);\n    \n    int32_t phys_tid_119812 = global_tid_132993;\n    int64_t global_tid_132998 = sext_i32_i64(group_tid_132995) *\n            segmap_group_sizze_119835 + sext_i32_i64(local_tid_132994);\n    int64_t slice_132999 = n_114534;\n    int64_t slice_133000 = m_114533 * slice_132999;\n    int64_t gtid_119810 = squot64(global_tid_132998, slice_132999);\n    int64_t remnant_133001 = global_tid_132998 - gtid_119810 * slice_132999;\n    int64_t gtid_119811 = remnant_133001;\n    int64_t remnant_133002 = remnant_133001 - gtid_119811;\n    \n    if (slt64(gtid_119810, m_114533) && slt64(gtid_119811, n_114534)) {\n        float x_119838 = ((__global float *) Y_mem_130086",
                   ")[gtid_119810 *\n                                                           n_114534 +\n                                                           gtid_119811];\n        float x_119839 = ((__global float *) mem_param_130667)[gtid_119810 *\n                                                               ctx_param_ext_130663 +\n                                                               gtid_119811];\n        float defunc_1_f_res_119840 = x_119838 - x_119839;\n        \n        ((__global float *) mem_130672)[gtid_119810 * n_114534 + gtid_119811] =\n            defunc_1_f_res_119840;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_119835\n}\n__kernel void mainzisegmap_119845(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t n_p_114536,\n                                  int64_t css_chunk_len_114580,\n                                  int64_t num_groups_119873,\n                                  int64_t num_threads_132192, __global\n                                  unsigned char *mem_130127, __global\n                                  unsigned char *mem_130618, __global\n                                  unsigned char *mem_130675, __global\n                                  unsigned char *mem_130694, __global\n                                  unsigned char *color_132098)\n{\n    #define segmap_group_sizze_119872 (mainzisegmap_group_sizze_119847)\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_133003;\n    int32_t local_tid_133004;\n    int64_t g",
                   "roup_sizze_133007;\n    int32_t wave_sizze_133006;\n    int32_t group_tid_133005;\n    \n    global_tid_133003 = get_global_id(0);\n    local_tid_133004 = get_local_id(0);\n    group_sizze_133007 = get_local_size(0);\n    wave_sizze_133006 = LOCKSTEP_WIDTH;\n    group_tid_133005 = get_group_id(0);\n    \n    int32_t phys_tid_119845 = global_tid_133003;\n    int32_t phys_group_id_133008;\n    \n    phys_group_id_133008 = get_group_id(0);\n    for (int32_t i_133009 = 0; i_133009 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533,\n                                          segmap_group_sizze_119872)) -\n                   phys_group_id_133008, sext_i64_i32(num_groups_119873));\n         i_133009++) {\n        int32_t virt_group_id_133010 = phys_group_id_133008 + i_133009 *\n                sext_i64_i32(num_groups_119873);\n        int64_t global_tid_133011 = sext_i32_i64(virt_group_id_133010) *\n                segmap_group_sizze_119872 + sext_i32_i64(local_tid_133004);\n        int64_t slice_133012 = m_114533;\n        int64_t gtid_119844 = global_tid_133011;\n        int64_t remnant_133013 = global_tid_133011 - gtid_119844;\n        \n        if (slt64(gtid_119844, m_114533)) {\n            for (int64_t i_129884 = 0; i_129884 < n_p_114536; i_129884++) {\n                float x_119880 = ((__global float *) mem_130618)[i_129884 *\n                                                                 m_114533 +\n                                                                 gtid_119844];\n                float defunc_2_reduce_res_119881;\n                float redout_129886 = 0.0F;\n                \n                for (int64_t i_129887 = 0; i_129887 < css_chunk_len_114580;\n                     i_129887++) {\n                    int64_t x_119885 = ((__global\n                                         int64_t *) mem_130127)[i_129884 *\n                                                                css_chunk_len_114580 +\n                                                                i_129887];\n            ",
                   "        bool cond_119886 = sle64((int64_t) 0, x_119885);\n                    float defunc_0_f_res_119887;\n                    \n                    if (cond_119886) {\n                        bool y_119888 = slt64(x_119885, n_114534);\n                        bool bounds_check_119889 = cond_119886 && y_119888;\n                        bool index_certs_119890;\n                        \n                        if (!bounds_check_119889) {\n                            {\n                                if (atomic_cmpxchg_i32_global(global_failure,\n                                                              -1, 56) == -1) {\n                                    global_failure_args[0] = x_119885;\n                                    global_failure_args[1] = n_114534;\n                                    ;\n                                }\n                                local_failure = true;\n                                goto error_0;\n                            }\n                        }\n                        \n                        float defunc_0_f_res_t_res_119891 = ((__global\n                                                              float *) mem_130675)[x_119885 *\n                                                                                   m_114533 +\n                                                                                   gtid_119844];\n                        \n                        defunc_0_f_res_119887 = defunc_0_f_res_t_res_119891;\n                    } else {\n                        defunc_0_f_res_119887 = NAN;\n                    }\n                    \n                    bool isnan_res_119892;\n                    \n                    isnan_res_119892 = futrts_isnan32(defunc_0_f_res_119887);\n                    \n                    float defunc_0_f_res_119893;\n                    \n                    if (isnan_res_119892) {\n                        defunc_0_f_res_119893 = 0.0F;\n                    } else {\n                        defunc_0_f_res_1",
                   "19893 = defunc_0_f_res_119887;\n                    }\n                    \n                    float defunc_1_op_res_119884 = defunc_0_f_res_119893 +\n                          redout_129886;\n                    float redout_tmp_133015 = defunc_1_op_res_119884;\n                    \n                    redout_129886 = redout_tmp_133015;\n                }\n                defunc_2_reduce_res_119881 = redout_129886;\n                \n                float defunc_1_f_res_119894 = defunc_2_reduce_res_119881 /\n                      x_119880;\n                \n                ((__global float *) color_132098)[phys_tid_119845 + i_129884 *\n                                                  num_threads_132192] =\n                    defunc_1_f_res_119894;\n            }\n            for (int64_t i_133016 = 0; i_133016 < n_p_114536; i_133016++) {\n                ((__global float *) mem_130694)[i_133016 * m_114533 +\n                                                gtid_119844] = ((__global\n                                                                 float *) color_132098)[phys_tid_119845 +\n                                                                                        i_133016 *\n                                                                                        num_threads_132192];\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_119872\n}\n__kernel void mainzisegmap_119928(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_p_114536, __global\n                                  unsigned char *defunc_3_map_res_mem_130203,\n                                  __global unsigned char *mem_130733, __global\n                                  unsigned char *mem_130738)\n{\n    #define segmap_group_sizze_120042 (mainzisegmap_group_sizze_119931)\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_133102;\n    int32_t local_tid_133103;\n    int64_t group_sizze_133106;\n    int32_t wave_sizze_133105;\n    int32_t group_tid_133104;\n    \n    global_tid_133102 = get_global_id(0);\n    local_tid_133103 = get_local_id(0);\n    group_sizze_133106 = get_local_size(0);\n    wave_sizze_133105 = LOCKSTEP_WIDTH;\n    group_tid_133104 = get_group_id(0);\n    \n    int32_t phys_tid_119928 = global_tid_133102;\n    int64_t global_tid_133107 = sext_i32_i64(group_tid_133104) *\n            segmap_group_sizze_120042 + sext_i32_i64(local_tid_133103);\n    int64_t slice_133108 = n_p_114536;\n    int64_t slice_133109 = m_114533 * slice_133108;\n    int64_t gtid_119926 = squot64(global_tid_133107, slice_133108);\n    int64_t remnant_133110 = global_tid_133107 - gtid_119926 * slice_133108;\n    int64_t gtid_119927 = remnant_133110;\n    int64_t remnant_133111 = remnant_133110 - gtid_119927;\n    \n    if (slt64(gtid_119926, m_114533) && slt64(gtid_119927, n_p_114536)) {\n        float x_120045 = ((__global\n                           float *) defunc_3_map_res_mem_130203)[gtid_119926 *\n                                                                 n_p_114536 +\n                                                                 gtid_119927];\n        float defunc_2_reduce_res_120046 = ((__global\n                                             float *) mem_130733)[gtid_119926 *\n                                                                  n_p_114536 +\n                                                                  gtid_119927];\n        float defunc_1_f_res_120047 = defunc_2_reduce_res_120046 / x_120045;\n        \n        ((__global float *) mem_130738)[gtid_119926 * n_p_114536 +\n                                        gtid_119927] = defunc_1_f_res_120047;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_120042\n}\n__kernel void mainzisegmap_120060(__global int *global_failure,\n                                  int failure_is_an_",
                   "option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t m_114533, int64_t n_p_114536,\n                                  int64_t C_len_114582, __global\n                                  unsigned char *defunc_4_map_res_mem_130745,\n                                  __global unsigned char *mem_130750)\n{\n    #define segmap_group_sizze_120093 (mainzisegmap_group_sizze_120063)\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_133114;\n    int32_t local_tid_133115;\n    int64_t group_sizze_133118;\n    int32_t wave_sizze_133117;\n    int32_t group_tid_133116;\n    \n    global_tid_133114 = get_global_id(0);\n    local_tid_133115 = get_local_id(0);\n    group_sizze_133118 = get_local_size(0);\n    wave_sizze_133117 = LOCKSTEP_WIDTH;\n    group_tid_133116 = get_group_id(0);\n    \n    int32_t phys_tid_120060 = global_tid_133114;\n    int64_t global_tid_133119 = sext_i32_i64(group_tid_133116) *\n            segmap_group_sizze_120093 + sext_i32_i64(local_tid_133115);\n    int64_t slice_133120 = C_len_114582;\n    int64_t slice_133121 = m_114533 * slice_133120;\n    int64_t gtid_120058 = squot64(global_tid_133119, slice_133120);\n    int64_t remnant_133122 = global_tid_133119 - gtid_120058 * slice_133120;\n    int64_t gtid_120059 = remnant_133122;\n    int64_t remnant_133123 = remnant_133122 - gtid_120059;\n    \n    if (slt64(gtid_120058, m_114533) && slt64(gtid_120059, C_len_114582)) {\n        int64_t i_120098 = smod64(gtid_120059, n_p_114536);\n        bool x_120099 = sle64((int64_t) 0, i_120098);\n        bool y_120100 = slt64(i_120098, n_p_114536);\n        bool bounds_check_120101 = x_120099 && y_120100;\n        bool index_certs_120102;\n        \n        if (!bounds_check_120101) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 61) == -1) {\n                    global_failure_arg",
                   "s[0] = i_120098;\n                    global_failure_args[1] = n_p_114536;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        float defunc_0_f_res_120103 = ((__global\n                                        float *) defunc_4_map_res_mem_130745)[gtid_120058 *\n                                                                              n_p_114536 +\n                                                                              i_120098];\n        \n        ((__global float *) mem_130750)[gtid_120058 * C_len_114582 +\n                                        gtid_120059] = defunc_0_f_res_120103;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_120093\n}\n__kernel void mainzisegmap_120133(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t n_p_114536, float i64_res_114576,\n                                  int64_t C_len_114582,\n                                  int64_t lifted_single_ma_arg_114959,\n                                  int64_t lifted_single_ma_arg_114976,\n                                  int64_t num_groups_120230,\n                                  int64_t num_threads_132198, __global\n                                  unsigned char *mem_130753, __global\n                                  unsigned char *mem_130802, __global\n                                  unsigned char *color_132104, __global\n                                  unsigned char *color_132105)\n{\n    #define segmap_group_sizze_120229 (mainzisegmap_group_sizze_120135)\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_133124;\n    int32_t local_tid_133125;\n    int64_t group_sizze_133128;\n    int32_t wave_sizze_133127;\n    int32_t group_tid_133126;\n    \n    global_tid_133124 = get_global_id(0);\n    local_tid_133125 = get_local_id(0);\n    group_sizze_133128 = get_local_size(0);\n    wave_sizze_133127 = LOCKSTEP_WIDTH;\n    group_tid_133126 = get_group_id(0);\n    \n    int32_t phys_tid_120133 = global_tid_133124;\n    int32_t phys_group_id_133129;\n    \n    phys_group_id_133129 = get_group_id(0);\n    for (int32_t i_133130 = 0; i_133130 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533,\n                                          segmap_group_sizze_120229)) -\n                   phys_group_id_133129, sext_i64_i32(num_groups_120230));\n         i_133130++) {\n        int32_t virt_group_id_133131 = phys_group_id_133129 + i_133130 *\n                sext_i64_i32(num_groups_120230);\n        int64_t global_tid_133132 = sext_i32_i64(virt_group_id_133131) *\n                segmap_group_sizze_120229 + sext_i32_i64(local_tid_133125);\n        int64_t slice_133133 = m_114533;\n        int64_t gtid_120132 = global_tid_133132;\n        int64_t remnant_133134 = global_tid_133132 - gtid_120132;\n        \n        if (slt64(gtid_120132, m_114533)) {\n            float defunc_2_reduce_res_120235;\n            float redout_129892 = 0.0F;\n            \n            for (int64_t i_129893 = 0; i_129893 < n_p_114536; i_129893++) {\n                float x_120239 = ((__global float *) mem_130753)[i_129893 *\n                                                                 m_114533 +\n                                                                 gtid_120132];\n                float defunc_1_op_res_120238 = x_120239 + redout_129892;\n                float redout_tmp_133135 = defunc_1_op_res_120238;\n                \n                redout_129892 = redout_tmp_133135;\n            }\n            defunc_2_reduce_res_120235 = redout",
                   "_129892;\n            \n            float discard_129899;\n            float scanacc_129895 = 0.0F;\n            \n            for (int64_t i_129897 = 0; i_129897 < lifted_single_ma_arg_114959;\n                 i_129897++) {\n                bool cond_120245 = i_129897 == (int64_t) 0;\n                float defunc_0_f_res_120246;\n                \n                if (cond_120245) {\n                    float defunc_0_f_res_t_res_120247 =\n                          defunc_2_reduce_res_120235 / i64_res_114576;\n                    \n                    defunc_0_f_res_120246 = defunc_0_f_res_t_res_120247;\n                } else {\n                    int64_t x_120248 = add64(n_p_114536, i_129897);\n                    int64_t i_120249 = sub64(x_120248, (int64_t) 1);\n                    bool x_120250 = sle64((int64_t) 0, i_120249);\n                    bool y_120251 = slt64(i_120249, C_len_114582);\n                    bool bounds_check_120252 = x_120250 && y_120251;\n                    bool index_certs_120253;\n                    \n                    if (!bounds_check_120252) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          62) == -1) {\n                                global_failure_args[0] = i_120249;\n                                global_failure_args[1] = C_len_114582;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    float x_120254 = ((__global float *) mem_130753)[i_120249 *\n                                                                     m_114533 +\n                                                                     gtid_120132];\n                    int64_t i_120255 = sub64(i_129897, (int64_t) 1);\n                    bool x_120256 = sle64((int64_t) 0, i_120255);\n        ",
                   "            bool y_120257 = slt64(i_120255, C_len_114582);\n                    bool bounds_check_120258 = x_120256 && y_120257;\n                    bool index_certs_120259;\n                    \n                    if (!bounds_check_120258) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          63) == -1) {\n                                global_failure_args[0] = i_120255;\n                                global_failure_args[1] = C_len_114582;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    float y_120260 = ((__global float *) mem_130753)[i_120255 *\n                                                                     m_114533 +\n                                                                     gtid_120132];\n                    float x_120261 = x_120254 - y_120260;\n                    float defunc_0_f_res_f_res_120262 = x_120261 /\n                          i64_res_114576;\n                    \n                    defunc_0_f_res_120246 = defunc_0_f_res_f_res_120262;\n                }\n                \n                float defunc_1_op_res_120243 = defunc_0_f_res_120246 +\n                      scanacc_129895;\n                \n                ((__global float *) color_132104)[phys_tid_120133 + i_129897 *\n                                                  num_threads_132198] =\n                    defunc_1_op_res_120243;\n                \n                float scanacc_tmp_133136 = defunc_1_op_res_120243;\n                \n                scanacc_129895 = scanacc_tmp_133136;\n            }\n            discard_129899 = scanacc_129895;\n            \n            float defunc_2_reduce_res_120264;\n            float redout_129900 = 0.0F;\n            \n            for (int64_t i_129901 =",
                   " 0; i_129901 < n_p_114536; i_129901++) {\n                float x_120268 = ((__global\n                                   float *) color_132104)[phys_tid_120133 +\n                                                          i_129901 *\n                                                          num_threads_132198];\n                float defunc_1_op_res_120267 = x_120268 + redout_129900;\n                float redout_tmp_133138 = defunc_1_op_res_120267;\n                \n                redout_129900 = redout_tmp_133138;\n            }\n            defunc_2_reduce_res_120264 = redout_129900;\n            \n            float discard_129907;\n            float scanacc_129903 = 0.0F;\n            \n            for (int64_t i_129905 = 0; i_129905 < lifted_single_ma_arg_114976;\n                 i_129905++) {\n                bool cond_120274 = i_129905 == (int64_t) 0;\n                float defunc_0_f_res_120275;\n                \n                if (cond_120274) {\n                    float defunc_0_f_res_t_res_120276 =\n                          defunc_2_reduce_res_120264 / i64_res_114576;\n                    \n                    defunc_0_f_res_120275 = defunc_0_f_res_t_res_120276;\n                } else {\n                    int64_t x_120277 = add64(n_p_114536, i_129905);\n                    int64_t i_120278 = sub64(x_120277, (int64_t) 1);\n                    bool x_120279 = sle64((int64_t) 0, i_120278);\n                    bool y_120280 = slt64(i_120278,\n                                          lifted_single_ma_arg_114959);\n                    bool bounds_check_120281 = x_120279 && y_120280;\n                    bool index_certs_120282;\n                    \n                    if (!bounds_check_120281) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          64) == -1) {\n                                global_failure_args[0] = i_120278;\n                                global_failure_a",
                   "rgs[1] =\n                                    lifted_single_ma_arg_114959;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    float x_120283 = ((__global\n                                       float *) color_132104)[phys_tid_120133 +\n                                                              i_120278 *\n                                                              num_threads_132198];\n                    int64_t i_120284 = sub64(i_129905, (int64_t) 1);\n                    bool x_120285 = sle64((int64_t) 0, i_120284);\n                    bool y_120286 = slt64(i_120284,\n                                          lifted_single_ma_arg_114959);\n                    bool bounds_check_120287 = x_120285 && y_120286;\n                    bool index_certs_120288;\n                    \n                    if (!bounds_check_120287) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          65) == -1) {\n                                global_failure_args[0] = i_120284;\n                                global_failure_args[1] =\n                                    lifted_single_ma_arg_114959;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    float y_120289 = ((__global\n                                       float *) color_132104)[phys_tid_120133 +\n                                                              i_120284 *\n                                                              num_threads_132198];\n                    float x_120290 = x_120283 - y_120289;\n                    float defunc_0_f_res_f_r",
                   "es_120291 = x_120290 /\n                          i64_res_114576;\n                    \n                    defunc_0_f_res_120275 = defunc_0_f_res_f_res_120291;\n                }\n                \n                float defunc_1_op_res_120272 = defunc_0_f_res_120275 +\n                      scanacc_129903;\n                \n                ((__global float *) color_132105)[phys_tid_120133 + i_129905 *\n                                                  num_threads_132198] =\n                    defunc_1_op_res_120272;\n                \n                float scanacc_tmp_133139 = defunc_1_op_res_120272;\n                \n                scanacc_129903 = scanacc_tmp_133139;\n            }\n            discard_129907 = scanacc_129903;\n            \n            float defunc_2_reduce_res_120293;\n            float redout_129908 = 0.0F;\n            \n            for (int32_t i_129999 = 0; i_129999 < 3; i_129999++) {\n                int64_t i_129909 = sext_i32_i64(i_129999);\n                float x_120297 = ((__global\n                                   float *) color_132105)[phys_tid_120133 +\n                                                          i_129909 *\n                                                          num_threads_132198];\n                float defunc_1_op_res_120296 = x_120297 + redout_129908;\n                float redout_tmp_133141 = defunc_1_op_res_120296;\n                \n                redout_129908 = redout_tmp_133141;\n            }\n            defunc_2_reduce_res_120293 = redout_129908;\n            \n            float discard_129915;\n            float scanacc_129911 = 0.0F;\n            \n            for (int64_t i_129913 = 0; i_129913 < n_114534; i_129913++) {\n                bool cond_120303 = i_129913 == (int64_t) 0;\n                float defunc_0_f_res_120304;\n                \n                if (cond_120303) {\n                    float defunc_0_f_res_t_res_120305 =\n                          defunc_2_reduce_res_120293 / 3.0F;\n                    \n                   ",
                   " defunc_0_f_res_120304 = defunc_0_f_res_t_res_120305;\n                } else {\n                    int64_t x_120306 = add64((int64_t) 3, i_129913);\n                    int64_t i_120307 = sub64(x_120306, (int64_t) 1);\n                    bool x_120308 = sle64((int64_t) 0, i_120307);\n                    bool y_120309 = slt64(i_120307,\n                                          lifted_single_ma_arg_114976);\n                    bool bounds_check_120310 = x_120308 && y_120309;\n                    bool index_certs_120311;\n                    \n                    if (!bounds_check_120310) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          66) == -1) {\n                                global_failure_args[0] = i_120307;\n                                global_failure_args[1] =\n                                    lifted_single_ma_arg_114976;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    float x_120312 = ((__global\n                                       float *) color_132105)[phys_tid_120133 +\n                                                              i_120307 *\n                                                              num_threads_132198];\n                    int64_t i_120313 = sub64(i_129913, (int64_t) 1);\n                    bool x_120314 = sle64((int64_t) 0, i_120313);\n                    bool y_120315 = slt64(i_120313,\n                                          lifted_single_ma_arg_114976);\n                    bool bounds_check_120316 = x_120314 && y_120315;\n                    bool index_certs_120317;\n                    \n                    if (!bounds_check_120316) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_fail",
                   "ure, -1,\n                                                          67) == -1) {\n                                global_failure_args[0] = i_120313;\n                                global_failure_args[1] =\n                                    lifted_single_ma_arg_114976;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    float y_120318 = ((__global\n                                       float *) color_132105)[phys_tid_120133 +\n                                                              i_120313 *\n                                                              num_threads_132198];\n                    float x_120319 = x_120312 - y_120318;\n                    float defunc_0_f_res_f_res_120320 = x_120319 / 3.0F;\n                    \n                    defunc_0_f_res_120304 = defunc_0_f_res_f_res_120320;\n                }\n                \n                float defunc_1_op_res_120301 = defunc_0_f_res_120304 +\n                      scanacc_129911;\n                \n                ((__global float *) color_132104)[phys_tid_120133 + i_129913 *\n                                                  num_threads_132198] =\n                    defunc_1_op_res_120301;\n                \n                float scanacc_tmp_133142 = defunc_1_op_res_120301;\n                \n                scanacc_129911 = scanacc_tmp_133142;\n            }\n            discard_129915 = scanacc_129911;\n            for (int64_t i_133144 = 0; i_133144 < n_114534; i_133144++) {\n                ((__global float *) mem_130802)[i_133144 * m_114533 +\n                                                gtid_120132] = ((__global\n                                                                 float *) color_132104)[phys_tid_120133 +\n                                                                                        i_133144 *\n     ",
                   "                                                                                   num_threads_132198];\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_120229\n}\n__kernel void mainzisegmap_120742(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t loopz2081Uz2085Uz2089U_115023,\n                                  int64_t ctx_param_ext_130640,\n                                  int64_t ctx_param_ext_130641,\n                                  int64_t ctx_param_ext_130643, __global\n                                  unsigned char *defunc_3_map_res_mem_130116,\n                                  __global unsigned char *mem_param_130645,\n                                  __global\n                                  unsigned char *defunc_3_map_res_mem_130856,\n                                  __global unsigned char *mem_130861, __global\n                                  unsigned char *mem_130865)\n{\n    #define segmap_group_sizze_120788 (mainzisegmap_group_sizze_120745)\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_133565;\n    int32_t local_tid_133566;\n    int64_t group_sizze_133569;\n    int32_t wave_sizze_133568;\n    int32_t group_tid_133567;\n    \n    global_tid_133565 = get_global_id(0);\n    local_tid_133566 = get_local_id(0);\n    group_sizze_133569 = get_local_size(0);\n    wave_sizze_133568 = LOCKSTEP_WIDTH;\n    group_tid_133567 = get_group_id(0);\n    \n    int32_t phys_tid_120742 = global_tid_133565;\n    int64_t global_tid_133570 = sext_i32_i64(group_tid_133567) *\n            segmap_group_sizze_120788 + sext_i32_i64(local_tid_133566);\n ",
                   "   int64_t slice_133571 = n_114534;\n    int64_t slice_133572 = m_114533 * slice_133571;\n    int64_t gtid_120740 = squot64(global_tid_133570, slice_133571);\n    int64_t remnant_133573 = global_tid_133570 - gtid_120740 * slice_133571;\n    int64_t gtid_120741 = remnant_133573;\n    int64_t remnant_133574 = remnant_133573 - gtid_120741;\n    \n    if (slt64(gtid_120740, m_114533) && slt64(gtid_120741, n_114534)) {\n        int64_t x_120794 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130116)[gtid_120740 *\n                                                                     n_114534 +\n                                                                     gtid_120741];\n        bool cond_120795 = sle64((int64_t) 0, x_120794);\n        float defunc_0_f_res_120796;\n        \n        if (cond_120795) {\n            bool y_120797 = slt64(x_120794, n_114534);\n            bool bounds_check_120798 = cond_120795 && y_120797;\n            bool index_certs_120799;\n            \n            if (!bounds_check_120798) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 80) ==\n                        -1) {\n                        global_failure_args[0] = x_120794;\n                        global_failure_args[1] = n_114534;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            float defunc_0_f_res_t_res_120800 = ((__global\n                                                  float *) defunc_3_map_res_mem_130856)[gtid_120740 *\n                                                                                        n_114534 +\n                                                                                        x_120794];\n            \n            defunc_0_f_res_120796 = defunc_0_f_res_t_res_120800;\n        } else {\n            defunc_0_f_res_120796 = 0.0F;\n        }\n        \n        float defunc_0_f_res_120801;\n        \n        if (cond_120795) {\n            bo",
                   "ol y_120802 = slt64(x_120794, loopz2081Uz2085Uz2089U_115023);\n            bool bounds_check_120803 = cond_120795 && y_120802;\n            bool index_certs_120804;\n            \n            if (!bounds_check_120803) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 81) ==\n                        -1) {\n                        global_failure_args[0] = x_120794;\n                        global_failure_args[1] = loopz2081Uz2085Uz2089U_115023;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            float defunc_0_f_res_t_res_120805 = ((__global\n                                                  float *) mem_param_130645)[ctx_param_ext_130640 +\n                                                                             (gtid_120740 *\n                                                                              ctx_param_ext_130641 +\n                                                                              x_120794 *\n                                                                              ctx_param_ext_130643)];\n            \n            defunc_0_f_res_120801 = defunc_0_f_res_t_res_120805;\n        } else {\n            defunc_0_f_res_120801 = 0.0F;\n        }\n        ((__global float *) mem_130861)[gtid_120740 * n_114534 + gtid_120741] =\n            defunc_0_f_res_120801;\n        ((__global float *) mem_130865)[gtid_120740 * n_114534 + gtid_120741] =\n            defunc_0_f_res_120796;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_120788\n}\n__kernel void mainzisegmap_120811(__global int *global_failure,\n                                  int64_t m_114533, int64_t l_window_114538,\n                                  int64_t t_jump_114541, int64_t l_n_m_114584,\n                                  int64_t i_114610, int64_t num_groups_120883,\n                                  int64_t num_threads_132209, __global\n                                  un",
                   "signed char *defunc_3_map_res_mem_130117,\n                                  __global unsigned char *mem_130872, __global\n                                  unsigned char *mem_130875, __global\n                                  unsigned char *mem_130878, __global\n                                  unsigned char *mem_130881, __global\n                                  unsigned char *mem_130884, __global\n                                  unsigned char *mem_130903, __global\n                                  unsigned char *color_132109)\n{\n    #define segmap_group_sizze_120882 (mainzisegmap_group_sizze_120813)\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_133578;\n    int32_t local_tid_133579;\n    int64_t group_sizze_133582;\n    int32_t wave_sizze_133581;\n    int32_t group_tid_133580;\n    \n    global_tid_133578 = get_global_id(0);\n    local_tid_133579 = get_local_id(0);\n    group_sizze_133582 = get_local_size(0);\n    wave_sizze_133581 = LOCKSTEP_WIDTH;\n    group_tid_133580 = get_group_id(0);\n    \n    int32_t phys_tid_120811 = global_tid_133578;\n    int32_t phys_group_id_133583;\n    \n    phys_group_id_133583 = get_group_id(0);\n    for (int32_t i_133584 = 0; i_133584 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533,\n                                          segmap_group_sizze_120882)) -\n                   phys_group_id_133583, sext_i64_i32(num_groups_120883));\n         i_133584++) {\n        int32_t virt_group_id_133585 = phys_group_id_133583 + i_133584 *\n                sext_i64_i32(num_groups_120883);\n        int64_t global_tid_133586 = sext_i32_i64(virt_group_id_133585) *\n                segmap_group_sizze_120882 + sext_i32_i64(local_tid_133579);\n        int64_t slice_133587 = m_114533;\n        int64_t gtid_120810 = global_tid_133586;\n        int64_t remnant_133588 = global_tid_133586 - gtid_120810;\n        \n        if (slt64(gtid_120810, m_114533",
                   ")) {\n            int64_t x_120891 = ((__global\n                                 int64_t *) defunc_3_map_res_mem_130117)[gtid_120810];\n            \n            for (int64_t i_129918 = 0; i_129918 < l_n_m_114584; i_129918++) {\n                int64_t x_120894 = ((__global int64_t *) mem_130872)[i_129918 *\n                                                                     m_114533 +\n                                                                     gtid_120810];\n                float x_120895 = ((__global float *) mem_130875)[i_129918 *\n                                                                 m_114533 +\n                                                                 gtid_120810];\n                int64_t min_arg_120896 = mul64(t_jump_114541, i_129918);\n                int64_t min_res_120897 = smin64(i_114610, min_arg_120896);\n                float defunc_0_f_res_120898 = sitofp_i64_f32(min_res_120897);\n                float defunc_2_reduce_res_120899;\n                float redout_128797 = 0.0F;\n                \n                for (int64_t i_128798 = 0; i_128798 < l_window_114538;\n                     i_128798++) {\n                    bool cond_120904 = sle64(x_120891, i_128798);\n                    float defunc_0_f_res_120905;\n                    \n                    if (cond_120904) {\n                        defunc_0_f_res_120905 = 0.0F;\n                    } else {\n                        int64_t i_120906 = add64(x_120894, i_128798);\n                        float x_120907 = ((__global\n                                           float *) mem_130878)[i_120906 *\n                                                                m_114533 +\n                                                                gtid_120810];\n                        float defunc_0_f_res_f_res_120908 = 1.0F + x_120907;\n                        \n                        defunc_0_f_res_120905 = defunc_0_f_res_f_res_120908;\n                    }\n                    \n                    float de",
                   "func_0_f_res_120909;\n                    \n                    if (cond_120904) {\n                        defunc_0_f_res_120909 = 0.0F;\n                    } else {\n                        int64_t i_120910 = add64(x_120894, i_128798);\n                        float x_120911 = ((__global\n                                           float *) mem_130881)[i_120910 *\n                                                                m_114533 +\n                                                                gtid_120810];\n                        \n                        defunc_0_f_res_120909 = x_120911;\n                    }\n                    \n                    float x_j_120912 = defunc_0_f_res_120905 -\n                          defunc_0_f_res_120898;\n                    float abs_res_120913 = (float) fabs(x_j_120912);\n                    float tmp1_120914 = abs_res_120913 / x_120895;\n                    float x_120915 = tmp1_120914 * tmp1_120914;\n                    float y_120916 = tmp1_120914 * x_120915;\n                    float tmp2_120917 = 1.0F - y_120916;\n                    float x_120918 = tmp2_120917 * tmp2_120917;\n                    float tmp3_120919 = tmp2_120917 * x_120918;\n                    float w_j_120920 = defunc_0_f_res_120909 * tmp3_120919;\n                    float defunc_1_op_res_120902 = w_j_120920 + redout_128797;\n                    float redout_tmp_133590 = defunc_1_op_res_120902;\n                    \n                    redout_128797 = redout_tmp_133590;\n                }\n                defunc_2_reduce_res_120899 = redout_128797;\n                \n                float a0_120921 = 1.0F / defunc_2_reduce_res_120899;\n                float defunc_2_reduce_res_120922;\n                float redout_128799 = 0.0F;\n                \n                for (int64_t i_128800 = 0; i_128800 < l_window_114538;\n                     i_128800++) {\n                    bool cond_120927 = sle64(x_120891, i_128800);\n                    float defunc_0_f_res_120928;\n     ",
                   "               \n                    if (cond_120927) {\n                        defunc_0_f_res_120928 = 0.0F;\n                    } else {\n                        int64_t i_120929 = add64(x_120894, i_128800);\n                        float x_120930 = ((__global\n                                           float *) mem_130878)[i_120929 *\n                                                                m_114533 +\n                                                                gtid_120810];\n                        float defunc_0_f_res_f_res_120931 = 1.0F + x_120930;\n                        \n                        defunc_0_f_res_120928 = defunc_0_f_res_f_res_120931;\n                    }\n                    \n                    float defunc_0_f_res_120932;\n                    \n                    if (cond_120927) {\n                        defunc_0_f_res_120932 = 0.0F;\n                    } else {\n                        int64_t i_120933 = add64(x_120894, i_128800);\n                        float x_120934 = ((__global\n                                           float *) mem_130881)[i_120933 *\n                                                                m_114533 +\n                                                                gtid_120810];\n                        \n                        defunc_0_f_res_120932 = x_120934;\n                    }\n                    \n                    float x_j_120935 = defunc_0_f_res_120928 -\n                          defunc_0_f_res_120898;\n                    float abs_res_120936 = (float) fabs(x_j_120935);\n                    float tmp1_120937 = abs_res_120936 / x_120895;\n                    float x_120938 = tmp1_120937 * tmp1_120937;\n                    float y_120939 = tmp1_120937 * x_120938;\n                    float tmp2_120940 = 1.0F - y_120939;\n                    float x_120941 = tmp2_120940 * tmp2_120940;\n                    float tmp3_120942 = tmp2_120940 * x_120941;\n                    float tmp4_120943 = defunc_0_f_res_120932 * ",
                   "tmp3_120942;\n                    float defunc_0_f_res_120944;\n                    \n                    if (cond_120927) {\n                        defunc_0_f_res_120944 = 0.0F;\n                    } else {\n                        int64_t i_120945 = add64(x_120894, i_128800);\n                        float x_120946 = ((__global\n                                           float *) mem_130884)[i_120945 *\n                                                                m_114533 +\n                                                                gtid_120810];\n                        \n                        defunc_0_f_res_120944 = x_120946;\n                    }\n                    \n                    float x_120947 = a0_120921 * tmp4_120943;\n                    float defunc_9_fit_fun_res_120948 = defunc_0_f_res_120944 *\n                          x_120947;\n                    float defunc_1_op_res_120925 = defunc_9_fit_fun_res_120948 +\n                          redout_128799;\n                    float redout_tmp_133591 = defunc_1_op_res_120925;\n                    \n                    redout_128799 = redout_tmp_133591;\n                }\n                defunc_2_reduce_res_120922 = redout_128799;\n                ((__global float *) color_132109)[phys_tid_120811 + i_129918 *\n                                                  num_threads_132209] =\n                    defunc_2_reduce_res_120922;\n            }\n            for (int64_t i_133592 = 0; i_133592 < l_n_m_114584; i_133592++) {\n                ((__global float *) mem_130903)[i_133592 * m_114533 +\n                                                gtid_120810] = ((__global\n                                                                 float *) color_132109)[phys_tid_120811 +\n                                                                                        i_133592 *\n                                                                                        num_threads_132209];\n            }\n        }\n        barrier(CLK_GL",
                   "OBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_120882\n}\n__kernel void mainzisegmap_120951(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t l_window_114538,\n                                  int64_t t_jump_114541, int64_t l_n_m_114584,\n                                  int64_t i_114610, __global\n                                  unsigned char *defunc_3_map_res_mem_130117,\n                                  __global unsigned char *mem_130122, __global\n                                  unsigned char *defunc_3_map_res_mem_130404,\n                                  __global\n                                  unsigned char *defunc_3_map_res_mem_130405,\n                                  __global unsigned char *mem_130861, __global\n                                  unsigned char *mem_130865, __global\n                                  unsigned char *mem_130908)\n{\n    #define segmap_group_sizze_121242 (mainzisegmap_group_sizze_120954)\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_133593;\n    int32_t local_tid_133594;\n    int64_t group_sizze_133597;\n    int32_t wave_sizze_133596;\n    int32_t group_tid_133595;\n    \n    global_tid_133593 = get_global_id(0);\n    local_tid_133594 = get_local_id(0);\n    group_sizze_133597 = get_local_size(0);\n    wave_sizze_133596 = LOCKSTEP_WIDTH;\n    group_tid_133595 = get_group_id(0);\n    \n    int32_t phys_tid_120951 = global_tid_133593;\n    int64_t global_tid_133598 = sext_i32_i64(group_tid_133595) *\n            segmap_group_sizze_121242 + sext_i32_i64(local_tid_133594);\n    int64_t slice_133599 = l_n_m_114584;\n    int64_t slice_133600 = m_114533 * slice_133599;\n    int64_t gtid_120949 = squot64(global_tid_133598, slice_133599);\n    int64_t remnant_133601 = global_tid_133598 ",
                   "- gtid_120949 * slice_133599;\n    int64_t gtid_120950 = remnant_133601;\n    int64_t remnant_133602 = remnant_133601 - gtid_120950;\n    \n    if (slt64(gtid_120949, m_114533) && slt64(gtid_120950, l_n_m_114584)) {\n        int64_t x_121252 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130117)[gtid_120949];\n        int64_t x_121254 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130404)[gtid_120949 *\n                                                                     l_n_m_114584 +\n                                                                     gtid_120950];\n        float x_121255 = ((__global\n                           float *) defunc_3_map_res_mem_130405)[gtid_120949 *\n                                                                 l_n_m_114584 +\n                                                                 gtid_120950];\n        int64_t min_arg_121256 = mul64(t_jump_114541, gtid_120950);\n        int64_t min_res_121257 = smin64(i_114610, min_arg_121256);\n        float defunc_0_f_res_121258 = sitofp_i64_f32(min_res_121257);\n        float defunc_2_reduce_res_121259;\n        float redout_128801 = 0.0F;\n        \n        for (int64_t i_128802 = 0; i_128802 < l_window_114538; i_128802++) {\n            bool cond_121264 = sle64(x_121252, i_128802);\n            float defunc_0_f_res_121265;\n            \n            if (cond_121264) {\n                defunc_0_f_res_121265 = 0.0F;\n            } else {\n                int64_t i_121266 = add64(x_121254, i_128802);\n                float x_121267 = ((__global float *) mem_130122)[gtid_120949 *\n                                                                 n_114534 +\n                                                                 i_121266];\n                float defunc_0_f_res_f_res_121268 = 1.0F + x_121267;\n                \n                defunc_0_f_res_121265 = defunc_0_f_res_f_res_121268;\n            }\n            \n            float defunc_0_f_res_121269;\n          ",
                   "  \n            if (cond_121264) {\n                defunc_0_f_res_121269 = 0.0F;\n            } else {\n                int64_t i_121270 = add64(x_121254, i_128802);\n                float x_121271 = ((__global float *) mem_130861)[gtid_120949 *\n                                                                 n_114534 +\n                                                                 i_121270];\n                \n                defunc_0_f_res_121269 = x_121271;\n            }\n            \n            float x_j_121272 = defunc_0_f_res_121265 - defunc_0_f_res_121258;\n            float abs_res_121273 = (float) fabs(x_j_121272);\n            float tmp1_121274 = abs_res_121273 / x_121255;\n            float x_121275 = tmp1_121274 * tmp1_121274;\n            float y_121276 = tmp1_121274 * x_121275;\n            float tmp2_121277 = 1.0F - y_121276;\n            float x_121278 = tmp2_121277 * tmp2_121277;\n            float tmp3_121279 = tmp2_121277 * x_121278;\n            float w_j_121280 = defunc_0_f_res_121269 * tmp3_121279;\n            float defunc_1_op_res_121262 = w_j_121280 + redout_128801;\n            float redout_tmp_133603 = defunc_1_op_res_121262;\n            \n            redout_128801 = redout_tmp_133603;\n        }\n        defunc_2_reduce_res_121259 = redout_128801;\n        \n        float a0_121281 = 1.0F / defunc_2_reduce_res_121259;\n        float defunc_2_reduce_res_121282;\n        float redout_128803 = 0.0F;\n        \n        for (int64_t i_128804 = 0; i_128804 < l_window_114538; i_128804++) {\n            bool cond_121287 = sle64(x_121252, i_128804);\n            float defunc_0_f_res_121288;\n            \n            if (cond_121287) {\n                defunc_0_f_res_121288 = 0.0F;\n            } else {\n                int64_t i_121289 = add64(x_121254, i_128804);\n                float x_121290 = ((__global float *) mem_130122)[gtid_120949 *\n                                                                 n_114534 +\n                                                            ",
                   "     i_121289];\n                float defunc_0_f_res_f_res_121291 = 1.0F + x_121290;\n                \n                defunc_0_f_res_121288 = defunc_0_f_res_f_res_121291;\n            }\n            \n            float defunc_0_f_res_121292;\n            \n            if (cond_121287) {\n                defunc_0_f_res_121292 = 0.0F;\n            } else {\n                int64_t i_121293 = add64(x_121254, i_128804);\n                float x_121294 = ((__global float *) mem_130861)[gtid_120949 *\n                                                                 n_114534 +\n                                                                 i_121293];\n                \n                defunc_0_f_res_121292 = x_121294;\n            }\n            \n            float x_j_121295 = defunc_0_f_res_121288 - defunc_0_f_res_121258;\n            float abs_res_121296 = (float) fabs(x_j_121295);\n            float tmp1_121297 = abs_res_121296 / x_121255;\n            float x_121298 = tmp1_121297 * tmp1_121297;\n            float y_121299 = tmp1_121297 * x_121298;\n            float tmp2_121300 = 1.0F - y_121299;\n            float x_121301 = tmp2_121300 * tmp2_121300;\n            float tmp3_121302 = tmp2_121300 * x_121301;\n            float tmp4_121303 = defunc_0_f_res_121292 * tmp3_121302;\n            float defunc_0_f_res_121304;\n            \n            if (cond_121287) {\n                defunc_0_f_res_121304 = 0.0F;\n            } else {\n                int64_t i_121305 = add64(x_121254, i_128804);\n                float x_121306 = ((__global float *) mem_130865)[gtid_120949 *\n                                                                 n_114534 +\n                                                                 i_121305];\n                \n                defunc_0_f_res_121304 = x_121306;\n            }\n            \n            float x_121307 = a0_121281 * tmp4_121303;\n            float defunc_9_fit_fun_res_121308 = defunc_0_f_res_121304 *\n                  x_121307;\n            float defunc_1_op_res",
                   "_121285 = defunc_9_fit_fun_res_121308 +\n                  redout_128803;\n            float redout_tmp_133604 = defunc_1_op_res_121285;\n            \n            redout_128803 = redout_tmp_133604;\n        }\n        defunc_2_reduce_res_121282 = redout_128803;\n        ((__global float *) mem_130908)[gtid_120949 * l_n_m_114584 +\n                                        gtid_120950] =\n            defunc_2_reduce_res_121282;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_121242\n}\n__kernel void mainzisegmap_121079(__global int *global_failure,\n                                  int64_t m_114533, int64_t l_n_m_114584,\n                                  __global unsigned char *mem_130913, __global\n                                  unsigned char *mem_130918)\n{\n    #define segmap_group_sizze_121357 (mainzisegmap_group_sizze_121082)\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_133673;\n    int32_t local_tid_133674;\n    int64_t group_sizze_133677;\n    int32_t wave_sizze_133676;\n    int32_t group_tid_133675;\n    \n    global_tid_133673 = get_global_id(0);\n    local_tid_133674 = get_local_id(0);\n    group_sizze_133677 = get_local_size(0);\n    wave_sizze_133676 = LOCKSTEP_WIDTH;\n    group_tid_133675 = get_group_id(0);\n    \n    int32_t phys_tid_121079 = global_tid_133673;\n    int64_t global_tid_133678 = sext_i32_i64(group_tid_133675) *\n            segmap_group_sizze_121357 + sext_i32_i64(local_tid_133674);\n    int64_t slice_133679 = l_n_m_114584;\n    int64_t slice_133680 = m_114533 * slice_133679;\n    int64_t gtid_121077 = squot64(global_tid_133678, slice_133679);\n    int64_t remnant_133681 = global_tid_133678 - gtid_121077 * slice_133679;\n    int64_t gtid_121078 = remnant_133681;\n    int64_t remnant_133682 = remnant_133681 - gtid_121078;\n    \n    if (slt64(gtid_121077, m_114533) && slt64(gtid_121078, l_n_m_114584)) {\n        float defunc_2_redu",
                   "ce_res_121360 = ((__global\n                                             float *) mem_130913)[gtid_121077 *\n                                                                  l_n_m_114584 +\n                                                                  gtid_121078];\n        float a0_121361 = 1.0F / defunc_2_reduce_res_121360;\n        \n        ((__global float *) mem_130918)[gtid_121077 * l_n_m_114584 +\n                                        gtid_121078] = a0_121361;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_121357\n}\n__kernel void mainzisegmap_121412(__global int *global_failure,\n                                  int64_t m_114533, int64_t l_window_114538,\n                                  int64_t t_jump_114541, int64_t l_n_m_114584,\n                                  int64_t i_114610, int64_t num_groups_121513,\n                                  int64_t num_threads_132215, __global\n                                  unsigned char *defunc_3_map_res_mem_130117,\n                                  __global unsigned char *mem_130933, __global\n                                  unsigned char *mem_130936, __global\n                                  unsigned char *mem_130939, __global\n                                  unsigned char *mem_130942, __global\n                                  unsigned char *mem_130945, __global\n                                  unsigned char *mem_130979, __global\n                                  unsigned char *mem_130982, __global\n                                  unsigned char *color_132110, __global\n                                  unsigned char *color_132111)\n{\n    #define segmap_group_sizze_121512 (mainzisegmap_group_sizze_121414)\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_133756;\n    int32_t local_tid_133757;\n    int64_t group_sizze_133760;\n    int32_t wave_sizze_133759;\n    int32_t group_tid_1",
                   "33758;\n    \n    global_tid_133756 = get_global_id(0);\n    local_tid_133757 = get_local_id(0);\n    group_sizze_133760 = get_local_size(0);\n    wave_sizze_133759 = LOCKSTEP_WIDTH;\n    group_tid_133758 = get_group_id(0);\n    \n    int32_t phys_tid_121412 = global_tid_133756;\n    int32_t phys_group_id_133761;\n    \n    phys_group_id_133761 = get_group_id(0);\n    for (int32_t i_133762 = 0; i_133762 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533,\n                                          segmap_group_sizze_121512)) -\n                   phys_group_id_133761, sext_i64_i32(num_groups_121513));\n         i_133762++) {\n        int32_t virt_group_id_133763 = phys_group_id_133761 + i_133762 *\n                sext_i64_i32(num_groups_121513);\n        int64_t global_tid_133764 = sext_i32_i64(virt_group_id_133763) *\n                segmap_group_sizze_121512 + sext_i32_i64(local_tid_133757);\n        int64_t slice_133765 = m_114533;\n        int64_t gtid_121411 = global_tid_133764;\n        int64_t remnant_133766 = global_tid_133764 - gtid_121411;\n        \n        if (slt64(gtid_121411, m_114533)) {\n            int64_t x_121522 = ((__global\n                                 int64_t *) defunc_3_map_res_mem_130117)[gtid_121411];\n            \n            for (int64_t i_129924 = 0; i_129924 < l_n_m_114584; i_129924++) {\n                int64_t x_121526 = ((__global int64_t *) mem_130933)[i_129924 *\n                                                                     m_114533 +\n                                                                     gtid_121411];\n                float x_121527 = ((__global float *) mem_130936)[i_129924 *\n                                                                 m_114533 +\n                                                                 gtid_121411];\n                int64_t min_arg_121528 = mul64(t_jump_114541, i_129924);\n                int64_t min_res_121529 = smin64(i_114610, min_arg_121528);\n                float defunc_0_f_res_121530 = sitofp_i64_f3",
                   "2(min_res_121529);\n                float defunc_2_reduce_res_121531;\n                float defunc_2_reduce_res_121532;\n                float defunc_2_reduce_res_121533;\n                float redout_128823;\n                float redout_128824;\n                float redout_128825;\n                \n                redout_128823 = 0.0F;\n                redout_128824 = 0.0F;\n                redout_128825 = 0.0F;\n                for (int64_t i_128826 = 0; i_128826 < l_window_114538;\n                     i_128826++) {\n                    bool cond_121544 = sle64(x_121522, i_128826);\n                    float defunc_0_f_res_121545;\n                    \n                    if (cond_121544) {\n                        defunc_0_f_res_121545 = 0.0F;\n                    } else {\n                        int64_t i_121546 = add64(x_121526, i_128826);\n                        float x_121547 = ((__global\n                                           float *) mem_130939)[i_121546 *\n                                                                m_114533 +\n                                                                gtid_121411];\n                        float defunc_0_f_res_f_res_121548 = 1.0F + x_121547;\n                        \n                        defunc_0_f_res_121545 = defunc_0_f_res_f_res_121548;\n                    }\n                    \n                    float defunc_0_f_res_121549;\n                    \n                    if (cond_121544) {\n                        defunc_0_f_res_121549 = 0.0F;\n                    } else {\n                        int64_t i_121550 = add64(x_121526, i_128826);\n                        float x_121551 = ((__global\n                                           float *) mem_130942)[i_121550 *\n                                                                m_114533 +\n                                                                gtid_121411];\n                        \n                        defunc_0_f_res_121549 = x_121551;\n                    }\n      ",
                   "              \n                    float x_j_121552 = defunc_0_f_res_121545 -\n                          defunc_0_f_res_121530;\n                    float abs_res_121553 = (float) fabs(x_j_121552);\n                    float tmp1_121554 = abs_res_121553 / x_121527;\n                    float x_121555 = tmp1_121554 * tmp1_121554;\n                    float y_121556 = tmp1_121554 * x_121555;\n                    float tmp2_121557 = 1.0F - y_121556;\n                    float x_121558 = tmp2_121557 * tmp2_121557;\n                    float tmp3_121559 = tmp2_121557 * x_121558;\n                    float w_j_121560 = defunc_0_f_res_121549 * tmp3_121559;\n                    float xw_j_121561 = x_j_121552 * w_j_121560;\n                    float x2w_j_121562 = x_j_121552 * xw_j_121561;\n                    float defunc_1_op_res_121536 = w_j_121560 + redout_128823;\n                    float defunc_1_op_res_121539 = xw_j_121561 + redout_128824;\n                    float defunc_1_op_res_121542 = x2w_j_121562 + redout_128825;\n                    float redout_tmp_133769 = defunc_1_op_res_121536;\n                    float redout_tmp_133770 = defunc_1_op_res_121539;\n                    float redout_tmp_133771 = defunc_1_op_res_121542;\n                    \n                    redout_128823 = redout_tmp_133769;\n                    redout_128824 = redout_tmp_133770;\n                    redout_128825 = redout_tmp_133771;\n                }\n                defunc_2_reduce_res_121531 = redout_128823;\n                defunc_2_reduce_res_121532 = redout_128824;\n                defunc_2_reduce_res_121533 = redout_128825;\n                \n                float x_121563 = defunc_2_reduce_res_121531 *\n                      defunc_2_reduce_res_121533;\n                float y_121564 = defunc_2_reduce_res_121532 *\n                      defunc_2_reduce_res_121532;\n                float y_121565 = x_121563 - y_121564;\n                float det1_121566 = 1.0F / y_121565;\n                float a11_121567 = de",
                   "func_2_reduce_res_121533 * det1_121566;\n                float negate_arg_121568 = defunc_2_reduce_res_121532 *\n                      det1_121566;\n                float b11_121569 = 0.0F - negate_arg_121568;\n                float c11_121570 = defunc_2_reduce_res_121531 * det1_121566;\n                float defunc_2_reduce_res_121571;\n                float defunc_2_reduce_res_121572;\n                float redout_128827;\n                float redout_128828;\n                \n                redout_128827 = 0.0F;\n                redout_128828 = 0.0F;\n                for (int64_t i_128829 = 0; i_128829 < l_window_114538;\n                     i_128829++) {\n                    bool cond_121580 = sle64(x_121522, i_128829);\n                    float defunc_0_f_res_121581;\n                    \n                    if (cond_121580) {\n                        defunc_0_f_res_121581 = 0.0F;\n                    } else {\n                        int64_t i_121582 = add64(x_121526, i_128829);\n                        float x_121583 = ((__global\n                                           float *) mem_130939)[i_121582 *\n                                                                m_114533 +\n                                                                gtid_121411];\n                        float defunc_0_f_res_f_res_121584 = 1.0F + x_121583;\n                        \n                        defunc_0_f_res_121581 = defunc_0_f_res_f_res_121584;\n                    }\n                    \n                    float defunc_0_f_res_121585;\n                    \n                    if (cond_121580) {\n                        defunc_0_f_res_121585 = 0.0F;\n                    } else {\n                        int64_t i_121586 = add64(x_121526, i_128829);\n                        float x_121587 = ((__global\n                                           float *) mem_130942)[i_121586 *\n                                                                m_114533 +\n                                                 ",
                   "               gtid_121411];\n                        \n                        defunc_0_f_res_121585 = x_121587;\n                    }\n                    \n                    float x_j_121588 = defunc_0_f_res_121581 -\n                          defunc_0_f_res_121530;\n                    float abs_res_121589 = (float) fabs(x_j_121588);\n                    float tmp1_121590 = abs_res_121589 / x_121527;\n                    float x_121591 = tmp1_121590 * tmp1_121590;\n                    float y_121592 = tmp1_121590 * x_121591;\n                    float tmp2_121593 = 1.0F - y_121592;\n                    float x_121594 = tmp2_121593 * tmp2_121593;\n                    float tmp3_121595 = tmp2_121593 * x_121594;\n                    float tmp4_121596 = defunc_0_f_res_121585 * tmp3_121595;\n                    float defunc_1_f_res_121597 = x_j_121588 * tmp4_121596;\n                    float defunc_0_f_res_121598;\n                    \n                    if (cond_121580) {\n                        defunc_0_f_res_121598 = 0.0F;\n                    } else {\n                        int64_t i_121599 = add64(x_121526, i_128829);\n                        float x_121600 = ((__global\n                                           float *) mem_130945)[i_121599 *\n                                                                m_114533 +\n                                                                gtid_121411];\n                        \n                        defunc_0_f_res_121598 = x_121600;\n                    }\n                    \n                    float x_121601 = a11_121567 * tmp4_121596;\n                    float y_121602 = b11_121569 * defunc_1_f_res_121597;\n                    float x_121603 = x_121601 + y_121602;\n                    float defunc_9_fit_fun_res_121604 = defunc_0_f_res_121598 *\n                          x_121603;\n                    float x_121605 = b11_121569 * tmp4_121596;\n                    float y_121606 = c11_121570 * defunc_1_f_res_121597;\n                    ",
                   "float x_121607 = x_121605 + y_121606;\n                    float defunc_9_slope_fun_res_121608 =\n                          defunc_0_f_res_121598 * x_121607;\n                    float defunc_1_op_res_121575 = defunc_9_fit_fun_res_121604 +\n                          redout_128827;\n                    float defunc_1_op_res_121578 =\n                          defunc_9_slope_fun_res_121608 + redout_128828;\n                    float redout_tmp_133772 = defunc_1_op_res_121575;\n                    float redout_tmp_133773 = defunc_1_op_res_121578;\n                    \n                    redout_128827 = redout_tmp_133772;\n                    redout_128828 = redout_tmp_133773;\n                }\n                defunc_2_reduce_res_121571 = redout_128827;\n                defunc_2_reduce_res_121572 = redout_128828;\n                ((__global float *) color_132111)[phys_tid_121412 + i_129924 *\n                                                  num_threads_132215] =\n                    defunc_2_reduce_res_121571;\n                ((__global float *) color_132110)[phys_tid_121412 + i_129924 *\n                                                  num_threads_132215] =\n                    defunc_2_reduce_res_121572;\n            }\n            for (int64_t i_133774 = 0; i_133774 < l_n_m_114584; i_133774++) {\n                ((__global float *) mem_130979)[i_133774 * m_114533 +\n                                                gtid_121411] = ((__global\n                                                                 float *) color_132111)[phys_tid_121412 +\n                                                                                        i_133774 *\n                                                                                        num_threads_132215];\n            }\n            for (int64_t i_133775 = 0; i_133775 < l_n_m_114584; i_133775++) {\n                ((__global float *) mem_130982)[i_133775 * m_114533 +\n                                                gtid_121411] = ((__global\n     ",
                   "                                                            float *) color_132110)[phys_tid_121412 +\n                                                                                        i_133775 *\n                                                                                        num_threads_132215];\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_121512\n}\n__kernel void mainzisegmap_121611(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t l_window_114538,\n                                  int64_t t_jump_114541, int64_t l_n_m_114584,\n                                  int64_t i_114610, __global\n                                  unsigned char *defunc_3_map_res_mem_130117,\n                                  __global unsigned char *mem_130122, __global\n                                  unsigned char *defunc_3_map_res_mem_130404,\n                                  __global\n                                  unsigned char *defunc_3_map_res_mem_130405,\n                                  __global unsigned char *mem_130861, __global\n                                  unsigned char *mem_130865, __global\n                                  unsigned char *mem_130987, __global\n                                  unsigned char *mem_130991)\n{\n    #define segmap_group_sizze_122007 (mainzisegmap_group_sizze_121614)\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_133776;\n    int32_t local_tid_133777;\n    int64_t group_sizze_133780;\n    int32_t wave_sizze_133779;\n    int32_t group_tid_133778;\n    \n    global_tid_133776 = get_global_id(0);\n    local_tid_133777 = get_local_id(0);\n    group_sizze_133780 = get_local_size(0);\n    wave_sizze_133779 = LOCKSTEP_WIDTH;\n    group_tid_",
                   "133778 = get_group_id(0);\n    \n    int32_t phys_tid_121611 = global_tid_133776;\n    int64_t global_tid_133781 = sext_i32_i64(group_tid_133778) *\n            segmap_group_sizze_122007 + sext_i32_i64(local_tid_133777);\n    int64_t slice_133782 = l_n_m_114584;\n    int64_t slice_133783 = m_114533 * slice_133782;\n    int64_t gtid_121609 = squot64(global_tid_133781, slice_133782);\n    int64_t remnant_133784 = global_tid_133781 - gtid_121609 * slice_133782;\n    int64_t gtid_121610 = remnant_133784;\n    int64_t remnant_133785 = remnant_133784 - gtid_121610;\n    \n    if (slt64(gtid_121609, m_114533) && slt64(gtid_121610, l_n_m_114584)) {\n        int64_t x_122019 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130117)[gtid_121609];\n        int64_t x_122021 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130404)[gtid_121609 *\n                                                                     l_n_m_114584 +\n                                                                     gtid_121610];\n        float x_122022 = ((__global\n                           float *) defunc_3_map_res_mem_130405)[gtid_121609 *\n                                                                 l_n_m_114584 +\n                                                                 gtid_121610];\n        int64_t min_arg_122023 = mul64(t_jump_114541, gtid_121610);\n        int64_t min_res_122024 = smin64(i_114610, min_arg_122023);\n        float defunc_0_f_res_122025 = sitofp_i64_f32(min_res_122024);\n        float defunc_2_reduce_res_122026;\n        float defunc_2_reduce_res_122027;\n        float defunc_2_reduce_res_122028;\n        float redout_128830;\n        float redout_128831;\n        float redout_128832;\n        \n        redout_128830 = 0.0F;\n        redout_128831 = 0.0F;\n        redout_128832 = 0.0F;\n        for (int64_t i_128833 = 0; i_128833 < l_window_114538; i_128833++) {\n            bool cond_122039 = sle64(x_122019, i_128833);\n            float defunc_0_f",
                   "_res_122040;\n            \n            if (cond_122039) {\n                defunc_0_f_res_122040 = 0.0F;\n            } else {\n                int64_t i_122041 = add64(x_122021, i_128833);\n                float x_122042 = ((__global float *) mem_130122)[gtid_121609 *\n                                                                 n_114534 +\n                                                                 i_122041];\n                float defunc_0_f_res_f_res_122043 = 1.0F + x_122042;\n                \n                defunc_0_f_res_122040 = defunc_0_f_res_f_res_122043;\n            }\n            \n            float defunc_0_f_res_122044;\n            \n            if (cond_122039) {\n                defunc_0_f_res_122044 = 0.0F;\n            } else {\n                int64_t i_122045 = add64(x_122021, i_128833);\n                float x_122046 = ((__global float *) mem_130861)[gtid_121609 *\n                                                                 n_114534 +\n                                                                 i_122045];\n                \n                defunc_0_f_res_122044 = x_122046;\n            }\n            \n            float x_j_122047 = defunc_0_f_res_122040 - defunc_0_f_res_122025;\n            float abs_res_122048 = (float) fabs(x_j_122047);\n            float tmp1_122049 = abs_res_122048 / x_122022;\n            float x_122050 = tmp1_122049 * tmp1_122049;\n            float y_122051 = tmp1_122049 * x_122050;\n            float tmp2_122052 = 1.0F - y_122051;\n            float x_122053 = tmp2_122052 * tmp2_122052;\n            float tmp3_122054 = tmp2_122052 * x_122053;\n            float w_j_122055 = defunc_0_f_res_122044 * tmp3_122054;\n            float xw_j_122056 = x_j_122047 * w_j_122055;\n            float x2w_j_122057 = x_j_122047 * xw_j_122056;\n            float defunc_1_op_res_122031 = w_j_122055 + redout_128830;\n            float defunc_1_op_res_122034 = xw_j_122056 + redout_128831;\n            float defunc_1_op_res_122037 = x2w_j_122057 + redout_12",
                   "8832;\n            float redout_tmp_133786 = defunc_1_op_res_122031;\n            float redout_tmp_133787 = defunc_1_op_res_122034;\n            float redout_tmp_133788 = defunc_1_op_res_122037;\n            \n            redout_128830 = redout_tmp_133786;\n            redout_128831 = redout_tmp_133787;\n            redout_128832 = redout_tmp_133788;\n        }\n        defunc_2_reduce_res_122026 = redout_128830;\n        defunc_2_reduce_res_122027 = redout_128831;\n        defunc_2_reduce_res_122028 = redout_128832;\n        \n        float x_122058 = defunc_2_reduce_res_122026 *\n              defunc_2_reduce_res_122028;\n        float y_122059 = defunc_2_reduce_res_122027 *\n              defunc_2_reduce_res_122027;\n        float y_122060 = x_122058 - y_122059;\n        float det1_122061 = 1.0F / y_122060;\n        float a11_122062 = defunc_2_reduce_res_122028 * det1_122061;\n        float negate_arg_122063 = defunc_2_reduce_res_122027 * det1_122061;\n        float b11_122064 = 0.0F - negate_arg_122063;\n        float c11_122065 = defunc_2_reduce_res_122026 * det1_122061;\n        float defunc_2_reduce_res_122066;\n        float defunc_2_reduce_res_122067;\n        float redout_128834;\n        float redout_128835;\n        \n        redout_128834 = 0.0F;\n        redout_128835 = 0.0F;\n        for (int64_t i_128836 = 0; i_128836 < l_window_114538; i_128836++) {\n            bool cond_122075 = sle64(x_122019, i_128836);\n            float defunc_0_f_res_122076;\n            \n            if (cond_122075) {\n                defunc_0_f_res_122076 = 0.0F;\n            } else {\n                int64_t i_122077 = add64(x_122021, i_128836);\n                float x_122078 = ((__global float *) mem_130122)[gtid_121609 *\n                                                                 n_114534 +\n                                                                 i_122077];\n                float defunc_0_f_res_f_res_122079 = 1.0F + x_122078;\n                \n                defunc_0_f_res_122076 = defunc_0_f_r",
                   "es_f_res_122079;\n            }\n            \n            float defunc_0_f_res_122080;\n            \n            if (cond_122075) {\n                defunc_0_f_res_122080 = 0.0F;\n            } else {\n                int64_t i_122081 = add64(x_122021, i_128836);\n                float x_122082 = ((__global float *) mem_130861)[gtid_121609 *\n                                                                 n_114534 +\n                                                                 i_122081];\n                \n                defunc_0_f_res_122080 = x_122082;\n            }\n            \n            float x_j_122083 = defunc_0_f_res_122076 - defunc_0_f_res_122025;\n            float abs_res_122084 = (float) fabs(x_j_122083);\n            float tmp1_122085 = abs_res_122084 / x_122022;\n            float x_122086 = tmp1_122085 * tmp1_122085;\n            float y_122087 = tmp1_122085 * x_122086;\n            float tmp2_122088 = 1.0F - y_122087;\n            float x_122089 = tmp2_122088 * tmp2_122088;\n            float tmp3_122090 = tmp2_122088 * x_122089;\n            float tmp4_122091 = defunc_0_f_res_122080 * tmp3_122090;\n            float defunc_1_f_res_122092 = x_j_122083 * tmp4_122091;\n            float defunc_0_f_res_122093;\n            \n            if (cond_122075) {\n                defunc_0_f_res_122093 = 0.0F;\n            } else {\n                int64_t i_122094 = add64(x_122021, i_128836);\n                float x_122095 = ((__global float *) mem_130865)[gtid_121609 *\n                                                                 n_114534 +\n                                                                 i_122094];\n                \n                defunc_0_f_res_122093 = x_122095;\n            }\n            \n            float x_122096 = a11_122062 * tmp4_122091;\n            float y_122097 = b11_122064 * defunc_1_f_res_122092;\n            float x_122098 = x_122096 + y_122097;\n            float defunc_9_fit_fun_res_122099 = defunc_0_f_res_122093 *\n                  x_122098;\n   ",
                   "         float x_122100 = b11_122064 * tmp4_122091;\n            float y_122101 = c11_122065 * defunc_1_f_res_122092;\n            float x_122102 = x_122100 + y_122101;\n            float defunc_9_slope_fun_res_122103 = defunc_0_f_res_122093 *\n                  x_122102;\n            float defunc_1_op_res_122070 = defunc_9_fit_fun_res_122099 +\n                  redout_128834;\n            float defunc_1_op_res_122073 = defunc_9_slope_fun_res_122103 +\n                  redout_128835;\n            float redout_tmp_133789 = defunc_1_op_res_122070;\n            float redout_tmp_133790 = defunc_1_op_res_122073;\n            \n            redout_128834 = redout_tmp_133789;\n            redout_128835 = redout_tmp_133790;\n        }\n        defunc_2_reduce_res_122066 = redout_128834;\n        defunc_2_reduce_res_122067 = redout_128835;\n        ((__global float *) mem_130987)[gtid_121609 * l_n_m_114584 +\n                                        gtid_121610] =\n            defunc_2_reduce_res_122066;\n        ((__global float *) mem_130991)[gtid_121609 * l_n_m_114584 +\n                                        gtid_121610] =\n            defunc_2_reduce_res_122067;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_122007\n}\n__kernel void mainzisegmap_121790(__global int *global_failure,\n                                  int64_t m_114533, int64_t l_n_m_114584,\n                                  __global unsigned char *mem_130996, __global\n                                  unsigned char *mem_131000, __global\n                                  unsigned char *mem_131004, __global\n                                  unsigned char *mem_131009, __global\n                                  unsigned char *mem_131013, __global\n                                  unsigned char *mem_131017)\n{\n    #define segmap_group_sizze_122162 (mainzisegmap_group_sizze_121793)\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        r",
                   "eturn;\n    \n    int32_t global_tid_133885;\n    int32_t local_tid_133886;\n    int64_t group_sizze_133889;\n    int32_t wave_sizze_133888;\n    int32_t group_tid_133887;\n    \n    global_tid_133885 = get_global_id(0);\n    local_tid_133886 = get_local_id(0);\n    group_sizze_133889 = get_local_size(0);\n    wave_sizze_133888 = LOCKSTEP_WIDTH;\n    group_tid_133887 = get_group_id(0);\n    \n    int32_t phys_tid_121790 = global_tid_133885;\n    int64_t global_tid_133890 = sext_i32_i64(group_tid_133887) *\n            segmap_group_sizze_122162 + sext_i32_i64(local_tid_133886);\n    int64_t slice_133891 = l_n_m_114584;\n    int64_t slice_133892 = m_114533 * slice_133891;\n    int64_t gtid_121788 = squot64(global_tid_133890, slice_133891);\n    int64_t remnant_133893 = global_tid_133890 - gtid_121788 * slice_133891;\n    int64_t gtid_121789 = remnant_133893;\n    int64_t remnant_133894 = remnant_133893 - gtid_121789;\n    \n    if (slt64(gtid_121788, m_114533) && slt64(gtid_121789, l_n_m_114584)) {\n        float defunc_2_reduce_res_122167 = ((__global\n                                             float *) mem_130996)[gtid_121788 *\n                                                                  l_n_m_114584 +\n                                                                  gtid_121789];\n        float defunc_2_reduce_res_122168 = ((__global\n                                             float *) mem_131000)[gtid_121788 *\n                                                                  l_n_m_114584 +\n                                                                  gtid_121789];\n        float defunc_2_reduce_res_122169 = ((__global\n                                             float *) mem_131004)[gtid_121788 *\n                                                                  l_n_m_114584 +\n                                                                  gtid_121789];\n        float x_122170 = defunc_2_reduce_res_122167 *\n              defunc_2_reduce_res_122169;\n        float y_122171 = defunc",
                   "_2_reduce_res_122168 *\n              defunc_2_reduce_res_122168;\n        float y_122172 = x_122170 - y_122171;\n        float det1_122173 = 1.0F / y_122172;\n        float a11_122174 = defunc_2_reduce_res_122169 * det1_122173;\n        float negate_arg_122175 = defunc_2_reduce_res_122168 * det1_122173;\n        float b11_122176 = 0.0F - negate_arg_122175;\n        float c11_122177 = defunc_2_reduce_res_122167 * det1_122173;\n        \n        ((__global float *) mem_131009)[gtid_121788 * l_n_m_114584 +\n                                        gtid_121789] = a11_122174;\n        ((__global float *) mem_131013)[gtid_121788 * l_n_m_114584 +\n                                        gtid_121789] = b11_122176;\n        ((__global float *) mem_131017)[gtid_121788 * l_n_m_114584 +\n                                        gtid_121789] = c11_122177;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_122162\n}\n__kernel void mainzisegmap_122245(__global int *global_failure,\n                                  int64_t m_114533, int64_t l_window_114538,\n                                  int64_t t_jump_114541, int64_t l_n_m_114584,\n                                  int64_t i_114610, int64_t num_groups_122378,\n                                  int64_t num_threads_132222, __global\n                                  unsigned char *defunc_3_map_res_mem_130117,\n                                  __global unsigned char *mem_131043, __global\n                                  unsigned char *mem_131046, __global\n                                  unsigned char *mem_131049, __global\n                                  unsigned char *mem_131052, __global\n                                  unsigned char *mem_131055, __global\n                                  unsigned char *mem_131089, __global\n                                  unsigned char *mem_131092, __global\n                                  unsigned char *color_132112, __global\n                                  unsigned char *color_132113)\n{\n   ",
                   " #define segmap_group_sizze_122377 (mainzisegmap_group_sizze_122247)\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_133981;\n    int32_t local_tid_133982;\n    int64_t group_sizze_133985;\n    int32_t wave_sizze_133984;\n    int32_t group_tid_133983;\n    \n    global_tid_133981 = get_global_id(0);\n    local_tid_133982 = get_local_id(0);\n    group_sizze_133985 = get_local_size(0);\n    wave_sizze_133984 = LOCKSTEP_WIDTH;\n    group_tid_133983 = get_group_id(0);\n    \n    int32_t phys_tid_122245 = global_tid_133981;\n    int32_t phys_group_id_133986;\n    \n    phys_group_id_133986 = get_group_id(0);\n    for (int32_t i_133987 = 0; i_133987 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533,\n                                          segmap_group_sizze_122377)) -\n                   phys_group_id_133986, sext_i64_i32(num_groups_122378));\n         i_133987++) {\n        int32_t virt_group_id_133988 = phys_group_id_133986 + i_133987 *\n                sext_i64_i32(num_groups_122378);\n        int64_t global_tid_133989 = sext_i32_i64(virt_group_id_133988) *\n                segmap_group_sizze_122377 + sext_i32_i64(local_tid_133982);\n        int64_t slice_133990 = m_114533;\n        int64_t gtid_122244 = global_tid_133989;\n        int64_t remnant_133991 = global_tid_133989 - gtid_122244;\n        \n        if (slt64(gtid_122244, m_114533)) {\n            int64_t x_122387 = ((__global\n                                 int64_t *) defunc_3_map_res_mem_130117)[gtid_122244];\n            \n            for (int64_t i_129931 = 0; i_129931 < l_n_m_114584; i_129931++) {\n                int64_t x_122391 = ((__global int64_t *) mem_131043)[i_129931 *\n                                                                     m_114533 +\n                                                                     gtid_122244];\n                float x_122392 = ((__global float *) mem_131046)[i_1299",
                   "31 *\n                                                                 m_114533 +\n                                                                 gtid_122244];\n                int64_t min_arg_122393 = mul64(t_jump_114541, i_129931);\n                int64_t min_res_122394 = smin64(i_114610, min_arg_122393);\n                float defunc_0_f_res_122395 = sitofp_i64_f32(min_res_122394);\n                float defunc_2_reduce_res_122396;\n                float defunc_2_reduce_res_122397;\n                float defunc_2_reduce_res_122398;\n                float defunc_2_reduce_res_122399;\n                float defunc_2_reduce_res_122400;\n                float redout_128855;\n                float redout_128856;\n                float redout_128857;\n                float redout_128858;\n                float redout_128859;\n                \n                redout_128855 = 0.0F;\n                redout_128856 = 0.0F;\n                redout_128857 = 0.0F;\n                redout_128858 = 0.0F;\n                redout_128859 = 0.0F;\n                for (int64_t i_128860 = 0; i_128860 < l_window_114538;\n                     i_128860++) {\n                    bool cond_122417 = sle64(x_122387, i_128860);\n                    float defunc_0_f_res_122418;\n                    \n                    if (cond_122417) {\n                        defunc_0_f_res_122418 = 0.0F;\n                    } else {\n                        int64_t i_122419 = add64(x_122391, i_128860);\n                        float x_122420 = ((__global\n                                           float *) mem_131049)[i_122419 *\n                                                                m_114533 +\n                                                                gtid_122244];\n                        float defunc_0_f_res_f_res_122421 = 1.0F + x_122420;\n                        \n                        defunc_0_f_res_122418 = defunc_0_f_res_f_res_122421;\n                    }\n                    \n                    float defunc_0_f",
                   "_res_122422;\n                    \n                    if (cond_122417) {\n                        defunc_0_f_res_122422 = 0.0F;\n                    } else {\n                        int64_t i_122423 = add64(x_122391, i_128860);\n                        float x_122424 = ((__global\n                                           float *) mem_131052)[i_122423 *\n                                                                m_114533 +\n                                                                gtid_122244];\n                        \n                        defunc_0_f_res_122422 = x_122424;\n                    }\n                    \n                    float x_j_122425 = defunc_0_f_res_122418 -\n                          defunc_0_f_res_122395;\n                    float abs_res_122426 = (float) fabs(x_j_122425);\n                    float tmp1_122427 = abs_res_122426 / x_122392;\n                    float x_122428 = tmp1_122427 * tmp1_122427;\n                    float y_122429 = tmp1_122427 * x_122428;\n                    float tmp2_122430 = 1.0F - y_122429;\n                    float x_122431 = tmp2_122430 * tmp2_122430;\n                    float tmp3_122432 = tmp2_122430 * x_122431;\n                    float w_j_122433 = defunc_0_f_res_122422 * tmp3_122432;\n                    float xw_j_122434 = x_j_122425 * w_j_122433;\n                    float x2w_j_122435 = x_j_122425 * xw_j_122434;\n                    float x3w_j_122436 = x_j_122425 * x2w_j_122435;\n                    float x4w_j_122437 = x_j_122425 * x3w_j_122436;\n                    float defunc_1_op_res_122403 = w_j_122433 + redout_128855;\n                    float defunc_1_op_res_122406 = xw_j_122434 + redout_128856;\n                    float defunc_1_op_res_122409 = x2w_j_122435 + redout_128857;\n                    float defunc_1_op_res_122412 = x3w_j_122436 + redout_128858;\n                    float defunc_1_op_res_122415 = x4w_j_122437 + redout_128859;\n                    float redout_tmp_133994 = defunc_1_op_res_12",
                   "2403;\n                    float redout_tmp_133995 = defunc_1_op_res_122406;\n                    float redout_tmp_133996 = defunc_1_op_res_122409;\n                    float redout_tmp_133997 = defunc_1_op_res_122412;\n                    float redout_tmp_133998 = defunc_1_op_res_122415;\n                    \n                    redout_128855 = redout_tmp_133994;\n                    redout_128856 = redout_tmp_133995;\n                    redout_128857 = redout_tmp_133996;\n                    redout_128858 = redout_tmp_133997;\n                    redout_128859 = redout_tmp_133998;\n                }\n                defunc_2_reduce_res_122396 = redout_128855;\n                defunc_2_reduce_res_122397 = redout_128856;\n                defunc_2_reduce_res_122398 = redout_128857;\n                defunc_2_reduce_res_122399 = redout_128858;\n                defunc_2_reduce_res_122400 = redout_128859;\n                \n                float x_122438 = defunc_2_reduce_res_122398 *\n                      defunc_2_reduce_res_122400;\n                float y_122439 = defunc_2_reduce_res_122399 *\n                      defunc_2_reduce_res_122399;\n                float a12_122440 = x_122438 - y_122439;\n                float x_122441 = defunc_2_reduce_res_122398 *\n                      defunc_2_reduce_res_122399;\n                float y_122442 = defunc_2_reduce_res_122397 *\n                      defunc_2_reduce_res_122400;\n                float b12_122443 = x_122441 - y_122442;\n                float x_122444 = defunc_2_reduce_res_122397 *\n                      defunc_2_reduce_res_122399;\n                float y_122445 = defunc_2_reduce_res_122398 *\n                      defunc_2_reduce_res_122398;\n                float c12_122446 = x_122444 - y_122445;\n                float x_122447 = defunc_2_reduce_res_122396 *\n                      defunc_2_reduce_res_122400;\n                float b2_122448 = x_122447 - y_122445;\n                float x_122449 = defunc_2_reduce_res_122397 *\n              ",
                   "        defunc_2_reduce_res_122398;\n                float y_122450 = defunc_2_reduce_res_122396 *\n                      defunc_2_reduce_res_122399;\n                float c2_122451 = x_122449 - y_122450;\n                float x_122452 = defunc_2_reduce_res_122396 * a12_122440;\n                float y_122453 = defunc_2_reduce_res_122397 * b12_122443;\n                float x_122454 = x_122452 + y_122453;\n                float y_122455 = defunc_2_reduce_res_122398 * c12_122446;\n                float y_122456 = x_122454 + y_122455;\n                float det_122457 = 1.0F / y_122456;\n                float a12_122458 = a12_122440 * det_122457;\n                float b12_122459 = b12_122443 * det_122457;\n                float c12_122460 = c12_122446 * det_122457;\n                float b2_122461 = b2_122448 * det_122457;\n                float c2_122462 = c2_122451 * det_122457;\n                float defunc_2_reduce_res_122463;\n                float defunc_2_reduce_res_122464;\n                float redout_128861;\n                float redout_128862;\n                \n                redout_128861 = 0.0F;\n                redout_128862 = 0.0F;\n                for (int64_t i_128863 = 0; i_128863 < l_window_114538;\n                     i_128863++) {\n                    bool cond_122472 = sle64(x_122387, i_128863);\n                    float defunc_0_f_res_122473;\n                    \n                    if (cond_122472) {\n                        defunc_0_f_res_122473 = 0.0F;\n                    } else {\n                        int64_t i_122474 = add64(x_122391, i_128863);\n                        float x_122475 = ((__global\n                                           float *) mem_131049)[i_122474 *\n                                                                m_114533 +\n                                                                gtid_122244];\n                        float defunc_0_f_res_f_res_122476 = 1.0F + x_122475;\n                        \n                        defunc_0_f_r",
                   "es_122473 = defunc_0_f_res_f_res_122476;\n                    }\n                    \n                    float defunc_0_f_res_122477;\n                    \n                    if (cond_122472) {\n                        defunc_0_f_res_122477 = 0.0F;\n                    } else {\n                        int64_t i_122478 = add64(x_122391, i_128863);\n                        float x_122479 = ((__global\n                                           float *) mem_131052)[i_122478 *\n                                                                m_114533 +\n                                                                gtid_122244];\n                        \n                        defunc_0_f_res_122477 = x_122479;\n                    }\n                    \n                    float x_j_122480 = defunc_0_f_res_122473 -\n                          defunc_0_f_res_122395;\n                    float abs_res_122481 = (float) fabs(x_j_122480);\n                    float tmp1_122482 = abs_res_122481 / x_122392;\n                    float x_122483 = tmp1_122482 * tmp1_122482;\n                    float y_122484 = tmp1_122482 * x_122483;\n                    float tmp2_122485 = 1.0F - y_122484;\n                    float x_122486 = tmp2_122485 * tmp2_122485;\n                    float tmp3_122487 = tmp2_122485 * x_122486;\n                    float tmp4_122488 = defunc_0_f_res_122477 * tmp3_122487;\n                    float defunc_1_f_res_122489 = x_j_122480 * tmp4_122488;\n                    float defunc_1_f_res_122490 = x_j_122480 *\n                          defunc_1_f_res_122489;\n                    float defunc_0_f_res_122491;\n                    \n                    if (cond_122472) {\n                        defunc_0_f_res_122491 = 0.0F;\n                    } else {\n                        int64_t i_122492 = add64(x_122391, i_128863);\n                        float x_122493 = ((__global\n                                           float *) mem_131055)[i_122492 *\n                                    ",
                   "                            m_114533 +\n                                                                gtid_122244];\n                        \n                        defunc_0_f_res_122491 = x_122493;\n                    }\n                    \n                    float x_122494 = a12_122458 * tmp4_122488;\n                    float y_122495 = b12_122459 * defunc_1_f_res_122489;\n                    float x_122496 = x_122494 + y_122495;\n                    float y_122497 = c12_122460 * defunc_1_f_res_122490;\n                    float x_122498 = x_122496 + y_122497;\n                    float defunc_9_fit_fun_res_122499 = defunc_0_f_res_122491 *\n                          x_122498;\n                    float x_122500 = b12_122459 * tmp4_122488;\n                    float y_122501 = b2_122461 * defunc_1_f_res_122489;\n                    float x_122502 = x_122500 + y_122501;\n                    float y_122503 = c2_122462 * defunc_1_f_res_122490;\n                    float x_122504 = x_122502 + y_122503;\n                    float defunc_9_slope_fun_res_122505 =\n                          defunc_0_f_res_122491 * x_122504;\n                    float defunc_1_op_res_122467 = defunc_9_fit_fun_res_122499 +\n                          redout_128861;\n                    float defunc_1_op_res_122470 =\n                          defunc_9_slope_fun_res_122505 + redout_128862;\n                    float redout_tmp_133999 = defunc_1_op_res_122467;\n                    float redout_tmp_134000 = defunc_1_op_res_122470;\n                    \n                    redout_128861 = redout_tmp_133999;\n                    redout_128862 = redout_tmp_134000;\n                }\n                defunc_2_reduce_res_122463 = redout_128861;\n                defunc_2_reduce_res_122464 = redout_128862;\n                ((__global float *) color_132113)[phys_tid_122245 + i_129931 *\n                                                  num_threads_132222] =\n                    defunc_2_reduce_res_122463;\n                ((__g",
                   "lobal float *) color_132112)[phys_tid_122245 + i_129931 *\n                                                  num_threads_132222] =\n                    defunc_2_reduce_res_122464;\n            }\n            for (int64_t i_134001 = 0; i_134001 < l_n_m_114584; i_134001++) {\n                ((__global float *) mem_131089)[i_134001 * m_114533 +\n                                                gtid_122244] = ((__global\n                                                                 float *) color_132113)[phys_tid_122245 +\n                                                                                        i_134001 *\n                                                                                        num_threads_132222];\n            }\n            for (int64_t i_134002 = 0; i_134002 < l_n_m_114584; i_134002++) {\n                ((__global float *) mem_131092)[i_134002 * m_114533 +\n                                                gtid_122244] = ((__global\n                                                                 float *) color_132112)[phys_tid_122245 +\n                                                                                        i_134002 *\n                                                                                        num_threads_132222];\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_122377\n}\n__kernel void mainzisegmap_122508(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t l_window_114538,\n                                  int64_t t_jump_114541, int64_t l_n_m_114584,\n                                  int64_t i_114610, __global\n                                  unsigned char *defunc_3_map_res_mem_130117,\n                                  __global unsigned char *mem_130122, __global\n                                  unsigned char *defunc_3_map_res_mem_1304",
                   "04,\n                                  __global\n                                  unsigned char *defunc_3_map_res_mem_130405,\n                                  __global unsigned char *mem_130861, __global\n                                  unsigned char *mem_130865, __global\n                                  unsigned char *mem_131097, __global\n                                  unsigned char *mem_131101)\n{\n    #define segmap_group_sizze_123020 (mainzisegmap_group_sizze_122511)\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_134003;\n    int32_t local_tid_134004;\n    int64_t group_sizze_134007;\n    int32_t wave_sizze_134006;\n    int32_t group_tid_134005;\n    \n    global_tid_134003 = get_global_id(0);\n    local_tid_134004 = get_local_id(0);\n    group_sizze_134007 = get_local_size(0);\n    wave_sizze_134006 = LOCKSTEP_WIDTH;\n    group_tid_134005 = get_group_id(0);\n    \n    int32_t phys_tid_122508 = global_tid_134003;\n    int64_t global_tid_134008 = sext_i32_i64(group_tid_134005) *\n            segmap_group_sizze_123020 + sext_i32_i64(local_tid_134004);\n    int64_t slice_134009 = l_n_m_114584;\n    int64_t slice_134010 = m_114533 * slice_134009;\n    int64_t gtid_122506 = squot64(global_tid_134008, slice_134009);\n    int64_t remnant_134011 = global_tid_134008 - gtid_122506 * slice_134009;\n    int64_t gtid_122507 = remnant_134011;\n    int64_t remnant_134012 = remnant_134011 - gtid_122507;\n    \n    if (slt64(gtid_122506, m_114533) && slt64(gtid_122507, l_n_m_114584)) {\n        int64_t x_123032 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130117)[gtid_122506];\n        int64_t x_123034 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130404)[gtid_122506 *\n                                                                     l_n_m_114584 +\n                                                                    ",
                   " gtid_122507];\n        float x_123035 = ((__global\n                           float *) defunc_3_map_res_mem_130405)[gtid_122506 *\n                                                                 l_n_m_114584 +\n                                                                 gtid_122507];\n        int64_t min_arg_123036 = mul64(t_jump_114541, gtid_122507);\n        int64_t min_res_123037 = smin64(i_114610, min_arg_123036);\n        float defunc_0_f_res_123038 = sitofp_i64_f32(min_res_123037);\n        float defunc_2_reduce_res_123039;\n        float defunc_2_reduce_res_123040;\n        float defunc_2_reduce_res_123041;\n        float defunc_2_reduce_res_123042;\n        float defunc_2_reduce_res_123043;\n        float redout_128864;\n        float redout_128865;\n        float redout_128866;\n        float redout_128867;\n        float redout_128868;\n        \n        redout_128864 = 0.0F;\n        redout_128865 = 0.0F;\n        redout_128866 = 0.0F;\n        redout_128867 = 0.0F;\n        redout_128868 = 0.0F;\n        for (int64_t i_128869 = 0; i_128869 < l_window_114538; i_128869++) {\n            bool cond_123060 = sle64(x_123032, i_128869);\n            float defunc_0_f_res_123061;\n            \n            if (cond_123060) {\n                defunc_0_f_res_123061 = 0.0F;\n            } else {\n                int64_t i_123062 = add64(x_123034, i_128869);\n                float x_123063 = ((__global float *) mem_130122)[gtid_122506 *\n                                                                 n_114534 +\n                                                                 i_123062];\n                float defunc_0_f_res_f_res_123064 = 1.0F + x_123063;\n                \n                defunc_0_f_res_123061 = defunc_0_f_res_f_res_123064;\n            }\n            \n            float defunc_0_f_res_123065;\n            \n            if (cond_123060) {\n                defunc_0_f_res_123065 = 0.0F;\n            } else {\n                int64_t i_123066 = add64(x_123034, i_128869);\n                ",
                   "float x_123067 = ((__global float *) mem_130861)[gtid_122506 *\n                                                                 n_114534 +\n                                                                 i_123066];\n                \n                defunc_0_f_res_123065 = x_123067;\n            }\n            \n            float x_j_123068 = defunc_0_f_res_123061 - defunc_0_f_res_123038;\n            float abs_res_123069 = (float) fabs(x_j_123068);\n            float tmp1_123070 = abs_res_123069 / x_123035;\n            float x_123071 = tmp1_123070 * tmp1_123070;\n            float y_123072 = tmp1_123070 * x_123071;\n            float tmp2_123073 = 1.0F - y_123072;\n            float x_123074 = tmp2_123073 * tmp2_123073;\n            float tmp3_123075 = tmp2_123073 * x_123074;\n            float w_j_123076 = defunc_0_f_res_123065 * tmp3_123075;\n            float xw_j_123077 = x_j_123068 * w_j_123076;\n            float x2w_j_123078 = x_j_123068 * xw_j_123077;\n            float x3w_j_123079 = x_j_123068 * x2w_j_123078;\n            float x4w_j_123080 = x_j_123068 * x3w_j_123079;\n            float defunc_1_op_res_123046 = w_j_123076 + redout_128864;\n            float defunc_1_op_res_123049 = xw_j_123077 + redout_128865;\n            float defunc_1_op_res_123052 = x2w_j_123078 + redout_128866;\n            float defunc_1_op_res_123055 = x3w_j_123079 + redout_128867;\n            float defunc_1_op_res_123058 = x4w_j_123080 + redout_128868;\n            float redout_tmp_134013 = defunc_1_op_res_123046;\n            float redout_tmp_134014 = defunc_1_op_res_123049;\n            float redout_tmp_134015 = defunc_1_op_res_123052;\n            float redout_tmp_134016 = defunc_1_op_res_123055;\n            float redout_tmp_134017 = defunc_1_op_res_123058;\n            \n            redout_128864 = redout_tmp_134013;\n            redout_128865 = redout_tmp_134014;\n            redout_128866 = redout_tmp_134015;\n            redout_128867 = redout_tmp_134016;\n            redout_128868 = redout_tmp_134017;",
                   "\n        }\n        defunc_2_reduce_res_123039 = redout_128864;\n        defunc_2_reduce_res_123040 = redout_128865;\n        defunc_2_reduce_res_123041 = redout_128866;\n        defunc_2_reduce_res_123042 = redout_128867;\n        defunc_2_reduce_res_123043 = redout_128868;\n        \n        float x_123081 = defunc_2_reduce_res_123041 *\n              defunc_2_reduce_res_123043;\n        float y_123082 = defunc_2_reduce_res_123042 *\n              defunc_2_reduce_res_123042;\n        float a12_123083 = x_123081 - y_123082;\n        float x_123084 = defunc_2_reduce_res_123041 *\n              defunc_2_reduce_res_123042;\n        float y_123085 = defunc_2_reduce_res_123040 *\n              defunc_2_reduce_res_123043;\n        float b12_123086 = x_123084 - y_123085;\n        float x_123087 = defunc_2_reduce_res_123040 *\n              defunc_2_reduce_res_123042;\n        float y_123088 = defunc_2_reduce_res_123041 *\n              defunc_2_reduce_res_123041;\n        float c12_123089 = x_123087 - y_123088;\n        float x_123090 = defunc_2_reduce_res_123039 *\n              defunc_2_reduce_res_123043;\n        float b2_123091 = x_123090 - y_123088;\n        float x_123092 = defunc_2_reduce_res_123040 *\n              defunc_2_reduce_res_123041;\n        float y_123093 = defunc_2_reduce_res_123039 *\n              defunc_2_reduce_res_123042;\n        float c2_123094 = x_123092 - y_123093;\n        float x_123095 = defunc_2_reduce_res_123039 * a12_123083;\n        float y_123096 = defunc_2_reduce_res_123040 * b12_123086;\n        float x_123097 = x_123095 + y_123096;\n        float y_123098 = defunc_2_reduce_res_123041 * c12_123089;\n        float y_123099 = x_123097 + y_123098;\n        float det_123100 = 1.0F / y_123099;\n        float a12_123101 = a12_123083 * det_123100;\n        float b12_123102 = b12_123086 * det_123100;\n        float c12_123103 = c12_123089 * det_123100;\n        float b2_123104 = b2_123091 * det_123100;\n        float c2_123105 = c2_123094 * det_123100;\n        float defunc_2_reduc",
                   "e_res_123106;\n        float defunc_2_reduce_res_123107;\n        float redout_128870;\n        float redout_128871;\n        \n        redout_128870 = 0.0F;\n        redout_128871 = 0.0F;\n        for (int64_t i_128872 = 0; i_128872 < l_window_114538; i_128872++) {\n            bool cond_123115 = sle64(x_123032, i_128872);\n            float defunc_0_f_res_123116;\n            \n            if (cond_123115) {\n                defunc_0_f_res_123116 = 0.0F;\n            } else {\n                int64_t i_123117 = add64(x_123034, i_128872);\n                float x_123118 = ((__global float *) mem_130122)[gtid_122506 *\n                                                                 n_114534 +\n                                                                 i_123117];\n                float defunc_0_f_res_f_res_123119 = 1.0F + x_123118;\n                \n                defunc_0_f_res_123116 = defunc_0_f_res_f_res_123119;\n            }\n            \n            float defunc_0_f_res_123120;\n            \n            if (cond_123115) {\n                defunc_0_f_res_123120 = 0.0F;\n            } else {\n                int64_t i_123121 = add64(x_123034, i_128872);\n                float x_123122 = ((__global float *) mem_130861)[gtid_122506 *\n                                                                 n_114534 +\n                                                                 i_123121];\n                \n                defunc_0_f_res_123120 = x_123122;\n            }\n            \n            float x_j_123123 = defunc_0_f_res_123116 - defunc_0_f_res_123038;\n            float abs_res_123124 = (float) fabs(x_j_123123);\n            float tmp1_123125 = abs_res_123124 / x_123035;\n            float x_123126 = tmp1_123125 * tmp1_123125;\n            float y_123127 = tmp1_123125 * x_123126;\n            float tmp2_123128 = 1.0F - y_123127;\n            float x_123129 = tmp2_123128 * tmp2_123128;\n            float tmp3_123130 = tmp2_123128 * x_123129;\n            float tmp4_123131 = defunc_0_f_res_1",
                   "23120 * tmp3_123130;\n            float defunc_1_f_res_123132 = x_j_123123 * tmp4_123131;\n            float defunc_1_f_res_123133 = x_j_123123 * defunc_1_f_res_123132;\n            float defunc_0_f_res_123134;\n            \n            if (cond_123115) {\n                defunc_0_f_res_123134 = 0.0F;\n            } else {\n                int64_t i_123135 = add64(x_123034, i_128872);\n                float x_123136 = ((__global float *) mem_130865)[gtid_122506 *\n                                                                 n_114534 +\n                                                                 i_123135];\n                \n                defunc_0_f_res_123134 = x_123136;\n            }\n            \n            float x_123137 = a12_123101 * tmp4_123131;\n            float y_123138 = b12_123102 * defunc_1_f_res_123132;\n            float x_123139 = x_123137 + y_123138;\n            float y_123140 = c12_123103 * defunc_1_f_res_123133;\n            float x_123141 = x_123139 + y_123140;\n            float defunc_9_fit_fun_res_123142 = defunc_0_f_res_123134 *\n                  x_123141;\n            float x_123143 = b12_123102 * tmp4_123131;\n            float y_123144 = b2_123104 * defunc_1_f_res_123132;\n            float x_123145 = x_123143 + y_123144;\n            float y_123146 = c2_123105 * defunc_1_f_res_123133;\n            float x_123147 = x_123145 + y_123146;\n            float defunc_9_slope_fun_res_123148 = defunc_0_f_res_123134 *\n                  x_123147;\n            float defunc_1_op_res_123110 = defunc_9_fit_fun_res_123142 +\n                  redout_128870;\n            float defunc_1_op_res_123113 = defunc_9_slope_fun_res_123148 +\n                  redout_128871;\n            float redout_tmp_134018 = defunc_1_op_res_123110;\n            float redout_tmp_134019 = defunc_1_op_res_123113;\n            \n            redout_128870 = redout_tmp_134018;\n            redout_128871 = redout_tmp_134019;\n        }\n        defunc_2_reduce_res_123106 = redout_128870;\n        defunc_2_",
                   "reduce_res_123107 = redout_128871;\n        ((__global float *) mem_131097)[gtid_122506 * l_n_m_114584 +\n                                        gtid_122507] =\n            defunc_2_reduce_res_123106;\n        ((__global float *) mem_131101)[gtid_122506 * l_n_m_114584 +\n                                        gtid_122507] =\n            defunc_2_reduce_res_123107;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_123020\n}\n__kernel void mainzisegmap_122736(__global int *global_failure,\n                                  int64_t m_114533, int64_t l_n_m_114584,\n                                  __global unsigned char *mem_131106, __global\n                                  unsigned char *mem_131110, __global\n                                  unsigned char *mem_131114, __global\n                                  unsigned char *mem_131118, __global\n                                  unsigned char *mem_131122, __global\n                                  unsigned char *mem_131127, __global\n                                  unsigned char *mem_131131, __global\n                                  unsigned char *mem_131135, __global\n                                  unsigned char *mem_131139, __global\n                                  unsigned char *mem_131143)\n{\n    #define segmap_group_sizze_123217 (mainzisegmap_group_sizze_122739)\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_134140;\n    int32_t local_tid_134141;\n    int64_t group_sizze_134144;\n    int32_t wave_sizze_134143;\n    int32_t group_tid_134142;\n    \n    global_tid_134140 = get_global_id(0);\n    local_tid_134141 = get_local_id(0);\n    group_sizze_134144 = get_local_size(0);\n    wave_sizze_134143 = LOCKSTEP_WIDTH;\n    group_tid_134142 = get_group_id(0);\n    \n    int32_t phys_tid_122736 = global_tid_134140;\n    int64_t global_tid_134145 = sext_i32_i64(group_tid_134142) *\n            segma",
                   "p_group_sizze_123217 + sext_i32_i64(local_tid_134141);\n    int64_t slice_134146 = l_n_m_114584;\n    int64_t slice_134147 = m_114533 * slice_134146;\n    int64_t gtid_122734 = squot64(global_tid_134145, slice_134146);\n    int64_t remnant_134148 = global_tid_134145 - gtid_122734 * slice_134146;\n    int64_t gtid_122735 = remnant_134148;\n    int64_t remnant_134149 = remnant_134148 - gtid_122735;\n    \n    if (slt64(gtid_122734, m_114533) && slt64(gtid_122735, l_n_m_114584)) {\n        float defunc_2_reduce_res_123224 = ((__global\n                                             float *) mem_131106)[gtid_122734 *\n                                                                  l_n_m_114584 +\n                                                                  gtid_122735];\n        float defunc_2_reduce_res_123225 = ((__global\n                                             float *) mem_131110)[gtid_122734 *\n                                                                  l_n_m_114584 +\n                                                                  gtid_122735];\n        float defunc_2_reduce_res_123226 = ((__global\n                                             float *) mem_131114)[gtid_122734 *\n                                                                  l_n_m_114584 +\n                                                                  gtid_122735];\n        float defunc_2_reduce_res_123227 = ((__global\n                                             float *) mem_131118)[gtid_122734 *\n                                                                  l_n_m_114584 +\n                                                                  gtid_122735];\n        float defunc_2_reduce_res_123228 = ((__global\n                                             float *) mem_131122)[gtid_122734 *\n                                                                  l_n_m_114584 +\n                                                                  gtid_122735];\n        float x_123229 = defunc_2_reduce_res_12322",
                   "6 *\n              defunc_2_reduce_res_123228;\n        float y_123230 = defunc_2_reduce_res_123227 *\n              defunc_2_reduce_res_123227;\n        float a12_123231 = x_123229 - y_123230;\n        float x_123232 = defunc_2_reduce_res_123226 *\n              defunc_2_reduce_res_123227;\n        float y_123233 = defunc_2_reduce_res_123225 *\n              defunc_2_reduce_res_123228;\n        float b12_123234 = x_123232 - y_123233;\n        float x_123235 = defunc_2_reduce_res_123225 *\n              defunc_2_reduce_res_123227;\n        float y_123236 = defunc_2_reduce_res_123226 *\n              defunc_2_reduce_res_123226;\n        float c12_123237 = x_123235 - y_123236;\n        float x_123238 = defunc_2_reduce_res_123224 *\n              defunc_2_reduce_res_123228;\n        float b2_123239 = x_123238 - y_123236;\n        float x_123240 = defunc_2_reduce_res_123225 *\n              defunc_2_reduce_res_123226;\n        float y_123241 = defunc_2_reduce_res_123224 *\n              defunc_2_reduce_res_123227;\n        float c2_123242 = x_123240 - y_123241;\n        float x_123243 = defunc_2_reduce_res_123224 * a12_123231;\n        float y_123244 = defunc_2_reduce_res_123225 * b12_123234;\n        float x_123245 = x_123243 + y_123244;\n        float y_123246 = defunc_2_reduce_res_123226 * c12_123237;\n        float y_123247 = x_123245 + y_123246;\n        float det_123248 = 1.0F / y_123247;\n        float a12_123249 = a12_123231 * det_123248;\n        float b12_123250 = b12_123234 * det_123248;\n        float c12_123251 = c12_123237 * det_123248;\n        float b2_123252 = b2_123239 * det_123248;\n        float c2_123253 = c2_123242 * det_123248;\n        \n        ((__global float *) mem_131127)[gtid_122734 * l_n_m_114584 +\n                                        gtid_122735] = a12_123249;\n        ((__global float *) mem_131131)[gtid_122734 * l_n_m_114584 +\n                                        gtid_122735] = b12_123250;\n        ((__global float *) mem_131135)[gtid_122734 * l_n_m_114584 +\n        ",
                   "                                gtid_122735] = c12_123251;\n        ((__global float *) mem_131139)[gtid_122734 * l_n_m_114584 +\n                                        gtid_122735] = b2_123252;\n        ((__global float *) mem_131143)[gtid_122734 * l_n_m_114584 +\n                                        gtid_122735] = c2_123253;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_123217\n}\n__kernel void mainzisegmap_123938(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t l_jump_114542, int64_t l_n_m_114584,\n                                  int64_t i_114610, int64_t y_115794, __global\n                                  unsigned char *defunc_11_loess_l_res_mem_131230,\n                                  __global\n                                  unsigned char *defunc_11_loess_l_res_mem_131231,\n                                  __global unsigned char *mem_131236)\n{\n    #define segmap_group_sizze_124053 (mainzisegmap_group_sizze_123941)\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_134303;\n    int32_t local_tid_134304;\n    int64_t group_sizze_134307;\n    int32_t wave_sizze_134306;\n    int32_t group_tid_134305;\n    \n    global_tid_134303 = get_global_id(0);\n    local_tid_134304 = get_local_id(0);\n    group_sizze_134307 = get_local_size(0);\n    wave_sizze_134306 = LOCKSTEP_WIDTH;\n    group_tid_134305 = get_group_id(0);\n    \n    int32_t phys_tid_123938 = global_tid_134303;\n    int64_t global_tid_134308 = sext_i32_i64(group_tid_134305) *\n            segmap_group_sizze_124053 + sext_i32_i64(local_tid_134304);\n    int64_t slice_134309 = n_114534;\n    int64_t slice_134310 = m_114533 * slice_134309;\n    int64_t gtid_123936 ",
                   "= squot64(global_tid_134308, slice_134309);\n    int64_t remnant_134311 = global_tid_134308 - gtid_123936 * slice_134309;\n    int64_t gtid_123937 = remnant_134311;\n    int64_t remnant_134312 = remnant_134311 - gtid_123937;\n    \n    if (slt64(gtid_123936, m_114533) && slt64(gtid_123937, n_114534)) {\n        int64_t m_v_124059 = sdiv64(gtid_123937, l_jump_114542);\n        bool cond_124060 = m_v_124059 == y_115794;\n        int64_t j_124061;\n        \n        if (cond_124060) {\n            int64_t j_t_res_124062 = sub64(m_v_124059, (int64_t) 1);\n            \n            j_124061 = j_t_res_124062;\n        } else {\n            j_124061 = m_v_124059;\n        }\n        \n        int64_t min_arg_124063 = mul64(l_jump_114542, j_124061);\n        int64_t min_res_124064 = smin64(i_114610, min_arg_124063);\n        int64_t defunc_0_m_fun_arg_124065 = add64((int64_t) 1, j_124061);\n        int64_t min_arg_124066 = mul64(l_jump_114542,\n                                       defunc_0_m_fun_arg_124065);\n        int64_t min_res_124067 = smin64(i_114610, min_arg_124066);\n        int64_t i64_arg_124068 = sub64(min_res_124067, min_res_124064);\n        float i64_res_124069 = sitofp_i64_f32(i64_arg_124068);\n        int64_t i64_arg_124070 = sub64(gtid_123937, min_res_124064);\n        float i64_res_124071 = sitofp_i64_f32(i64_arg_124070);\n        float u_124072 = i64_res_124071 / i64_res_124069;\n        float u2_124073 = u_124072 * u_124072;\n        float u3_124074 = u_124072 * u2_124073;\n        float x_124075 = 2.0F * u3_124074;\n        float y_124076 = 3.0F * u2_124073;\n        float x_124077 = x_124075 - y_124076;\n        float x_124078 = 1.0F + x_124077;\n        bool x_124079 = sle64((int64_t) 0, j_124061);\n        bool y_124080 = slt64(j_124061, l_n_m_114584);\n        bool bounds_check_124081 = x_124079 && y_124080;\n        bool index_certs_124082;\n        \n        if (!bounds_check_124081) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 82) == -1) {\n      ",
                   "              global_failure_args[0] = j_124061;\n                    global_failure_args[1] = l_n_m_114584;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        float y_124083 = ((__global\n                           float *) defunc_11_loess_l_res_mem_131230)[gtid_123936 *\n                                                                      l_n_m_114584 +\n                                                                      j_124061];\n        float x_124084 = x_124078 * y_124083;\n        float x_124085 = y_124076 - x_124075;\n        bool x_124086 = sle64((int64_t) 0, defunc_0_m_fun_arg_124065);\n        bool y_124087 = slt64(defunc_0_m_fun_arg_124065, l_n_m_114584);\n        bool bounds_check_124088 = x_124086 && y_124087;\n        bool index_certs_124089;\n        \n        if (!bounds_check_124088) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 83) == -1) {\n                    global_failure_args[0] = defunc_0_m_fun_arg_124065;\n                    global_failure_args[1] = l_n_m_114584;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        float y_124090 = ((__global\n                           float *) defunc_11_loess_l_res_mem_131230)[gtid_123936 *\n                                                                      l_n_m_114584 +\n                                                                      defunc_0_m_fun_arg_124065];\n        float y_124091 = x_124085 * y_124090;\n        float x_124092 = x_124084 + y_124091;\n        float y_124093 = 2.0F * u2_124073;\n        float x_124094 = u3_124074 - y_124093;\n        float x_124095 = u_124072 + x_124094;\n        float y_124096 = ((__global\n                           float *) defunc_11_loess_l_res_mem_131231)[gtid_123936 *\n                                                                      l_n_m_114584 +\n                                                                      j_124061];\n ",
                   "       float x_124097 = x_124095 * y_124096;\n        float y_124098 = i64_res_124069 * x_124097;\n        float x_124099 = x_124092 + y_124098;\n        float x_124100 = u3_124074 - u2_124073;\n        float y_124101 = ((__global\n                           float *) defunc_11_loess_l_res_mem_131231)[gtid_123936 *\n                                                                      l_n_m_114584 +\n                                                                      defunc_0_m_fun_arg_124065];\n        float x_124102 = x_124100 * y_124101;\n        float y_124103 = i64_res_124069 * x_124102;\n        float defunc_0_f_res_124104 = x_124099 + y_124103;\n        \n        ((__global float *) mem_131236)[gtid_123936 * n_114534 + gtid_123937] =\n            defunc_0_f_res_124104;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_124053\n}\n__kernel void mainzisegmap_124116(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t n_p_114536, int64_t C_len_114582,\n                                  int64_t L_l_ixfn_131237, __global\n                                  unsigned char *mem_130750, __global\n                                  unsigned char *L_l_mem_131238, __global\n                                  unsigned char *mem_131243)\n{\n    #define segmap_group_sizze_124139 (mainzisegmap_group_sizze_124119)\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_134313;\n    int32_t local_tid_134314;\n    int64_t group_sizze_134317;\n    int32_t wave_sizze_134316;\n    int32_t group_tid_134315;\n    \n    global_tid_134313 = get_global_id(0);\n    local_tid_134314 = get_local_id(0);\n    group_sizze_134317 = get_local_size(0);\n    wave_sizze_134316 = LOCKSTEP_WIDTH;\n    group_tid_134315 = get_group_id(0);\n    \n    int32_t phys_tid_124116 = global_tid_134313;\n    int64_t global_tid_13",
                   "4318 = sext_i32_i64(group_tid_134315) *\n            segmap_group_sizze_124139 + sext_i32_i64(local_tid_134314);\n    int64_t slice_134319 = n_114534;\n    int64_t slice_134320 = m_114533 * slice_134319;\n    int64_t gtid_124114 = squot64(global_tid_134318, slice_134319);\n    int64_t remnant_134321 = global_tid_134318 - gtid_124114 * slice_134319;\n    int64_t gtid_124115 = remnant_134321;\n    int64_t remnant_134322 = remnant_134321 - gtid_124115;\n    \n    if (slt64(gtid_124114, m_114533) && slt64(gtid_124115, n_114534)) {\n        int64_t slice_128911 = n_p_114536 + gtid_124115;\n        float x_124142 = ((__global float *) mem_130750)[gtid_124114 *\n                                                         C_len_114582 +\n                                                         slice_128911];\n        float x_124143 = ((__global float *) L_l_mem_131238)[gtid_124114 *\n                                                             L_l_ixfn_131237 +\n                                                             gtid_124115];\n        float defunc_1_f_res_124144 = x_124142 - x_124143;\n        \n        ((__global float *) mem_131243)[gtid_124114 * n_114534 + gtid_124115] =\n            defunc_1_f_res_124144;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_124139\n}\n__kernel void mainzisegmap_124202(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t m_114533, int64_t n_114534, __global\n                                  unsigned char *defunc_3_map_res_mem_130116,\n                                  __global unsigned char *mem_131261, __global\n                                  unsigned char *mem_131266)\n{\n    #define segmap_group_sizze_124275 (mainzisegmap_group_sizze_124205)\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_134341;\n    int32_t local_tid_134342;\n    int64_t group_sizze_134345;\n    int32_t wave_sizze_134344;\n    int32_t group_tid_134343;\n    \n    global_tid_134341 = get_global_id(0);\n    local_tid_134342 = get_local_id(0);\n    group_sizze_134345 = get_local_size(0);\n    wave_sizze_134344 = LOCKSTEP_WIDTH;\n    group_tid_134343 = get_group_id(0);\n    \n    int32_t phys_tid_124202 = global_tid_134341;\n    int64_t global_tid_134346 = sext_i32_i64(group_tid_134343) *\n            segmap_group_sizze_124275 + sext_i32_i64(local_tid_134342);\n    int64_t slice_134347 = n_114534;\n    int64_t slice_134348 = m_114533 * slice_134347;\n    int64_t gtid_124200 = squot64(global_tid_134346, slice_134347);\n    int64_t remnant_134349 = global_tid_134346 - gtid_124200 * slice_134347;\n    int64_t gtid_124201 = remnant_134349;\n    int64_t remnant_134350 = remnant_134349 - gtid_124201;\n    \n    if (slt64(gtid_124200, m_114533) && slt64(gtid_124201, n_114534)) {\n        int64_t x_124279 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130116)[gtid_124200 *\n                                                                     n_114534 +\n                                                                     gtid_124201];\n        bool cond_124280 = sle64((int64_t) 0, x_124279);\n        float defunc_0_f_res_124281;\n        \n        if (cond_124280) {\n            bool y_124282 = slt64(x_124279, n_114534);\n            bool bounds_check_124283 = cond_124280 && y_124282;\n            bool index_certs_124284;\n            \n            if (!bounds_check_124283) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 85) ==\n                        -1) {\n                        global_failure_args[0] = x_124279;\n                        global_failure_args[1] = n_114534;\n                        ;\n                    }\n                    return;\n                }\n            }\n            \n            float defunc_0_f_res_t_res_124285",
                   " = ((__global\n                                                  float *) mem_131261)[gtid_124200 *\n                                                                       n_114534 +\n                                                                       x_124279];\n            \n            defunc_0_f_res_124281 = defunc_0_f_res_t_res_124285;\n        } else {\n            defunc_0_f_res_124281 = 0.0F;\n        }\n        ((__global float *) mem_131266)[gtid_124200 * n_114534 + gtid_124201] =\n            defunc_0_f_res_124281;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_124275\n}\n__kernel void mainzisegmap_124239(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534, __global\n                                  unsigned char *Y_mem_130086, __global\n                                  unsigned char *mem_131243, __global\n                                  unsigned char *mem_131261)\n{\n    #define segmap_group_sizze_124262 (mainzisegmap_group_sizze_124242)\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_134331;\n    int32_t local_tid_134332;\n    int64_t group_sizze_134335;\n    int32_t wave_sizze_134334;\n    int32_t group_tid_134333;\n    \n    global_tid_134331 = get_global_id(0);\n    local_tid_134332 = get_local_id(0);\n    group_sizze_134335 = get_local_size(0);\n    wave_sizze_134334 = LOCKSTEP_WIDTH;\n    group_tid_134333 = get_group_id(0);\n    \n    int32_t phys_tid_124239 = global_tid_134331;\n    int64_t global_tid_134336 = sext_i32_i64(group_tid_134333) *\n            segmap_group_sizze_124262 + sext_i32_i64(local_tid_134332);\n    int64_t slice_134337 = n_114534;\n    int64_t slice_134338 = m_114533 * slice_134337;\n    int64_t gtid_124237 = squot64(global_tid_134336, slice_134337);\n    int64_t remnant_134339 = global_tid_134336 - gtid_124237 * slice_134337;\n    int64_t gtid_124238 = remnant_134339;",
                   "\n    int64_t remnant_134340 = remnant_134339 - gtid_124238;\n    \n    if (slt64(gtid_124237, m_114533) && slt64(gtid_124238, n_114534)) {\n        float x_124265 = ((__global float *) Y_mem_130086)[gtid_124237 *\n                                                           n_114534 +\n                                                           gtid_124238];\n        float x_124266 = ((__global float *) mem_131243)[gtid_124237 *\n                                                         n_114534 +\n                                                         gtid_124238];\n        float defunc_1_f_res_124267 = x_124265 - x_124266;\n        \n        ((__global float *) mem_131261)[gtid_124237 * n_114534 + gtid_124238] =\n            defunc_1_f_res_124267;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_124262\n}\n__kernel void mainzisegmap_124291(__global int *global_failure,\n                                  int64_t m_114533, int64_t t_window_114537,\n                                  int64_t t_jump_114541, int64_t t_n_m_114591,\n                                  int64_t i_114610, int64_t num_groups_124363,\n                                  int64_t num_threads_132237, __global\n                                  unsigned char *defunc_3_map_res_mem_130117,\n                                  __global unsigned char *mem_131274, __global\n                                  unsigned char *mem_131277, __global\n                                  unsigned char *mem_131280, __global\n                                  unsigned char *mem_131283, __global\n                                  unsigned char *mem_131286, __global\n                                  unsigned char *mem_131305, __global\n                                  unsigned char *color_132123)\n{\n    #define segmap_group_sizze_124362 (mainzisegmap_group_sizze_124293)\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 glob",
                   "al_tid_134355;\n    int32_t local_tid_134356;\n    int64_t group_sizze_134359;\n    int32_t wave_sizze_134358;\n    int32_t group_tid_134357;\n    \n    global_tid_134355 = get_global_id(0);\n    local_tid_134356 = get_local_id(0);\n    group_sizze_134359 = get_local_size(0);\n    wave_sizze_134358 = LOCKSTEP_WIDTH;\n    group_tid_134357 = get_group_id(0);\n    \n    int32_t phys_tid_124291 = global_tid_134355;\n    int32_t phys_group_id_134360;\n    \n    phys_group_id_134360 = get_group_id(0);\n    for (int32_t i_134361 = 0; i_134361 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533,\n                                          segmap_group_sizze_124362)) -\n                   phys_group_id_134360, sext_i64_i32(num_groups_124363));\n         i_134361++) {\n        int32_t virt_group_id_134362 = phys_group_id_134360 + i_134361 *\n                sext_i64_i32(num_groups_124363);\n        int64_t global_tid_134363 = sext_i32_i64(virt_group_id_134362) *\n                segmap_group_sizze_124362 + sext_i32_i64(local_tid_134356);\n        int64_t slice_134364 = m_114533;\n        int64_t gtid_124290 = global_tid_134363;\n        int64_t remnant_134365 = global_tid_134363 - gtid_124290;\n        \n        if (slt64(gtid_124290, m_114533)) {\n            int64_t x_124371 = ((__global\n                                 int64_t *) defunc_3_map_res_mem_130117)[gtid_124290];\n            \n            for (int64_t i_129936 = 0; i_129936 < t_n_m_114591; i_129936++) {\n                int64_t x_124374 = ((__global int64_t *) mem_131274)[i_129936 *\n                                                                     m_114533 +\n                                                                     gtid_124290];\n                float x_124375 = ((__global float *) mem_131277)[i_129936 *\n                                                                 m_114533 +\n                                                                 gtid_124290];\n                int64_t min_arg_124376 = mul64(t_jump_114541, i_129936);\n   ",
                   "             int64_t min_res_124377 = smin64(i_114610, min_arg_124376);\n                float defunc_0_f_res_124378 = sitofp_i64_f32(min_res_124377);\n                float defunc_2_reduce_res_124379;\n                float redout_128912 = 0.0F;\n                \n                for (int64_t i_128913 = 0; i_128913 < t_window_114537;\n                     i_128913++) {\n                    bool cond_124384 = sle64(x_124371, i_128913);\n                    float defunc_0_f_res_124385;\n                    \n                    if (cond_124384) {\n                        defunc_0_f_res_124385 = 0.0F;\n                    } else {\n                        int64_t i_124386 = add64(x_124374, i_128913);\n                        float x_124387 = ((__global\n                                           float *) mem_131280)[i_124386 *\n                                                                m_114533 +\n                                                                gtid_124290];\n                        float defunc_0_f_res_f_res_124388 = 1.0F + x_124387;\n                        \n                        defunc_0_f_res_124385 = defunc_0_f_res_f_res_124388;\n                    }\n                    \n                    float defunc_0_f_res_124389;\n                    \n                    if (cond_124384) {\n                        defunc_0_f_res_124389 = 0.0F;\n                    } else {\n                        int64_t i_124390 = add64(x_124374, i_128913);\n                        float x_124391 = ((__global\n                                           float *) mem_131283)[i_124390 *\n                                                                m_114533 +\n                                                                gtid_124290];\n                        \n                        defunc_0_f_res_124389 = x_124391;\n                    }\n                    \n                    float x_j_124392 = defunc_0_f_res_124385 -\n                          defunc_0_f_res_124378;\n                    flo",
                   "at abs_res_124393 = (float) fabs(x_j_124392);\n                    float tmp1_124394 = abs_res_124393 / x_124375;\n                    float x_124395 = tmp1_124394 * tmp1_124394;\n                    float y_124396 = tmp1_124394 * x_124395;\n                    float tmp2_124397 = 1.0F - y_124396;\n                    float x_124398 = tmp2_124397 * tmp2_124397;\n                    float tmp3_124399 = tmp2_124397 * x_124398;\n                    float w_j_124400 = defunc_0_f_res_124389 * tmp3_124399;\n                    float defunc_1_op_res_124382 = w_j_124400 + redout_128912;\n                    float redout_tmp_134367 = defunc_1_op_res_124382;\n                    \n                    redout_128912 = redout_tmp_134367;\n                }\n                defunc_2_reduce_res_124379 = redout_128912;\n                \n                float a0_124401 = 1.0F / defunc_2_reduce_res_124379;\n                float defunc_2_reduce_res_124402;\n                float redout_128914 = 0.0F;\n                \n                for (int64_t i_128915 = 0; i_128915 < t_window_114537;\n                     i_128915++) {\n                    bool cond_124407 = sle64(x_124371, i_128915);\n                    float defunc_0_f_res_124408;\n                    \n                    if (cond_124407) {\n                        defunc_0_f_res_124408 = 0.0F;\n                    } else {\n                        int64_t i_124409 = add64(x_124374, i_128915);\n                        float x_124410 = ((__global\n                                           float *) mem_131280)[i_124409 *\n                                                                m_114533 +\n                                                                gtid_124290];\n                        float defunc_0_f_res_f_res_124411 = 1.0F + x_124410;\n                        \n                        defunc_0_f_res_124408 = defunc_0_f_res_f_res_124411;\n                    }\n                    \n                    float defunc_0_f_res_124412;\n                ",
                   "    \n                    if (cond_124407) {\n                        defunc_0_f_res_124412 = 0.0F;\n                    } else {\n                        int64_t i_124413 = add64(x_124374, i_128915);\n                        float x_124414 = ((__global\n                                           float *) mem_131283)[i_124413 *\n                                                                m_114533 +\n                                                                gtid_124290];\n                        \n                        defunc_0_f_res_124412 = x_124414;\n                    }\n                    \n                    float x_j_124415 = defunc_0_f_res_124408 -\n                          defunc_0_f_res_124378;\n                    float abs_res_124416 = (float) fabs(x_j_124415);\n                    float tmp1_124417 = abs_res_124416 / x_124375;\n                    float x_124418 = tmp1_124417 * tmp1_124417;\n                    float y_124419 = tmp1_124417 * x_124418;\n                    float tmp2_124420 = 1.0F - y_124419;\n                    float x_124421 = tmp2_124420 * tmp2_124420;\n                    float tmp3_124422 = tmp2_124420 * x_124421;\n                    float tmp4_124423 = defunc_0_f_res_124412 * tmp3_124422;\n                    float defunc_0_f_res_124424;\n                    \n                    if (cond_124407) {\n                        defunc_0_f_res_124424 = 0.0F;\n                    } else {\n                        int64_t i_124425 = add64(x_124374, i_128915);\n                        float x_124426 = ((__global\n                                           float *) mem_131286)[i_124425 *\n                                                                m_114533 +\n                                                                gtid_124290];\n                        \n                        defunc_0_f_res_124424 = x_124426;\n                    }\n                    \n                    float x_124427 = a0_124401 * tmp4_124423;\n                    float defunc",
                   "_9_fit_fun_res_124428 = defunc_0_f_res_124424 *\n                          x_124427;\n                    float defunc_1_op_res_124405 = defunc_9_fit_fun_res_124428 +\n                          redout_128914;\n                    float redout_tmp_134368 = defunc_1_op_res_124405;\n                    \n                    redout_128914 = redout_tmp_134368;\n                }\n                defunc_2_reduce_res_124402 = redout_128914;\n                ((__global float *) color_132123)[phys_tid_124291 + i_129936 *\n                                                  num_threads_132237] =\n                    defunc_2_reduce_res_124402;\n            }\n            for (int64_t i_134369 = 0; i_134369 < t_n_m_114591; i_134369++) {\n                ((__global float *) mem_131305)[i_134369 * m_114533 +\n                                                gtid_124290] = ((__global\n                                                                 float *) color_132123)[phys_tid_124291 +\n                                                                                        i_134369 *\n                                                                                        num_threads_132237];\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_124362\n}\n__kernel void mainzisegmap_124431(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t t_window_114537,\n                                  int64_t t_jump_114541, int64_t t_n_m_114591,\n                                  int64_t i_114610, __global\n                                  unsigned char *defunc_3_map_res_mem_130117,\n                                  __global unsigned char *mem_130122, __global\n                                  unsigned char *defunc_3_map_res_mem_130606,\n                                  __global\n                                  unsigned char *def",
                   "unc_3_map_res_mem_130607,\n                                  __global unsigned char *mem_130861, __global\n                                  unsigned char *defunc_4_map_res_mem_131267,\n                                  __global unsigned char *mem_131310)\n{\n    #define segmap_group_sizze_124722 (mainzisegmap_group_sizze_124434)\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_134370;\n    int32_t local_tid_134371;\n    int64_t group_sizze_134374;\n    int32_t wave_sizze_134373;\n    int32_t group_tid_134372;\n    \n    global_tid_134370 = get_global_id(0);\n    local_tid_134371 = get_local_id(0);\n    group_sizze_134374 = get_local_size(0);\n    wave_sizze_134373 = LOCKSTEP_WIDTH;\n    group_tid_134372 = get_group_id(0);\n    \n    int32_t phys_tid_124431 = global_tid_134370;\n    int64_t global_tid_134375 = sext_i32_i64(group_tid_134372) *\n            segmap_group_sizze_124722 + sext_i32_i64(local_tid_134371);\n    int64_t slice_134376 = t_n_m_114591;\n    int64_t slice_134377 = m_114533 * slice_134376;\n    int64_t gtid_124429 = squot64(global_tid_134375, slice_134376);\n    int64_t remnant_134378 = global_tid_134375 - gtid_124429 * slice_134376;\n    int64_t gtid_124430 = remnant_134378;\n    int64_t remnant_134379 = remnant_134378 - gtid_124430;\n    \n    if (slt64(gtid_124429, m_114533) && slt64(gtid_124430, t_n_m_114591)) {\n        int64_t x_124732 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130117)[gtid_124429];\n        int64_t x_124734 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130606)[gtid_124429 *\n                                                                     t_n_m_114591 +\n                                                                     gtid_124430];\n        float x_124735 = ((__global\n                           float *) defunc_3_map_res_mem_130607)[gtid_124429 *\n                      ",
                   "                                           t_n_m_114591 +\n                                                                 gtid_124430];\n        int64_t min_arg_124736 = mul64(t_jump_114541, gtid_124430);\n        int64_t min_res_124737 = smin64(i_114610, min_arg_124736);\n        float defunc_0_f_res_124738 = sitofp_i64_f32(min_res_124737);\n        float defunc_2_reduce_res_124739;\n        float redout_128916 = 0.0F;\n        \n        for (int64_t i_128917 = 0; i_128917 < t_window_114537; i_128917++) {\n            bool cond_124744 = sle64(x_124732, i_128917);\n            float defunc_0_f_res_124745;\n            \n            if (cond_124744) {\n                defunc_0_f_res_124745 = 0.0F;\n            } else {\n                int64_t i_124746 = add64(x_124734, i_128917);\n                float x_124747 = ((__global float *) mem_130122)[gtid_124429 *\n                                                                 n_114534 +\n                                                                 i_124746];\n                float defunc_0_f_res_f_res_124748 = 1.0F + x_124747;\n                \n                defunc_0_f_res_124745 = defunc_0_f_res_f_res_124748;\n            }\n            \n            float defunc_0_f_res_124749;\n            \n            if (cond_124744) {\n                defunc_0_f_res_124749 = 0.0F;\n            } else {\n                int64_t i_124750 = add64(x_124734, i_128917);\n                float x_124751 = ((__global float *) mem_130861)[gtid_124429 *\n                                                                 n_114534 +\n                                                                 i_124750];\n                \n                defunc_0_f_res_124749 = x_124751;\n            }\n            \n            float x_j_124752 = defunc_0_f_res_124745 - defunc_0_f_res_124738;\n            float abs_res_124753 = (float) fabs(x_j_124752);\n            float tmp1_124754 = abs_res_124753 / x_124735;\n            float x_124755 = tmp1_124754 * tmp1_124754;\n            floa",
                   "t y_124756 = tmp1_124754 * x_124755;\n            float tmp2_124757 = 1.0F - y_124756;\n            float x_124758 = tmp2_124757 * tmp2_124757;\n            float tmp3_124759 = tmp2_124757 * x_124758;\n            float w_j_124760 = defunc_0_f_res_124749 * tmp3_124759;\n            float defunc_1_op_res_124742 = w_j_124760 + redout_128916;\n            float redout_tmp_134380 = defunc_1_op_res_124742;\n            \n            redout_128916 = redout_tmp_134380;\n        }\n        defunc_2_reduce_res_124739 = redout_128916;\n        \n        float a0_124761 = 1.0F / defunc_2_reduce_res_124739;\n        float defunc_2_reduce_res_124762;\n        float redout_128918 = 0.0F;\n        \n        for (int64_t i_128919 = 0; i_128919 < t_window_114537; i_128919++) {\n            bool cond_124767 = sle64(x_124732, i_128919);\n            float defunc_0_f_res_124768;\n            \n            if (cond_124767) {\n                defunc_0_f_res_124768 = 0.0F;\n            } else {\n                int64_t i_124769 = add64(x_124734, i_128919);\n                float x_124770 = ((__global float *) mem_130122)[gtid_124429 *\n                                                                 n_114534 +\n                                                                 i_124769];\n                float defunc_0_f_res_f_res_124771 = 1.0F + x_124770;\n                \n                defunc_0_f_res_124768 = defunc_0_f_res_f_res_124771;\n            }\n            \n            float defunc_0_f_res_124772;\n            \n            if (cond_124767) {\n                defunc_0_f_res_124772 = 0.0F;\n            } else {\n                int64_t i_124773 = add64(x_124734, i_128919);\n                float x_124774 = ((__global float *) mem_130861)[gtid_124429 *\n                                                                 n_114534 +\n                                                                 i_124773];\n                \n                defunc_0_f_res_124772 = x_124774;\n            }\n            \n            float x_j",
                   "_124775 = defunc_0_f_res_124768 - defunc_0_f_res_124738;\n            float abs_res_124776 = (float) fabs(x_j_124775);\n            float tmp1_124777 = abs_res_124776 / x_124735;\n            float x_124778 = tmp1_124777 * tmp1_124777;\n            float y_124779 = tmp1_124777 * x_124778;\n            float tmp2_124780 = 1.0F - y_124779;\n            float x_124781 = tmp2_124780 * tmp2_124780;\n            float tmp3_124782 = tmp2_124780 * x_124781;\n            float tmp4_124783 = defunc_0_f_res_124772 * tmp3_124782;\n            float defunc_0_f_res_124784;\n            \n            if (cond_124767) {\n                defunc_0_f_res_124784 = 0.0F;\n            } else {\n                int64_t i_124785 = add64(x_124734, i_128919);\n                float x_124786 = ((__global\n                                   float *) defunc_4_map_res_mem_131267)[gtid_124429 *\n                                                                         n_114534 +\n                                                                         i_124785];\n                \n                defunc_0_f_res_124784 = x_124786;\n            }\n            \n            float x_124787 = a0_124761 * tmp4_124783;\n            float defunc_9_fit_fun_res_124788 = defunc_0_f_res_124784 *\n                  x_124787;\n            float defunc_1_op_res_124765 = defunc_9_fit_fun_res_124788 +\n                  redout_128918;\n            float redout_tmp_134381 = defunc_1_op_res_124765;\n            \n            redout_128918 = redout_tmp_134381;\n        }\n        defunc_2_reduce_res_124762 = redout_128918;\n        ((__global float *) mem_131310)[gtid_124429 * t_n_m_114591 +\n                                        gtid_124430] =\n            defunc_2_reduce_res_124762;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_124722\n}\n__kernel void mainzisegmap_124559(__global int *global_failure,\n                                  int64_t m_114533, int64_t t_n_m_114591,\n                                  __global unsigned char *",
                   "mem_131315, __global\n                                  unsigned char *mem_131320)\n{\n    #define segmap_group_sizze_124837 (mainzisegmap_group_sizze_124562)\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_134450;\n    int32_t local_tid_134451;\n    int64_t group_sizze_134454;\n    int32_t wave_sizze_134453;\n    int32_t group_tid_134452;\n    \n    global_tid_134450 = get_global_id(0);\n    local_tid_134451 = get_local_id(0);\n    group_sizze_134454 = get_local_size(0);\n    wave_sizze_134453 = LOCKSTEP_WIDTH;\n    group_tid_134452 = get_group_id(0);\n    \n    int32_t phys_tid_124559 = global_tid_134450;\n    int64_t global_tid_134455 = sext_i32_i64(group_tid_134452) *\n            segmap_group_sizze_124837 + sext_i32_i64(local_tid_134451);\n    int64_t slice_134456 = t_n_m_114591;\n    int64_t slice_134457 = m_114533 * slice_134456;\n    int64_t gtid_124557 = squot64(global_tid_134455, slice_134456);\n    int64_t remnant_134458 = global_tid_134455 - gtid_124557 * slice_134456;\n    int64_t gtid_124558 = remnant_134458;\n    int64_t remnant_134459 = remnant_134458 - gtid_124558;\n    \n    if (slt64(gtid_124557, m_114533) && slt64(gtid_124558, t_n_m_114591)) {\n        float defunc_2_reduce_res_124840 = ((__global\n                                             float *) mem_131315)[gtid_124557 *\n                                                                  t_n_m_114591 +\n                                                                  gtid_124558];\n        float a0_124841 = 1.0F / defunc_2_reduce_res_124840;\n        \n        ((__global float *) mem_131320)[gtid_124557 * t_n_m_114591 +\n                                        gtid_124558] = a0_124841;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_124837\n}\n__kernel void mainzisegmap_124892(__global int *global_failure,\n                                  int64_t m_114533, int64_t t_window_114537,\n   ",
                   "                               int64_t t_jump_114541, int64_t t_n_m_114591,\n                                  int64_t i_114610, int64_t num_groups_124993,\n                                  int64_t num_threads_132243, __global\n                                  unsigned char *defunc_3_map_res_mem_130117,\n                                  __global unsigned char *mem_131335, __global\n                                  unsigned char *mem_131338, __global\n                                  unsigned char *mem_131341, __global\n                                  unsigned char *mem_131344, __global\n                                  unsigned char *mem_131347, __global\n                                  unsigned char *mem_131381, __global\n                                  unsigned char *mem_131384, __global\n                                  unsigned char *color_132124, __global\n                                  unsigned char *color_132125)\n{\n    #define segmap_group_sizze_124992 (mainzisegmap_group_sizze_124894)\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_134533;\n    int32_t local_tid_134534;\n    int64_t group_sizze_134537;\n    int32_t wave_sizze_134536;\n    int32_t group_tid_134535;\n    \n    global_tid_134533 = get_global_id(0);\n    local_tid_134534 = get_local_id(0);\n    group_sizze_134537 = get_local_size(0);\n    wave_sizze_134536 = LOCKSTEP_WIDTH;\n    group_tid_134535 = get_group_id(0);\n    \n    int32_t phys_tid_124892 = global_tid_134533;\n    int32_t phys_group_id_134538;\n    \n    phys_group_id_134538 = get_group_id(0);\n    for (int32_t i_134539 = 0; i_134539 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533,\n                                          segmap_group_sizze_124992)) -\n                   phys_group_id_134538, sext_i64_i32(num_groups_124993));\n         i_134539++) {\n        int32_t virt_group_id_134540 = phys_group_id_134538 + i_134539 ",
                   "*\n                sext_i64_i32(num_groups_124993);\n        int64_t global_tid_134541 = sext_i32_i64(virt_group_id_134540) *\n                segmap_group_sizze_124992 + sext_i32_i64(local_tid_134534);\n        int64_t slice_134542 = m_114533;\n        int64_t gtid_124891 = global_tid_134541;\n        int64_t remnant_134543 = global_tid_134541 - gtid_124891;\n        \n        if (slt64(gtid_124891, m_114533)) {\n            int64_t x_125002 = ((__global\n                                 int64_t *) defunc_3_map_res_mem_130117)[gtid_124891];\n            \n            for (int64_t i_129942 = 0; i_129942 < t_n_m_114591; i_129942++) {\n                int64_t x_125006 = ((__global int64_t *) mem_131335)[i_129942 *\n                                                                     m_114533 +\n                                                                     gtid_124891];\n                float x_125007 = ((__global float *) mem_131338)[i_129942 *\n                                                                 m_114533 +\n                                                                 gtid_124891];\n                int64_t min_arg_125008 = mul64(t_jump_114541, i_129942);\n                int64_t min_res_125009 = smin64(i_114610, min_arg_125008);\n                float defunc_0_f_res_125010 = sitofp_i64_f32(min_res_125009);\n                float defunc_2_reduce_res_125011;\n                float defunc_2_reduce_res_125012;\n                float defunc_2_reduce_res_125013;\n                float redout_128938;\n                float redout_128939;\n                float redout_128940;\n                \n                redout_128938 = 0.0F;\n                redout_128939 = 0.0F;\n                redout_128940 = 0.0F;\n                for (int64_t i_128941 = 0; i_128941 < t_window_114537;\n                     i_128941++) {\n                    bool cond_125024 = sle64(x_125002, i_128941);\n                    float defunc_0_f_res_125025;\n                    \n                    if (cond_125024) ",
                   "{\n                        defunc_0_f_res_125025 = 0.0F;\n                    } else {\n                        int64_t i_125026 = add64(x_125006, i_128941);\n                        float x_125027 = ((__global\n                                           float *) mem_131341)[i_125026 *\n                                                                m_114533 +\n                                                                gtid_124891];\n                        float defunc_0_f_res_f_res_125028 = 1.0F + x_125027;\n                        \n                        defunc_0_f_res_125025 = defunc_0_f_res_f_res_125028;\n                    }\n                    \n                    float defunc_0_f_res_125029;\n                    \n                    if (cond_125024) {\n                        defunc_0_f_res_125029 = 0.0F;\n                    } else {\n                        int64_t i_125030 = add64(x_125006, i_128941);\n                        float x_125031 = ((__global\n                                           float *) mem_131344)[i_125030 *\n                                                                m_114533 +\n                                                                gtid_124891];\n                        \n                        defunc_0_f_res_125029 = x_125031;\n                    }\n                    \n                    float x_j_125032 = defunc_0_f_res_125025 -\n                          defunc_0_f_res_125010;\n                    float abs_res_125033 = (float) fabs(x_j_125032);\n                    float tmp1_125034 = abs_res_125033 / x_125007;\n                    float x_125035 = tmp1_125034 * tmp1_125034;\n                    float y_125036 = tmp1_125034 * x_125035;\n                    float tmp2_125037 = 1.0F - y_125036;\n                    float x_125038 = tmp2_125037 * tmp2_125037;\n                    float tmp3_125039 = tmp2_125037 * x_125038;\n                    float w_j_125040 = defunc_0_f_res_125029 * tmp3_125039;\n                    float xw_j_125041 = x",
                   "_j_125032 * w_j_125040;\n                    float x2w_j_125042 = x_j_125032 * xw_j_125041;\n                    float defunc_1_op_res_125016 = w_j_125040 + redout_128938;\n                    float defunc_1_op_res_125019 = xw_j_125041 + redout_128939;\n                    float defunc_1_op_res_125022 = x2w_j_125042 + redout_128940;\n                    float redout_tmp_134546 = defunc_1_op_res_125016;\n                    float redout_tmp_134547 = defunc_1_op_res_125019;\n                    float redout_tmp_134548 = defunc_1_op_res_125022;\n                    \n                    redout_128938 = redout_tmp_134546;\n                    redout_128939 = redout_tmp_134547;\n                    redout_128940 = redout_tmp_134548;\n                }\n                defunc_2_reduce_res_125011 = redout_128938;\n                defunc_2_reduce_res_125012 = redout_128939;\n                defunc_2_reduce_res_125013 = redout_128940;\n                \n                float x_125043 = defunc_2_reduce_res_125011 *\n                      defunc_2_reduce_res_125013;\n                float y_125044 = defunc_2_reduce_res_125012 *\n                      defunc_2_reduce_res_125012;\n                float y_125045 = x_125043 - y_125044;\n                float det1_125046 = 1.0F / y_125045;\n                float a11_125047 = defunc_2_reduce_res_125013 * det1_125046;\n                float negate_arg_125048 = defunc_2_reduce_res_125012 *\n                      det1_125046;\n                float b11_125049 = 0.0F - negate_arg_125048;\n                float c11_125050 = defunc_2_reduce_res_125011 * det1_125046;\n                float defunc_2_reduce_res_125051;\n                float defunc_2_reduce_res_125052;\n                float redout_128942;\n                float redout_128943;\n                \n                redout_128942 = 0.0F;\n                redout_128943 = 0.0F;\n                for (int64_t i_128944 = 0; i_128944 < t_window_114537;\n                     i_128944++) {\n                    bool cond_125",
                   "060 = sle64(x_125002, i_128944);\n                    float defunc_0_f_res_125061;\n                    \n                    if (cond_125060) {\n                        defunc_0_f_res_125061 = 0.0F;\n                    } else {\n                        int64_t i_125062 = add64(x_125006, i_128944);\n                        float x_125063 = ((__global\n                                           float *) mem_131341)[i_125062 *\n                                                                m_114533 +\n                                                                gtid_124891];\n                        float defunc_0_f_res_f_res_125064 = 1.0F + x_125063;\n                        \n                        defunc_0_f_res_125061 = defunc_0_f_res_f_res_125064;\n                    }\n                    \n                    float defunc_0_f_res_125065;\n                    \n                    if (cond_125060) {\n                        defunc_0_f_res_125065 = 0.0F;\n                    } else {\n                        int64_t i_125066 = add64(x_125006, i_128944);\n                        float x_125067 = ((__global\n                                           float *) mem_131344)[i_125066 *\n                                                                m_114533 +\n                                                                gtid_124891];\n                        \n                        defunc_0_f_res_125065 = x_125067;\n                    }\n                    \n                    float x_j_125068 = defunc_0_f_res_125061 -\n                          defunc_0_f_res_125010;\n                    float abs_res_125069 = (float) fabs(x_j_125068);\n                    float tmp1_125070 = abs_res_125069 / x_125007;\n                    float x_125071 = tmp1_125070 * tmp1_125070;\n                    float y_125072 = tmp1_125070 * x_125071;\n                    float tmp2_125073 = 1.0F - y_125072;\n                    float x_125074 = tmp2_125073 * tmp2_125073;\n                    float tmp3_125075 = t",
                   "mp2_125073 * x_125074;\n                    float tmp4_125076 = defunc_0_f_res_125065 * tmp3_125075;\n                    float defunc_1_f_res_125077 = x_j_125068 * tmp4_125076;\n                    float defunc_0_f_res_125078;\n                    \n                    if (cond_125060) {\n                        defunc_0_f_res_125078 = 0.0F;\n                    } else {\n                        int64_t i_125079 = add64(x_125006, i_128944);\n                        float x_125080 = ((__global\n                                           float *) mem_131347)[i_125079 *\n                                                                m_114533 +\n                                                                gtid_124891];\n                        \n                        defunc_0_f_res_125078 = x_125080;\n                    }\n                    \n                    float x_125081 = a11_125047 * tmp4_125076;\n                    float y_125082 = b11_125049 * defunc_1_f_res_125077;\n                    float x_125083 = x_125081 + y_125082;\n                    float defunc_9_fit_fun_res_125084 = defunc_0_f_res_125078 *\n                          x_125083;\n                    float x_125085 = b11_125049 * tmp4_125076;\n                    float y_125086 = c11_125050 * defunc_1_f_res_125077;\n                    float x_125087 = x_125085 + y_125086;\n                    float defunc_9_slope_fun_res_125088 =\n                          defunc_0_f_res_125078 * x_125087;\n                    float defunc_1_op_res_125055 = defunc_9_fit_fun_res_125084 +\n                          redout_128942;\n                    float defunc_1_op_res_125058 =\n                          defunc_9_slope_fun_res_125088 + redout_128943;\n                    float redout_tmp_134549 = defunc_1_op_res_125055;\n                    float redout_tmp_134550 = defunc_1_op_res_125058;\n                    \n                    redout_128942 = redout_tmp_134549;\n                    redout_128943 = redout_tmp_134550;\n                }",
                   "\n                defunc_2_reduce_res_125051 = redout_128942;\n                defunc_2_reduce_res_125052 = redout_128943;\n                ((__global float *) color_132125)[phys_tid_124892 + i_129942 *\n                                                  num_threads_132243] =\n                    defunc_2_reduce_res_125051;\n                ((__global float *) color_132124)[phys_tid_124892 + i_129942 *\n                                                  num_threads_132243] =\n                    defunc_2_reduce_res_125052;\n            }\n            for (int64_t i_134551 = 0; i_134551 < t_n_m_114591; i_134551++) {\n                ((__global float *) mem_131381)[i_134551 * m_114533 +\n                                                gtid_124891] = ((__global\n                                                                 float *) color_132125)[phys_tid_124892 +\n                                                                                        i_134551 *\n                                                                                        num_threads_132243];\n            }\n            for (int64_t i_134552 = 0; i_134552 < t_n_m_114591; i_134552++) {\n                ((__global float *) mem_131384)[i_134552 * m_114533 +\n                                                gtid_124891] = ((__global\n                                                                 float *) color_132124)[phys_tid_124892 +\n                                                                                        i_134552 *\n                                                                                        num_threads_132243];\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_124992\n}\n__kernel void mainzisegmap_125091(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t t_window_114537,\n                              ",
                   "    int64_t t_jump_114541, int64_t t_n_m_114591,\n                                  int64_t i_114610, __global\n                                  unsigned char *defunc_3_map_res_mem_130117,\n                                  __global unsigned char *mem_130122, __global\n                                  unsigned char *defunc_3_map_res_mem_130606,\n                                  __global\n                                  unsigned char *defunc_3_map_res_mem_130607,\n                                  __global unsigned char *mem_130861, __global\n                                  unsigned char *defunc_4_map_res_mem_131267,\n                                  __global unsigned char *mem_131389, __global\n                                  unsigned char *mem_131393)\n{\n    #define segmap_group_sizze_125487 (mainzisegmap_group_sizze_125094)\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_134553;\n    int32_t local_tid_134554;\n    int64_t group_sizze_134557;\n    int32_t wave_sizze_134556;\n    int32_t group_tid_134555;\n    \n    global_tid_134553 = get_global_id(0);\n    local_tid_134554 = get_local_id(0);\n    group_sizze_134557 = get_local_size(0);\n    wave_sizze_134556 = LOCKSTEP_WIDTH;\n    group_tid_134555 = get_group_id(0);\n    \n    int32_t phys_tid_125091 = global_tid_134553;\n    int64_t global_tid_134558 = sext_i32_i64(group_tid_134555) *\n            segmap_group_sizze_125487 + sext_i32_i64(local_tid_134554);\n    int64_t slice_134559 = t_n_m_114591;\n    int64_t slice_134560 = m_114533 * slice_134559;\n    int64_t gtid_125089 = squot64(global_tid_134558, slice_134559);\n    int64_t remnant_134561 = global_tid_134558 - gtid_125089 * slice_134559;\n    int64_t gtid_125090 = remnant_134561;\n    int64_t remnant_134562 = remnant_134561 - gtid_125090;\n    \n    if (slt64(gtid_125089, m_114533) && slt64(gtid_125090, t_n_m_114591)) {\n        int64_t x_125499 = ((__globa",
                   "l\n                             int64_t *) defunc_3_map_res_mem_130117)[gtid_125089];\n        int64_t x_125501 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130606)[gtid_125089 *\n                                                                     t_n_m_114591 +\n                                                                     gtid_125090];\n        float x_125502 = ((__global\n                           float *) defunc_3_map_res_mem_130607)[gtid_125089 *\n                                                                 t_n_m_114591 +\n                                                                 gtid_125090];\n        int64_t min_arg_125503 = mul64(t_jump_114541, gtid_125090);\n        int64_t min_res_125504 = smin64(i_114610, min_arg_125503);\n        float defunc_0_f_res_125505 = sitofp_i64_f32(min_res_125504);\n        float defunc_2_reduce_res_125506;\n        float defunc_2_reduce_res_125507;\n        float defunc_2_reduce_res_125508;\n        float redout_128945;\n        float redout_128946;\n        float redout_128947;\n        \n        redout_128945 = 0.0F;\n        redout_128946 = 0.0F;\n        redout_128947 = 0.0F;\n        for (int64_t i_128948 = 0; i_128948 < t_window_114537; i_128948++) {\n            bool cond_125519 = sle64(x_125499, i_128948);\n            float defunc_0_f_res_125520;\n            \n            if (cond_125519) {\n                defunc_0_f_res_125520 = 0.0F;\n            } else {\n                int64_t i_125521 = add64(x_125501, i_128948);\n                float x_125522 = ((__global float *) mem_130122)[gtid_125089 *\n                                                                 n_114534 +\n                                                                 i_125521];\n                float defunc_0_f_res_f_res_125523 = 1.0F + x_125522;\n                \n                defunc_0_f_res_125520 = defunc_0_f_res_f_res_125523;\n            }\n            \n            float defunc_0_f_res_125524;\n            \n            if (cond",
                   "_125519) {\n                defunc_0_f_res_125524 = 0.0F;\n            } else {\n                int64_t i_125525 = add64(x_125501, i_128948);\n                float x_125526 = ((__global float *) mem_130861)[gtid_125089 *\n                                                                 n_114534 +\n                                                                 i_125525];\n                \n                defunc_0_f_res_125524 = x_125526;\n            }\n            \n            float x_j_125527 = defunc_0_f_res_125520 - defunc_0_f_res_125505;\n            float abs_res_125528 = (float) fabs(x_j_125527);\n            float tmp1_125529 = abs_res_125528 / x_125502;\n            float x_125530 = tmp1_125529 * tmp1_125529;\n            float y_125531 = tmp1_125529 * x_125530;\n            float tmp2_125532 = 1.0F - y_125531;\n            float x_125533 = tmp2_125532 * tmp2_125532;\n            float tmp3_125534 = tmp2_125532 * x_125533;\n            float w_j_125535 = defunc_0_f_res_125524 * tmp3_125534;\n            float xw_j_125536 = x_j_125527 * w_j_125535;\n            float x2w_j_125537 = x_j_125527 * xw_j_125536;\n            float defunc_1_op_res_125511 = w_j_125535 + redout_128945;\n            float defunc_1_op_res_125514 = xw_j_125536 + redout_128946;\n            float defunc_1_op_res_125517 = x2w_j_125537 + redout_128947;\n            float redout_tmp_134563 = defunc_1_op_res_125511;\n            float redout_tmp_134564 = defunc_1_op_res_125514;\n            float redout_tmp_134565 = defunc_1_op_res_125517;\n            \n            redout_128945 = redout_tmp_134563;\n            redout_128946 = redout_tmp_134564;\n            redout_128947 = redout_tmp_134565;\n        }\n        defunc_2_reduce_res_125506 = redout_128945;\n        defunc_2_reduce_res_125507 = redout_128946;\n        defunc_2_reduce_res_125508 = redout_128947;\n        \n        float x_125538 = defunc_2_reduce_res_125506 *\n              defunc_2_reduce_res_125508;\n        float y_125539 = defunc_2_reduce_res_125507 *\n  ",
                   "            defunc_2_reduce_res_125507;\n        float y_125540 = x_125538 - y_125539;\n        float det1_125541 = 1.0F / y_125540;\n        float a11_125542 = defunc_2_reduce_res_125508 * det1_125541;\n        float negate_arg_125543 = defunc_2_reduce_res_125507 * det1_125541;\n        float b11_125544 = 0.0F - negate_arg_125543;\n        float c11_125545 = defunc_2_reduce_res_125506 * det1_125541;\n        float defunc_2_reduce_res_125546;\n        float defunc_2_reduce_res_125547;\n        float redout_128949;\n        float redout_128950;\n        \n        redout_128949 = 0.0F;\n        redout_128950 = 0.0F;\n        for (int64_t i_128951 = 0; i_128951 < t_window_114537; i_128951++) {\n            bool cond_125555 = sle64(x_125499, i_128951);\n            float defunc_0_f_res_125556;\n            \n            if (cond_125555) {\n                defunc_0_f_res_125556 = 0.0F;\n            } else {\n                int64_t i_125557 = add64(x_125501, i_128951);\n                float x_125558 = ((__global float *) mem_130122)[gtid_125089 *\n                                                                 n_114534 +\n                                                                 i_125557];\n                float defunc_0_f_res_f_res_125559 = 1.0F + x_125558;\n                \n                defunc_0_f_res_125556 = defunc_0_f_res_f_res_125559;\n            }\n            \n            float defunc_0_f_res_125560;\n            \n            if (cond_125555) {\n                defunc_0_f_res_125560 = 0.0F;\n            } else {\n                int64_t i_125561 = add64(x_125501, i_128951);\n                float x_125562 = ((__global float *) mem_130861)[gtid_125089 *\n                                                                 n_114534 +\n                                                                 i_125561];\n                \n                defunc_0_f_res_125560 = x_125562;\n            }\n            \n            float x_j_125563 = defunc_0_f_res_125556 - defunc_0_f_res_125505;\n            ",
                   "float abs_res_125564 = (float) fabs(x_j_125563);\n            float tmp1_125565 = abs_res_125564 / x_125502;\n            float x_125566 = tmp1_125565 * tmp1_125565;\n            float y_125567 = tmp1_125565 * x_125566;\n            float tmp2_125568 = 1.0F - y_125567;\n            float x_125569 = tmp2_125568 * tmp2_125568;\n            float tmp3_125570 = tmp2_125568 * x_125569;\n            float tmp4_125571 = defunc_0_f_res_125560 * tmp3_125570;\n            float defunc_1_f_res_125572 = x_j_125563 * tmp4_125571;\n            float defunc_0_f_res_125573;\n            \n            if (cond_125555) {\n                defunc_0_f_res_125573 = 0.0F;\n            } else {\n                int64_t i_125574 = add64(x_125501, i_128951);\n                float x_125575 = ((__global\n                                   float *) defunc_4_map_res_mem_131267)[gtid_125089 *\n                                                                         n_114534 +\n                                                                         i_125574];\n                \n                defunc_0_f_res_125573 = x_125575;\n            }\n            \n            float x_125576 = a11_125542 * tmp4_125571;\n            float y_125577 = b11_125544 * defunc_1_f_res_125572;\n            float x_125578 = x_125576 + y_125577;\n            float defunc_9_fit_fun_res_125579 = defunc_0_f_res_125573 *\n                  x_125578;\n            float x_125580 = b11_125544 * tmp4_125571;\n            float y_125581 = c11_125545 * defunc_1_f_res_125572;\n            float x_125582 = x_125580 + y_125581;\n            float defunc_9_slope_fun_res_125583 = defunc_0_f_res_125573 *\n                  x_125582;\n            float defunc_1_op_res_125550 = defunc_9_fit_fun_res_125579 +\n                  redout_128949;\n            float defunc_1_op_res_125553 = defunc_9_slope_fun_res_125583 +\n                  redout_128950;\n            float redout_tmp_134566 = defunc_1_op_res_125550;\n            float redout_tmp_134567 = defunc_1_op_res_125553",
                   ";\n            \n            redout_128949 = redout_tmp_134566;\n            redout_128950 = redout_tmp_134567;\n        }\n        defunc_2_reduce_res_125546 = redout_128949;\n        defunc_2_reduce_res_125547 = redout_128950;\n        ((__global float *) mem_131389)[gtid_125089 * t_n_m_114591 +\n                                        gtid_125090] =\n            defunc_2_reduce_res_125546;\n        ((__global float *) mem_131393)[gtid_125089 * t_n_m_114591 +\n                                        gtid_125090] =\n            defunc_2_reduce_res_125547;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_125487\n}\n__kernel void mainzisegmap_125270(__global int *global_failure,\n                                  int64_t m_114533, int64_t t_n_m_114591,\n                                  __global unsigned char *mem_131398, __global\n                                  unsigned char *mem_131402, __global\n                                  unsigned char *mem_131406, __global\n                                  unsigned char *mem_131411, __global\n                                  unsigned char *mem_131415, __global\n                                  unsigned char *mem_131419)\n{\n    #define segmap_group_sizze_125642 (mainzisegmap_group_sizze_125273)\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_134662;\n    int32_t local_tid_134663;\n    int64_t group_sizze_134666;\n    int32_t wave_sizze_134665;\n    int32_t group_tid_134664;\n    \n    global_tid_134662 = get_global_id(0);\n    local_tid_134663 = get_local_id(0);\n    group_sizze_134666 = get_local_size(0);\n    wave_sizze_134665 = LOCKSTEP_WIDTH;\n    group_tid_134664 = get_group_id(0);\n    \n    int32_t phys_tid_125270 = global_tid_134662;\n    int64_t global_tid_134667 = sext_i32_i64(group_tid_134664) *\n            segmap_group_sizze_125642 + sext_i32_i64(local_tid_134663);\n    int64_t slice_134668 = t_n_m_1145",
                   "91;\n    int64_t slice_134669 = m_114533 * slice_134668;\n    int64_t gtid_125268 = squot64(global_tid_134667, slice_134668);\n    int64_t remnant_134670 = global_tid_134667 - gtid_125268 * slice_134668;\n    int64_t gtid_125269 = remnant_134670;\n    int64_t remnant_134671 = remnant_134670 - gtid_125269;\n    \n    if (slt64(gtid_125268, m_114533) && slt64(gtid_125269, t_n_m_114591)) {\n        float defunc_2_reduce_res_125647 = ((__global\n                                             float *) mem_131398)[gtid_125268 *\n                                                                  t_n_m_114591 +\n                                                                  gtid_125269];\n        float defunc_2_reduce_res_125648 = ((__global\n                                             float *) mem_131402)[gtid_125268 *\n                                                                  t_n_m_114591 +\n                                                                  gtid_125269];\n        float defunc_2_reduce_res_125649 = ((__global\n                                             float *) mem_131406)[gtid_125268 *\n                                                                  t_n_m_114591 +\n                                                                  gtid_125269];\n        float x_125650 = defunc_2_reduce_res_125647 *\n              defunc_2_reduce_res_125649;\n        float y_125651 = defunc_2_reduce_res_125648 *\n              defunc_2_reduce_res_125648;\n        float y_125652 = x_125650 - y_125651;\n        float det1_125653 = 1.0F / y_125652;\n        float a11_125654 = defunc_2_reduce_res_125649 * det1_125653;\n        float negate_arg_125655 = defunc_2_reduce_res_125648 * det1_125653;\n        float b11_125656 = 0.0F - negate_arg_125655;\n        float c11_125657 = defunc_2_reduce_res_125647 * det1_125653;\n        \n        ((__global float *) mem_131411)[gtid_125268 * t_n_m_114591 +\n                                        gtid_125269] = a11_125654;\n        ((__global float *) mem_13141",
                   "5)[gtid_125268 * t_n_m_114591 +\n                                        gtid_125269] = b11_125656;\n        ((__global float *) mem_131419)[gtid_125268 * t_n_m_114591 +\n                                        gtid_125269] = c11_125657;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_125642\n}\n__kernel void mainzisegmap_125725(__global int *global_failure,\n                                  int64_t m_114533, int64_t t_window_114537,\n                                  int64_t t_jump_114541, int64_t t_n_m_114591,\n                                  int64_t i_114610, int64_t num_groups_125858,\n                                  int64_t num_threads_132250, __global\n                                  unsigned char *defunc_3_map_res_mem_130117,\n                                  __global unsigned char *mem_131445, __global\n                                  unsigned char *mem_131448, __global\n                                  unsigned char *mem_131451, __global\n                                  unsigned char *mem_131454, __global\n                                  unsigned char *mem_131457, __global\n                                  unsigned char *mem_131491, __global\n                                  unsigned char *mem_131494, __global\n                                  unsigned char *color_132126, __global\n                                  unsigned char *color_132127)\n{\n    #define segmap_group_sizze_125857 (mainzisegmap_group_sizze_125727)\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_134758;\n    int32_t local_tid_134759;\n    int64_t group_sizze_134762;\n    int32_t wave_sizze_134761;\n    int32_t group_tid_134760;\n    \n    global_tid_134758 = get_global_id(0);\n    local_tid_134759 = get_local_id(0);\n    group_sizze_134762 = get_local_size(0);\n    wave_sizze_134761 = LOCKSTEP_WIDTH;\n    group_tid_134760 = get_group_id(0);\n    \n    int32_t phy",
                   "s_tid_125725 = global_tid_134758;\n    int32_t phys_group_id_134763;\n    \n    phys_group_id_134763 = get_group_id(0);\n    for (int32_t i_134764 = 0; i_134764 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533,\n                                          segmap_group_sizze_125857)) -\n                   phys_group_id_134763, sext_i64_i32(num_groups_125858));\n         i_134764++) {\n        int32_t virt_group_id_134765 = phys_group_id_134763 + i_134764 *\n                sext_i64_i32(num_groups_125858);\n        int64_t global_tid_134766 = sext_i32_i64(virt_group_id_134765) *\n                segmap_group_sizze_125857 + sext_i32_i64(local_tid_134759);\n        int64_t slice_134767 = m_114533;\n        int64_t gtid_125724 = global_tid_134766;\n        int64_t remnant_134768 = global_tid_134766 - gtid_125724;\n        \n        if (slt64(gtid_125724, m_114533)) {\n            int64_t x_125867 = ((__global\n                                 int64_t *) defunc_3_map_res_mem_130117)[gtid_125724];\n            \n            for (int64_t i_129949 = 0; i_129949 < t_n_m_114591; i_129949++) {\n                int64_t x_125871 = ((__global int64_t *) mem_131445)[i_129949 *\n                                                                     m_114533 +\n                                                                     gtid_125724];\n                float x_125872 = ((__global float *) mem_131448)[i_129949 *\n                                                                 m_114533 +\n                                                                 gtid_125724];\n                int64_t min_arg_125873 = mul64(t_jump_114541, i_129949);\n                int64_t min_res_125874 = smin64(i_114610, min_arg_125873);\n                float defunc_0_f_res_125875 = sitofp_i64_f32(min_res_125874);\n                float defunc_2_reduce_res_125876;\n                float defunc_2_reduce_res_125877;\n                float defunc_2_reduce_res_125878;\n                float defunc_2_reduce_res_125879;\n                flo",
                   "at defunc_2_reduce_res_125880;\n                float redout_128970;\n                float redout_128971;\n                float redout_128972;\n                float redout_128973;\n                float redout_128974;\n                \n                redout_128970 = 0.0F;\n                redout_128971 = 0.0F;\n                redout_128972 = 0.0F;\n                redout_128973 = 0.0F;\n                redout_128974 = 0.0F;\n                for (int64_t i_128975 = 0; i_128975 < t_window_114537;\n                     i_128975++) {\n                    bool cond_125897 = sle64(x_125867, i_128975);\n                    float defunc_0_f_res_125898;\n                    \n                    if (cond_125897) {\n                        defunc_0_f_res_125898 = 0.0F;\n                    } else {\n                        int64_t i_125899 = add64(x_125871, i_128975);\n                        float x_125900 = ((__global\n                                           float *) mem_131451)[i_125899 *\n                                                                m_114533 +\n                                                                gtid_125724];\n                        float defunc_0_f_res_f_res_125901 = 1.0F + x_125900;\n                        \n                        defunc_0_f_res_125898 = defunc_0_f_res_f_res_125901;\n                    }\n                    \n                    float defunc_0_f_res_125902;\n                    \n                    if (cond_125897) {\n                        defunc_0_f_res_125902 = 0.0F;\n                    } else {\n                        int64_t i_125903 = add64(x_125871, i_128975);\n                        float x_125904 = ((__global\n                                           float *) mem_131454)[i_125903 *\n                                                                m_114533 +\n                                                                gtid_125724];\n                        \n                        defunc_0_f_res_125902 = x_125904;\n                ",
                   "    }\n                    \n                    float x_j_125905 = defunc_0_f_res_125898 -\n                          defunc_0_f_res_125875;\n                    float abs_res_125906 = (float) fabs(x_j_125905);\n                    float tmp1_125907 = abs_res_125906 / x_125872;\n                    float x_125908 = tmp1_125907 * tmp1_125907;\n                    float y_125909 = tmp1_125907 * x_125908;\n                    float tmp2_125910 = 1.0F - y_125909;\n                    float x_125911 = tmp2_125910 * tmp2_125910;\n                    float tmp3_125912 = tmp2_125910 * x_125911;\n                    float w_j_125913 = defunc_0_f_res_125902 * tmp3_125912;\n                    float xw_j_125914 = x_j_125905 * w_j_125913;\n                    float x2w_j_125915 = x_j_125905 * xw_j_125914;\n                    float x3w_j_125916 = x_j_125905 * x2w_j_125915;\n                    float x4w_j_125917 = x_j_125905 * x3w_j_125916;\n                    float defunc_1_op_res_125883 = w_j_125913 + redout_128970;\n                    float defunc_1_op_res_125886 = xw_j_125914 + redout_128971;\n                    float defunc_1_op_res_125889 = x2w_j_125915 + redout_128972;\n                    float defunc_1_op_res_125892 = x3w_j_125916 + redout_128973;\n                    float defunc_1_op_res_125895 = x4w_j_125917 + redout_128974;\n                    float redout_tmp_134771 = defunc_1_op_res_125883;\n                    float redout_tmp_134772 = defunc_1_op_res_125886;\n                    float redout_tmp_134773 = defunc_1_op_res_125889;\n                    float redout_tmp_134774 = defunc_1_op_res_125892;\n                    float redout_tmp_134775 = defunc_1_op_res_125895;\n                    \n                    redout_128970 = redout_tmp_134771;\n                    redout_128971 = redout_tmp_134772;\n                    redout_128972 = redout_tmp_134773;\n                    redout_128973 = redout_tmp_134774;\n                    redout_128974 = redout_tmp_134775;\n                }\n     ",
                   "           defunc_2_reduce_res_125876 = redout_128970;\n                defunc_2_reduce_res_125877 = redout_128971;\n                defunc_2_reduce_res_125878 = redout_128972;\n                defunc_2_reduce_res_125879 = redout_128973;\n                defunc_2_reduce_res_125880 = redout_128974;\n                \n                float x_125918 = defunc_2_reduce_res_125878 *\n                      defunc_2_reduce_res_125880;\n                float y_125919 = defunc_2_reduce_res_125879 *\n                      defunc_2_reduce_res_125879;\n                float a12_125920 = x_125918 - y_125919;\n                float x_125921 = defunc_2_reduce_res_125878 *\n                      defunc_2_reduce_res_125879;\n                float y_125922 = defunc_2_reduce_res_125877 *\n                      defunc_2_reduce_res_125880;\n                float b12_125923 = x_125921 - y_125922;\n                float x_125924 = defunc_2_reduce_res_125877 *\n                      defunc_2_reduce_res_125879;\n                float y_125925 = defunc_2_reduce_res_125878 *\n                      defunc_2_reduce_res_125878;\n                float c12_125926 = x_125924 - y_125925;\n                float x_125927 = defunc_2_reduce_res_125876 *\n                      defunc_2_reduce_res_125880;\n                float b2_125928 = x_125927 - y_125925;\n                float x_125929 = defunc_2_reduce_res_125877 *\n                      defunc_2_reduce_res_125878;\n                float y_125930 = defunc_2_reduce_res_125876 *\n                      defunc_2_reduce_res_125879;\n                float c2_125931 = x_125929 - y_125930;\n                float x_125932 = defunc_2_reduce_res_125876 * a12_125920;\n                float y_125933 = defunc_2_reduce_res_125877 * b12_125923;\n                float x_125934 = x_125932 + y_125933;\n                float y_125935 = defunc_2_reduce_res_125878 * c12_125926;\n                float y_125936 = x_125934 + y_125935;\n                float det_125937 = 1.0F / y_125936;\n                floa",
                   "t a12_125938 = a12_125920 * det_125937;\n                float b12_125939 = b12_125923 * det_125937;\n                float c12_125940 = c12_125926 * det_125937;\n                float b2_125941 = b2_125928 * det_125937;\n                float c2_125942 = c2_125931 * det_125937;\n                float defunc_2_reduce_res_125943;\n                float defunc_2_reduce_res_125944;\n                float redout_128976;\n                float redout_128977;\n                \n                redout_128976 = 0.0F;\n                redout_128977 = 0.0F;\n                for (int64_t i_128978 = 0; i_128978 < t_window_114537;\n                     i_128978++) {\n                    bool cond_125952 = sle64(x_125867, i_128978);\n                    float defunc_0_f_res_125953;\n                    \n                    if (cond_125952) {\n                        defunc_0_f_res_125953 = 0.0F;\n                    } else {\n                        int64_t i_125954 = add64(x_125871, i_128978);\n                        float x_125955 = ((__global\n                                           float *) mem_131451)[i_125954 *\n                                                                m_114533 +\n                                                                gtid_125724];\n                        float defunc_0_f_res_f_res_125956 = 1.0F + x_125955;\n                        \n                        defunc_0_f_res_125953 = defunc_0_f_res_f_res_125956;\n                    }\n                    \n                    float defunc_0_f_res_125957;\n                    \n                    if (cond_125952) {\n                        defunc_0_f_res_125957 = 0.0F;\n                    } else {\n                        int64_t i_125958 = add64(x_125871, i_128978);\n                        float x_125959 = ((__global\n                                           float *) mem_131454)[i_125958 *\n                                                                m_114533 +\n                                                         ",
                   "       gtid_125724];\n                        \n                        defunc_0_f_res_125957 = x_125959;\n                    }\n                    \n                    float x_j_125960 = defunc_0_f_res_125953 -\n                          defunc_0_f_res_125875;\n                    float abs_res_125961 = (float) fabs(x_j_125960);\n                    float tmp1_125962 = abs_res_125961 / x_125872;\n                    float x_125963 = tmp1_125962 * tmp1_125962;\n                    float y_125964 = tmp1_125962 * x_125963;\n                    float tmp2_125965 = 1.0F - y_125964;\n                    float x_125966 = tmp2_125965 * tmp2_125965;\n                    float tmp3_125967 = tmp2_125965 * x_125966;\n                    float tmp4_125968 = defunc_0_f_res_125957 * tmp3_125967;\n                    float defunc_1_f_res_125969 = x_j_125960 * tmp4_125968;\n                    float defunc_1_f_res_125970 = x_j_125960 *\n                          defunc_1_f_res_125969;\n                    float defunc_0_f_res_125971;\n                    \n                    if (cond_125952) {\n                        defunc_0_f_res_125971 = 0.0F;\n                    } else {\n                        int64_t i_125972 = add64(x_125871, i_128978);\n                        float x_125973 = ((__global\n                                           float *) mem_131457)[i_125972 *\n                                                                m_114533 +\n                                                                gtid_125724];\n                        \n                        defunc_0_f_res_125971 = x_125973;\n                    }\n                    \n                    float x_125974 = a12_125938 * tmp4_125968;\n                    float y_125975 = b12_125939 * defunc_1_f_res_125969;\n                    float x_125976 = x_125974 + y_125975;\n                    float y_125977 = c12_125940 * defunc_1_f_res_125970;\n                    float x_125978 = x_125976 + y_125977;\n                    float defunc_9_fi",
                   "t_fun_res_125979 = defunc_0_f_res_125971 *\n                          x_125978;\n                    float x_125980 = b12_125939 * tmp4_125968;\n                    float y_125981 = b2_125941 * defunc_1_f_res_125969;\n                    float x_125982 = x_125980 + y_125981;\n                    float y_125983 = c2_125942 * defunc_1_f_res_125970;\n                    float x_125984 = x_125982 + y_125983;\n                    float defunc_9_slope_fun_res_125985 =\n                          defunc_0_f_res_125971 * x_125984;\n                    float defunc_1_op_res_125947 = defunc_9_fit_fun_res_125979 +\n                          redout_128976;\n                    float defunc_1_op_res_125950 =\n                          defunc_9_slope_fun_res_125985 + redout_128977;\n                    float redout_tmp_134776 = defunc_1_op_res_125947;\n                    float redout_tmp_134777 = defunc_1_op_res_125950;\n                    \n                    redout_128976 = redout_tmp_134776;\n                    redout_128977 = redout_tmp_134777;\n                }\n                defunc_2_reduce_res_125943 = redout_128976;\n                defunc_2_reduce_res_125944 = redout_128977;\n                ((__global float *) color_132127)[phys_tid_125725 + i_129949 *\n                                                  num_threads_132250] =\n                    defunc_2_reduce_res_125943;\n                ((__global float *) color_132126)[phys_tid_125725 + i_129949 *\n                                                  num_threads_132250] =\n                    defunc_2_reduce_res_125944;\n            }\n            for (int64_t i_134778 = 0; i_134778 < t_n_m_114591; i_134778++) {\n                ((__global float *) mem_131491)[i_134778 * m_114533 +\n                                                gtid_125724] = ((__global\n                                                                 float *) color_132127)[phys_tid_125725 +\n                                                                                     ",
                   "   i_134778 *\n                                                                                        num_threads_132250];\n            }\n            for (int64_t i_134779 = 0; i_134779 < t_n_m_114591; i_134779++) {\n                ((__global float *) mem_131494)[i_134779 * m_114533 +\n                                                gtid_125724] = ((__global\n                                                                 float *) color_132126)[phys_tid_125725 +\n                                                                                        i_134779 *\n                                                                                        num_threads_132250];\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_125857\n}\n__kernel void mainzisegmap_125988(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t t_window_114537,\n                                  int64_t t_jump_114541, int64_t t_n_m_114591,\n                                  int64_t i_114610, __global\n                                  unsigned char *defunc_3_map_res_mem_130117,\n                                  __global unsigned char *mem_130122, __global\n                                  unsigned char *defunc_3_map_res_mem_130606,\n                                  __global\n                                  unsigned char *defunc_3_map_res_mem_130607,\n                                  __global unsigned char *mem_130861, __global\n                                  unsigned char *defunc_4_map_res_mem_131267,\n                                  __global unsigned char *mem_131499, __global\n                                  unsigned char *mem_131503)\n{\n    #define segmap_group_sizze_126500 (mainzisegmap_group_sizze_125991)\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_134780;\n    int32_t local_tid_134781;\n    int64_t group_sizze_134784;\n    int32_t wave_sizze_134783;\n    int32_t group_tid_134782;\n    \n    global_tid_134780 = get_global_id(0);\n    local_tid_134781 = get_local_id(0);\n    group_sizze_134784 = get_local_size(0);\n    wave_sizze_134783 = LOCKSTEP_WIDTH;\n    group_tid_134782 = get_group_id(0);\n    \n    int32_t phys_tid_125988 = global_tid_134780;\n    int64_t global_tid_134785 = sext_i32_i64(group_tid_134782) *\n            segmap_group_sizze_126500 + sext_i32_i64(local_tid_134781);\n    int64_t slice_134786 = t_n_m_114591;\n    int64_t slice_134787 = m_114533 * slice_134786;\n    int64_t gtid_125986 = squot64(global_tid_134785, slice_134786);\n    int64_t remnant_134788 = global_tid_134785 - gtid_125986 * slice_134786;\n    int64_t gtid_125987 = remnant_134788;\n    int64_t remnant_134789 = remnant_134788 - gtid_125987;\n    \n    if (slt64(gtid_125986, m_114533) && slt64(gtid_125987, t_n_m_114591)) {\n        int64_t x_126512 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130117)[gtid_125986];\n        int64_t x_126514 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130606)[gtid_125986 *\n                                                                     t_n_m_114591 +\n                                                                     gtid_125987];\n        float x_126515 = ((__global\n                           float *) defunc_3_map_res_mem_130607)[gtid_125986 *\n                                                                 t_n_m_114591 +\n                                                                 gtid_125987];\n        int64_t min_arg_126516 = mul64(t_jump_114541, gtid_125987);\n        int64_t min_res_126517 = smin64(i_114610, min_arg_126516);\n        float defunc_0_f_res_126518 = sitofp_i64_f32(min_res_126517);\n        float defunc_2_reduce_res_126519;\n        float defunc_2_reduce_res_126520;\n        fl",
                   "oat defunc_2_reduce_res_126521;\n        float defunc_2_reduce_res_126522;\n        float defunc_2_reduce_res_126523;\n        float redout_128979;\n        float redout_128980;\n        float redout_128981;\n        float redout_128982;\n        float redout_128983;\n        \n        redout_128979 = 0.0F;\n        redout_128980 = 0.0F;\n        redout_128981 = 0.0F;\n        redout_128982 = 0.0F;\n        redout_128983 = 0.0F;\n        for (int64_t i_128984 = 0; i_128984 < t_window_114537; i_128984++) {\n            bool cond_126540 = sle64(x_126512, i_128984);\n            float defunc_0_f_res_126541;\n            \n            if (cond_126540) {\n                defunc_0_f_res_126541 = 0.0F;\n            } else {\n                int64_t i_126542 = add64(x_126514, i_128984);\n                float x_126543 = ((__global float *) mem_130122)[gtid_125986 *\n                                                                 n_114534 +\n                                                                 i_126542];\n                float defunc_0_f_res_f_res_126544 = 1.0F + x_126543;\n                \n                defunc_0_f_res_126541 = defunc_0_f_res_f_res_126544;\n            }\n            \n            float defunc_0_f_res_126545;\n            \n            if (cond_126540) {\n                defunc_0_f_res_126545 = 0.0F;\n            } else {\n                int64_t i_126546 = add64(x_126514, i_128984);\n                float x_126547 = ((__global float *) mem_130861)[gtid_125986 *\n                                                                 n_114534 +\n                                                                 i_126546];\n                \n                defunc_0_f_res_126545 = x_126547;\n            }\n            \n            float x_j_126548 = defunc_0_f_res_126541 - defunc_0_f_res_126518;\n            float abs_res_126549 = (float) fabs(x_j_126548);\n            float tmp1_126550 = abs_res_126549 / x_126515;\n            float x_126551 = tmp1_126550 * tmp1_126550;\n            float y_12655",
                   "2 = tmp1_126550 * x_126551;\n            float tmp2_126553 = 1.0F - y_126552;\n            float x_126554 = tmp2_126553 * tmp2_126553;\n            float tmp3_126555 = tmp2_126553 * x_126554;\n            float w_j_126556 = defunc_0_f_res_126545 * tmp3_126555;\n            float xw_j_126557 = x_j_126548 * w_j_126556;\n            float x2w_j_126558 = x_j_126548 * xw_j_126557;\n            float x3w_j_126559 = x_j_126548 * x2w_j_126558;\n            float x4w_j_126560 = x_j_126548 * x3w_j_126559;\n            float defunc_1_op_res_126526 = w_j_126556 + redout_128979;\n            float defunc_1_op_res_126529 = xw_j_126557 + redout_128980;\n            float defunc_1_op_res_126532 = x2w_j_126558 + redout_128981;\n            float defunc_1_op_res_126535 = x3w_j_126559 + redout_128982;\n            float defunc_1_op_res_126538 = x4w_j_126560 + redout_128983;\n            float redout_tmp_134790 = defunc_1_op_res_126526;\n            float redout_tmp_134791 = defunc_1_op_res_126529;\n            float redout_tmp_134792 = defunc_1_op_res_126532;\n            float redout_tmp_134793 = defunc_1_op_res_126535;\n            float redout_tmp_134794 = defunc_1_op_res_126538;\n            \n            redout_128979 = redout_tmp_134790;\n            redout_128980 = redout_tmp_134791;\n            redout_128981 = redout_tmp_134792;\n            redout_128982 = redout_tmp_134793;\n            redout_128983 = redout_tmp_134794;\n        }\n        defunc_2_reduce_res_126519 = redout_128979;\n        defunc_2_reduce_res_126520 = redout_128980;\n        defunc_2_reduce_res_126521 = redout_128981;\n        defunc_2_reduce_res_126522 = redout_128982;\n        defunc_2_reduce_res_126523 = redout_128983;\n        \n        float x_126561 = defunc_2_reduce_res_126521 *\n              defunc_2_reduce_res_126523;\n        float y_126562 = defunc_2_reduce_res_126522 *\n              defunc_2_reduce_res_126522;\n        float a12_126563 = x_126561 - y_126562;\n        float x_126564 = defunc_2_reduce_res_126521 *\n              ",
                   "defunc_2_reduce_res_126522;\n        float y_126565 = defunc_2_reduce_res_126520 *\n              defunc_2_reduce_res_126523;\n        float b12_126566 = x_126564 - y_126565;\n        float x_126567 = defunc_2_reduce_res_126520 *\n              defunc_2_reduce_res_126522;\n        float y_126568 = defunc_2_reduce_res_126521 *\n              defunc_2_reduce_res_126521;\n        float c12_126569 = x_126567 - y_126568;\n        float x_126570 = defunc_2_reduce_res_126519 *\n              defunc_2_reduce_res_126523;\n        float b2_126571 = x_126570 - y_126568;\n        float x_126572 = defunc_2_reduce_res_126520 *\n              defunc_2_reduce_res_126521;\n        float y_126573 = defunc_2_reduce_res_126519 *\n              defunc_2_reduce_res_126522;\n        float c2_126574 = x_126572 - y_126573;\n        float x_126575 = defunc_2_reduce_res_126519 * a12_126563;\n        float y_126576 = defunc_2_reduce_res_126520 * b12_126566;\n        float x_126577 = x_126575 + y_126576;\n        float y_126578 = defunc_2_reduce_res_126521 * c12_126569;\n        float y_126579 = x_126577 + y_126578;\n        float det_126580 = 1.0F / y_126579;\n        float a12_126581 = a12_126563 * det_126580;\n        float b12_126582 = b12_126566 * det_126580;\n        float c12_126583 = c12_126569 * det_126580;\n        float b2_126584 = b2_126571 * det_126580;\n        float c2_126585 = c2_126574 * det_126580;\n        float defunc_2_reduce_res_126586;\n        float defunc_2_reduce_res_126587;\n        float redout_128985;\n        float redout_128986;\n        \n        redout_128985 = 0.0F;\n        redout_128986 = 0.0F;\n        for (int64_t i_128987 = 0; i_128987 < t_window_114537; i_128987++) {\n            bool cond_126595 = sle64(x_126512, i_128987);\n            float defunc_0_f_res_126596;\n            \n            if (cond_126595) {\n                defunc_0_f_res_126596 = 0.0F;\n            } else {\n                int64_t i_126597 = add64(x_126514, i_128987);\n                float x_126598 = ((__global float *) mem",
                   "_130122)[gtid_125986 *\n                                                                 n_114534 +\n                                                                 i_126597];\n                float defunc_0_f_res_f_res_126599 = 1.0F + x_126598;\n                \n                defunc_0_f_res_126596 = defunc_0_f_res_f_res_126599;\n            }\n            \n            float defunc_0_f_res_126600;\n            \n            if (cond_126595) {\n                defunc_0_f_res_126600 = 0.0F;\n            } else {\n                int64_t i_126601 = add64(x_126514, i_128987);\n                float x_126602 = ((__global float *) mem_130861)[gtid_125986 *\n                                                                 n_114534 +\n                                                                 i_126601];\n                \n                defunc_0_f_res_126600 = x_126602;\n            }\n            \n            float x_j_126603 = defunc_0_f_res_126596 - defunc_0_f_res_126518;\n            float abs_res_126604 = (float) fabs(x_j_126603);\n            float tmp1_126605 = abs_res_126604 / x_126515;\n            float x_126606 = tmp1_126605 * tmp1_126605;\n            float y_126607 = tmp1_126605 * x_126606;\n            float tmp2_126608 = 1.0F - y_126607;\n            float x_126609 = tmp2_126608 * tmp2_126608;\n            float tmp3_126610 = tmp2_126608 * x_126609;\n            float tmp4_126611 = defunc_0_f_res_126600 * tmp3_126610;\n            float defunc_1_f_res_126612 = x_j_126603 * tmp4_126611;\n            float defunc_1_f_res_126613 = x_j_126603 * defunc_1_f_res_126612;\n            float defunc_0_f_res_126614;\n            \n            if (cond_126595) {\n                defunc_0_f_res_126614 = 0.0F;\n            } else {\n                int64_t i_126615 = add64(x_126514, i_128987);\n                float x_126616 = ((__global\n                                   float *) defunc_4_map_res_mem_131267)[gtid_125986 *\n                                                                         n_1",
                   "14534 +\n                                                                         i_126615];\n                \n                defunc_0_f_res_126614 = x_126616;\n            }\n            \n            float x_126617 = a12_126581 * tmp4_126611;\n            float y_126618 = b12_126582 * defunc_1_f_res_126612;\n            float x_126619 = x_126617 + y_126618;\n            float y_126620 = c12_126583 * defunc_1_f_res_126613;\n            float x_126621 = x_126619 + y_126620;\n            float defunc_9_fit_fun_res_126622 = defunc_0_f_res_126614 *\n                  x_126621;\n            float x_126623 = b12_126582 * tmp4_126611;\n            float y_126624 = b2_126584 * defunc_1_f_res_126612;\n            float x_126625 = x_126623 + y_126624;\n            float y_126626 = c2_126585 * defunc_1_f_res_126613;\n            float x_126627 = x_126625 + y_126626;\n            float defunc_9_slope_fun_res_126628 = defunc_0_f_res_126614 *\n                  x_126627;\n            float defunc_1_op_res_126590 = defunc_9_fit_fun_res_126622 +\n                  redout_128985;\n            float defunc_1_op_res_126593 = defunc_9_slope_fun_res_126628 +\n                  redout_128986;\n            float redout_tmp_134795 = defunc_1_op_res_126590;\n            float redout_tmp_134796 = defunc_1_op_res_126593;\n            \n            redout_128985 = redout_tmp_134795;\n            redout_128986 = redout_tmp_134796;\n        }\n        defunc_2_reduce_res_126586 = redout_128985;\n        defunc_2_reduce_res_126587 = redout_128986;\n        ((__global float *) mem_131499)[gtid_125986 * t_n_m_114591 +\n                                        gtid_125987] =\n            defunc_2_reduce_res_126586;\n        ((__global float *) mem_131503)[gtid_125986 * t_n_m_114591 +\n                                        gtid_125987] =\n            defunc_2_reduce_res_126587;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_126500\n}\n__kernel void mainzisegmap_126216(__global int *global_failure,\n                    ",
                   "              int64_t m_114533, int64_t t_n_m_114591,\n                                  __global unsigned char *mem_131508, __global\n                                  unsigned char *mem_131512, __global\n                                  unsigned char *mem_131516, __global\n                                  unsigned char *mem_131520, __global\n                                  unsigned char *mem_131524, __global\n                                  unsigned char *mem_131529, __global\n                                  unsigned char *mem_131533, __global\n                                  unsigned char *mem_131537, __global\n                                  unsigned char *mem_131541, __global\n                                  unsigned char *mem_131545)\n{\n    #define segmap_group_sizze_126697 (mainzisegmap_group_sizze_126219)\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_134917;\n    int32_t local_tid_134918;\n    int64_t group_sizze_134921;\n    int32_t wave_sizze_134920;\n    int32_t group_tid_134919;\n    \n    global_tid_134917 = get_global_id(0);\n    local_tid_134918 = get_local_id(0);\n    group_sizze_134921 = get_local_size(0);\n    wave_sizze_134920 = LOCKSTEP_WIDTH;\n    group_tid_134919 = get_group_id(0);\n    \n    int32_t phys_tid_126216 = global_tid_134917;\n    int64_t global_tid_134922 = sext_i32_i64(group_tid_134919) *\n            segmap_group_sizze_126697 + sext_i32_i64(local_tid_134918);\n    int64_t slice_134923 = t_n_m_114591;\n    int64_t slice_134924 = m_114533 * slice_134923;\n    int64_t gtid_126214 = squot64(global_tid_134922, slice_134923);\n    int64_t remnant_134925 = global_tid_134922 - gtid_126214 * slice_134923;\n    int64_t gtid_126215 = remnant_134925;\n    int64_t remnant_134926 = remnant_134925 - gtid_126215;\n    \n    if (slt64(gtid_126214, m_114533) && slt64(gtid_126215, t_n_m_114591)) {\n        float defunc_2_reduce_res_126704 = ((",
                   "__global\n                                             float *) mem_131508)[gtid_126214 *\n                                                                  t_n_m_114591 +\n                                                                  gtid_126215];\n        float defunc_2_reduce_res_126705 = ((__global\n                                             float *) mem_131512)[gtid_126214 *\n                                                                  t_n_m_114591 +\n                                                                  gtid_126215];\n        float defunc_2_reduce_res_126706 = ((__global\n                                             float *) mem_131516)[gtid_126214 *\n                                                                  t_n_m_114591 +\n                                                                  gtid_126215];\n        float defunc_2_reduce_res_126707 = ((__global\n                                             float *) mem_131520)[gtid_126214 *\n                                                                  t_n_m_114591 +\n                                                                  gtid_126215];\n        float defunc_2_reduce_res_126708 = ((__global\n                                             float *) mem_131524)[gtid_126214 *\n                                                                  t_n_m_114591 +\n                                                                  gtid_126215];\n        float x_126709 = defunc_2_reduce_res_126706 *\n              defunc_2_reduce_res_126708;\n        float y_126710 = defunc_2_reduce_res_126707 *\n              defunc_2_reduce_res_126707;\n        float a12_126711 = x_126709 - y_126710;\n        float x_126712 = defunc_2_reduce_res_126706 *\n              defunc_2_reduce_res_126707;\n        float y_126713 = defunc_2_reduce_res_126705 *\n              defunc_2_reduce_res_126708;\n        float b12_126714 = x_126712 - y_126713;\n        float x_126715 = defunc_2_reduce_res_126705 *\n              defunc_2_reduce_res_12",
                   "6707;\n        float y_126716 = defunc_2_reduce_res_126706 *\n              defunc_2_reduce_res_126706;\n        float c12_126717 = x_126715 - y_126716;\n        float x_126718 = defunc_2_reduce_res_126704 *\n              defunc_2_reduce_res_126708;\n        float b2_126719 = x_126718 - y_126716;\n        float x_126720 = defunc_2_reduce_res_126705 *\n              defunc_2_reduce_res_126706;\n        float y_126721 = defunc_2_reduce_res_126704 *\n              defunc_2_reduce_res_126707;\n        float c2_126722 = x_126720 - y_126721;\n        float x_126723 = defunc_2_reduce_res_126704 * a12_126711;\n        float y_126724 = defunc_2_reduce_res_126705 * b12_126714;\n        float x_126725 = x_126723 + y_126724;\n        float y_126726 = defunc_2_reduce_res_126706 * c12_126717;\n        float y_126727 = x_126725 + y_126726;\n        float det_126728 = 1.0F / y_126727;\n        float a12_126729 = a12_126711 * det_126728;\n        float b12_126730 = b12_126714 * det_126728;\n        float c12_126731 = c12_126717 * det_126728;\n        float b2_126732 = b2_126719 * det_126728;\n        float c2_126733 = c2_126722 * det_126728;\n        \n        ((__global float *) mem_131529)[gtid_126214 * t_n_m_114591 +\n                                        gtid_126215] = a12_126729;\n        ((__global float *) mem_131533)[gtid_126214 * t_n_m_114591 +\n                                        gtid_126215] = b12_126730;\n        ((__global float *) mem_131537)[gtid_126214 * t_n_m_114591 +\n                                        gtid_126215] = c12_126731;\n        ((__global float *) mem_131541)[gtid_126214 * t_n_m_114591 +\n                                        gtid_126215] = b2_126732;\n        ((__global float *) mem_131545)[gtid_126214 * t_n_m_114591 +\n                                        gtid_126215] = c2_126733;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_126697\n}\n__kernel void mainzisegmap_127418(__global int *global_failure,\n                                  int failure_is_an_op",
                   "tion, __global\n                                  int64_t *global_failure_args,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t t_jump_114541, int64_t t_n_m_114591,\n                                  int64_t i_114610, int64_t y_116486, __global\n                                  unsigned char *defunc_11_loess_l_res_mem_131632,\n                                  __global\n                                  unsigned char *defunc_11_loess_l_res_mem_131633,\n                                  __global unsigned char *mem_131638)\n{\n    #define segmap_group_sizze_127533 (mainzisegmap_group_sizze_127421)\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_135080;\n    int32_t local_tid_135081;\n    int64_t group_sizze_135084;\n    int32_t wave_sizze_135083;\n    int32_t group_tid_135082;\n    \n    global_tid_135080 = get_global_id(0);\n    local_tid_135081 = get_local_id(0);\n    group_sizze_135084 = get_local_size(0);\n    wave_sizze_135083 = LOCKSTEP_WIDTH;\n    group_tid_135082 = get_group_id(0);\n    \n    int32_t phys_tid_127418 = global_tid_135080;\n    int64_t global_tid_135085 = sext_i32_i64(group_tid_135082) *\n            segmap_group_sizze_127533 + sext_i32_i64(local_tid_135081);\n    int64_t slice_135086 = n_114534;\n    int64_t slice_135087 = m_114533 * slice_135086;\n    int64_t gtid_127416 = squot64(global_tid_135085, slice_135086);\n    int64_t remnant_135088 = global_tid_135085 - gtid_127416 * slice_135086;\n    int64_t gtid_127417 = remnant_135088;\n    int64_t remnant_135089 = remnant_135088 - gtid_127417;\n    \n    if (slt64(gtid_127416, m_114533) && slt64(gtid_127417, n_114534)) {\n        int64_t m_v_127539 = sdiv64(gtid_127417, t_jump_114541);\n        bool cond_127540 = m_v_127539 == y_116486;\n        int64_t j_127541;\n        \n        if (cond_127540) {\n            int64_t j_t_res_127542 = sub64(",
                   "m_v_127539, (int64_t) 1);\n            \n            j_127541 = j_t_res_127542;\n        } else {\n            j_127541 = m_v_127539;\n        }\n        \n        int64_t min_arg_127543 = mul64(t_jump_114541, j_127541);\n        int64_t min_res_127544 = smin64(i_114610, min_arg_127543);\n        int64_t defunc_0_m_fun_arg_127545 = add64((int64_t) 1, j_127541);\n        int64_t min_arg_127546 = mul64(t_jump_114541,\n                                       defunc_0_m_fun_arg_127545);\n        int64_t min_res_127547 = smin64(i_114610, min_arg_127546);\n        int64_t i64_arg_127548 = sub64(min_res_127547, min_res_127544);\n        float i64_res_127549 = sitofp_i64_f32(i64_arg_127548);\n        int64_t i64_arg_127550 = sub64(gtid_127417, min_res_127544);\n        float i64_res_127551 = sitofp_i64_f32(i64_arg_127550);\n        float u_127552 = i64_res_127551 / i64_res_127549;\n        float u2_127553 = u_127552 * u_127552;\n        float u3_127554 = u_127552 * u2_127553;\n        float x_127555 = 2.0F * u3_127554;\n        float y_127556 = 3.0F * u2_127553;\n        float x_127557 = x_127555 - y_127556;\n        float x_127558 = 1.0F + x_127557;\n        bool x_127559 = sle64((int64_t) 0, j_127541);\n        bool y_127560 = slt64(j_127541, t_n_m_114591);\n        bool bounds_check_127561 = x_127559 && y_127560;\n        bool index_certs_127562;\n        \n        if (!bounds_check_127561) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 86) == -1) {\n                    global_failure_args[0] = j_127541;\n                    global_failure_args[1] = t_n_m_114591;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        float y_127563 = ((__global\n                           float *) defunc_11_loess_l_res_mem_131632)[gtid_127416 *\n                                                                      t_n_m_114591 +\n                                                                      j_127541];\n        float x_127564 = x_12",
                   "7558 * y_127563;\n        float x_127565 = y_127556 - x_127555;\n        bool x_127566 = sle64((int64_t) 0, defunc_0_m_fun_arg_127545);\n        bool y_127567 = slt64(defunc_0_m_fun_arg_127545, t_n_m_114591);\n        bool bounds_check_127568 = x_127566 && y_127567;\n        bool index_certs_127569;\n        \n        if (!bounds_check_127568) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 87) == -1) {\n                    global_failure_args[0] = defunc_0_m_fun_arg_127545;\n                    global_failure_args[1] = t_n_m_114591;\n                    ;\n                }\n                return;\n            }\n        }\n        \n        float y_127570 = ((__global\n                           float *) defunc_11_loess_l_res_mem_131632)[gtid_127416 *\n                                                                      t_n_m_114591 +\n                                                                      defunc_0_m_fun_arg_127545];\n        float y_127571 = x_127565 * y_127570;\n        float x_127572 = x_127564 + y_127571;\n        float y_127573 = 2.0F * u2_127553;\n        float x_127574 = u3_127554 - y_127573;\n        float x_127575 = u_127552 + x_127574;\n        float y_127576 = ((__global\n                           float *) defunc_11_loess_l_res_mem_131633)[gtid_127416 *\n                                                                      t_n_m_114591 +\n                                                                      j_127541];\n        float x_127577 = x_127575 * y_127576;\n        float y_127578 = i64_res_127549 * x_127577;\n        float x_127579 = x_127572 + y_127578;\n        float x_127580 = u3_127554 - u2_127553;\n        float y_127581 = ((__global\n                           float *) defunc_11_loess_l_res_mem_131633)[gtid_127416 *\n                                                                      t_n_m_114591 +\n                                                                      defunc_0_m_fun_arg_127545];\n        float x_127582 = x",
                   "_127580 * y_127581;\n        float y_127583 = i64_res_127549 * x_127582;\n        float defunc_0_f_res_127584 = x_127579 + y_127583;\n        \n        ((__global float *) mem_131638)[gtid_127416 * n_114534 + gtid_127417] =\n            defunc_0_f_res_127584;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_127533\n}\n__kernel void mainzisegmap_127596(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t loopres_ixfn_131656, __global\n                                  unsigned char *Y_mem_130086, __global\n                                  unsigned char *loopres_mem_131652, __global\n                                  unsigned char *loopres_mem_131660, __global\n                                  unsigned char *mem_131665)\n{\n    #define segmap_group_sizze_127629 (mainzisegmap_group_sizze_127599)\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_135090;\n    int32_t local_tid_135091;\n    int64_t group_sizze_135094;\n    int32_t wave_sizze_135093;\n    int32_t group_tid_135092;\n    \n    global_tid_135090 = get_global_id(0);\n    local_tid_135091 = get_local_id(0);\n    group_sizze_135094 = get_local_size(0);\n    wave_sizze_135093 = LOCKSTEP_WIDTH;\n    group_tid_135092 = get_group_id(0);\n    \n    int32_t phys_tid_127596 = global_tid_135090;\n    int64_t global_tid_135095 = sext_i32_i64(group_tid_135092) *\n            segmap_group_sizze_127629 + sext_i32_i64(local_tid_135091);\n    int64_t slice_135096 = n_114534;\n    int64_t slice_135097 = m_114533 * slice_135096;\n    int64_t gtid_127594 = squot64(global_tid_135095, slice_135096);\n    int64_t remnant_135098 = global_tid_135095 - gtid_127594 * slice_135096;\n    int64_t gtid_127595 = remnant_135098;\n    int64_t remnant_135099 = remnant_135098 - gtid_127595;\n    \n    if (slt64(gtid_127594, m_114533) && slt64(gtid_12759",
                   "5, n_114534)) {\n        float x_127632 = ((__global float *) Y_mem_130086)[gtid_127594 *\n                                                           n_114534 +\n                                                           gtid_127595];\n        float x_127633 = ((__global float *) loopres_mem_131652)[gtid_127594 *\n                                                                 n_114534 +\n                                                                 gtid_127595];\n        float x_127634 = ((__global float *) loopres_mem_131660)[gtid_127594 *\n                                                                 loopres_ixfn_131656 +\n                                                                 gtid_127595];\n        float x_127635 = x_127632 - x_127633;\n        float defunc_2_f_res_127636 = x_127635 - x_127634;\n        bool isnan_res_127637;\n        \n        isnan_res_127637 = futrts_isnan32(defunc_2_f_res_127636);\n        \n        float defunc_0_f_res_127638;\n        \n        if (isnan_res_127637) {\n            defunc_0_f_res_127638 = NAN;\n        } else {\n            float abs_res_127639 = (float) fabs(defunc_2_f_res_127636);\n            \n            defunc_0_f_res_127638 = abs_res_127639;\n        }\n        ((__global float *) mem_131665)[gtid_127594 * n_114534 + gtid_127595] =\n            defunc_0_f_res_127638;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_127629\n}\n__kernel void mainzisegmap_127651(__global int *global_failure,\n                                  int failure_is_an_option, __global\n                                  int64_t *global_failure_args,\n                                  int64_t m_114533, int64_t n_114534, __global\n                                  unsigned char *defunc_3_map_res_mem_130116,\n                                  __global unsigned char *mem_131665, __global\n                                  unsigned char *mem_131670)\n{\n    #define segmap_group_sizze_127684 (mainzisegmap_group_sizze_127654)\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_135100;\n    int32_t local_tid_135101;\n    int64_t group_sizze_135104;\n    int32_t wave_sizze_135103;\n    int32_t group_tid_135102;\n    \n    global_tid_135100 = get_global_id(0);\n    local_tid_135101 = get_local_id(0);\n    group_sizze_135104 = get_local_size(0);\n    wave_sizze_135103 = LOCKSTEP_WIDTH;\n    group_tid_135102 = get_group_id(0);\n    \n    int32_t phys_tid_127651 = global_tid_135100;\n    int64_t global_tid_135105 = sext_i32_i64(group_tid_135102) *\n            segmap_group_sizze_127684 + sext_i32_i64(local_tid_135101);\n    int64_t slice_135106 = n_114534;\n    int64_t slice_135107 = m_114533 * slice_135106;\n    int64_t gtid_127649 = squot64(global_tid_135105, slice_135106);\n    int64_t remnant_135108 = global_tid_135105 - gtid_127649 * slice_135106;\n    int64_t gtid_127650 = remnant_135108;\n    int64_t remnant_135109 = remnant_135108 - gtid_127650;\n    \n    if (slt64(gtid_127649, m_114533) && slt64(gtid_127650, n_114534)) {\n        int64_t x_127688 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130116)[gtid_127649 *\n                                                                     n_114534 +\n                                                                     gtid_127650];\n        bool cond_127689 = sle64((int64_t) 0, x_127688);\n        float defunc_0_f_res_127690;\n        \n        if (cond_127689) {\n            bool y_127691 = slt64(x_127688, n_114534);\n            bool bounds_check_127692 = cond_127689 && y_127691;\n            bool index_certs_127693;\n            \n            if (!bounds_check_127692) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 88) ==\n                        -1) {\n                        global_failure_args[0] = x_127688;\n                        global_failure_args[1] = n_114534;\n                        ;\n                   ",
                   " }\n                    return;\n                }\n            }\n            \n            float defunc_0_f_res_t_res_127694 = ((__global\n                                                  float *) mem_131665)[gtid_127649 *\n                                                                       n_114534 +\n                                                                       x_127688];\n            \n            defunc_0_f_res_127690 = defunc_0_f_res_t_res_127694;\n        } else {\n            defunc_0_f_res_127690 = INFINITY;\n        }\n        ((__global float *) mem_131670)[gtid_127649 * n_114534 + gtid_127650] =\n            defunc_0_f_res_127690;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_127684\n}\n__kernel void mainzisegmap_127708(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t i_114610, int32_t iters_116571,\n                                  int64_t num_groups_127802,\n                                  int64_t num_threads_132263, __global\n                                  unsigned char *mem_131673, __global\n                                  unsigned char *mem_131787, __global\n                                  unsigned char *color_132135, __global\n                                  unsigned char *color_132136, __global\n                                  unsigned char *color_132137, __global\n                                  unsigned char *color_132138, __global\n                                  unsigned char *color_132139, __global\n                                  unsigned char *color_132140, __global\n                                  unsigned char *color_132141)\n{\n    #define segmap_group_sizze_127801 (mainzisegmap_group_sizze_127710)\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_135112;\n    int32_t local_tid_135113;\n    int64_t grou",
                   "p_sizze_135116;\n    int32_t wave_sizze_135115;\n    int32_t group_tid_135114;\n    \n    global_tid_135112 = get_global_id(0);\n    local_tid_135113 = get_local_id(0);\n    group_sizze_135116 = get_local_size(0);\n    wave_sizze_135115 = LOCKSTEP_WIDTH;\n    group_tid_135114 = get_group_id(0);\n    \n    int32_t phys_tid_127708 = global_tid_135112;\n    int32_t phys_group_id_135117;\n    \n    phys_group_id_135117 = get_group_id(0);\n    for (int32_t i_135118 = 0; i_135118 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533,\n                                          segmap_group_sizze_127801)) -\n                   phys_group_id_135117, sext_i64_i32(num_groups_127802));\n         i_135118++) {\n        int32_t virt_group_id_135119 = phys_group_id_135117 + i_135118 *\n                sext_i64_i32(num_groups_127802);\n        int64_t global_tid_135120 = sext_i32_i64(virt_group_id_135119) *\n                segmap_group_sizze_127801 + sext_i32_i64(local_tid_135113);\n        int64_t slice_135121 = m_114533;\n        int64_t gtid_127707 = global_tid_135120;\n        int64_t remnant_135122 = global_tid_135120 - gtid_127707;\n        \n        if (slt64(gtid_127707, m_114533)) {\n            for (int64_t i_135123 = 0; i_135123 < n_114534; i_135123++) {\n                ((__global float *) color_132135)[phys_tid_127708 + i_135123 *\n                                                  num_threads_132263] =\n                    ((__global float *) mem_131673)[gtid_127707 + i_135123 *\n                                                    m_114533];\n            }\n            for (int32_t i_127807 = 0; i_127807 < iters_116571; i_127807++) {\n                int32_t defunc_2_radix_sort_step_arg_127809 = mul32(2,\n                                                                    i_127807);\n                int32_t defunc_0_get_bit_arg_127810 = add32(1,\n                                                            defunc_2_radix_sort_step_arg_127809);\n                bool cond_f_res_127811 = defunc_0_get_bit_arg_1",
                   "27810 == 31;\n                bool cond_f_res_127812 = defunc_2_radix_sort_step_arg_127809 ==\n                     31;\n                int64_t discard_129972;\n                int64_t discard_129973;\n                int64_t discard_129974;\n                int64_t discard_129975;\n                int64_t scanacc_129957;\n                int64_t scanacc_129958;\n                int64_t scanacc_129959;\n                int64_t scanacc_129960;\n                \n                scanacc_129957 = (int64_t) 0;\n                scanacc_129958 = (int64_t) 0;\n                scanacc_129959 = (int64_t) 0;\n                scanacc_129960 = (int64_t) 0;\n                for (int64_t i_129966 = 0; i_129966 < n_114534; i_129966++) {\n                    float x_127830 = ((__global\n                                       float *) color_132135)[phys_tid_127708 +\n                                                              i_129966 *\n                                                              num_threads_132263];\n                    int32_t i32_arg_127831;\n                    \n                    i32_arg_127831 = futrts_to_bits32(x_127830);\n                    \n                    int32_t unsign_arg_127832 = ashr32(i32_arg_127831,\n                                                       defunc_0_get_bit_arg_127810);\n                    int32_t unsign_arg_127833 = 1 & unsign_arg_127832;\n                    int32_t unsign_arg_127834 = ashr32(i32_arg_127831, 31);\n                    int32_t unsign_arg_127835 = 1 & unsign_arg_127834;\n                    bool cond_127836 = unsign_arg_127835 == 1;\n                    bool x_127837 = !cond_127836;\n                    bool y_127838 = cond_f_res_127811 && x_127837;\n                    bool cond_127839 = cond_127836 || y_127838;\n                    int32_t defunc_1_get_bit_res_127840;\n                    \n                    if (cond_127839) {\n                        int32_t defunc_1_get_bit_res_t_res_127841 = 1 ^\n                                unsign_ar",
                   "g_127833;\n                        \n                        defunc_1_get_bit_res_127840 =\n                            defunc_1_get_bit_res_t_res_127841;\n                    } else {\n                        defunc_1_get_bit_res_127840 = unsign_arg_127833;\n                    }\n                    \n                    int32_t x_127842 = mul32(2, defunc_1_get_bit_res_127840);\n                    int32_t unsign_arg_127843 = ashr32(i32_arg_127831,\n                                                       defunc_2_radix_sort_step_arg_127809);\n                    int32_t unsign_arg_127844 = 1 & unsign_arg_127843;\n                    bool y_127845 = cond_f_res_127812 && x_127837;\n                    bool cond_127846 = cond_127836 || y_127845;\n                    int32_t defunc_1_get_bit_res_127847;\n                    \n                    if (cond_127846) {\n                        int32_t defunc_1_get_bit_res_t_res_127848 = 1 ^\n                                unsign_arg_127844;\n                        \n                        defunc_1_get_bit_res_127847 =\n                            defunc_1_get_bit_res_t_res_127848;\n                    } else {\n                        defunc_1_get_bit_res_127847 = unsign_arg_127844;\n                    }\n                    \n                    int32_t defunc_0_f_res_127849 = add32(x_127842,\n                                                          defunc_1_get_bit_res_127847);\n                    bool cond_127850 = defunc_0_f_res_127849 == 0;\n                    int64_t defunc_0_f_res_127851 = btoi_bool_i64(cond_127850);\n                    int64_t defunc_0_f_res_127852;\n                    int64_t defunc_0_f_res_127853;\n                    int64_t defunc_0_f_res_127854;\n                    \n                    if (cond_127850) {\n                        defunc_0_f_res_127852 = (int64_t) 0;\n                        defunc_0_f_res_127853 = (int64_t) 0;\n                        defunc_0_f_res_127854 = (int64_t) 0;\n                    } else {\n    ",
                   "                    bool cond_127855 = defunc_0_f_res_127849 == 1;\n                        int64_t defunc_0_f_res_f_res_127856 =\n                                btoi_bool_i64(cond_127855);\n                        int64_t defunc_0_f_res_f_res_127857;\n                        int64_t defunc_0_f_res_f_res_127858;\n                        \n                        if (cond_127855) {\n                            defunc_0_f_res_f_res_127857 = (int64_t) 0;\n                            defunc_0_f_res_f_res_127858 = (int64_t) 0;\n                        } else {\n                            bool cond_127859 = defunc_0_f_res_127849 == 2;\n                            int64_t defunc_0_f_res_f_res_f_res_127860 =\n                                    btoi_bool_i64(cond_127859);\n                            bool cond_neg_127861 = !cond_127859;\n                            int64_t defunc_0_f_res_f_res_f_res_127862 =\n                                    btoi_bool_i64(cond_neg_127861);\n                            \n                            defunc_0_f_res_f_res_127857 =\n                                defunc_0_f_res_f_res_f_res_127860;\n                            defunc_0_f_res_f_res_127858 =\n                                defunc_0_f_res_f_res_f_res_127862;\n                        }\n                        defunc_0_f_res_127852 = defunc_0_f_res_f_res_127856;\n                        defunc_0_f_res_127853 = defunc_0_f_res_f_res_127857;\n                        defunc_0_f_res_127854 = defunc_0_f_res_f_res_127858;\n                    }\n                    \n                    int64_t defunc_1_op_res_127826 =\n                            add64(defunc_0_f_res_127851, scanacc_129957);\n                    int64_t defunc_1_op_res_127827 =\n                            add64(defunc_0_f_res_127852, scanacc_129958);\n                    int64_t defunc_1_op_res_127828 =\n                            add64(defunc_0_f_res_127853, scanacc_129959);\n                    int64_t defunc_1_op_res_127829 =\n                 ",
                   "           add64(defunc_0_f_res_127854, scanacc_129960);\n                    \n                    ((__global int64_t *) color_132141)[phys_tid_127708 +\n                                                        i_129966 *\n                                                        num_threads_132263] =\n                        defunc_1_op_res_127826;\n                    ((__global int64_t *) color_132140)[phys_tid_127708 +\n                                                        i_129966 *\n                                                        num_threads_132263] =\n                        defunc_1_op_res_127827;\n                    ((__global int64_t *) color_132139)[phys_tid_127708 +\n                                                        i_129966 *\n                                                        num_threads_132263] =\n                        defunc_1_op_res_127828;\n                    ((__global int64_t *) color_132138)[phys_tid_127708 +\n                                                        i_129966 *\n                                                        num_threads_132263] =\n                        defunc_1_op_res_127829;\n                    ((__global int32_t *) color_132137)[phys_tid_127708 +\n                                                        i_129966 *\n                                                        num_threads_132263] =\n                        defunc_0_f_res_127849;\n                    \n                    int64_t scanacc_tmp_135125 = defunc_1_op_res_127826;\n                    int64_t scanacc_tmp_135126 = defunc_1_op_res_127827;\n                    int64_t scanacc_tmp_135127 = defunc_1_op_res_127828;\n                    int64_t scanacc_tmp_135128 = defunc_1_op_res_127829;\n                    \n                    scanacc_129957 = scanacc_tmp_135125;\n                    scanacc_129958 = scanacc_tmp_135126;\n                    scanacc_129959 = scanacc_tmp_135127;\n                    scanacc_129960 = scanacc_tmp_135128;\n                }\n        ",
                   "        discard_129972 = scanacc_129957;\n                discard_129973 = scanacc_129958;\n                discard_129974 = scanacc_129959;\n                discard_129975 = scanacc_129960;\n                \n                int64_t last_res_127863 = ((__global\n                                            int64_t *) color_132141)[phys_tid_127708 +\n                                                                     i_114610 *\n                                                                     num_threads_132263];\n                int64_t last_res_127864 = ((__global\n                                            int64_t *) color_132140)[phys_tid_127708 +\n                                                                     i_114610 *\n                                                                     num_threads_132263];\n                int64_t last_res_127865 = ((__global\n                                            int64_t *) color_132139)[phys_tid_127708 +\n                                                                     i_114610 *\n                                                                     num_threads_132263];\n                \n                for (int64_t i_135134 = 0; i_135134 < n_114534; i_135134++) {\n                    ((__global float *) color_132136)[phys_tid_127708 +\n                                                      i_135134 *\n                                                      num_threads_132263] =\n                        ((__global float *) color_132135)[phys_tid_127708 +\n                                                          i_135134 *\n                                                          num_threads_132263];\n                }\n                for (int64_t write_iter_129976 = 0; write_iter_129976 <\n                     n_114534; write_iter_129976++) {\n                    int32_t write_iv_129978 = ((__global\n                                                int32_t *) color_132137)[phys_tid_127708 +\n                                         ",
                   "                                write_iter_129976 *\n                                                                         num_threads_132263];\n                    bool match_lit_127874 = 0 == write_iv_129978;\n                    int64_t defunc_1_f_res_127875;\n                    \n                    if (match_lit_127874) {\n                        int64_t write_iv_129979 = ((__global\n                                                    int64_t *) color_132141)[phys_tid_127708 +\n                                                                             write_iter_129976 *\n                                                                             num_threads_132263];\n                        int64_t case_res_127876 = sub64(write_iv_129979,\n                                                        (int64_t) 1);\n                        \n                        defunc_1_f_res_127875 = case_res_127876;\n                    } else {\n                        bool match_lit_127877 = 1 == write_iv_129978;\n                        int64_t x_127878;\n                        \n                        if (match_lit_127877) {\n                            int64_t write_iv_129980 = ((__global\n                                                        int64_t *) color_132140)[phys_tid_127708 +\n                                                                                 write_iter_129976 *\n                                                                                 num_threads_132263];\n                            int64_t x_127879 = add64(last_res_127863,\n                                                     write_iv_129980);\n                            int64_t case_res_127880 = sub64(x_127879,\n                                                            (int64_t) 1);\n                            \n                            x_127878 = case_res_127880;\n                        } else {\n                            bool match_lit_127881 = 2 == write_iv_129978;\n                            in",
                   "t64_t x_127882;\n                            \n                            if (match_lit_127881) {\n                                int64_t write_iv_129981 = ((__global\n                                                            int64_t *) color_132139)[phys_tid_127708 +\n                                                                                     write_iter_129976 *\n                                                                                     num_threads_132263];\n                                int64_t x_127883 = add64(last_res_127863,\n                                                         last_res_127864);\n                                int64_t x_127884 = add64(x_127883,\n                                                         write_iv_129981);\n                                int64_t case_res_127885 = sub64(x_127884,\n                                                                (int64_t) 1);\n                                \n                                x_127882 = case_res_127885;\n                            } else {\n                                int64_t write_iv_129982 = ((__global\n                                                            int64_t *) color_132138)[phys_tid_127708 +\n                                                                                     write_iter_129976 *\n                                                                                     num_threads_132263];\n                                int64_t x_127886 = add64(last_res_127863,\n                                                         last_res_127864);\n                                int64_t x_127887 = add64(last_res_127865,\n                                                         x_127886);\n                                int64_t x_127888 = add64(x_127887,\n                                                         write_iv_129982);\n                                int64_t defunc_1_f_res_res_127889 =\n                                        sub64(x_127888, (int64_",
                   "t) 1);\n                                \n                                x_127882 = defunc_1_f_res_res_127889;\n                            }\n                            x_127878 = x_127882;\n                        }\n                        defunc_1_f_res_127875 = x_127878;\n                    }\n                    if (sle64((int64_t) 0, defunc_1_f_res_127875) &&\n                        slt64(defunc_1_f_res_127875, n_114534)) {\n                        for (int64_t i_135136 = 0; i_135136 < (int64_t) 1;\n                             i_135136++) {\n                            ((__global float *) color_132136)[phys_tid_127708 +\n                                                              (defunc_1_f_res_127875 +\n                                                               i_135136) *\n                                                              num_threads_132263] =\n                                ((__global\n                                  float *) color_132135)[phys_tid_127708 +\n                                                         num_threads_132263 *\n                                                         write_iter_129976 +\n                                                         i_135136 *\n                                                         num_threads_132263];\n                        }\n                    }\n                }\n                for (int64_t i_135137 = 0; i_135137 < n_114534; i_135137++) {\n                    ((__global float *) color_132135)[phys_tid_127708 +\n                                                      i_135137 *\n                                                      num_threads_132263] =\n                        ((__global float *) color_132136)[phys_tid_127708 +\n                                                          i_135137 *\n                                                          num_threads_132263];\n                }\n            }\n            for (int64_t i_135138 = 0; i_135138 < n_114534; i_135138++) {\n                ((__",
                   "global float *) mem_131787)[i_135138 * m_114533 +\n                                                gtid_127707] = ((__global\n                                                                 float *) color_132135)[phys_tid_127708 +\n                                                                                        i_135138 *\n                                                                                        num_threads_132263];\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_127801\n}\n__kernel void mainzisegmap_128091(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t i_114610, __global\n                                  unsigned char *mem_param_131846, __global\n                                  unsigned char *mem_131852, __global\n                                  unsigned char *mem_131882, __global\n                                  unsigned char *mem_131886, __global\n                                  unsigned char *mem_131890, __global\n                                  unsigned char *mem_131894, __global\n                                  unsigned char *mem_131898)\n{\n    #define segmap_group_sizze_128456 (mainzisegmap_group_sizze_128094)\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_135300;\n    int32_t local_tid_135301;\n    int64_t group_sizze_135304;\n    int32_t wave_sizze_135303;\n    int32_t group_tid_135302;\n    \n    global_tid_135300 = get_global_id(0);\n    local_tid_135301 = get_local_id(0);\n    group_sizze_135304 = get_local_size(0);\n    wave_sizze_135303 = LOCKSTEP_WIDTH;\n    group_tid_135302 = get_group_id(0);\n    \n    int32_t phys_tid_128091 = global_tid_135300;\n    int64_t global_tid_135305 = sext_i32_i64(group_tid_135302) *\n            s",
                   "egmap_group_sizze_128456 + sext_i32_i64(local_tid_135301);\n    int64_t slice_135306 = n_114534;\n    int64_t slice_135307 = m_114533 * slice_135306;\n    int64_t gtid_128089 = squot64(global_tid_135305, slice_135306);\n    int64_t remnant_135308 = global_tid_135305 - gtid_128089 * slice_135306;\n    int64_t gtid_128090 = remnant_135308;\n    int64_t remnant_135309 = remnant_135308 - gtid_128090;\n    \n    if (slt64(gtid_128089, m_114533) && slt64(gtid_128090, n_114534)) {\n        int32_t x_128462 = ((__global int32_t *) mem_131898)[gtid_128089 *\n                                                             n_114534 +\n                                                             gtid_128090];\n        float write_value_128467 = ((__global\n                                     float *) mem_param_131846)[gtid_128089 *\n                                                                n_114534 +\n                                                                gtid_128090];\n        bool match_lit_128468 = 0 == x_128462;\n        int64_t defunc_1_f_res_128469;\n        \n        if (match_lit_128468) {\n            int64_t x_128463 = ((__global int64_t *) mem_131882)[gtid_128089 *\n                                                                 n_114534 +\n                                                                 gtid_128090];\n            int64_t case_res_128470 = sub64(x_128463, (int64_t) 1);\n            \n            defunc_1_f_res_128469 = case_res_128470;\n        } else {\n            int64_t last_res_128459 = ((__global\n                                        int64_t *) mem_131882)[gtid_128089 *\n                                                               n_114534 +\n                                                               i_114610];\n            bool match_lit_128471 = 1 == x_128462;\n            int64_t x_128472;\n            \n            if (match_lit_128471) {\n                int64_t x_128464 = ((__global\n                                     int64_t *) mem_131886)[gtid_128",
                   "089 *\n                                                            n_114534 +\n                                                            gtid_128090];\n                int64_t x_128473 = add64(last_res_128459, x_128464);\n                int64_t case_res_128474 = sub64(x_128473, (int64_t) 1);\n                \n                x_128472 = case_res_128474;\n            } else {\n                int64_t last_res_128460 = ((__global\n                                            int64_t *) mem_131886)[gtid_128089 *\n                                                                   n_114534 +\n                                                                   i_114610];\n                bool match_lit_128475 = 2 == x_128462;\n                int64_t x_128476;\n                \n                if (match_lit_128475) {\n                    int64_t x_128465 = ((__global\n                                         int64_t *) mem_131890)[gtid_128089 *\n                                                                n_114534 +\n                                                                gtid_128090];\n                    int64_t x_128477 = add64(last_res_128459, last_res_128460);\n                    int64_t x_128478 = add64(x_128465, x_128477);\n                    int64_t case_res_128479 = sub64(x_128478, (int64_t) 1);\n                    \n                    x_128476 = case_res_128479;\n                } else {\n                    int64_t last_res_128461 = ((__global\n                                                int64_t *) mem_131890)[gtid_128089 *\n                                                                       n_114534 +\n                                                                       i_114610];\n                    int64_t x_128466 = ((__global\n                                         int64_t *) mem_131894)[gtid_128089 *\n                                                                n_114534 +\n                                                                gtid_128090];\n      ",
                   "              int64_t x_128480 = add64(last_res_128459, last_res_128460);\n                    int64_t x_128481 = add64(last_res_128461, x_128480);\n                    int64_t x_128482 = add64(x_128466, x_128481);\n                    int64_t defunc_1_f_res_res_128483 = sub64(x_128482,\n                                                              (int64_t) 1);\n                    \n                    x_128476 = defunc_1_f_res_res_128483;\n                }\n                x_128472 = x_128476;\n            }\n            defunc_1_f_res_128469 = x_128472;\n        }\n        if ((sle64((int64_t) 0, gtid_128089) && slt64(gtid_128089, m_114533)) &&\n            (sle64((int64_t) 0, defunc_1_f_res_128469) &&\n             slt64(defunc_1_f_res_128469, n_114534))) {\n            ((__global float *) mem_131852)[gtid_128089 * n_114534 +\n                                            defunc_1_f_res_128469] =\n                write_value_128467;\n        }\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_128456\n}\n__kernel void mainzisegmap_128490(__global int *global_failure,\n                                  int64_t m_114533, int64_t stl_res_114604,\n                                  int64_t j_m_i_115007, __global\n                                  unsigned char *mem_131932, __global\n                                  unsigned char *mem_131936, __global\n                                  unsigned char *mem_131939, __global\n                                  unsigned char *mem_131942)\n{\n    #define segmap_group_sizze_128505 (mainzisegmap_group_sizze_128492)\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_135314;\n    int32_t local_tid_135315;\n    int64_t group_sizze_135318;\n    int32_t wave_sizze_135317;\n    int32_t group_tid_135316;\n    \n    global_tid_135314 = get_global_id(0);\n    local_tid_135315 = get_local_id(0);\n    group_sizze_135318 = get_local_size(0",
                   ");\n    wave_sizze_135317 = LOCKSTEP_WIDTH;\n    group_tid_135316 = get_group_id(0);\n    \n    int32_t phys_tid_128490 = global_tid_135314;\n    int64_t global_tid_135319 = sext_i32_i64(group_tid_135316) *\n            segmap_group_sizze_128505 + sext_i32_i64(local_tid_135315);\n    int64_t slice_135320 = m_114533;\n    int64_t gtid_128489 = global_tid_135319;\n    int64_t remnant_135321 = global_tid_135319 - gtid_128489;\n    \n    if (slt64(gtid_128489, m_114533)) {\n        float defunc_2_reduce_res_128511;\n        float redout_129985 = 0.0F;\n        \n        for (int64_t i_129986 = 0; i_129986 < j_m_i_115007; i_129986++) {\n            int64_t slice_130015 = stl_res_114604 + i_129986;\n            float x_128515 = ((__global float *) mem_131932)[slice_130015 *\n                                                             m_114533 +\n                                                             gtid_128489];\n            float defunc_1_op_res_128514 = x_128515 + redout_129985;\n            float redout_tmp_135322 = defunc_1_op_res_128514;\n            \n            redout_129985 = redout_tmp_135322;\n        }\n        defunc_2_reduce_res_128511 = redout_129985;\n        \n        float h_128516 = 3.0F * defunc_2_reduce_res_128511;\n        float h9_128517 = 0.999F * h_128516;\n        float h1_128518 = 1.0e-3F * h_128516;\n        \n        ((__global float *) mem_131936)[gtid_128489] = h_128516;\n        ((__global float *) mem_131939)[gtid_128489] = h9_128517;\n        ((__global float *) mem_131942)[gtid_128489] = h1_128518;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_128505\n}\n__kernel void mainzisegmap_128521(__global int *global_failure,\n                                  int64_t m_114533, __global\n                                  unsigned char *mem_131946, __global\n                                  unsigned char *mem_131950, __global\n                                  unsigned char *mem_131953, __global\n                                  unsigned char *mem_131956)\n{\n ",
                   "   #define segmap_group_sizze_128557 (mainzisegmap_group_sizze_128523)\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_135387;\n    int32_t local_tid_135388;\n    int64_t group_sizze_135391;\n    int32_t wave_sizze_135390;\n    int32_t group_tid_135389;\n    \n    global_tid_135387 = get_global_id(0);\n    local_tid_135388 = get_local_id(0);\n    group_sizze_135391 = get_local_size(0);\n    wave_sizze_135390 = LOCKSTEP_WIDTH;\n    group_tid_135389 = get_group_id(0);\n    \n    int32_t phys_tid_128521 = global_tid_135387;\n    int64_t global_tid_135392 = sext_i32_i64(group_tid_135389) *\n            segmap_group_sizze_128557 + sext_i32_i64(local_tid_135388);\n    int64_t slice_135393 = m_114533;\n    int64_t gtid_128520 = global_tid_135392;\n    int64_t remnant_135394 = global_tid_135392 - gtid_128520;\n    \n    if (slt64(gtid_128520, m_114533)) {\n        float defunc_2_reduce_res_128562 = ((__global\n                                             float *) mem_131946)[gtid_128520];\n        float h_128563 = 3.0F * defunc_2_reduce_res_128562;\n        float h9_128564 = 0.999F * h_128563;\n        float h1_128565 = 1.0e-3F * h_128563;\n        \n        ((__global float *) mem_131950)[gtid_128520] = h_128563;\n        ((__global float *) mem_131953)[gtid_128520] = h9_128564;\n        ((__global float *) mem_131956)[gtid_128520] = h1_128565;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_128557\n}\n__kernel void mainzisegmap_128579(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534, __global\n                                  unsigned char *mem_131665, __global\n                                  unsigned char *defunc_2_map_res_mem_131957,\n                                  __global\n                                  unsigned char *defunc_2_map_res_mem_131958,\n                                  __global\n              ",
                   "                    unsigned char *defunc_2_map_res_mem_131959,\n                                  __global unsigned char *mem_131964)\n{\n    #define segmap_group_sizze_128636 (mainzisegmap_group_sizze_128582)\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_135396;\n    int32_t local_tid_135397;\n    int64_t group_sizze_135400;\n    int32_t wave_sizze_135399;\n    int32_t group_tid_135398;\n    \n    global_tid_135396 = get_global_id(0);\n    local_tid_135397 = get_local_id(0);\n    group_sizze_135400 = get_local_size(0);\n    wave_sizze_135399 = LOCKSTEP_WIDTH;\n    group_tid_135398 = get_group_id(0);\n    \n    int32_t phys_tid_128579 = global_tid_135396;\n    int64_t global_tid_135401 = sext_i32_i64(group_tid_135398) *\n            segmap_group_sizze_128636 + sext_i32_i64(local_tid_135397);\n    int64_t slice_135402 = n_114534;\n    int64_t slice_135403 = m_114533 * slice_135402;\n    int64_t gtid_128577 = squot64(global_tid_135401, slice_135402);\n    int64_t remnant_135404 = global_tid_135401 - gtid_128577 * slice_135402;\n    int64_t gtid_128578 = remnant_135404;\n    int64_t remnant_135405 = remnant_135404 - gtid_128578;\n    \n    if (slt64(gtid_128577, m_114533) && slt64(gtid_128578, n_114534)) {\n        float x_128639 = ((__global\n                           float *) defunc_2_map_res_mem_131957)[gtid_128577];\n        float x_128641 = ((__global\n                           float *) defunc_2_map_res_mem_131959)[gtid_128577];\n        float x_128642 = ((__global float *) mem_131665)[gtid_128577 *\n                                                         n_114534 +\n                                                         gtid_128578];\n        float x_128643 = x_128642 / x_128639;\n        float y_128644 = fpow32(x_128643, 2.0F);\n        float x_128645 = 1.0F - y_128644;\n        float bicube_128646 = fpow32(x_128645, 2.0F);\n        bool isnan_res_128647;\n        \n  ",
                   "      isnan_res_128647 = futrts_isnan32(x_128642);\n        \n        bool cond_f_res_128648 = x_128642 <= x_128641;\n        bool x_128649 = !isnan_res_128647;\n        bool y_128650 = cond_f_res_128648 && x_128649;\n        bool cond_128651 = isnan_res_128647 || y_128650;\n        float defunc_0_f_res_128652;\n        \n        if (cond_128651) {\n            defunc_0_f_res_128652 = 1.0F;\n        } else {\n            float x_128640 = ((__global\n                               float *) defunc_2_map_res_mem_131958)[gtid_128577];\n            bool cond_128653 = x_128640 <= x_128642;\n            bool cond_f_res_128654 = x_128642 <= 1.0e-6F;\n            bool x_128655 = !cond_128653;\n            bool y_128656 = cond_f_res_128654 && x_128655;\n            bool cond_128657 = cond_128653 || y_128656;\n            float defunc_0_f_res_f_res_128658;\n            \n            if (cond_128657) {\n                defunc_0_f_res_f_res_128658 = 1.0e-6F;\n            } else {\n                defunc_0_f_res_f_res_128658 = bicube_128646;\n            }\n            defunc_0_f_res_128652 = defunc_0_f_res_f_res_128658;\n        }\n        ((__global float *) mem_131964)[gtid_128577 * n_114534 + gtid_128578] =\n            defunc_0_f_res_128652;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_128636\n}\n__kernel void mainzisegmap_128670(__global int *global_failure,\n                                  int64_t m_114533, int64_t n_114534,\n                                  int64_t stl_res_ixfn_131982, __global\n                                  unsigned char *Y_mem_130086, __global\n                                  unsigned char *stl_res_mem_131978, __global\n                                  unsigned char *stl_res_mem_131986, __global\n                                  unsigned char *mem_131999)\n{\n    #define segmap_group_sizze_128697 (mainzisegmap_group_sizze_128673)\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_135406;\n    int32_t local_tid_135407;\n    int64_t group_sizze_135410;\n    int32_t wave_sizze_135409;\n    int32_t group_tid_135408;\n    \n    global_tid_135406 = get_global_id(0);\n    local_tid_135407 = get_local_id(0);\n    group_sizze_135410 = get_local_size(0);\n    wave_sizze_135409 = LOCKSTEP_WIDTH;\n    group_tid_135408 = get_group_id(0);\n    \n    int32_t phys_tid_128670 = global_tid_135406;\n    int64_t global_tid_135411 = sext_i32_i64(group_tid_135408) *\n            segmap_group_sizze_128697 + sext_i32_i64(local_tid_135407);\n    int64_t slice_135412 = n_114534;\n    int64_t slice_135413 = m_114533 * slice_135412;\n    int64_t gtid_128668 = squot64(global_tid_135411, slice_135412);\n    int64_t remnant_135414 = global_tid_135411 - gtid_128668 * slice_135412;\n    int64_t gtid_128669 = remnant_135414;\n    int64_t remnant_135415 = remnant_135414 - gtid_128669;\n    \n    if (slt64(gtid_128668, m_114533) && slt64(gtid_128669, n_114534)) {\n        float x_128700 = ((__global float *) Y_mem_130086)[gtid_128668 *\n                                                           n_114534 +\n                                                           gtid_128669];\n        float x_128701 = ((__global float *) stl_res_mem_131978)[gtid_128668 *\n                                                                 n_114534 +\n                                                                 gtid_128669];\n        float x_128702 = ((__global float *) stl_res_mem_131986)[gtid_128668 *\n                                                                 stl_res_ixfn_131982 +\n                                                                 gtid_128669];\n        float x_128703 = x_128700 - x_128701;\n        float defunc_2_f_res_128704 = x_128703 - x_128702;\n        \n        ((__global float *) mem_131999)[gtid_128668 * n_114534 + gtid_128669] =\n            defunc_2_f_res_128704;\n    }\n    \n  error_0:\n    return;\n    #undef segmap_group_sizze_128697\n}\n__kernel void mai",
                   "nzisegmap_intragroup_116763(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *color_132064_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_132063_backing_aligned_1,\n                                             int64_t m_114533, int64_t n_114534,\n                                             int64_t i_114610, __global\n                                             unsigned char *Y_mem_130086,\n                                             __global unsigned char *mem_130099,\n                                             __global unsigned char *mem_130102)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict color_132064_backing_1 = (__local volatile\n                                                              char *) color_132064_backing_aligned_0;\n    __local volatile char *restrict color_132063_backing_0 = (__local volatile\n                                                              char *) color_132063_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_132285;\n    int32_t local_tid_132286;\n    int64_t group_sizze_132289;\n    int32_t wave_sizze_132288;\n    int32_t group_tid_132287;\n    \n    global_tid_132285 = get_global_id(0);\n    local_tid_132286 = get_local_id(0);\n    group_sizze_132289 = get_local_size(0);\n    wave_sizze_132288 = LOCKSTEP_WIDTH;\n    group_tid_132287 = get_group_id(0);\n    \n    int32_t phys_tid_116763 = group_tid_132287;\n    int32_t ltid_pre_132290 = local_tid_132286;\n    int64_t slice_132291 = m_114533;\n    int64_t gtid_116755 = sext_i32_i64(group_tid_132287);\n    int64_t remnant_132292 = sext_i32_i64(group_tid_132287) - gtid_116755;\n    __local char *color_132063;\n    \n    color_132063 = (__local char *) color_132063_backing_0;\n    \n    __loc",
                   "al char *color_132064;\n    \n    color_132064 = (__local char *) color_132064_backing_1;\n    \n    int64_t gtid_116758 = sext_i32_i64(ltid_pre_132290);\n    int32_t phys_tid_116759 = local_tid_132286;\n    float x_116777 = ((__global float *) Y_mem_130086)[gtid_116755 * n_114534 +\n                                                       gtid_116758];\n    bool isnan_res_116778;\n    \n    isnan_res_116778 = futrts_isnan32(x_116777);\n    \n    bool defunc_0_p_res_116779 = !isnan_res_116778;\n    int64_t defunc_0_f_res_116780 = btoi_bool_i64(defunc_0_p_res_116779);\n    \n    ((__local int64_t *) color_132064)[gtid_116758] = defunc_0_f_res_116780;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_132293 = n_114534;\n    int64_t x_116774;\n    int64_t x_116775;\n    int64_t x_132295;\n    int64_t x_132296;\n    bool ltid_in_bounds_132298 = slt64(sext_i32_i64(local_tid_132286),\n                                       n_114534);\n    int32_t skip_threads_132299;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_132298) {\n            x_116775 = ((volatile __local\n                         int64_t *) color_132064)[sext_i32_i64(local_tid_132286)];\n            if ((local_tid_132286 - squot32(local_tid_132286, 32) * 32) == 0) {\n                x_116774 = x_116775;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_132299 = 1;\n        while (slt32(skip_threads_132299, 32)) {\n            if (sle32(skip_threads_132299, local_tid_132286 -\n                      squot32(local_tid_132286, 32) * 32) &&\n                ltid_in_bounds_132298) {\n                // read operands\n                {\n                    x_116774 = ((volatile __local\n                                 int64_t *) color_132064)[sext_i32_i64(local_tid_132286) -\n                                                          sext_i32_i64(skip_threads_132299)];\n                }\n                // perform operation\n                {\n                  ",
                   "  bool inactive_132300 =\n                         slt64(srem64(sext_i32_i64(local_tid_132286), n_114534),\n                               sext_i32_i64(local_tid_132286) -\n                               sext_i32_i64(local_tid_132286 -\n                               skip_threads_132299));\n                    \n                    if (inactive_132300) {\n                        x_116774 = x_116775;\n                    }\n                    if (!inactive_132300) {\n                        int64_t defunc_1_op_res_116776 = add64(x_116774,\n                                                               x_116775);\n                        \n                        x_116774 = defunc_1_op_res_116776;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_132288, skip_threads_132299)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (sle32(skip_threads_132299, local_tid_132286 -\n                      squot32(local_tid_132286, 32) * 32) &&\n                ltid_in_bounds_132298) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) color_132064)[sext_i32_i64(local_tid_132286)] =\n                        x_116774;\n                    x_116775 = x_116774;\n                }\n            }\n            if (sle32(wave_sizze_132288, skip_threads_132299)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_132299 *= 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_132286 - squot32(local_tid_132286, 32) * 32) == 31 &&\n            ltid_in_bounds_132298) {\n            ((volatile __local\n              int64_t *) color_132064)[sext_i32_i64(squot32(local_tid_132286,\n                                                            32))] = x_116774;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // scan the first block, after which offset 'i' c",
                   "ontains carry-in for block 'i+1'\n    {\n        int32_t skip_threads_132301;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_132286, 32) == 0 && ltid_in_bounds_132298) {\n                x_132296 = ((volatile __local\n                             int64_t *) color_132064)[sext_i32_i64(local_tid_132286)];\n                if ((local_tid_132286 - squot32(local_tid_132286, 32) * 32) ==\n                    0) {\n                    x_132295 = x_132296;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_132301 = 1;\n            while (slt32(skip_threads_132301, 32)) {\n                if (sle32(skip_threads_132301, local_tid_132286 -\n                          squot32(local_tid_132286, 32) * 32) &&\n                    (squot32(local_tid_132286, 32) == 0 &&\n                     ltid_in_bounds_132298)) {\n                    // read operands\n                    {\n                        x_132295 = ((volatile __local\n                                     int64_t *) color_132064)[sext_i32_i64(local_tid_132286) -\n                                                              sext_i32_i64(skip_threads_132301)];\n                    }\n                    // perform operation\n                    {\n                        bool inactive_132302 =\n                             slt64(srem64(sext_i32_i64(local_tid_132286 * 32 +\n                                          32 - 1), n_114534),\n                                   sext_i32_i64(local_tid_132286 * 32 + 32 -\n                                   1) - sext_i32_i64((local_tid_132286 -\n                                                      skip_threads_132301) *\n                                   32 + 32 - 1));\n                        \n                        if (inactive_132302) {\n                            x_132295 = x_132296;\n                        }\n                        if (!inactive_132302) {\n                      ",
                   "      int64_t defunc_1_op_res_132297 = add64(x_132295,\n                                                                   x_132296);\n                            \n                            x_132295 = defunc_1_op_res_132297;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_132288, skip_threads_132301)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (sle32(skip_threads_132301, local_tid_132286 -\n                          squot32(local_tid_132286, 32) * 32) &&\n                    (squot32(local_tid_132286, 32) == 0 &&\n                     ltid_in_bounds_132298)) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_132064)[sext_i32_i64(local_tid_132286)] =\n                            x_132295;\n                        x_132296 = x_132295;\n                    }\n                }\n                if (sle32(wave_sizze_132288, skip_threads_132301)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_132301 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // carry-in for every block except the first\n    {\n        if (!(squot32(local_tid_132286, 32) == 0 || !ltid_in_bounds_132298)) {\n            // read operands\n            {\n                x_116775 = x_116774;\n                x_116774 = ((__local\n                             int64_t *) color_132064)[sext_i32_i64(squot32(local_tid_132286,\n                                                                           32)) -\n                                                      (int64_t) 1];\n            }\n            // perform operation\n            {\n                bool inactive_132303 =\n                     slt64(srem64(sext_i32_i64(local_tid_132286), n_114534),\n                           sext_i32_i64(local_tid_132286) -\n                           sext_i32_i64(squot32(loca",
                   "l_tid_132286, 32) * 32 -\n                           1));\n                \n                if (inactive_132303) {\n                    x_116774 = x_116775;\n                }\n                if (!inactive_132303) {\n                    int64_t defunc_1_op_res_116776 = add64(x_116774, x_116775);\n                    \n                    x_116774 = defunc_1_op_res_116776;\n                }\n            }\n            // write final result\n            {\n                ((__local\n                  int64_t *) color_132064)[sext_i32_i64(local_tid_132286)] =\n                    x_116774;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_132286, 32) == 0) {\n            ((__local int64_t *) color_132064)[sext_i32_i64(local_tid_132286)] =\n                x_116775;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t last_res_116781 = ((__local int64_t *) color_132064)[i_114610];\n    \n    ((__local int64_t *) color_132063)[sext_i32_i64(local_tid_132286)] =\n        (int64_t) -1;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t write_i_116760 = sext_i32_i64(ltid_pre_132290);\n    int32_t phys_tid_116761 = local_tid_132286;\n    float x_116784 = ((__global float *) Y_mem_130086)[gtid_116755 * n_114534 +\n                                                       write_i_116760];\n    bool isnan_res_116787;\n    \n    isnan_res_116787 = futrts_isnan32(x_116784);\n    \n    bool defunc_0_p_res_116788 = !isnan_res_116787;\n    int64_t defunc_1_f_res_116789;\n    \n    if (defunc_0_p_res_116788) {\n        int64_t x_116785 = ((__local int64_t *) color_132064)[write_i_116760];\n        int64_t defunc_1_f_res_t_res_116790 = sub64(x_116785, (int64_t) 1);\n        \n        defunc_1_f_res_116789 = defunc_1_f_res_t_res_116790;\n    } else {\n        defunc_1_f_res_116789 = (int64_t) -1;\n    }\n    if (sle64((int64_t) 0, defunc_1_f_res_116789) &&\n        slt64(defunc_1_f_res_116789, n_114534)) {\n        ((__",
                   "local int64_t *) color_132063)[defunc_1_f_res_116789] =\n            write_i_116760;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    ((__global int64_t *) mem_130099)[gtid_116755 * n_114534 +\n                                      sext_i32_i64(local_tid_132286)] =\n        ((__local int64_t *) color_132063)[sext_i32_i64(local_tid_132286)];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_tid_132286 == 0) {\n        ((__global int64_t *) mem_130102)[gtid_116755] = last_res_116781;\n    }\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_117346(__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_132559_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_132083_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_132082_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *color_132081_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *color_132080_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_132079_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *color_132078_backing_aligned_6,\n                                             __local volatile\n                                             int64_t *color_132077_backing_aligned_7,\n                                             int64_t m_114533, int64",
                   "_t n_114534,\n                                             int64_t l_jump_114542,\n                                             int64_t l_n_m_114584,\n                                             int64_t i_114610,\n                                             unsigned char x_114611,\n                                             int64_t min_res_114683,\n                                             unsigned char empty_slice_114688,\n                                             int64_t m_114689,\n                                             float i64_res_114690,\n                                             int64_t computed_group_sizze_117204,\n                                             __global\n                                             unsigned char *defunc_3_map_res_mem_130116,\n                                             __global\n                                             unsigned char *defunc_3_map_res_mem_130117,\n                                             __global unsigned char *mem_130313,\n                                             __global unsigned char *mem_130317)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_132559_backing_7 =\n                          (__local volatile\n                           char *) red_arr_mem_132559_backing_aligned_0;\n    __local volatile char *restrict color_132083_backing_6 = (__local volatile\n                                                              char *) color_132083_backing_aligned_1;\n    __local volatile char *restrict color_132082_backing_5 = (__local volatile\n                                                              char *) color_132082_backing_aligned_2;\n    __local volatile char *restrict color_132081_backing_4 = (__local volatile\n                                                              char *) color_132081_backing_aligned_3;\n    __local volatile char *restrict color_132080_backing_3 = (__local volatile\n              ",
                   "                                                char *) color_132080_backing_aligned_4;\n    __local volatile char *restrict color_132079_backing_2 = (__local volatile\n                                                              char *) color_132079_backing_aligned_5;\n    __local volatile char *restrict color_132078_backing_1 = (__local volatile\n                                                              char *) color_132078_backing_aligned_6;\n    __local volatile char *restrict color_132077_backing_0 = (__local volatile\n                                                              char *) color_132077_backing_aligned_7;\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_132545;\n    int32_t local_tid_132546;\n    int64_t group_sizze_132549;\n    int32_t wave_sizze_132548;\n    int32_t group_tid_132547;\n    \n    global_tid_132545 = get_global_id(0);\n    local_tid_132546 = get_local_id(0);\n    group_sizze_132549 = get_local_size(0);\n    wave_sizze_132548 = LOCKSTEP_WIDTH;\n    group_tid_132547 = get_group_id(0);\n    \n    int32_t phys_tid_117346 = group_tid_132547;\n    int32_t ltid_pre_132550 = local_tid_132546;\n    int32_t ltid_pre_132551 = local_tid_132546;\n    int32_t ltid_pre_132552 = squot32(local_tid_132546,\n                                      sext_i64_i32(min_res_114683));\n    int32_t ltid_pre_132553 = local_tid_132546 - squot32(local_tid_132546,\n                                                         sext_i64_i32(min_res_114683)) *\n            sext_i64_i32(min_res_114683);\n    int64_t slice_132554 = m_114533;\n    int64_t gtid_117202 = sext_i32_i64(group_tid_132547);\n    int64_t remnant_132555 = sext_i32_i64(group_tid_132547) - gtid_117202;\n    __local char *color_132077;\n    \n    color_132077 = (__local char *) color_132077_backing_0;\n    \n    __loca",
                   "l char *color_132078;\n    \n    color_132078 = (__local char *) color_132078_backing_1;\n    \n    __local char *color_132079;\n    \n    color_132079 = (__local char *) color_132079_backing_2;\n    \n    __local char *color_132080;\n    \n    color_132080 = (__local char *) color_132080_backing_3;\n    \n    __local char *color_132081;\n    \n    color_132081 = (__local char *) color_132081_backing_4;\n    \n    __local char *color_132082;\n    \n    color_132082 = (__local char *) color_132082_backing_5;\n    \n    __local char *color_132083;\n    \n    color_132083 = (__local char *) color_132083_backing_6;\n    \n    int64_t x_117600 = ((__global\n                         int64_t *) defunc_3_map_res_mem_130117)[gtid_117202];\n    int64_t gtid_117205 = sext_i32_i64(ltid_pre_132550);\n    int32_t phys_tid_117206 = local_tid_132546;\n    \n    if (slt64(gtid_117205, n_114534)) {\n        int64_t x_117603 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130116)[gtid_117202 *\n                                                                     n_114534 +\n                                                                     gtid_117205];\n        int64_t defunc_0_f_res_117604 = add64((int64_t) 1, x_117603);\n        bool cond_117605 = slt64(defunc_0_f_res_117604, (int64_t) 0);\n        int64_t defunc_0_f_res_117606;\n        \n        if (cond_117605) {\n            defunc_0_f_res_117606 = (int64_t) 9223372036854775807;\n        } else {\n            defunc_0_f_res_117606 = defunc_0_f_res_117604;\n        }\n        ((__local int64_t *) color_132077)[gtid_117205] = defunc_0_f_res_117606;\n        ((__local int64_t *) color_132083)[gtid_117205] = defunc_0_f_res_117604;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t min_arg_117607 = sub64(x_117600, min_res_114683);\n    float i64_res_117608 = sitofp_i64_f32(x_117600);\n    float x_117609 = i64_res_114690 - i64_res_117608;\n    float max_arg_117610 = x_117609 / 2.0F;\n    float max_res_117611 = fmax32(0.0F, max_arg_117610);\n    in",
                   "t64_t gtid_117297 = sext_i32_i64(ltid_pre_132551);\n    int32_t phys_tid_117298 = local_tid_132546;\n    \n    if (slt64(gtid_117297, l_n_m_114584)) {\n        int64_t min_arg_117617 = mul64(l_jump_114542, gtid_117297);\n        int64_t min_res_117618 = smin64(i_114610, min_arg_117617);\n        int64_t defunc_0_g_res_117619 = add64((int64_t) 1, min_res_117618);\n        bool nearest_idx_117620;\n        int64_t nearest_idx_117621;\n        int64_t nearest_idx_117622;\n        bool loop_while_117623;\n        int64_t low_117624;\n        int64_t high_117625;\n        \n        loop_while_117623 = x_114611;\n        low_117624 = (int64_t) 0;\n        high_117625 = i_114610;\n        while (loop_while_117623) {\n            int64_t x_117626 = add64(low_117624, high_117625);\n            int64_t mid_117627 = sdiv64(x_117626, (int64_t) 2);\n            bool x_117628 = sle64((int64_t) 0, mid_117627);\n            bool y_117629 = slt64(mid_117627, n_114534);\n            bool bounds_check_117630 = x_117628 && y_117629;\n            bool index_certs_117631;\n            \n            if (!bounds_check_117630) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 14) ==\n                        -1) {\n                        global_failure_args[0] = mid_117627;\n                        global_failure_args[1] = n_114534;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_117632 = ((__local int64_t *) color_132077)[mid_117627];\n            bool cond_117633 = sle64(defunc_0_g_res_117619, x_117632);\n            int64_t loopres_117634;\n            int64_t loopres_117635;\n            \n            if (cond_117633) {\n                int64_t loopres_t_res_117636 = sub64(mid_117627, (int64_t) 1);\n                \n                loopres_117634 = low_117624;\n                loopres_117635 = loopres_t_res_117636;\n            } else {\n      ",
                   "          int64_t loopres_f_res_117637 = add64((int64_t) 1, mid_117627);\n                \n                loopres_117634 = loopres_f_res_117637;\n                loopres_117635 = high_117625;\n            }\n            \n            bool loop_cond_117638 = sle64(loopres_117634, loopres_117635);\n            bool loop_while_tmp_132556 = loop_cond_117638;\n            int64_t low_tmp_132557 = loopres_117634;\n            int64_t high_tmp_132558 = loopres_117635;\n            \n            loop_while_117623 = loop_while_tmp_132556;\n            low_117624 = low_tmp_132557;\n            high_117625 = high_tmp_132558;\n        }\n        nearest_idx_117620 = loop_while_117623;\n        nearest_idx_117621 = low_117624;\n        nearest_idx_117622 = high_117625;\n        \n        int64_t max_arg_117639 = sub64(nearest_idx_117621, min_res_114683);\n        int64_t max_res_117640 = smax64((int64_t) 0, max_arg_117639);\n        int64_t j_117641 = add64(min_res_114683, max_res_117640);\n        int64_t i_p_m_t_s_117642 = add64(m_114689, max_res_117640);\n        bool zzero_leq_i_p_m_t_s_117643 = sle64((int64_t) 0, i_p_m_t_s_117642);\n        bool i_p_m_t_s_leq_w_117644 = slt64(i_p_m_t_s_117642, n_114534);\n        bool zzero_lte_i_117645 = sle64((int64_t) 0, max_res_117640);\n        bool i_lte_j_117646 = sle64(max_res_117640, j_117641);\n        bool y_117647 = i_p_m_t_s_leq_w_117644 && zzero_lte_i_117645;\n        bool y_117648 = zzero_leq_i_p_m_t_s_117643 && y_117647;\n        bool y_117649 = i_lte_j_117646 && y_117648;\n        bool forwards_ok_117650 = zzero_lte_i_117645 && y_117649;\n        bool ok_or_empty_117651 = empty_slice_114688 || forwards_ok_117650;\n        bool index_certs_117652;\n        \n        if (!ok_or_empty_117651) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 15) == -1) {\n                    global_failure_args[0] = max_res_117640;\n                    global_failure_args[1] = j_117641;\n                    global_failure_args[2] = n_114534;\n    ",
                   "                ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        ((__local int64_t *) color_132082)[gtid_117297] = min_res_117618;\n        ((__local int64_t *) color_132081)[gtid_117297] = defunc_0_g_res_117619;\n        ((__local int64_t *) color_132080)[gtid_117297] = max_res_117640;\n    }\n    \n  error_1:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_117289 = sext_i32_i64(ltid_pre_132552);\n    int64_t gtid_slice_117288 = sext_i32_i64(ltid_pre_132553);\n    int32_t phys_tid_117292 = local_tid_132546;\n    \n    if (slt64(gtid_117289, l_n_m_114584) && slt64(gtid_slice_117288,\n                                                  min_res_114683)) {\n        int64_t max_res_117654 = ((__local\n                                   int64_t *) color_132080)[gtid_117289];\n        bool index_certs_117655 = 0;\n        int64_t slice_117656 = gtid_slice_117288 + max_res_117654;\n        int64_t v_117657 = ((__local int64_t *) color_132083)[slice_117656];\n        \n        ((__local int64_t *) color_132077)[gtid_117289 * min_res_114683 +\n                                           gtid_slice_117288] = v_117657;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_117276 = sext_i32_i64(ltid_pre_132552);\n    int64_t gtid_117277 = sext_i32_i64(ltid_pre_132553);\n    int32_t phys_tid_117278 = local_tid_132546;\n    __local char *red_arr_mem_132559;\n    \n    red_arr_mem_132559 = (__local char *) red_arr_mem_132559_backing_7;\n    if (slt64(gtid_117276, l_n_m_114584) && slt64(gtid_117277,\n                                                  min_res_114683)) {\n        int64_t binop_y_128719 = mul64(l_jump_114542, gtid_117276);\n        int64_t binop_y_128720 = smin64(i_114610, binop_y_128719);\n        int64_t index_primexp_128721 = add64((int64_t) 1, binop_y_128720);\n        int64_t x_117664 = ((__local int64_t *) color_132077)[gtid_117276 *\n   ",
                   "                                                           min_res_114683 +\n                                                              gtid_117277];\n        int64_t abs_arg_117665 = sub64(x_117664, index_primexp_128721);\n        int64_t abs_res_117666 = abs(abs_arg_117665);\n        \n        ((__local int64_t *) red_arr_mem_132559)[gtid_117276 * min_res_114683 +\n                                                 gtid_117277] = abs_res_117666;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_132561 = l_n_m_114584 * min_res_114683;\n    int64_t x_117659;\n    int64_t x_117660;\n    int64_t x_132563;\n    int64_t x_132564;\n    bool ltid_in_bounds_132566 = slt64(sext_i32_i64(local_tid_132546),\n                                       l_n_m_114584 * min_res_114683);\n    int32_t skip_threads_132567;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_132566) {\n            x_117660 = ((volatile __local\n                         int64_t *) red_arr_mem_132559)[sext_i32_i64(local_tid_132546)];\n            if ((local_tid_132546 - squot32(local_tid_132546, 32) * 32) == 0) {\n                x_117659 = x_117660;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_132567 = 1;\n        while (slt32(skip_threads_132567, 32)) {\n            if (sle32(skip_threads_132567, local_tid_132546 -\n                      squot32(local_tid_132546, 32) * 32) &&\n                ltid_in_bounds_132566) {\n                // read operands\n                {\n                    x_117659 = ((volatile __local\n                                 int64_t *) red_arr_mem_132559)[sext_i32_i64(local_tid_132546) -\n                                                                sext_i32_i64(skip_threads_132567)];\n                }\n                // perform operation\n                {\n                    bool inactive_132568 =\n                         slt64(srem64(sext_i32_i64(local_tid_132546),\n                                 ",
                   "     min_res_114683),\n                               sext_i32_i64(local_tid_132546) -\n                               sext_i32_i64(local_tid_132546 -\n                               skip_threads_132567));\n                    \n                    if (inactive_132568) {\n                        x_117659 = x_117660;\n                    }\n                    if (!inactive_132568) {\n                        int64_t defunc_1_op_res_117661 = add64(x_117659,\n                                                               x_117660);\n                        \n                        x_117659 = defunc_1_op_res_117661;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_132548, skip_threads_132567)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (sle32(skip_threads_132567, local_tid_132546 -\n                      squot32(local_tid_132546, 32) * 32) &&\n                ltid_in_bounds_132566) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) red_arr_mem_132559)[sext_i32_i64(local_tid_132546)] =\n                        x_117659;\n                    x_117660 = x_117659;\n                }\n            }\n            if (sle32(wave_sizze_132548, skip_threads_132567)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_132567 *= 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_132546 - squot32(local_tid_132546, 32) * 32) == 31 &&\n            ltid_in_bounds_132566) {\n            ((volatile __local\n              int64_t *) red_arr_mem_132559)[sext_i32_i64(squot32(local_tid_132546,\n                                                                  32))] =\n                x_117659;\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        int",
                   "32_t skip_threads_132569;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_132546, 32) == 0 && ltid_in_bounds_132566) {\n                x_132564 = ((volatile __local\n                             int64_t *) red_arr_mem_132559)[sext_i32_i64(local_tid_132546)];\n                if ((local_tid_132546 - squot32(local_tid_132546, 32) * 32) ==\n                    0) {\n                    x_132563 = x_132564;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_132569 = 1;\n            while (slt32(skip_threads_132569, 32)) {\n                if (sle32(skip_threads_132569, local_tid_132546 -\n                          squot32(local_tid_132546, 32) * 32) &&\n                    (squot32(local_tid_132546, 32) == 0 &&\n                     ltid_in_bounds_132566)) {\n                    // read operands\n                    {\n                        x_132563 = ((volatile __local\n                                     int64_t *) red_arr_mem_132559)[sext_i32_i64(local_tid_132546) -\n                                                                    sext_i32_i64(skip_threads_132569)];\n                    }\n                    // perform operation\n                    {\n                        bool inactive_132570 =\n                             slt64(srem64(sext_i32_i64(local_tid_132546 * 32 +\n                                          32 - 1), min_res_114683),\n                                   sext_i32_i64(local_tid_132546 * 32 + 32 -\n                                   1) - sext_i32_i64((local_tid_132546 -\n                                                      skip_threads_132569) *\n                                   32 + 32 - 1));\n                        \n                        if (inactive_132570) {\n                            x_132563 = x_132564;\n                        }\n                        if (!inactive_132570) {\n                            int64_t defunc_1_op_",
                   "res_132565 = add64(x_132563,\n                                                                   x_132564);\n                            \n                            x_132563 = defunc_1_op_res_132565;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_132548, skip_threads_132569)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (sle32(skip_threads_132569, local_tid_132546 -\n                          squot32(local_tid_132546, 32) * 32) &&\n                    (squot32(local_tid_132546, 32) == 0 &&\n                     ltid_in_bounds_132566)) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) red_arr_mem_132559)[sext_i32_i64(local_tid_132546)] =\n                            x_132563;\n                        x_132564 = x_132563;\n                    }\n                }\n                if (sle32(wave_sizze_132548, skip_threads_132569)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_132569 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // carry-in for every block except the first\n    {\n        if (!(squot32(local_tid_132546, 32) == 0 || !ltid_in_bounds_132566)) {\n            // read operands\n            {\n                x_117660 = x_117659;\n                x_117659 = ((__local\n                             int64_t *) red_arr_mem_132559)[sext_i32_i64(squot32(local_tid_132546,\n                                                                                 32)) -\n                                                            (int64_t) 1];\n            }\n            // perform operation\n            {\n                bool inactive_132571 =\n                     slt64(srem64(sext_i32_i64(local_tid_132546),\n                                  min_res_114683),\n                           sext_i32_i64(local_tid_132546) -\n              ",
                   "             sext_i32_i64(squot32(local_tid_132546, 32) * 32 -\n                           1));\n                \n                if (inactive_132571) {\n                    x_117659 = x_117660;\n                }\n                if (!inactive_132571) {\n                    int64_t defunc_1_op_res_117661 = add64(x_117659, x_117660);\n                    \n                    x_117659 = defunc_1_op_res_117661;\n                }\n            }\n            // write final result\n            {\n                ((__local\n                  int64_t *) red_arr_mem_132559)[sext_i32_i64(local_tid_132546)] =\n                    x_117659;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_132546, 32) == 0) {\n            ((__local\n              int64_t *) red_arr_mem_132559)[sext_i32_i64(local_tid_132546)] =\n                x_117660;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_132572 = 0; i_132572 < sdiv_up64(l_n_m_114584 -\n                                                    sext_i32_i64(local_tid_132546),\n                                                    computed_group_sizze_117204);\n         i_132572++) {\n        ((__local int64_t *) color_132079)[i_132572 *\n                                           computed_group_sizze_117204 +\n                                           sext_i32_i64(local_tid_132546)] =\n            ((__local int64_t *) red_arr_mem_132559)[(i_132572 *\n                                                      computed_group_sizze_117204 +\n                                                      sext_i32_i64(local_tid_132546)) *\n                                                     min_res_114683 +\n                                                     (min_res_114683 -\n                                                      (int64_t) 1)];\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t ",
                   "gtid_117215 = sext_i32_i64(ltid_pre_132551);\n    int32_t phys_tid_117216 = local_tid_132546;\n    \n    if (slt64(gtid_117215, l_n_m_114584)) {\n        int64_t binop_y_128729 = mul64(l_jump_114542, gtid_117215);\n        int64_t index_primexp_128730 = smin64(i_114610, binop_y_128729);\n        int64_t index_primexp_128726 = add64((int64_t) 1, index_primexp_128730);\n        int64_t max_res_117671 = ((__local\n                                   int64_t *) color_132080)[gtid_117215];\n        int64_t defunc_2_reduce_res_117672 = ((__local\n                                               int64_t *) color_132079)[gtid_117215];\n        int64_t idx_117673;\n        int64_t idx_117674;\n        int64_t idx_117675;\n        int64_t idx_117676;\n        int64_t best_idx_117678;\n        int64_t last_idx_117679;\n        int64_t best_sum_117680;\n        int64_t curr_sum_117681;\n        \n        best_idx_117678 = max_res_117671;\n        last_idx_117679 = max_res_117671;\n        best_sum_117680 = defunc_2_reduce_res_117672;\n        curr_sum_117681 = defunc_2_reduce_res_117672;\n        for (int64_t j_117677 = 0; j_117677 < min_res_114683; j_117677++) {\n            int64_t new_idx_117682 = add64(max_res_117671, j_117677);\n            int64_t x_117683 = add64(min_res_114683, new_idx_117682);\n            bool cond_117684 = slt64(x_117600, x_117683);\n            int64_t new_sum_117685;\n            \n            if (cond_117684) {\n                new_sum_117685 = (int64_t) 9223372036854775807;\n            } else {\n                bool x_117686 = sle64((int64_t) 0, last_idx_117679);\n                bool y_117687 = slt64(last_idx_117679, n_114534);\n                bool bounds_check_117688 = x_117686 && y_117687;\n                bool index_certs_117689;\n                \n                if (!bounds_check_117688) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 16) ==\n                            -1) {\n                            global_failure_args[0] = la",
                   "st_idx_117679;\n                            global_failure_args[1] = n_114534;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_5;\n                    }\n                }\n                \n                int64_t y_117690 = ((__local\n                                     int64_t *) color_132083)[last_idx_117679];\n                int64_t binop_p_117691 = sub64(index_primexp_128726, y_117690);\n                int64_t defunc_0_f_res_117692 = abs(binop_p_117691);\n                int64_t x_117693 = sub64(curr_sum_117681,\n                                         defunc_0_f_res_117692);\n                int64_t min_arg_117694 = add64(min_res_114683, last_idx_117679);\n                int64_t min_res_117695 = smin64(i_114610, min_arg_117694);\n                bool x_117696 = sle64((int64_t) 0, min_res_117695);\n                bool y_117697 = slt64(min_res_117695, n_114534);\n                bool bounds_check_117698 = x_117696 && y_117697;\n                bool index_certs_117699;\n                \n                if (!bounds_check_117698) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 17) ==\n                            -1) {\n                            global_failure_args[0] = min_res_117695;\n                            global_failure_args[1] = n_114534;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_5;\n                    }\n                }\n                \n                int64_t y_117700 = ((__local\n                                     int64_t *) color_132083)[min_res_117695];\n                int64_t binop_p_117701 = sub64(index_primexp_128726, y_117700);\n                int64_t defunc_0_f_res_117702 = abs(binop_p_117701);\n                int64_t new_sum_f_res_117703 = add64(x_117693,\n                                                     defunc_0_f_res_11",
                   "7702);\n                \n                new_sum_117685 = new_sum_f_res_117703;\n            }\n            \n            bool cond_117704 = sle64(new_sum_117685, best_sum_117680);\n            int64_t loopres_117705;\n            \n            if (cond_117704) {\n                loopres_117705 = new_idx_117682;\n            } else {\n                loopres_117705 = best_idx_117678;\n            }\n            \n            int64_t loopres_117706;\n            \n            if (cond_117704) {\n                loopres_117706 = new_sum_117685;\n            } else {\n                loopres_117706 = best_sum_117680;\n            }\n            \n            int64_t best_idx_tmp_132573 = loopres_117705;\n            int64_t last_idx_tmp_132574 = new_idx_117682;\n            int64_t best_sum_tmp_132575 = loopres_117706;\n            int64_t curr_sum_tmp_132576 = new_sum_117685;\n            \n            best_idx_117678 = best_idx_tmp_132573;\n            last_idx_117679 = last_idx_tmp_132574;\n            best_sum_117680 = best_sum_tmp_132575;\n            curr_sum_117681 = curr_sum_tmp_132576;\n        }\n        idx_117673 = best_idx_117678;\n        idx_117674 = last_idx_117679;\n        idx_117675 = best_sum_117680;\n        idx_117676 = curr_sum_117681;\n        \n        int64_t min_res_117707 = smin64(min_arg_117607, idx_117673);\n        int64_t x_117708 = add64(min_res_114683, min_res_117707);\n        int64_t r_117709 = sub64(x_117708, (int64_t) 1);\n        bool x_117710 = sle64((int64_t) 0, r_117709);\n        bool y_117711 = slt64(r_117709, n_114534);\n        bool bounds_check_117712 = x_117710 && y_117711;\n        bool index_certs_117713;\n        \n        if (!bounds_check_117712) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 18) == -1) {\n                    global_failure_args[0] = r_117709;\n                    global_failure_args[1] = n_114534;\n                    ;\n                }\n                local_failure = true;\n                goto error_5;\n      ",
                   "      }\n        }\n        \n        int64_t x_117714 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130116)[gtid_117202 *\n                                                                     n_114534 +\n                                                                     r_117709];\n        int64_t abs_arg_117715 = sub64(x_117714, index_primexp_128730);\n        int64_t abs_res_117716 = abs(abs_arg_117715);\n        bool x_117717 = sle64((int64_t) 0, min_res_117707);\n        bool y_117718 = slt64(min_res_117707, n_114534);\n        bool bounds_check_117719 = x_117717 && y_117718;\n        bool index_certs_117720;\n        \n        if (!bounds_check_117719) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 19) == -1) {\n                    global_failure_args[0] = min_res_117707;\n                    global_failure_args[1] = n_114534;\n                    ;\n                }\n                local_failure = true;\n                goto error_5;\n            }\n        }\n        \n        int64_t x_117721 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130116)[gtid_117202 *\n                                                                     n_114534 +\n                                                                     min_res_117707];\n        int64_t abs_arg_117722 = sub64(x_117721, index_primexp_128730);\n        int64_t abs_res_117723 = abs(abs_arg_117722);\n        int64_t max_res_117724 = smax64(abs_res_117716, abs_res_117723);\n        float defunc_0_f_res_117725 = sitofp_i64_f32(max_res_117724);\n        float defunc_1_f_res_117726 = max_res_117611 + defunc_0_f_res_117725;\n        \n        ((__local float *) color_132078)[gtid_117215] = defunc_1_f_res_117726;\n        ((__local int64_t *) color_132077)[gtid_117215] = min_res_117707;\n    }\n    \n  error_5:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_132577 = 0; i_132577",
                   " < sdiv_up64(l_n_m_114584 -\n                                                    sext_i32_i64(local_tid_132546),\n                                                    computed_group_sizze_117204);\n         i_132577++) {\n        ((__global int64_t *) mem_130313)[gtid_117202 * l_n_m_114584 +\n                                          (i_132577 *\n                                           computed_group_sizze_117204 +\n                                           sext_i32_i64(local_tid_132546))] =\n            ((__local int64_t *) color_132077)[i_132577 *\n                                               computed_group_sizze_117204 +\n                                               sext_i32_i64(local_tid_132546)];\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_132578 = 0; i_132578 < sdiv_up64(l_n_m_114584 -\n                                                    sext_i32_i64(local_tid_132546),\n                                                    computed_group_sizze_117204);\n         i_132578++) {\n        ((__global float *) mem_130317)[gtid_117202 * l_n_m_114584 + (i_132578 *\n                                                                      computed_group_sizze_117204 +\n                                                                      sext_i32_i64(local_tid_132546))] =\n            ((__local float *) color_132078)[i_132578 *\n                                             computed_group_sizze_117204 +\n                                             sext_i32_i64(local_tid_132546)];\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_6:\n    return;\n}\n__kernel void mainzisegmap_intragroup_118646(__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_132777_backing_aligned_0,\n                                             __",
                   "local volatile\n                                             int64_t *color_132097_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_132096_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *color_132095_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *color_132094_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_132093_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *color_132092_backing_aligned_6,\n                                             __local volatile\n                                             int64_t *color_132091_backing_aligned_7,\n                                             int64_t m_114533, int64_t n_114534,\n                                             int64_t t_jump_114541,\n                                             int64_t t_n_m_114591,\n                                             int64_t i_114610,\n                                             unsigned char x_114611,\n                                             int64_t min_res_114809,\n                                             unsigned char empty_slice_114814,\n                                             int64_t m_114815,\n                                             float i64_res_114816,\n                                             int64_t computed_group_sizze_118504,\n                                             __global\n                                             unsigned char *defunc_3_map_res_mem_130116,\n                                             __global\n                                             unsigned char *defunc_3_map_res_mem_130117,\n                 ",
                   "                            __global unsigned char *mem_130515,\n                                             __global unsigned char *mem_130519)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_132777_backing_7 =\n                          (__local volatile\n                           char *) red_arr_mem_132777_backing_aligned_0;\n    __local volatile char *restrict color_132097_backing_6 = (__local volatile\n                                                              char *) color_132097_backing_aligned_1;\n    __local volatile char *restrict color_132096_backing_5 = (__local volatile\n                                                              char *) color_132096_backing_aligned_2;\n    __local volatile char *restrict color_132095_backing_4 = (__local volatile\n                                                              char *) color_132095_backing_aligned_3;\n    __local volatile char *restrict color_132094_backing_3 = (__local volatile\n                                                              char *) color_132094_backing_aligned_4;\n    __local volatile char *restrict color_132093_backing_2 = (__local volatile\n                                                              char *) color_132093_backing_aligned_5;\n    __local volatile char *restrict color_132092_backing_1 = (__local volatile\n                                                              char *) color_132092_backing_aligned_6;\n    __local volatile char *restrict color_132091_backing_0 = (__local volatile\n                                                              char *) color_132091_backing_aligned_7;\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_132763;\n    int32_t local_tid_132764;\n    int64",
                   "_t group_sizze_132767;\n    int32_t wave_sizze_132766;\n    int32_t group_tid_132765;\n    \n    global_tid_132763 = get_global_id(0);\n    local_tid_132764 = get_local_id(0);\n    group_sizze_132767 = get_local_size(0);\n    wave_sizze_132766 = LOCKSTEP_WIDTH;\n    group_tid_132765 = get_group_id(0);\n    \n    int32_t phys_tid_118646 = group_tid_132765;\n    int32_t ltid_pre_132768 = local_tid_132764;\n    int32_t ltid_pre_132769 = local_tid_132764;\n    int32_t ltid_pre_132770 = squot32(local_tid_132764,\n                                      sext_i64_i32(min_res_114809));\n    int32_t ltid_pre_132771 = local_tid_132764 - squot32(local_tid_132764,\n                                                         sext_i64_i32(min_res_114809)) *\n            sext_i64_i32(min_res_114809);\n    int64_t slice_132772 = m_114533;\n    int64_t gtid_118502 = sext_i32_i64(group_tid_132765);\n    int64_t remnant_132773 = sext_i32_i64(group_tid_132765) - gtid_118502;\n    __local char *color_132091;\n    \n    color_132091 = (__local char *) color_132091_backing_0;\n    \n    __local char *color_132092;\n    \n    color_132092 = (__local char *) color_132092_backing_1;\n    \n    __local char *color_132093;\n    \n    color_132093 = (__local char *) color_132093_backing_2;\n    \n    __local char *color_132094;\n    \n    color_132094 = (__local char *) color_132094_backing_3;\n    \n    __local char *color_132095;\n    \n    color_132095 = (__local char *) color_132095_backing_4;\n    \n    __local char *color_132096;\n    \n    color_132096 = (__local char *) color_132096_backing_5;\n    \n    __local char *color_132097;\n    \n    color_132097 = (__local char *) color_132097_backing_6;\n    \n    int64_t x_118900 = ((__global\n                         int64_t *) defunc_3_map_res_mem_130117)[gtid_118502];\n    int64_t gtid_118505 = sext_i32_i64(ltid_pre_132768);\n    int32_t phys_tid_118506 = local_tid_132764;\n    \n    if (slt64(gtid_118505, n_114534)) {\n        int64_t x_118903 = ((__global\n                             int64_t *) ",
                   "defunc_3_map_res_mem_130116)[gtid_118502 *\n                                                                     n_114534 +\n                                                                     gtid_118505];\n        int64_t defunc_0_f_res_118904 = add64((int64_t) 1, x_118903);\n        bool cond_118905 = slt64(defunc_0_f_res_118904, (int64_t) 0);\n        int64_t defunc_0_f_res_118906;\n        \n        if (cond_118905) {\n            defunc_0_f_res_118906 = (int64_t) 9223372036854775807;\n        } else {\n            defunc_0_f_res_118906 = defunc_0_f_res_118904;\n        }\n        ((__local int64_t *) color_132091)[gtid_118505] = defunc_0_f_res_118906;\n        ((__local int64_t *) color_132097)[gtid_118505] = defunc_0_f_res_118904;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t min_arg_118907 = sub64(x_118900, min_res_114809);\n    float i64_res_118908 = sitofp_i64_f32(x_118900);\n    float x_118909 = i64_res_114816 - i64_res_118908;\n    float max_arg_118910 = x_118909 / 2.0F;\n    float max_res_118911 = fmax32(0.0F, max_arg_118910);\n    int64_t gtid_118597 = sext_i32_i64(ltid_pre_132769);\n    int32_t phys_tid_118598 = local_tid_132764;\n    \n    if (slt64(gtid_118597, t_n_m_114591)) {\n        int64_t min_arg_118917 = mul64(t_jump_114541, gtid_118597);\n        int64_t min_res_118918 = smin64(i_114610, min_arg_118917);\n        int64_t defunc_0_g_res_118919 = add64((int64_t) 1, min_res_118918);\n        bool nearest_idx_118920;\n        int64_t nearest_idx_118921;\n        int64_t nearest_idx_118922;\n        bool loop_while_118923;\n        int64_t low_118924;\n        int64_t high_118925;\n        \n        loop_while_118923 = x_114611;\n        low_118924 = (int64_t) 0;\n        high_118925 = i_114610;\n        while (loop_while_118923) {\n            int64_t x_118926 = add64(low_118924, high_118925);\n            int64_t mid_118927 = sdiv64(x_118926, (int64_t) 2);\n            bool x_118928 = sle64((int64_t) 0, mid_118927);\n            bool y_118929 = slt64(mid_118927, n_114534",
                   ");\n            bool bounds_check_118930 = x_118928 && y_118929;\n            bool index_certs_118931;\n            \n            if (!bounds_check_118930) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 38) ==\n                        -1) {\n                        global_failure_args[0] = mid_118927;\n                        global_failure_args[1] = n_114534;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_1;\n                }\n            }\n            \n            int64_t x_118932 = ((__local int64_t *) color_132091)[mid_118927];\n            bool cond_118933 = sle64(defunc_0_g_res_118919, x_118932);\n            int64_t loopres_118934;\n            int64_t loopres_118935;\n            \n            if (cond_118933) {\n                int64_t loopres_t_res_118936 = sub64(mid_118927, (int64_t) 1);\n                \n                loopres_118934 = low_118924;\n                loopres_118935 = loopres_t_res_118936;\n            } else {\n                int64_t loopres_f_res_118937 = add64((int64_t) 1, mid_118927);\n                \n                loopres_118934 = loopres_f_res_118937;\n                loopres_118935 = high_118925;\n            }\n            \n            bool loop_cond_118938 = sle64(loopres_118934, loopres_118935);\n            bool loop_while_tmp_132774 = loop_cond_118938;\n            int64_t low_tmp_132775 = loopres_118934;\n            int64_t high_tmp_132776 = loopres_118935;\n            \n            loop_while_118923 = loop_while_tmp_132774;\n            low_118924 = low_tmp_132775;\n            high_118925 = high_tmp_132776;\n        }\n        nearest_idx_118920 = loop_while_118923;\n        nearest_idx_118921 = low_118924;\n        nearest_idx_118922 = high_118925;\n        \n        int64_t max_arg_118939 = sub64(nearest_idx_118921, min_res_114809);\n        int64_t max_res_118940 = smax64((int64_t) 0, max_arg_118939);\n        int64_t j_118941 = add64(min",
                   "_res_114809, max_res_118940);\n        int64_t i_p_m_t_s_118942 = add64(m_114815, max_res_118940);\n        bool zzero_leq_i_p_m_t_s_118943 = sle64((int64_t) 0, i_p_m_t_s_118942);\n        bool i_p_m_t_s_leq_w_118944 = slt64(i_p_m_t_s_118942, n_114534);\n        bool zzero_lte_i_118945 = sle64((int64_t) 0, max_res_118940);\n        bool i_lte_j_118946 = sle64(max_res_118940, j_118941);\n        bool y_118947 = i_p_m_t_s_leq_w_118944 && zzero_lte_i_118945;\n        bool y_118948 = zzero_leq_i_p_m_t_s_118943 && y_118947;\n        bool y_118949 = i_lte_j_118946 && y_118948;\n        bool forwards_ok_118950 = zzero_lte_i_118945 && y_118949;\n        bool ok_or_empty_118951 = empty_slice_114814 || forwards_ok_118950;\n        bool index_certs_118952;\n        \n        if (!ok_or_empty_118951) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 39) == -1) {\n                    global_failure_args[0] = max_res_118940;\n                    global_failure_args[1] = j_118941;\n                    global_failure_args[2] = n_114534;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        ((__local int64_t *) color_132096)[gtid_118597] = min_res_118918;\n        ((__local int64_t *) color_132095)[gtid_118597] = defunc_0_g_res_118919;\n        ((__local int64_t *) color_132094)[gtid_118597] = max_res_118940;\n    }\n    \n  error_1:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_118589 = sext_i32_i64(ltid_pre_132770);\n    int64_t gtid_slice_118588 = sext_i32_i64(ltid_pre_132771);\n    int32_t phys_tid_118592 = local_tid_132764;\n    \n    if (slt64(gtid_118589, t_n_m_114591) && slt64(gtid_slice_118588,\n                                                  min_res_114809)) {\n        int64_t max_res_118954 = ((__local\n                                   int64_t *) color_132094)[gtid_118589];\n        bool index_certs",
                   "_118955 = 0;\n        int64_t slice_118956 = gtid_slice_118588 + max_res_118954;\n        int64_t v_118957 = ((__local int64_t *) color_132097)[slice_118956];\n        \n        ((__local int64_t *) color_132091)[gtid_118589 * min_res_114809 +\n                                           gtid_slice_118588] = v_118957;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_118576 = sext_i32_i64(ltid_pre_132770);\n    int64_t gtid_118577 = sext_i32_i64(ltid_pre_132771);\n    int32_t phys_tid_118578 = local_tid_132764;\n    __local char *red_arr_mem_132777;\n    \n    red_arr_mem_132777 = (__local char *) red_arr_mem_132777_backing_7;\n    if (slt64(gtid_118576, t_n_m_114591) && slt64(gtid_118577,\n                                                  min_res_114809)) {\n        int64_t binop_y_128753 = mul64(t_jump_114541, gtid_118576);\n        int64_t binop_y_128754 = smin64(i_114610, binop_y_128753);\n        int64_t index_primexp_128755 = add64((int64_t) 1, binop_y_128754);\n        int64_t x_118964 = ((__local int64_t *) color_132091)[gtid_118576 *\n                                                              min_res_114809 +\n                                                              gtid_118577];\n        int64_t abs_arg_118965 = sub64(x_118964, index_primexp_128755);\n        int64_t abs_res_118966 = abs(abs_arg_118965);\n        \n        ((__local int64_t *) red_arr_mem_132777)[gtid_118576 * min_res_114809 +\n                                                 gtid_118577] = abs_res_118966;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_132779 = t_n_m_114591 * min_res_114809;\n    int64_t x_118959;\n    int64_t x_118960;\n    int64_t x_132781;\n    int64_t x_132782;\n    bool ltid_in_bounds_132784 = slt64(sext_i32_i64(local_tid_132764),\n                                       t_n_m_114591 * min_res_114809);\n    int32_t skip_threads_132785;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_132784) {\n            x_118960 = ((volatile __local\n",
                   "                         int64_t *) red_arr_mem_132777)[sext_i32_i64(local_tid_132764)];\n            if ((local_tid_132764 - squot32(local_tid_132764, 32) * 32) == 0) {\n                x_118959 = x_118960;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_132785 = 1;\n        while (slt32(skip_threads_132785, 32)) {\n            if (sle32(skip_threads_132785, local_tid_132764 -\n                      squot32(local_tid_132764, 32) * 32) &&\n                ltid_in_bounds_132784) {\n                // read operands\n                {\n                    x_118959 = ((volatile __local\n                                 int64_t *) red_arr_mem_132777)[sext_i32_i64(local_tid_132764) -\n                                                                sext_i32_i64(skip_threads_132785)];\n                }\n                // perform operation\n                {\n                    bool inactive_132786 =\n                         slt64(srem64(sext_i32_i64(local_tid_132764),\n                                      min_res_114809),\n                               sext_i32_i64(local_tid_132764) -\n                               sext_i32_i64(local_tid_132764 -\n                               skip_threads_132785));\n                    \n                    if (inactive_132786) {\n                        x_118959 = x_118960;\n                    }\n                    if (!inactive_132786) {\n                        int64_t defunc_1_op_res_118961 = add64(x_118959,\n                                                               x_118960);\n                        \n                        x_118959 = defunc_1_op_res_118961;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_132766, skip_threads_132785)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (sle32(skip_threads_132785, local_tid_132764 -\n                      squot32(local_tid_132764, 32) * 32) &&\n                ltid_in_bounds_1",
                   "32784) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) red_arr_mem_132777)[sext_i32_i64(local_tid_132764)] =\n                        x_118959;\n                    x_118960 = x_118959;\n                }\n            }\n            if (sle32(wave_sizze_132766, skip_threads_132785)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_132785 *= 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_132764 - squot32(local_tid_132764, 32) * 32) == 31 &&\n            ltid_in_bounds_132784) {\n            ((volatile __local\n              int64_t *) red_arr_mem_132777)[sext_i32_i64(squot32(local_tid_132764,\n                                                                  32))] =\n                x_118959;\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_132787;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_132764, 32) == 0 && ltid_in_bounds_132784) {\n                x_132782 = ((volatile __local\n                             int64_t *) red_arr_mem_132777)[sext_i32_i64(local_tid_132764)];\n                if ((local_tid_132764 - squot32(local_tid_132764, 32) * 32) ==\n                    0) {\n                    x_132781 = x_132782;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_132787 = 1;\n            while (slt32(skip_threads_132787, 32)) {\n                if (sle32(skip_threads_132787, local_tid_132764 -\n                          squot32(local_tid_132764, 32) * 32) &&\n                    (squot32(local_tid_132764, 32) == 0 &&\n                     ltid_in_bounds_132784)) {\n                    // read operands\n                    {\n ",
                   "                       x_132781 = ((volatile __local\n                                     int64_t *) red_arr_mem_132777)[sext_i32_i64(local_tid_132764) -\n                                                                    sext_i32_i64(skip_threads_132787)];\n                    }\n                    // perform operation\n                    {\n                        bool inactive_132788 =\n                             slt64(srem64(sext_i32_i64(local_tid_132764 * 32 +\n                                          32 - 1), min_res_114809),\n                                   sext_i32_i64(local_tid_132764 * 32 + 32 -\n                                   1) - sext_i32_i64((local_tid_132764 -\n                                                      skip_threads_132787) *\n                                   32 + 32 - 1));\n                        \n                        if (inactive_132788) {\n                            x_132781 = x_132782;\n                        }\n                        if (!inactive_132788) {\n                            int64_t defunc_1_op_res_132783 = add64(x_132781,\n                                                                   x_132782);\n                            \n                            x_132781 = defunc_1_op_res_132783;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_132766, skip_threads_132787)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (sle32(skip_threads_132787, local_tid_132764 -\n                          squot32(local_tid_132764, 32) * 32) &&\n                    (squot32(local_tid_132764, 32) == 0 &&\n                     ltid_in_bounds_132784)) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) red_arr_mem_132777)[sext_i32_i64(local_tid_132764)] =\n                            x_132781;\n                        x_132782 = x_132781;\n                    }\n       ",
                   "         }\n                if (sle32(wave_sizze_132766, skip_threads_132787)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_132787 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // carry-in for every block except the first\n    {\n        if (!(squot32(local_tid_132764, 32) == 0 || !ltid_in_bounds_132784)) {\n            // read operands\n            {\n                x_118960 = x_118959;\n                x_118959 = ((__local\n                             int64_t *) red_arr_mem_132777)[sext_i32_i64(squot32(local_tid_132764,\n                                                                                 32)) -\n                                                            (int64_t) 1];\n            }\n            // perform operation\n            {\n                bool inactive_132789 =\n                     slt64(srem64(sext_i32_i64(local_tid_132764),\n                                  min_res_114809),\n                           sext_i32_i64(local_tid_132764) -\n                           sext_i32_i64(squot32(local_tid_132764, 32) * 32 -\n                           1));\n                \n                if (inactive_132789) {\n                    x_118959 = x_118960;\n                }\n                if (!inactive_132789) {\n                    int64_t defunc_1_op_res_118961 = add64(x_118959, x_118960);\n                    \n                    x_118959 = defunc_1_op_res_118961;\n                }\n            }\n            // write final result\n            {\n                ((__local\n                  int64_t *) red_arr_mem_132777)[sext_i32_i64(local_tid_132764)] =\n                    x_118959;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_132764, 32) == 0) {\n            ((__local\n              int64_t *) red_arr_mem_132777)[sext_i32_i64(local_tid_132764)] =\n                x_118960;\n        }\n    }\n    barri",
                   "er(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_132790 = 0; i_132790 < sdiv_up64(t_n_m_114591 -\n                                                    sext_i32_i64(local_tid_132764),\n                                                    computed_group_sizze_118504);\n         i_132790++) {\n        ((__local int64_t *) color_132093)[i_132790 *\n                                           computed_group_sizze_118504 +\n                                           sext_i32_i64(local_tid_132764)] =\n            ((__local int64_t *) red_arr_mem_132777)[(i_132790 *\n                                                      computed_group_sizze_118504 +\n                                                      sext_i32_i64(local_tid_132764)) *\n                                                     min_res_114809 +\n                                                     (min_res_114809 -\n                                                      (int64_t) 1)];\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_118515 = sext_i32_i64(ltid_pre_132769);\n    int32_t phys_tid_118516 = local_tid_132764;\n    \n    if (slt64(gtid_118515, t_n_m_114591)) {\n        int64_t binop_y_128763 = mul64(t_jump_114541, gtid_118515);\n        int64_t index_primexp_128764 = smin64(i_114610, binop_y_128763);\n        int64_t index_primexp_128760 = add64((int64_t) 1, index_primexp_128764);\n        int64_t max_res_118971 = ((__local\n                                   int64_t *) color_132094)[gtid_118515];\n        int64_t defunc_2_reduce_res_118972 = ((__local\n                                               int64_t *) color_132093)[gtid_118515];\n        int64_t idx_118973;\n        int64_t idx_118974;\n        int64_t idx_118975;\n        int64_t idx_118976;\n        int64_t best_idx_118978;\n        int64_t last_idx_118979;\n        int64_t best_sum_118980;\n        int64_t curr_sum_118981;\n        \n        best_idx_118978 = max_res_118971;\n        last_idx_118979 = ",
                   "max_res_118971;\n        best_sum_118980 = defunc_2_reduce_res_118972;\n        curr_sum_118981 = defunc_2_reduce_res_118972;\n        for (int64_t j_118977 = 0; j_118977 < min_res_114809; j_118977++) {\n            int64_t new_idx_118982 = add64(max_res_118971, j_118977);\n            int64_t x_118983 = add64(min_res_114809, new_idx_118982);\n            bool cond_118984 = slt64(x_118900, x_118983);\n            int64_t new_sum_118985;\n            \n            if (cond_118984) {\n                new_sum_118985 = (int64_t) 9223372036854775807;\n            } else {\n                bool x_118986 = sle64((int64_t) 0, last_idx_118979);\n                bool y_118987 = slt64(last_idx_118979, n_114534);\n                bool bounds_check_118988 = x_118986 && y_118987;\n                bool index_certs_118989;\n                \n                if (!bounds_check_118988) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 40) ==\n                            -1) {\n                            global_failure_args[0] = last_idx_118979;\n                            global_failure_args[1] = n_114534;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_5;\n                    }\n                }\n                \n                int64_t y_118990 = ((__local\n                                     int64_t *) color_132097)[last_idx_118979];\n                int64_t binop_p_118991 = sub64(index_primexp_128760, y_118990);\n                int64_t defunc_0_f_res_118992 = abs(binop_p_118991);\n                int64_t x_118993 = sub64(curr_sum_118981,\n                                         defunc_0_f_res_118992);\n                int64_t min_arg_118994 = add64(min_res_114809, last_idx_118979);\n                int64_t min_res_118995 = smin64(i_114610, min_arg_118994);\n                bool x_118996 = sle64((int64_t) 0, min_res_118995);\n                bool y_118997 = slt64(min_res_1",
                   "18995, n_114534);\n                bool bounds_check_118998 = x_118996 && y_118997;\n                bool index_certs_118999;\n                \n                if (!bounds_check_118998) {\n                    {\n                        if (atomic_cmpxchg_i32_global(global_failure, -1, 41) ==\n                            -1) {\n                            global_failure_args[0] = min_res_118995;\n                            global_failure_args[1] = n_114534;\n                            ;\n                        }\n                        local_failure = true;\n                        goto error_5;\n                    }\n                }\n                \n                int64_t y_119000 = ((__local\n                                     int64_t *) color_132097)[min_res_118995];\n                int64_t binop_p_119001 = sub64(index_primexp_128760, y_119000);\n                int64_t defunc_0_f_res_119002 = abs(binop_p_119001);\n                int64_t new_sum_f_res_119003 = add64(x_118993,\n                                                     defunc_0_f_res_119002);\n                \n                new_sum_118985 = new_sum_f_res_119003;\n            }\n            \n            bool cond_119004 = sle64(new_sum_118985, best_sum_118980);\n            int64_t loopres_119005;\n            \n            if (cond_119004) {\n                loopres_119005 = new_idx_118982;\n            } else {\n                loopres_119005 = best_idx_118978;\n            }\n            \n            int64_t loopres_119006;\n            \n            if (cond_119004) {\n                loopres_119006 = new_sum_118985;\n            } else {\n                loopres_119006 = best_sum_118980;\n            }\n            \n            int64_t best_idx_tmp_132791 = loopres_119005;\n            int64_t last_idx_tmp_132792 = new_idx_118982;\n            int64_t best_sum_tmp_132793 = loopres_119006;\n            int64_t curr_sum_tmp_132794 = new_sum_118985;\n            \n            best_idx_118978 = best_idx_tmp_132791;\n            last",
                   "_idx_118979 = last_idx_tmp_132792;\n            best_sum_118980 = best_sum_tmp_132793;\n            curr_sum_118981 = curr_sum_tmp_132794;\n        }\n        idx_118973 = best_idx_118978;\n        idx_118974 = last_idx_118979;\n        idx_118975 = best_sum_118980;\n        idx_118976 = curr_sum_118981;\n        \n        int64_t min_res_119007 = smin64(min_arg_118907, idx_118973);\n        int64_t x_119008 = add64(min_res_114809, min_res_119007);\n        int64_t r_119009 = sub64(x_119008, (int64_t) 1);\n        bool x_119010 = sle64((int64_t) 0, r_119009);\n        bool y_119011 = slt64(r_119009, n_114534);\n        bool bounds_check_119012 = x_119010 && y_119011;\n        bool index_certs_119013;\n        \n        if (!bounds_check_119012) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 42) == -1) {\n                    global_failure_args[0] = r_119009;\n                    global_failure_args[1] = n_114534;\n                    ;\n                }\n                local_failure = true;\n                goto error_5;\n            }\n        }\n        \n        int64_t x_119014 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130116)[gtid_118502 *\n                                                                     n_114534 +\n                                                                     r_119009];\n        int64_t abs_arg_119015 = sub64(x_119014, index_primexp_128764);\n        int64_t abs_res_119016 = abs(abs_arg_119015);\n        bool x_119017 = sle64((int64_t) 0, min_res_119007);\n        bool y_119018 = slt64(min_res_119007, n_114534);\n        bool bounds_check_119019 = x_119017 && y_119018;\n        bool index_certs_119020;\n        \n        if (!bounds_check_119019) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 43) == -1) {\n                    global_failure_args[0] = min_res_119007;\n                    global_failure_args[1] = n_114534;\n                    ;\n                }\n        ",
                   "        local_failure = true;\n                goto error_5;\n            }\n        }\n        \n        int64_t x_119021 = ((__global\n                             int64_t *) defunc_3_map_res_mem_130116)[gtid_118502 *\n                                                                     n_114534 +\n                                                                     min_res_119007];\n        int64_t abs_arg_119022 = sub64(x_119021, index_primexp_128764);\n        int64_t abs_res_119023 = abs(abs_arg_119022);\n        int64_t max_res_119024 = smax64(abs_res_119016, abs_res_119023);\n        float defunc_0_f_res_119025 = sitofp_i64_f32(max_res_119024);\n        float defunc_1_f_res_119026 = max_res_118911 + defunc_0_f_res_119025;\n        \n        ((__local float *) color_132092)[gtid_118515] = defunc_1_f_res_119026;\n        ((__local int64_t *) color_132091)[gtid_118515] = min_res_119007;\n    }\n    \n  error_5:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_132795 = 0; i_132795 < sdiv_up64(t_n_m_114591 -\n                                                    sext_i32_i64(local_tid_132764),\n                                                    computed_group_sizze_118504);\n         i_132795++) {\n        ((__global int64_t *) mem_130515)[gtid_118502 * t_n_m_114591 +\n                                          (i_132795 *\n                                           computed_group_sizze_118504 +\n                                           sext_i32_i64(local_tid_132764))] =\n            ((__local int64_t *) color_132091)[i_132795 *\n                                               computed_group_sizze_118504 +\n                                               sext_i32_i64(local_tid_132764)];\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_132796 = 0; i_132796 < sdiv_up64(t_n_m_114591 -\n                                                    sext_i32_i64(local_tid_132764),\n                                            ",
                   "        computed_group_sizze_118504);\n         i_132796++) {\n        ((__global float *) mem_130519)[gtid_118502 * t_n_m_114591 + (i_132796 *\n                                                                      computed_group_sizze_118504 +\n                                                                      sext_i32_i64(local_tid_132764))] =\n            ((__local float *) color_132092)[i_132796 *\n                                             computed_group_sizze_118504 +\n                                             sext_i32_i64(local_tid_132764)];\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_6:\n    return;\n}\n__kernel void mainzisegmap_intragroup_120129(__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_133187_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_133172_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *red_arr_mem_133157_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *color_132108_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *color_132107_backing_aligned_4,\n                                             int64_t m_114533, int64_t n_114534,\n                                             int64_t n_p_114536,\n                                             float i64_res_114576,\n                                             int64_t C_len_114582,\n                                             int64_t lifted_single_ma_arg_114959,\n                        ",
                   "                     int64_t lifted_single_ma_arg_114976,\n                                             int64_t computed_group_sizze_120107,\n                                             __global unsigned char *mem_130750,\n                                             __global unsigned char *mem_130822)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_133187_backing_4 =\n                          (__local volatile\n                           char *) red_arr_mem_133187_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_133172_backing_3 =\n                          (__local volatile\n                           char *) red_arr_mem_133172_backing_aligned_1;\n    __local volatile char *restrict red_arr_mem_133157_backing_2 =\n                          (__local volatile\n                           char *) red_arr_mem_133157_backing_aligned_2;\n    __local volatile char *restrict color_132108_backing_1 = (__local volatile\n                                                              char *) color_132108_backing_aligned_3;\n    __local volatile char *restrict color_132107_backing_0 = (__local volatile\n                                                              char *) color_132107_backing_aligned_4;\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_133145;\n    int32_t local_tid_133146;\n    int64_t group_sizze_133149;\n    int32_t wave_sizze_133148;\n    int32_t group_tid_133147;\n    \n    global_tid_133145 = get_global_id(0);\n    local_tid_133146 = get_local_id(0);\n    group_sizze_133149 = get_local_size(0);\n    wave_sizze_133148 = LOCKSTEP_WIDTH;\n    group_tid_133147 = get_group_id(0);\n    \n    int32_t phys_tid_120129 = group_tid_133147;\n    int32_t ltid_pre_133150 = lo",
                   "cal_tid_133146;\n    int32_t ltid_pre_133151 = local_tid_133146;\n    int32_t ltid_pre_133152 = local_tid_133146;\n    int32_t ltid_pre_133153 = local_tid_133146;\n    int32_t ltid_pre_133154 = local_tid_133146;\n    int64_t slice_133155 = m_114533;\n    int64_t gtid_120105 = sext_i32_i64(group_tid_133147);\n    int64_t remnant_133156 = sext_i32_i64(group_tid_133147) - gtid_120105;\n    __local char *color_132107;\n    \n    color_132107 = (__local char *) color_132107_backing_0;\n    \n    __local char *color_132108;\n    \n    color_132108 = (__local char *) color_132108_backing_1;\n    \n    float defunc_2_reduce_res_120331;\n    int64_t gtid_120108 = sext_i32_i64(ltid_pre_133152);\n    int32_t phys_tid_120109 = local_tid_133146;\n    __local char *red_arr_mem_133157;\n    \n    red_arr_mem_133157 = (__local char *) red_arr_mem_133157_backing_2;\n    if (slt64(gtid_120108, n_p_114536)) {\n        float x_120335 = ((__global float *) mem_130750)[gtid_120105 *\n                                                         C_len_114582 +\n                                                         gtid_120108];\n        \n        ((__local float *) red_arr_mem_133157)[gtid_120108] = x_120335;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_133159;\n    int32_t skip_waves_133160 = 1;\n    float x_120332;\n    float x_120333;\n    \n    offset_133159 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_133146, sext_i64_i32(n_p_114536))) {\n            x_120332 = ((__local\n                         float *) red_arr_mem_133157)[sext_i32_i64(local_tid_133146 +\n                                                      offset_133159)];\n        }\n    }\n    offset_133159 = 1;\n    while (slt32(offset_133159, wave_sizze_133148)) {\n        if (slt32(local_tid_133146 + offset_133159, sext_i64_i32(n_p_114536)) &&\n            ((local_tid_133146 - squot32(local_tid_133146, wave_sizze_133148) *\n              wave_sizze_133148) & (2 * offset_133159 - 1)) == 0) {\n           ",
                   " // read array element\n            {\n                x_120333 = ((volatile __local\n                             float *) red_arr_mem_133157)[sext_i32_i64(local_tid_133146 +\n                                                          offset_133159)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_120334 = x_120332 + x_120333;\n                \n                x_120332 = defunc_1_op_res_120334;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_133157)[sext_i32_i64(local_tid_133146)] =\n                    x_120332;\n            }\n        }\n        offset_133159 *= 2;\n    }\n    while (slt32(skip_waves_133160,\n                 squot32(sext_i64_i32(computed_group_sizze_120107) +\n                         wave_sizze_133148 - 1, wave_sizze_133148))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_133159 = skip_waves_133160 * wave_sizze_133148;\n        if (slt32(local_tid_133146 + offset_133159, sext_i64_i32(n_p_114536)) &&\n            ((local_tid_133146 - squot32(local_tid_133146, wave_sizze_133148) *\n              wave_sizze_133148) == 0 && (squot32(local_tid_133146,\n                                                  wave_sizze_133148) & (2 *\n                                                                        skip_waves_133160 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_120333 = ((__local\n                             float *) red_arr_mem_133157)[sext_i32_i64(local_tid_133146 +\n                                                          offset_133159)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_120334 = x_120332 + x_120333;\n                \n                x_120332 = defunc_1_op_res_120334;\n            }\n            // write result of op",
                   "eration\n            {\n                ((__local\n                  float *) red_arr_mem_133157)[sext_i32_i64(local_tid_133146)] =\n                    x_120332;\n            }\n        }\n        skip_waves_133160 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_120331 = ((__local\n                                   float *) red_arr_mem_133157)[(int64_t) 0];\n    \n    int64_t gtid_120110 = sext_i32_i64(ltid_pre_133153);\n    int32_t phys_tid_120111 = local_tid_133146;\n    \n    if (slt64(gtid_120110, lifted_single_ma_arg_114959)) {\n        bool cond_120341 = gtid_120110 == (int64_t) 0;\n        float defunc_0_f_res_120342;\n        \n        if (cond_120341) {\n            float defunc_0_f_res_t_res_120343 = defunc_2_reduce_res_120331 /\n                  i64_res_114576;\n            \n            defunc_0_f_res_120342 = defunc_0_f_res_t_res_120343;\n        } else {\n            int64_t x_120344 = add64(n_p_114536, gtid_120110);\n            int64_t i_120345 = sub64(x_120344, (int64_t) 1);\n            bool x_120346 = sle64((int64_t) 0, i_120345);\n            bool y_120347 = slt64(i_120345, C_len_114582);\n            bool bounds_check_120348 = x_120346 && y_120347;\n            bool index_certs_120349;\n            \n            if (!bounds_check_120348) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 68) ==\n                        -1) {\n                        global_failure_args[0] = i_120345;\n                        global_failure_args[1] = C_len_114582;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_2;\n                }\n            }\n            \n            float x_120350 = ((__global float *) mem_130750)[gtid_120105 *\n                                                             C_len_114582 +\n                                                             i_120345];\n            int64_t i_120351 = sub64(gtid_120110, (int64_t) 1);\n            bool x_12",
                   "0352 = sle64((int64_t) 0, i_120351);\n            bool y_120353 = slt64(i_120351, C_len_114582);\n            bool bounds_check_120354 = x_120352 && y_120353;\n            bool index_certs_120355;\n            \n            if (!bounds_check_120354) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 69) ==\n                        -1) {\n                        global_failure_args[0] = i_120351;\n                        global_failure_args[1] = C_len_114582;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_2;\n                }\n            }\n            \n            float y_120356 = ((__global float *) mem_130750)[gtid_120105 *\n                                                             C_len_114582 +\n                                                             i_120351];\n            float x_120357 = x_120350 - y_120356;\n            float defunc_0_f_res_f_res_120358 = x_120357 / i64_res_114576;\n            \n            defunc_0_f_res_120342 = defunc_0_f_res_f_res_120358;\n        }\n        ((__local float *) color_132107)[gtid_120110] = defunc_0_f_res_120342;\n    }\n    \n  error_2:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_133161 = lifted_single_ma_arg_114959;\n    float x_120337;\n    float x_120338;\n    float x_133163;\n    float x_133164;\n    bool ltid_in_bounds_133166 = slt64(sext_i32_i64(local_tid_133146),\n                                       lifted_single_ma_arg_114959);\n    int32_t skip_threads_133167;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_133166) {\n            x_120338 = ((volatile __local\n                         float *) color_132107)[sext_i32_i64(local_tid_133146)];\n            if ((local_tid_133146 - squot32(local_tid_133146, 32) * 32) == 0) {\n                x_120337 = x_120338;\n            }\n        }\n    }\n    // in-block scan ",
                   "(hopefully no barriers needed)\n    {\n        skip_threads_133167 = 1;\n        while (slt32(skip_threads_133167, 32)) {\n            if (sle32(skip_threads_133167, local_tid_133146 -\n                      squot32(local_tid_133146, 32) * 32) &&\n                ltid_in_bounds_133166) {\n                // read operands\n                {\n                    x_120337 = ((volatile __local\n                                 float *) color_132107)[sext_i32_i64(local_tid_133146) -\n                                                        sext_i32_i64(skip_threads_133167)];\n                }\n                // perform operation\n                {\n                    bool inactive_133168 =\n                         slt64(srem64(sext_i32_i64(local_tid_133146),\n                                      lifted_single_ma_arg_114959),\n                               sext_i32_i64(local_tid_133146) -\n                               sext_i32_i64(local_tid_133146 -\n                               skip_threads_133167));\n                    \n                    if (inactive_133168) {\n                        x_120337 = x_120338;\n                    }\n                    if (!inactive_133168) {\n                        float defunc_1_op_res_120339 = x_120337 + x_120338;\n                        \n                        x_120337 = defunc_1_op_res_120339;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_133148, skip_threads_133167)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (sle32(skip_threads_133167, local_tid_133146 -\n                      squot32(local_tid_133146, 32) * 32) &&\n                ltid_in_bounds_133166) {\n                // write result\n                {\n                    ((volatile __local\n                      float *) color_132107)[sext_i32_i64(local_tid_133146)] =\n                        x_120337;\n                    x_120338 = x_120337;\n                }\n            }\n            if (sle32(wave_sizze_133148, skip_t",
                   "hreads_133167)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_133167 *= 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_133146 - squot32(local_tid_133146, 32) * 32) == 31 &&\n            ltid_in_bounds_133166) {\n            ((volatile __local\n              float *) color_132107)[sext_i32_i64(squot32(local_tid_133146,\n                                                          32))] = x_120337;\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_133169;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_133146, 32) == 0 && ltid_in_bounds_133166) {\n                x_133164 = ((volatile __local\n                             float *) color_132107)[sext_i32_i64(local_tid_133146)];\n                if ((local_tid_133146 - squot32(local_tid_133146, 32) * 32) ==\n                    0) {\n                    x_133163 = x_133164;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_133169 = 1;\n            while (slt32(skip_threads_133169, 32)) {\n                if (sle32(skip_threads_133169, local_tid_133146 -\n                          squot32(local_tid_133146, 32) * 32) &&\n                    (squot32(local_tid_133146, 32) == 0 &&\n                     ltid_in_bounds_133166)) {\n                    // read operands\n                    {\n                        x_133163 = ((volatile __local\n                                     float *) color_132107)[sext_i32_i64(local_tid_133146) -\n                                                            sext_i32_i64(skip_threads_133169)];\n                    }\n                    // perform operation\n                    {\n                        bool inactive_133170 =\n     ",
                   "                        slt64(srem64(sext_i32_i64(local_tid_133146 * 32 +\n                                          32 - 1), lifted_single_ma_arg_114959),\n                                   sext_i32_i64(local_tid_133146 * 32 + 32 -\n                                   1) - sext_i32_i64((local_tid_133146 -\n                                                      skip_threads_133169) *\n                                   32 + 32 - 1));\n                        \n                        if (inactive_133170) {\n                            x_133163 = x_133164;\n                        }\n                        if (!inactive_133170) {\n                            float defunc_1_op_res_133165 = x_133163 + x_133164;\n                            \n                            x_133163 = defunc_1_op_res_133165;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_133148, skip_threads_133169)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (sle32(skip_threads_133169, local_tid_133146 -\n                          squot32(local_tid_133146, 32) * 32) &&\n                    (squot32(local_tid_133146, 32) == 0 &&\n                     ltid_in_bounds_133166)) {\n                    // write result\n                    {\n                        ((volatile __local\n                          float *) color_132107)[sext_i32_i64(local_tid_133146)] =\n                            x_133163;\n                        x_133164 = x_133163;\n                    }\n                }\n                if (sle32(wave_sizze_133148, skip_threads_133169)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_133169 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // carry-in for every block except the first\n    {\n        if (!(squot32(local_tid_133146, 32) == 0 || !ltid_in_bounds_133166)) {\n            // read operands\n            {\n                x_120338 = x_12033",
                   "7;\n                x_120337 = ((__local\n                             float *) color_132107)[sext_i32_i64(squot32(local_tid_133146,\n                                                                         32)) -\n                                                    (int64_t) 1];\n            }\n            // perform operation\n            {\n                bool inactive_133171 =\n                     slt64(srem64(sext_i32_i64(local_tid_133146),\n                                  lifted_single_ma_arg_114959),\n                           sext_i32_i64(local_tid_133146) -\n                           sext_i32_i64(squot32(local_tid_133146, 32) * 32 -\n                           1));\n                \n                if (inactive_133171) {\n                    x_120337 = x_120338;\n                }\n                if (!inactive_133171) {\n                    float defunc_1_op_res_120339 = x_120337 + x_120338;\n                    \n                    x_120337 = defunc_1_op_res_120339;\n                }\n            }\n            // write final result\n            {\n                ((__local\n                  float *) color_132107)[sext_i32_i64(local_tid_133146)] =\n                    x_120337;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_133146, 32) == 0) {\n            ((__local float *) color_132107)[sext_i32_i64(local_tid_133146)] =\n                x_120338;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    float defunc_2_reduce_res_120360;\n    int64_t gtid_120112 = sext_i32_i64(ltid_pre_133152);\n    int32_t phys_tid_120113 = local_tid_133146;\n    __local char *red_arr_mem_133172;\n    \n    red_arr_mem_133172 = (__local char *) red_arr_mem_133172_backing_3;\n    if (slt64(gtid_120112, n_p_114536)) {\n        float x_120364 = ((__local float *) color_132107)[gtid_120112];\n        \n        ((__local float *) red_arr_mem_133172)[gtid_120112] = x_120364;\n    }\n    barrier(CLK_LOCAL_MEM",
                   "_FENCE);\n    \n    int32_t offset_133174;\n    int32_t skip_waves_133175 = 1;\n    float x_120361;\n    float x_120362;\n    \n    offset_133174 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_133146, sext_i64_i32(n_p_114536))) {\n            x_120361 = ((__local\n                         float *) red_arr_mem_133172)[sext_i32_i64(local_tid_133146 +\n                                                      offset_133174)];\n        }\n    }\n    offset_133174 = 1;\n    while (slt32(offset_133174, wave_sizze_133148)) {\n        if (slt32(local_tid_133146 + offset_133174, sext_i64_i32(n_p_114536)) &&\n            ((local_tid_133146 - squot32(local_tid_133146, wave_sizze_133148) *\n              wave_sizze_133148) & (2 * offset_133174 - 1)) == 0) {\n            // read array element\n            {\n                x_120362 = ((volatile __local\n                             float *) red_arr_mem_133172)[sext_i32_i64(local_tid_133146 +\n                                                          offset_133174)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_120363 = x_120361 + x_120362;\n                \n                x_120361 = defunc_1_op_res_120363;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_133172)[sext_i32_i64(local_tid_133146)] =\n                    x_120361;\n            }\n        }\n        offset_133174 *= 2;\n    }\n    while (slt32(skip_waves_133175,\n                 squot32(sext_i64_i32(computed_group_sizze_120107) +\n                         wave_sizze_133148 - 1, wave_sizze_133148))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_133174 = skip_waves_133175 * wave_sizze_133148;\n        if (slt32(local_tid_133146 + offset_133174, sext_i64_i32(n_p_114536)) &&\n            ((local_tid_133146 - squot32(local_tid_133146, wave_sizze_133148) *\n              wave_sizze_133148) == 0 && (sq",
                   "uot32(local_tid_133146,\n                                                  wave_sizze_133148) & (2 *\n                                                                        skip_waves_133175 -\n                                                                        1)) ==\n             0)) {\n            // read array element\n            {\n                x_120362 = ((__local\n                             float *) red_arr_mem_133172)[sext_i32_i64(local_tid_133146 +\n                                                          offset_133174)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_120363 = x_120361 + x_120362;\n                \n                x_120361 = defunc_1_op_res_120363;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_133172)[sext_i32_i64(local_tid_133146)] =\n                    x_120361;\n            }\n        }\n        skip_waves_133175 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_120360 = ((__local\n                                   float *) red_arr_mem_133172)[(int64_t) 0];\n    \n    int64_t gtid_120114 = sext_i32_i64(ltid_pre_133154);\n    int32_t phys_tid_120115 = local_tid_133146;\n    \n    if (slt64(gtid_120114, lifted_single_ma_arg_114976)) {\n        bool cond_120370 = gtid_120114 == (int64_t) 0;\n        float defunc_0_f_res_120371;\n        \n        if (cond_120370) {\n            float defunc_0_f_res_t_res_120372 = defunc_2_reduce_res_120360 /\n                  i64_res_114576;\n            \n            defunc_0_f_res_120371 = defunc_0_f_res_t_res_120372;\n        } else {\n            int64_t x_120373 = add64(n_p_114536, gtid_120114);\n            int64_t i_120374 = sub64(x_120373, (int64_t) 1);\n            bool x_120375 = sle64((int64_t) 0, i_120374);\n            bool y_120376 = slt64(i_120374, lifted_single_ma_arg_114959);\n            bool bounds_check_120377 = x_120375 && y_120376;\n       ",
                   "     bool index_certs_120378;\n            \n            if (!bounds_check_120377) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 70) ==\n                        -1) {\n                        global_failure_args[0] = i_120374;\n                        global_failure_args[1] = lifted_single_ma_arg_114959;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_5;\n                }\n            }\n            \n            float x_120379 = ((__local float *) color_132107)[i_120374];\n            int64_t i_120380 = sub64(gtid_120114, (int64_t) 1);\n            bool x_120381 = sle64((int64_t) 0, i_120380);\n            bool y_120382 = slt64(i_120380, lifted_single_ma_arg_114959);\n            bool bounds_check_120383 = x_120381 && y_120382;\n            bool index_certs_120384;\n            \n            if (!bounds_check_120383) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 71) ==\n                        -1) {\n                        global_failure_args[0] = i_120380;\n                        global_failure_args[1] = lifted_single_ma_arg_114959;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_5;\n                }\n            }\n            \n            float y_120385 = ((__local float *) color_132107)[i_120380];\n            float x_120386 = x_120379 - y_120385;\n            float defunc_0_f_res_f_res_120387 = x_120386 / i64_res_114576;\n            \n            defunc_0_f_res_120371 = defunc_0_f_res_f_res_120387;\n        }\n        ((__local float *) color_132108)[gtid_120114] = defunc_0_f_res_120371;\n    }\n    \n  error_5:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_133176 = lifted_single_ma_arg_114976;\n    float x_120366;\n    float x_120367;\n    float x_133178;\n    float x_1331",
                   "79;\n    bool ltid_in_bounds_133181 = slt64(sext_i32_i64(local_tid_133146),\n                                       lifted_single_ma_arg_114976);\n    int32_t skip_threads_133182;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_133181) {\n            x_120367 = ((volatile __local\n                         float *) color_132108)[sext_i32_i64(local_tid_133146)];\n            if ((local_tid_133146 - squot32(local_tid_133146, 32) * 32) == 0) {\n                x_120366 = x_120367;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_133182 = 1;\n        while (slt32(skip_threads_133182, 32)) {\n            if (sle32(skip_threads_133182, local_tid_133146 -\n                      squot32(local_tid_133146, 32) * 32) &&\n                ltid_in_bounds_133181) {\n                // read operands\n                {\n                    x_120366 = ((volatile __local\n                                 float *) color_132108)[sext_i32_i64(local_tid_133146) -\n                                                        sext_i32_i64(skip_threads_133182)];\n                }\n                // perform operation\n                {\n                    bool inactive_133183 =\n                         slt64(srem64(sext_i32_i64(local_tid_133146),\n                                      lifted_single_ma_arg_114976),\n                               sext_i32_i64(local_tid_133146) -\n                               sext_i32_i64(local_tid_133146 -\n                               skip_threads_133182));\n                    \n                    if (inactive_133183) {\n                        x_120366 = x_120367;\n                    }\n                    if (!inactive_133183) {\n                        float defunc_1_op_res_120368 = x_120366 + x_120367;\n                        \n                        x_120366 = defunc_1_op_res_120368;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_133148, skip_threads_13318",
                   "2)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (sle32(skip_threads_133182, local_tid_133146 -\n                      squot32(local_tid_133146, 32) * 32) &&\n                ltid_in_bounds_133181) {\n                // write result\n                {\n                    ((volatile __local\n                      float *) color_132108)[sext_i32_i64(local_tid_133146)] =\n                        x_120366;\n                    x_120367 = x_120366;\n                }\n            }\n            if (sle32(wave_sizze_133148, skip_threads_133182)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_133182 *= 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_133146 - squot32(local_tid_133146, 32) * 32) == 31 &&\n            ltid_in_bounds_133181) {\n            ((volatile __local\n              float *) color_132108)[sext_i32_i64(squot32(local_tid_133146,\n                                                          32))] = x_120366;\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_133184;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_133146, 32) == 0 && ltid_in_bounds_133181) {\n                x_133179 = ((volatile __local\n                             float *) color_132108)[sext_i32_i64(local_tid_133146)];\n                if ((local_tid_133146 - squot32(local_tid_133146, 32) * 32) ==\n                    0) {\n                    x_133178 = x_133179;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_133184 = 1;\n            while (slt32(skip_threads_133184, 32)) {\n                if (sle32(skip_threads_133184, local_tid_133146 -\n                          squot32(local_tid_133146, 32) * ",
                   "32) &&\n                    (squot32(local_tid_133146, 32) == 0 &&\n                     ltid_in_bounds_133181)) {\n                    // read operands\n                    {\n                        x_133178 = ((volatile __local\n                                     float *) color_132108)[sext_i32_i64(local_tid_133146) -\n                                                            sext_i32_i64(skip_threads_133184)];\n                    }\n                    // perform operation\n                    {\n                        bool inactive_133185 =\n                             slt64(srem64(sext_i32_i64(local_tid_133146 * 32 +\n                                          32 - 1), lifted_single_ma_arg_114976),\n                                   sext_i32_i64(local_tid_133146 * 32 + 32 -\n                                   1) - sext_i32_i64((local_tid_133146 -\n                                                      skip_threads_133184) *\n                                   32 + 32 - 1));\n                        \n                        if (inactive_133185) {\n                            x_133178 = x_133179;\n                        }\n                        if (!inactive_133185) {\n                            float defunc_1_op_res_133180 = x_133178 + x_133179;\n                            \n                            x_133178 = defunc_1_op_res_133180;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_133148, skip_threads_133184)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (sle32(skip_threads_133184, local_tid_133146 -\n                          squot32(local_tid_133146, 32) * 32) &&\n                    (squot32(local_tid_133146, 32) == 0 &&\n                     ltid_in_bounds_133181)) {\n                    // write result\n                    {\n                        ((volatile __local\n                          float *) color_132108)[sext_i32_i64(local_tid_133146)] =\n                         ",
                   "   x_133178;\n                        x_133179 = x_133178;\n                    }\n                }\n                if (sle32(wave_sizze_133148, skip_threads_133184)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_133184 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // carry-in for every block except the first\n    {\n        if (!(squot32(local_tid_133146, 32) == 0 || !ltid_in_bounds_133181)) {\n            // read operands\n            {\n                x_120367 = x_120366;\n                x_120366 = ((__local\n                             float *) color_132108)[sext_i32_i64(squot32(local_tid_133146,\n                                                                         32)) -\n                                                    (int64_t) 1];\n            }\n            // perform operation\n            {\n                bool inactive_133186 =\n                     slt64(srem64(sext_i32_i64(local_tid_133146),\n                                  lifted_single_ma_arg_114976),\n                           sext_i32_i64(local_tid_133146) -\n                           sext_i32_i64(squot32(local_tid_133146, 32) * 32 -\n                           1));\n                \n                if (inactive_133186) {\n                    x_120366 = x_120367;\n                }\n                if (!inactive_133186) {\n                    float defunc_1_op_res_120368 = x_120366 + x_120367;\n                    \n                    x_120366 = defunc_1_op_res_120368;\n                }\n            }\n            // write final result\n            {\n                ((__local\n                  float *) color_132108)[sext_i32_i64(local_tid_133146)] =\n                    x_120366;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_133146, 32) == 0) {\n            ((__local float *) color_132108)[sext_i32_i64(local_tid_133146)] =\n             ",
                   "   x_120367;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    float defunc_2_reduce_res_120389;\n    int64_t gtid_120116 = sext_i32_i64(ltid_pre_133150);\n    int32_t phys_tid_120117 = local_tid_133146;\n    __local char *red_arr_mem_133187;\n    \n    red_arr_mem_133187 = (__local char *) red_arr_mem_133187_backing_4;\n    if (slt64(gtid_120116, (int64_t) 3)) {\n        float x_120393 = ((__local float *) color_132108)[gtid_120116];\n        \n        ((__local float *) red_arr_mem_133187)[gtid_120116] = x_120393;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_133189;\n    int32_t skip_waves_133190 = 1;\n    float x_120390;\n    float x_120391;\n    \n    offset_133189 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_133146, 3)) {\n            x_120390 = ((__local\n                         float *) red_arr_mem_133187)[sext_i32_i64(local_tid_133146 +\n                                                      offset_133189)];\n        }\n    }\n    offset_133189 = 1;\n    while (slt32(offset_133189, wave_sizze_133148)) {\n        if (slt32(local_tid_133146 + offset_133189, 3) && ((local_tid_133146 -\n                                                            squot32(local_tid_133146,\n                                                                    wave_sizze_133148) *\n                                                            wave_sizze_133148) &\n                                                           (2 * offset_133189 -\n                                                            1)) == 0) {\n            // read array element\n            {\n                x_120391 = ((volatile __local\n                             float *) red_arr_mem_133187)[sext_i32_i64(local_tid_133146 +\n                                                          offset_133189)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_120392 = x_120390 + x_120391;\n                \n                x_",
                   "120390 = defunc_1_op_res_120392;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_133187)[sext_i32_i64(local_tid_133146)] =\n                    x_120390;\n            }\n        }\n        offset_133189 *= 2;\n    }\n    while (slt32(skip_waves_133190,\n                 squot32(sext_i64_i32(computed_group_sizze_120107) +\n                         wave_sizze_133148 - 1, wave_sizze_133148))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_133189 = skip_waves_133190 * wave_sizze_133148;\n        if (slt32(local_tid_133146 + offset_133189, 3) && ((local_tid_133146 -\n                                                            squot32(local_tid_133146,\n                                                                    wave_sizze_133148) *\n                                                            wave_sizze_133148) ==\n                                                           0 &&\n                                                           (squot32(local_tid_133146,\n                                                                    wave_sizze_133148) &\n                                                            (2 *\n                                                             skip_waves_133190 -\n                                                             1)) == 0)) {\n            // read array element\n            {\n                x_120391 = ((__local\n                             float *) red_arr_mem_133187)[sext_i32_i64(local_tid_133146 +\n                                                          offset_133189)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_120392 = x_120390 + x_120391;\n                \n                x_120390 = defunc_1_op_res_120392;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_133187)[sext_i32_i64(local_tid_13",
                   "3146)] =\n                    x_120390;\n            }\n        }\n        skip_waves_133190 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_120389 = ((__local\n                                   float *) red_arr_mem_133187)[(int64_t) 0];\n    \n    int64_t gtid_120118 = sext_i32_i64(ltid_pre_133151);\n    int32_t phys_tid_120119 = local_tid_133146;\n    \n    if (slt64(gtid_120118, n_114534)) {\n        bool cond_120399 = gtid_120118 == (int64_t) 0;\n        float defunc_0_f_res_120400;\n        \n        if (cond_120399) {\n            float defunc_0_f_res_t_res_120401 = defunc_2_reduce_res_120389 /\n                  3.0F;\n            \n            defunc_0_f_res_120400 = defunc_0_f_res_t_res_120401;\n        } else {\n            int64_t x_120402 = add64((int64_t) 3, gtid_120118);\n            int64_t i_120403 = sub64(x_120402, (int64_t) 1);\n            bool x_120404 = sle64((int64_t) 0, i_120403);\n            bool y_120405 = slt64(i_120403, lifted_single_ma_arg_114976);\n            bool bounds_check_120406 = x_120404 && y_120405;\n            bool index_certs_120407;\n            \n            if (!bounds_check_120406) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 72) ==\n                        -1) {\n                        global_failure_args[0] = i_120403;\n                        global_failure_args[1] = lifted_single_ma_arg_114976;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_8;\n                }\n            }\n            \n            float x_120408 = ((__local float *) color_132108)[i_120403];\n            int64_t i_120409 = sub64(gtid_120118, (int64_t) 1);\n            bool x_120410 = sle64((int64_t) 0, i_120409);\n            bool y_120411 = slt64(i_120409, lifted_single_ma_arg_114976);\n            bool bounds_check_120412 = x_120410 && y_120411;\n            bool index_certs_120413;\n            \n            if (!bounds_check_120412) {\n      ",
                   "          {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 73) ==\n                        -1) {\n                        global_failure_args[0] = i_120409;\n                        global_failure_args[1] = lifted_single_ma_arg_114976;\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_8;\n                }\n            }\n            \n            float y_120414 = ((__local float *) color_132108)[i_120409];\n            float x_120415 = x_120408 - y_120414;\n            float defunc_0_f_res_f_res_120416 = x_120415 / 3.0F;\n            \n            defunc_0_f_res_120400 = defunc_0_f_res_f_res_120416;\n        }\n        ((__local float *) color_132107)[gtid_120118] = defunc_0_f_res_120400;\n    }\n    \n  error_8:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_133191 = n_114534;\n    float x_120395;\n    float x_120396;\n    float x_133193;\n    float x_133194;\n    bool ltid_in_bounds_133196 = slt64(sext_i32_i64(local_tid_133146),\n                                       n_114534);\n    int32_t skip_threads_133197;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_133196) {\n            x_120396 = ((volatile __local\n                         float *) color_132107)[sext_i32_i64(local_tid_133146)];\n            if ((local_tid_133146 - squot32(local_tid_133146, 32) * 32) == 0) {\n                x_120395 = x_120396;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_133197 = 1;\n        while (slt32(skip_threads_133197, 32)) {\n            if (sle32(skip_threads_133197, local_tid_133146 -\n                      squot32(local_tid_133146, 32) * 32) &&\n                ltid_in_bounds_133196) {\n                // read operands\n                {\n                    x_120395 = ((volatile __local\n                                 float *) color_1321",
                   "07)[sext_i32_i64(local_tid_133146) -\n                                                        sext_i32_i64(skip_threads_133197)];\n                }\n                // perform operation\n                {\n                    bool inactive_133198 =\n                         slt64(srem64(sext_i32_i64(local_tid_133146), n_114534),\n                               sext_i32_i64(local_tid_133146) -\n                               sext_i32_i64(local_tid_133146 -\n                               skip_threads_133197));\n                    \n                    if (inactive_133198) {\n                        x_120395 = x_120396;\n                    }\n                    if (!inactive_133198) {\n                        float defunc_1_op_res_120397 = x_120395 + x_120396;\n                        \n                        x_120395 = defunc_1_op_res_120397;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_133148, skip_threads_133197)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (sle32(skip_threads_133197, local_tid_133146 -\n                      squot32(local_tid_133146, 32) * 32) &&\n                ltid_in_bounds_133196) {\n                // write result\n                {\n                    ((volatile __local\n                      float *) color_132107)[sext_i32_i64(local_tid_133146)] =\n                        x_120395;\n                    x_120396 = x_120395;\n                }\n            }\n            if (sle32(wave_sizze_133148, skip_threads_133197)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_133197 *= 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_133146 - squot32(local_tid_133146, 32) * 32) == 31 &&\n            ltid_in_bounds_133196) {\n            ((volatile __local\n              float *) color_132107)[sext_i32_i64(squot32(local_tid_133146,\n                                    ",
                   "                      32))] = x_120395;\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_133199;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_133146, 32) == 0 && ltid_in_bounds_133196) {\n                x_133194 = ((volatile __local\n                             float *) color_132107)[sext_i32_i64(local_tid_133146)];\n                if ((local_tid_133146 - squot32(local_tid_133146, 32) * 32) ==\n                    0) {\n                    x_133193 = x_133194;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_133199 = 1;\n            while (slt32(skip_threads_133199, 32)) {\n                if (sle32(skip_threads_133199, local_tid_133146 -\n                          squot32(local_tid_133146, 32) * 32) &&\n                    (squot32(local_tid_133146, 32) == 0 &&\n                     ltid_in_bounds_133196)) {\n                    // read operands\n                    {\n                        x_133193 = ((volatile __local\n                                     float *) color_132107)[sext_i32_i64(local_tid_133146) -\n                                                            sext_i32_i64(skip_threads_133199)];\n                    }\n                    // perform operation\n                    {\n                        bool inactive_133200 =\n                             slt64(srem64(sext_i32_i64(local_tid_133146 * 32 +\n                                          32 - 1), n_114534),\n                                   sext_i32_i64(local_tid_133146 * 32 + 32 -\n                                   1) - sext_i32_i64((local_tid_133146 -\n                                                      skip_threads_133199) *\n                                   32 + 32 - 1));\n                        \n                        if (inactive_133200) {\n        ",
                   "                    x_133193 = x_133194;\n                        }\n                        if (!inactive_133200) {\n                            float defunc_1_op_res_133195 = x_133193 + x_133194;\n                            \n                            x_133193 = defunc_1_op_res_133195;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_133148, skip_threads_133199)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (sle32(skip_threads_133199, local_tid_133146 -\n                          squot32(local_tid_133146, 32) * 32) &&\n                    (squot32(local_tid_133146, 32) == 0 &&\n                     ltid_in_bounds_133196)) {\n                    // write result\n                    {\n                        ((volatile __local\n                          float *) color_132107)[sext_i32_i64(local_tid_133146)] =\n                            x_133193;\n                        x_133194 = x_133193;\n                    }\n                }\n                if (sle32(wave_sizze_133148, skip_threads_133199)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_133199 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // carry-in for every block except the first\n    {\n        if (!(squot32(local_tid_133146, 32) == 0 || !ltid_in_bounds_133196)) {\n            // read operands\n            {\n                x_120396 = x_120395;\n                x_120395 = ((__local\n                             float *) color_132107)[sext_i32_i64(squot32(local_tid_133146,\n                                                                         32)) -\n                                                    (int64_t) 1];\n            }\n            // perform operation\n            {\n                bool inactive_133201 =\n                     slt64(srem64(sext_i32_i64(local_tid_133146), n_114534),\n                           sext_i32_i64(local_tid_133146) ",
                   "-\n                           sext_i32_i64(squot32(local_tid_133146, 32) * 32 -\n                           1));\n                \n                if (inactive_133201) {\n                    x_120395 = x_120396;\n                }\n                if (!inactive_133201) {\n                    float defunc_1_op_res_120397 = x_120395 + x_120396;\n                    \n                    x_120395 = defunc_1_op_res_120397;\n                }\n            }\n            // write final result\n            {\n                ((__local\n                  float *) color_132107)[sext_i32_i64(local_tid_133146)] =\n                    x_120395;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_133146, 32) == 0) {\n            ((__local float *) color_132107)[sext_i32_i64(local_tid_133146)] =\n                x_120396;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int64_t i_133202 = 0; i_133202 < sdiv_up64(n_114534 -\n                                                    sext_i32_i64(local_tid_133146),\n                                                    computed_group_sizze_120107);\n         i_133202++) {\n        ((__global float *) mem_130822)[gtid_120105 * n_114534 + (i_133202 *\n                                                                  computed_group_sizze_120107 +\n                                                                  sext_i32_i64(local_tid_133146))] =\n            ((__local float *) color_132107)[i_133202 *\n                                             computed_group_sizze_120107 +\n                                             sext_i32_i64(local_tid_133146)];\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_9:\n    return;\n}\n__kernel void mainzisegmap_intragroup_123347(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_134247_backing_aligned_0,\n                    ",
                   "                         __local volatile\n                                             int64_t *red_arr_mem_134243_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_132114_backing_aligned_2,\n                                             int64_t m_114533, int64_t n_114534,\n                                             int64_t l_window_114538,\n                                             int64_t t_jump_114541,\n                                             int64_t l_n_m_114584,\n                                             int64_t i_114610, __global\n                                             unsigned char *defunc_3_map_res_mem_130117,\n                                             __global unsigned char *mem_130122,\n                                             __global\n                                             unsigned char *defunc_3_map_res_mem_130404,\n                                             __global\n                                             unsigned char *defunc_3_map_res_mem_130405,\n                                             __global unsigned char *mem_130861,\n                                             __global unsigned char *mem_130865,\n                                             __global unsigned char *mem_131184)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_134247_backing_2 =\n                          (__local volatile\n                           char *) red_arr_mem_134247_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_134243_backing_1 =\n                          (__local volatile\n                           char *) red_arr_mem_134243_backing_aligned_1;\n    __local volatile char *restrict color_132114_backing_0 = (__local volatile\n                                                              char *) color_132114_backing_aligned_2;\n    \n    if (*global",
                   "_failure >= 0)\n        return;\n    \n    int32_t global_tid_134233;\n    int32_t local_tid_134234;\n    int64_t group_sizze_134237;\n    int32_t wave_sizze_134236;\n    int32_t group_tid_134235;\n    \n    global_tid_134233 = get_global_id(0);\n    local_tid_134234 = get_local_id(0);\n    group_sizze_134237 = get_local_size(0);\n    wave_sizze_134236 = LOCKSTEP_WIDTH;\n    group_tid_134235 = get_group_id(0);\n    \n    int32_t phys_tid_123347 = group_tid_134235;\n    int32_t ltid_pre_134238 = local_tid_134234;\n    int64_t slice_134239 = l_n_m_114584;\n    int64_t slice_134240 = m_114533 * slice_134239;\n    int64_t gtid_123335 = squot64(sext_i32_i64(group_tid_134235), slice_134239);\n    int64_t remnant_134241 = sext_i32_i64(group_tid_134235) - gtid_123335 *\n            slice_134239;\n    int64_t gtid_123336 = remnant_134241;\n    int64_t remnant_134242 = remnant_134241 - gtid_123336;\n    __local char *color_132114;\n    \n    color_132114 = (__local char *) color_132114_backing_0;\n    \n    int64_t x_123412 = ((__global\n                         int64_t *) defunc_3_map_res_mem_130117)[gtid_123335];\n    int64_t x_123414 = ((__global\n                         int64_t *) defunc_3_map_res_mem_130404)[gtid_123335 *\n                                                                 l_n_m_114584 +\n                                                                 gtid_123336];\n    float x_123415 = ((__global\n                       float *) defunc_3_map_res_mem_130405)[gtid_123335 *\n                                                             l_n_m_114584 +\n                                                             gtid_123336];\n    int64_t min_arg_123416 = mul64(t_jump_114541, gtid_123336);\n    int64_t min_res_123417 = smin64(i_114610, min_arg_123416);\n    float defunc_0_f_res_123418 = sitofp_i64_f32(min_res_123417);\n    float defunc_2_reduce_res_123419;\n    int64_t gtid_123340 = sext_i32_i64(ltid_pre_134238);\n    int32_t phys_tid_123341 = local_tid_134234;\n    __local char *red_arr_mem_134243;\n  ",
                   "  \n    red_arr_mem_134243 = (__local char *) red_arr_mem_134243_backing_1;\n    \n    bool cond_123425 = sle64(x_123412, gtid_123340);\n    float defunc_0_f_res_123426;\n    \n    if (cond_123425) {\n        defunc_0_f_res_123426 = 0.0F;\n    } else {\n        int64_t i_123427 = add64(gtid_123340, x_123414);\n        float x_123428 = ((__global float *) mem_130122)[gtid_123335 *\n                                                         n_114534 + i_123427];\n        float defunc_0_f_res_f_res_123429 = 1.0F + x_123428;\n        \n        defunc_0_f_res_123426 = defunc_0_f_res_f_res_123429;\n    }\n    \n    float defunc_0_f_res_123430;\n    \n    if (cond_123425) {\n        defunc_0_f_res_123430 = 0.0F;\n    } else {\n        int64_t i_123431 = add64(gtid_123340, x_123414);\n        float x_123432 = ((__global float *) mem_130861)[gtid_123335 *\n                                                         n_114534 + i_123431];\n        \n        defunc_0_f_res_123430 = x_123432;\n    }\n    \n    float x_j_123433 = defunc_0_f_res_123426 - defunc_0_f_res_123418;\n    float abs_res_123434 = (float) fabs(x_j_123433);\n    float tmp1_123435 = abs_res_123434 / x_123415;\n    float x_123436 = tmp1_123435 * tmp1_123435;\n    float y_123437 = tmp1_123435 * x_123436;\n    float tmp2_123438 = 1.0F - y_123437;\n    float x_123439 = tmp2_123438 * tmp2_123438;\n    float tmp3_123440 = tmp2_123438 * x_123439;\n    float tmp4_123441 = defunc_0_f_res_123430 * tmp3_123440;\n    \n    ((__local float *) red_arr_mem_134243)[gtid_123340] = tmp4_123441;\n    ((__local float *) color_132114)[gtid_123340] = tmp4_123441;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_134245;\n    int32_t skip_waves_134246 = 1;\n    float x_123421;\n    float x_123422;\n    \n    offset_134245 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_134234, sext_i64_i32(l_window_114538))) {\n            x_123421 = ((__local\n                         float *) red_arr_mem_134243)[sext_i32_i64(local_tid_134234 +\n ",
                   "                                                     offset_134245)];\n        }\n    }\n    offset_134245 = 1;\n    while (slt32(offset_134245, wave_sizze_134236)) {\n        if (slt32(local_tid_134234 + offset_134245,\n                  sext_i64_i32(l_window_114538)) && ((local_tid_134234 -\n                                                      squot32(local_tid_134234,\n                                                              wave_sizze_134236) *\n                                                      wave_sizze_134236) & (2 *\n                                                                            offset_134245 -\n                                                                            1)) ==\n            0) {\n            // read array element\n            {\n                x_123422 = ((volatile __local\n                             float *) red_arr_mem_134243)[sext_i32_i64(local_tid_134234 +\n                                                          offset_134245)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_123423 = x_123421 + x_123422;\n                \n                x_123421 = defunc_1_op_res_123423;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_134243)[sext_i32_i64(local_tid_134234)] =\n                    x_123421;\n            }\n        }\n        offset_134245 *= 2;\n    }\n    while (slt32(skip_waves_134246, squot32(sext_i64_i32(l_window_114538) +\n                                            wave_sizze_134236 - 1,\n                                            wave_sizze_134236))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_134245 = skip_waves_134246 * wave_sizze_134236;\n        if (slt32(local_tid_134234 + offset_134245,\n                  sext_i64_i32(l_window_114538)) && ((local_tid_134234 -\n                                                      squot32(local_tid_134234,\n                        ",
                   "                                      wave_sizze_134236) *\n                                                      wave_sizze_134236) == 0 &&\n                                                     (squot32(local_tid_134234,\n                                                              wave_sizze_134236) &\n                                                      (2 * skip_waves_134246 -\n                                                       1)) == 0)) {\n            // read array element\n            {\n                x_123422 = ((__local\n                             float *) red_arr_mem_134243)[sext_i32_i64(local_tid_134234 +\n                                                          offset_134245)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_123423 = x_123421 + x_123422;\n                \n                x_123421 = defunc_1_op_res_123423;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_134243)[sext_i32_i64(local_tid_134234)] =\n                    x_123421;\n            }\n        }\n        skip_waves_134246 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_123419 = ((__local\n                                   float *) red_arr_mem_134243)[(int64_t) 0];\n    \n    float a0_123442 = 1.0F / defunc_2_reduce_res_123419;\n    float defunc_2_reduce_res_123443;\n    int64_t gtid_123342 = sext_i32_i64(ltid_pre_134238);\n    int32_t phys_tid_123343 = local_tid_134234;\n    __local char *red_arr_mem_134247;\n    \n    red_arr_mem_134247 = (__local char *) red_arr_mem_134247_backing_2;\n    \n    float x_123448 = ((__local float *) color_132114)[gtid_123342];\n    bool cond_123449 = sle64(x_123412, gtid_123342);\n    float defunc_0_f_res_123450;\n    \n    if (cond_123449) {\n        defunc_0_f_res_123450 = 0.0F;\n    } else {\n        int64_t i_123451 = add64(gtid_123342, x_123414);\n        float x_123452 = ((__global float *) mem_130865)[",
                   "gtid_123335 *\n                                                         n_114534 + i_123451];\n        \n        defunc_0_f_res_123450 = x_123452;\n    }\n    \n    float x_123453 = a0_123442 * x_123448;\n    float defunc_9_fit_fun_res_123454 = defunc_0_f_res_123450 * x_123453;\n    \n    ((__local float *) red_arr_mem_134247)[gtid_123342] =\n        defunc_9_fit_fun_res_123454;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_134249;\n    int32_t skip_waves_134250 = 1;\n    float x_123444;\n    float x_123445;\n    \n    offset_134249 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_134234, sext_i64_i32(l_window_114538))) {\n            x_123444 = ((__local\n                         float *) red_arr_mem_134247)[sext_i32_i64(local_tid_134234 +\n                                                      offset_134249)];\n        }\n    }\n    offset_134249 = 1;\n    while (slt32(offset_134249, wave_sizze_134236)) {\n        if (slt32(local_tid_134234 + offset_134249,\n                  sext_i64_i32(l_window_114538)) && ((local_tid_134234 -\n                                                      squot32(local_tid_134234,\n                                                              wave_sizze_134236) *\n                                                      wave_sizze_134236) & (2 *\n                                                                            offset_134249 -\n                                                                            1)) ==\n            0) {\n            // read array element\n            {\n                x_123445 = ((volatile __local\n                             float *) red_arr_mem_134247)[sext_i32_i64(local_tid_134234 +\n                                                          offset_134249)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_123446 = x_123444 + x_123445;\n                \n                x_123444 = defunc_1_op_res_123446;\n            }\n        ",
                   "    // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_134247)[sext_i32_i64(local_tid_134234)] =\n                    x_123444;\n            }\n        }\n        offset_134249 *= 2;\n    }\n    while (slt32(skip_waves_134250, squot32(sext_i64_i32(l_window_114538) +\n                                            wave_sizze_134236 - 1,\n                                            wave_sizze_134236))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_134249 = skip_waves_134250 * wave_sizze_134236;\n        if (slt32(local_tid_134234 + offset_134249,\n                  sext_i64_i32(l_window_114538)) && ((local_tid_134234 -\n                                                      squot32(local_tid_134234,\n                                                              wave_sizze_134236) *\n                                                      wave_sizze_134236) == 0 &&\n                                                     (squot32(local_tid_134234,\n                                                              wave_sizze_134236) &\n                                                      (2 * skip_waves_134250 -\n                                                       1)) == 0)) {\n            // read array element\n            {\n                x_123445 = ((__local\n                             float *) red_arr_mem_134247)[sext_i32_i64(local_tid_134234 +\n                                                          offset_134249)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_123446 = x_123444 + x_123445;\n                \n                x_123444 = defunc_1_op_res_123446;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_134247)[sext_i32_i64(local_tid_134234)] =\n                    x_123444;\n            }\n        }\n        skip_waves_134250 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n  ",
                   "  defunc_2_reduce_res_123443 = ((__local\n                                   float *) red_arr_mem_134247)[(int64_t) 0];\n    if (local_tid_134234 == 0) {\n        ((__global float *) mem_131184)[gtid_123335 * l_n_m_114584 +\n                                        gtid_123336] =\n            defunc_2_reduce_res_123443;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_123476(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_134271_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_134269_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *red_arr_mem_134265_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_134263_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_134261_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_132116_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *color_132115_backing_aligned_6,\n                                             int64_t m_114533, int64_t n_114534,\n                                             int64_t l_window_114538,\n                                             int64_t t_jump_114541,\n                                             int64_t l_n_m_114584,\n                                             int64_t i_114610, __global\n                                             unsigned char *defunc_3_map_res_mem_130117,\n                                             __global unsign",
                   "ed char *mem_130122,\n                                             __global\n                                             unsigned char *defunc_3_map_res_mem_130404,\n                                             __global\n                                             unsigned char *defunc_3_map_res_mem_130405,\n                                             __global unsigned char *mem_130861,\n                                             __global unsigned char *mem_130865,\n                                             __global unsigned char *mem_131197,\n                                             __global unsigned char *mem_131201)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_134271_backing_6 =\n                          (__local volatile\n                           char *) red_arr_mem_134271_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_134269_backing_5 =\n                          (__local volatile\n                           char *) red_arr_mem_134269_backing_aligned_1;\n    __local volatile char *restrict red_arr_mem_134265_backing_4 =\n                          (__local volatile\n                           char *) red_arr_mem_134265_backing_aligned_2;\n    __local volatile char *restrict red_arr_mem_134263_backing_3 =\n                          (__local volatile\n                           char *) red_arr_mem_134263_backing_aligned_3;\n    __local volatile char *restrict red_arr_mem_134261_backing_2 =\n                          (__local volatile\n                           char *) red_arr_mem_134261_backing_aligned_4;\n    __local volatile char *restrict color_132116_backing_1 = (__local volatile\n                                                              char *) color_132116_backing_aligned_5;\n    __local volatile char *restrict color_132115_backing_0 = (__local volatile\n                                                              char *) color_132115_backing_aligne",
                   "d_6;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_134251;\n    int32_t local_tid_134252;\n    int64_t group_sizze_134255;\n    int32_t wave_sizze_134254;\n    int32_t group_tid_134253;\n    \n    global_tid_134251 = get_global_id(0);\n    local_tid_134252 = get_local_id(0);\n    group_sizze_134255 = get_local_size(0);\n    wave_sizze_134254 = LOCKSTEP_WIDTH;\n    group_tid_134253 = get_group_id(0);\n    \n    int32_t phys_tid_123476 = group_tid_134253;\n    int32_t ltid_pre_134256 = local_tid_134252;\n    int64_t slice_134257 = l_n_m_114584;\n    int64_t slice_134258 = m_114533 * slice_134257;\n    int64_t gtid_123464 = squot64(sext_i32_i64(group_tid_134253), slice_134257);\n    int64_t remnant_134259 = sext_i32_i64(group_tid_134253) - gtid_123464 *\n            slice_134257;\n    int64_t gtid_123465 = remnant_134259;\n    int64_t remnant_134260 = remnant_134259 - gtid_123465;\n    __local char *color_132115;\n    \n    color_132115 = (__local char *) color_132115_backing_0;\n    \n    __local char *color_132116;\n    \n    color_132116 = (__local char *) color_132116_backing_1;\n    \n    int64_t x_123572 = ((__global\n                         int64_t *) defunc_3_map_res_mem_130117)[gtid_123464];\n    int64_t x_123574 = ((__global\n                         int64_t *) defunc_3_map_res_mem_130404)[gtid_123464 *\n                                                                 l_n_m_114584 +\n                                                                 gtid_123465];\n    float x_123575 = ((__global\n                       float *) defunc_3_map_res_mem_130405)[gtid_123464 *\n                                                             l_n_m_114584 +\n                                                             gtid_123465];\n    int64_t min_arg_123576 = mul64(t_jump_114541, gtid_123465);\n    int64_t min_res_123577 = smin64(i_114610, min_arg_123576);\n    float defunc_0_f_res_123578 = sitofp_i64_f32(min_res_123577);\n    float defunc_2_reduce_res_123579;\n    float defunc_2",
                   "_reduce_res_123580;\n    float defunc_2_reduce_res_123581;\n    int64_t gtid_123469 = sext_i32_i64(ltid_pre_134256);\n    int32_t phys_tid_123470 = local_tid_134252;\n    __local char *red_arr_mem_134261;\n    \n    red_arr_mem_134261 = (__local char *) red_arr_mem_134261_backing_2;\n    \n    __local char *red_arr_mem_134263;\n    \n    red_arr_mem_134263 = (__local char *) red_arr_mem_134263_backing_3;\n    \n    __local char *red_arr_mem_134265;\n    \n    red_arr_mem_134265 = (__local char *) red_arr_mem_134265_backing_4;\n    \n    bool cond_123594 = sle64(x_123572, gtid_123469);\n    float defunc_0_f_res_123595;\n    \n    if (cond_123594) {\n        defunc_0_f_res_123595 = 0.0F;\n    } else {\n        int64_t i_123596 = add64(gtid_123469, x_123574);\n        float x_123597 = ((__global float *) mem_130122)[gtid_123464 *\n                                                         n_114534 + i_123596];\n        float defunc_0_f_res_f_res_123598 = 1.0F + x_123597;\n        \n        defunc_0_f_res_123595 = defunc_0_f_res_f_res_123598;\n    }\n    \n    float defunc_0_f_res_123599;\n    \n    if (cond_123594) {\n        defunc_0_f_res_123599 = 0.0F;\n    } else {\n        int64_t i_123600 = add64(gtid_123469, x_123574);\n        float x_123601 = ((__global float *) mem_130861)[gtid_123464 *\n                                                         n_114534 + i_123600];\n        \n        defunc_0_f_res_123599 = x_123601;\n    }\n    \n    float x_j_123602 = defunc_0_f_res_123595 - defunc_0_f_res_123578;\n    float abs_res_123603 = (float) fabs(x_j_123602);\n    float tmp1_123604 = abs_res_123603 / x_123575;\n    float x_123605 = tmp1_123604 * tmp1_123604;\n    float y_123606 = tmp1_123604 * x_123605;\n    float tmp2_123607 = 1.0F - y_123606;\n    float x_123608 = tmp2_123607 * tmp2_123607;\n    float tmp3_123609 = tmp2_123607 * x_123608;\n    float tmp4_123610 = defunc_0_f_res_123599 * tmp3_123609;\n    float defunc_1_f_res_123611 = x_j_123602 * tmp4_123610;\n    float defunc_1_f_res_123612 = x_j_123602 * defunc_1_f",
                   "_res_123611;\n    \n    ((__local float *) red_arr_mem_134261)[gtid_123469] = tmp4_123610;\n    ((__local float *) red_arr_mem_134263)[gtid_123469] = defunc_1_f_res_123611;\n    ((__local float *) red_arr_mem_134265)[gtid_123469] = defunc_1_f_res_123612;\n    ((__local float *) color_132116)[gtid_123469] = defunc_1_f_res_123611;\n    ((__local float *) color_132115)[gtid_123469] = tmp4_123610;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_134267;\n    int32_t skip_waves_134268 = 1;\n    float x_123584;\n    float x_123585;\n    float x_123586;\n    float x_123587;\n    float x_123588;\n    float x_123589;\n    \n    offset_134267 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_134252, sext_i64_i32(l_window_114538))) {\n            x_123584 = ((__local\n                         float *) red_arr_mem_134261)[sext_i32_i64(local_tid_134252 +\n                                                      offset_134267)];\n            x_123585 = ((__local\n                         float *) red_arr_mem_134263)[sext_i32_i64(local_tid_134252 +\n                                                      offset_134267)];\n            x_123586 = ((__local\n                         float *) red_arr_mem_134265)[sext_i32_i64(local_tid_134252 +\n                                                      offset_134267)];\n        }\n    }\n    offset_134267 = 1;\n    while (slt32(offset_134267, wave_sizze_134254)) {\n        if (slt32(local_tid_134252 + offset_134267,\n                  sext_i64_i32(l_window_114538)) && ((local_tid_134252 -\n                                                      squot32(local_tid_134252,\n                                                              wave_sizze_134254) *\n                                                      wave_sizze_134254) & (2 *\n                                                                            offset_134267 -\n                                                                            1)) ==\n            0) {\n       ",
                   "     // read array element\n            {\n                x_123587 = ((volatile __local\n                             float *) red_arr_mem_134261)[sext_i32_i64(local_tid_134252 +\n                                                          offset_134267)];\n                x_123588 = ((volatile __local\n                             float *) red_arr_mem_134263)[sext_i32_i64(local_tid_134252 +\n                                                          offset_134267)];\n                x_123589 = ((volatile __local\n                             float *) red_arr_mem_134265)[sext_i32_i64(local_tid_134252 +\n                                                          offset_134267)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_123590 = x_123584 + x_123587;\n                float defunc_1_op_res_123591 = x_123585 + x_123588;\n                float defunc_1_op_res_123592 = x_123586 + x_123589;\n                \n                x_123584 = defunc_1_op_res_123590;\n                x_123585 = defunc_1_op_res_123591;\n                x_123586 = defunc_1_op_res_123592;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_134261)[sext_i32_i64(local_tid_134252)] =\n                    x_123584;\n                ((volatile __local\n                  float *) red_arr_mem_134263)[sext_i32_i64(local_tid_134252)] =\n                    x_123585;\n                ((volatile __local\n                  float *) red_arr_mem_134265)[sext_i32_i64(local_tid_134252)] =\n                    x_123586;\n            }\n        }\n        offset_134267 *= 2;\n    }\n    while (slt32(skip_waves_134268, squot32(sext_i64_i32(l_window_114538) +\n                                            wave_sizze_134254 - 1,\n                                            wave_sizze_134254))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_134267 = skip_waves_134268 * wave_sizze_134254;\n       ",
                   " if (slt32(local_tid_134252 + offset_134267,\n                  sext_i64_i32(l_window_114538)) && ((local_tid_134252 -\n                                                      squot32(local_tid_134252,\n                                                              wave_sizze_134254) *\n                                                      wave_sizze_134254) == 0 &&\n                                                     (squot32(local_tid_134252,\n                                                              wave_sizze_134254) &\n                                                      (2 * skip_waves_134268 -\n                                                       1)) == 0)) {\n            // read array element\n            {\n                x_123587 = ((__local\n                             float *) red_arr_mem_134261)[sext_i32_i64(local_tid_134252 +\n                                                          offset_134267)];\n                x_123588 = ((__local\n                             float *) red_arr_mem_134263)[sext_i32_i64(local_tid_134252 +\n                                                          offset_134267)];\n                x_123589 = ((__local\n                             float *) red_arr_mem_134265)[sext_i32_i64(local_tid_134252 +\n                                                          offset_134267)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_123590 = x_123584 + x_123587;\n                float defunc_1_op_res_123591 = x_123585 + x_123588;\n                float defunc_1_op_res_123592 = x_123586 + x_123589;\n                \n                x_123584 = defunc_1_op_res_123590;\n                x_123585 = defunc_1_op_res_123591;\n                x_123586 = defunc_1_op_res_123592;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_134261)[sext_i32_i64(local_tid_134252)] =\n                    x_123584;\n                ((__local",
                   "\n                  float *) red_arr_mem_134263)[sext_i32_i64(local_tid_134252)] =\n                    x_123585;\n                ((__local\n                  float *) red_arr_mem_134265)[sext_i32_i64(local_tid_134252)] =\n                    x_123586;\n            }\n        }\n        skip_waves_134268 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_123579 = ((__local\n                                   float *) red_arr_mem_134261)[(int64_t) 0];\n    defunc_2_reduce_res_123580 = ((__local\n                                   float *) red_arr_mem_134263)[(int64_t) 0];\n    defunc_2_reduce_res_123581 = ((__local\n                                   float *) red_arr_mem_134265)[(int64_t) 0];\n    \n    float x_123613 = defunc_2_reduce_res_123579 * defunc_2_reduce_res_123581;\n    float y_123614 = defunc_2_reduce_res_123580 * defunc_2_reduce_res_123580;\n    float y_123615 = x_123613 - y_123614;\n    float det1_123616 = 1.0F / y_123615;\n    float a11_123617 = defunc_2_reduce_res_123581 * det1_123616;\n    float negate_arg_123618 = defunc_2_reduce_res_123580 * det1_123616;\n    float b11_123619 = 0.0F - negate_arg_123618;\n    float c11_123620 = defunc_2_reduce_res_123579 * det1_123616;\n    float defunc_2_reduce_res_123621;\n    float defunc_2_reduce_res_123622;\n    int64_t gtid_123471 = sext_i32_i64(ltid_pre_134256);\n    int32_t phys_tid_123472 = local_tid_134252;\n    __local char *red_arr_mem_134269;\n    \n    red_arr_mem_134269 = (__local char *) red_arr_mem_134269_backing_5;\n    \n    __local char *red_arr_mem_134271;\n    \n    red_arr_mem_134271 = (__local char *) red_arr_mem_134271_backing_6;\n    \n    float x_123630 = ((__local float *) color_132115)[gtid_123471];\n    float x_123631 = ((__local float *) color_132116)[gtid_123471];\n    bool cond_123632 = sle64(x_123572, gtid_123471);\n    float defunc_0_f_res_123633;\n    \n    if (cond_123632) {\n        defunc_0_f_res_123633 = 0.0F;\n    } else {\n        int64_t i_123634 = add64(gtid_123471, x_123574);\n        float x_12",
                   "3635 = ((__global float *) mem_130865)[gtid_123464 *\n                                                         n_114534 + i_123634];\n        \n        defunc_0_f_res_123633 = x_123635;\n    }\n    \n    float x_123636 = a11_123617 * x_123630;\n    float y_123637 = b11_123619 * x_123631;\n    float x_123638 = x_123636 + y_123637;\n    float defunc_9_fit_fun_res_123639 = defunc_0_f_res_123633 * x_123638;\n    float x_123640 = b11_123619 * x_123630;\n    float y_123641 = c11_123620 * x_123631;\n    float x_123642 = x_123640 + y_123641;\n    float defunc_9_slope_fun_res_123643 = defunc_0_f_res_123633 * x_123642;\n    \n    ((__local float *) red_arr_mem_134269)[gtid_123471] =\n        defunc_9_fit_fun_res_123639;\n    ((__local float *) red_arr_mem_134271)[gtid_123471] =\n        defunc_9_slope_fun_res_123643;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_134273;\n    int32_t skip_waves_134274 = 1;\n    float x_123623;\n    float x_123624;\n    float x_123625;\n    float x_123626;\n    \n    offset_134273 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_134252, sext_i64_i32(l_window_114538))) {\n            x_123623 = ((__local\n                         float *) red_arr_mem_134269)[sext_i32_i64(local_tid_134252 +\n                                                      offset_134273)];\n            x_123624 = ((__local\n                         float *) red_arr_mem_134271)[sext_i32_i64(local_tid_134252 +\n                                                      offset_134273)];\n        }\n    }\n    offset_134273 = 1;\n    while (slt32(offset_134273, wave_sizze_134254)) {\n        if (slt32(local_tid_134252 + offset_134273,\n                  sext_i64_i32(l_window_114538)) && ((local_tid_134252 -\n                                                      squot32(local_tid_134252,\n                                                              wave_sizze_134254) *\n                                                      wave_sizze_134254) & (2 *\n                   ",
                   "                                                         offset_134273 -\n                                                                            1)) ==\n            0) {\n            // read array element\n            {\n                x_123625 = ((volatile __local\n                             float *) red_arr_mem_134269)[sext_i32_i64(local_tid_134252 +\n                                                          offset_134273)];\n                x_123626 = ((volatile __local\n                             float *) red_arr_mem_134271)[sext_i32_i64(local_tid_134252 +\n                                                          offset_134273)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_123627 = x_123623 + x_123625;\n                float defunc_1_op_res_123628 = x_123624 + x_123626;\n                \n                x_123623 = defunc_1_op_res_123627;\n                x_123624 = defunc_1_op_res_123628;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_134269)[sext_i32_i64(local_tid_134252)] =\n                    x_123623;\n                ((volatile __local\n                  float *) red_arr_mem_134271)[sext_i32_i64(local_tid_134252)] =\n                    x_123624;\n            }\n        }\n        offset_134273 *= 2;\n    }\n    while (slt32(skip_waves_134274, squot32(sext_i64_i32(l_window_114538) +\n                                            wave_sizze_134254 - 1,\n                                            wave_sizze_134254))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_134273 = skip_waves_134274 * wave_sizze_134254;\n        if (slt32(local_tid_134252 + offset_134273,\n                  sext_i64_i32(l_window_114538)) && ((local_tid_134252 -\n                                                      squot32(local_tid_134252,\n                                                              wave_sizze_134254) *\n               ",
                   "                                       wave_sizze_134254) == 0 &&\n                                                     (squot32(local_tid_134252,\n                                                              wave_sizze_134254) &\n                                                      (2 * skip_waves_134274 -\n                                                       1)) == 0)) {\n            // read array element\n            {\n                x_123625 = ((__local\n                             float *) red_arr_mem_134269)[sext_i32_i64(local_tid_134252 +\n                                                          offset_134273)];\n                x_123626 = ((__local\n                             float *) red_arr_mem_134271)[sext_i32_i64(local_tid_134252 +\n                                                          offset_134273)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_123627 = x_123623 + x_123625;\n                float defunc_1_op_res_123628 = x_123624 + x_123626;\n                \n                x_123623 = defunc_1_op_res_123627;\n                x_123624 = defunc_1_op_res_123628;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_134269)[sext_i32_i64(local_tid_134252)] =\n                    x_123623;\n                ((__local\n                  float *) red_arr_mem_134271)[sext_i32_i64(local_tid_134252)] =\n                    x_123624;\n            }\n        }\n        skip_waves_134274 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_123621 = ((__local\n                                   float *) red_arr_mem_134269)[(int64_t) 0];\n    defunc_2_reduce_res_123622 = ((__local\n                                   float *) red_arr_mem_134271)[(int64_t) 0];\n    if (local_tid_134252 == 0) {\n        ((__global float *) mem_131197)[gtid_123464 * l_n_m_114584 +\n                                        gtid_123465] =\n          ",
                   "  defunc_2_reduce_res_123621;\n    }\n    if (local_tid_134252 == 0) {\n        ((__global float *) mem_131201)[gtid_123464 * l_n_m_114584 +\n                                        gtid_123465] =\n            defunc_2_reduce_res_123622;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_123686(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_134299_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_134297_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *red_arr_mem_134293_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_134291_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_134289_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *red_arr_mem_134287_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *red_arr_mem_134285_backing_aligned_6,\n                                             __local volatile\n                                             int64_t *color_132120_backing_aligned_7,\n                                             __local volatile\n                                             int64_t *color_132119_backing_aligned_8,\n                                             __local volatile\n                                             int64_t *color_132118_backing_aligned_9,\n                                             __local volatile\n                                             int64_t *color_132117_backi",
                   "ng_aligned_10,\n                                             int64_t m_114533, int64_t n_114534,\n                                             int64_t l_window_114538,\n                                             int64_t t_jump_114541,\n                                             int64_t l_n_m_114584,\n                                             int64_t i_114610, __global\n                                             unsigned char *defunc_3_map_res_mem_130117,\n                                             __global unsigned char *mem_130122,\n                                             __global\n                                             unsigned char *defunc_3_map_res_mem_130404,\n                                             __global\n                                             unsigned char *defunc_3_map_res_mem_130405,\n                                             __global unsigned char *mem_130861,\n                                             __global unsigned char *mem_130865,\n                                             __global unsigned char *mem_131221,\n                                             __global unsigned char *mem_131225)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_134299_backing_10 =\n                          (__local volatile\n                           char *) red_arr_mem_134299_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_134297_backing_9 =\n                          (__local volatile\n                           char *) red_arr_mem_134297_backing_aligned_1;\n    __local volatile char *restrict red_arr_mem_134293_backing_8 =\n                          (__local volatile\n                           char *) red_arr_mem_134293_backing_aligned_2;\n    __local volatile char *restrict red_arr_mem_134291_backing_7 =\n                          (__local volatile\n                           char *) red_arr_mem_134291_backing_aligned_3;\n    __local volati",
                   "le char *restrict red_arr_mem_134289_backing_6 =\n                          (__local volatile\n                           char *) red_arr_mem_134289_backing_aligned_4;\n    __local volatile char *restrict red_arr_mem_134287_backing_5 =\n                          (__local volatile\n                           char *) red_arr_mem_134287_backing_aligned_5;\n    __local volatile char *restrict red_arr_mem_134285_backing_4 =\n                          (__local volatile\n                           char *) red_arr_mem_134285_backing_aligned_6;\n    __local volatile char *restrict color_132120_backing_3 = (__local volatile\n                                                              char *) color_132120_backing_aligned_7;\n    __local volatile char *restrict color_132119_backing_2 = (__local volatile\n                                                              char *) color_132119_backing_aligned_8;\n    __local volatile char *restrict color_132118_backing_1 = (__local volatile\n                                                              char *) color_132118_backing_aligned_9;\n    __local volatile char *restrict color_132117_backing_0 = (__local volatile\n                                                              char *) color_132117_backing_aligned_10;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_134275;\n    int32_t local_tid_134276;\n    int64_t group_sizze_134279;\n    int32_t wave_sizze_134278;\n    int32_t group_tid_134277;\n    \n    global_tid_134275 = get_global_id(0);\n    local_tid_134276 = get_local_id(0);\n    group_sizze_134279 = get_local_size(0);\n    wave_sizze_134278 = LOCKSTEP_WIDTH;\n    group_tid_134277 = get_group_id(0);\n    \n    int32_t phys_tid_123686 = group_tid_134277;\n    int32_t ltid_pre_134280 = local_tid_134276;\n    int64_t slice_134281 = l_n_m_114584;\n    int64_t slice_134282 = m_114533 * slice_134281;\n    int64_t gtid_123654 = squot64(sext_i32_i64(group_tid_134277), slice_134281);\n    int64_t remnant_134283 = sext_i32_i64(gro",
                   "up_tid_134277) - gtid_123654 *\n            slice_134281;\n    int64_t gtid_123655 = remnant_134283;\n    int64_t remnant_134284 = remnant_134283 - gtid_123655;\n    __local char *color_132117;\n    \n    color_132117 = (__local char *) color_132117_backing_0;\n    \n    __local char *color_132118;\n    \n    color_132118 = (__local char *) color_132118_backing_1;\n    \n    __local char *color_132119;\n    \n    color_132119 = (__local char *) color_132119_backing_2;\n    \n    __local char *color_132120;\n    \n    color_132120 = (__local char *) color_132120_backing_3;\n    \n    int64_t x_123818 = ((__global\n                         int64_t *) defunc_3_map_res_mem_130117)[gtid_123654];\n    int64_t x_123820 = ((__global\n                         int64_t *) defunc_3_map_res_mem_130404)[gtid_123654 *\n                                                                 l_n_m_114584 +\n                                                                 gtid_123655];\n    float x_123821 = ((__global\n                       float *) defunc_3_map_res_mem_130405)[gtid_123654 *\n                                                             l_n_m_114584 +\n                                                             gtid_123655];\n    int64_t min_arg_123822 = mul64(t_jump_114541, gtid_123655);\n    int64_t min_res_123823 = smin64(i_114610, min_arg_123822);\n    float defunc_0_f_res_123824 = sitofp_i64_f32(min_res_123823);\n    int64_t gtid_123659 = sext_i32_i64(ltid_pre_134280);\n    int32_t phys_tid_123660 = local_tid_134276;\n    bool cond_123828 = sle64(x_123818, gtid_123659);\n    float defunc_0_f_res_123829;\n    \n    if (cond_123828) {\n        defunc_0_f_res_123829 = 0.0F;\n    } else {\n        int64_t i_123830 = add64(gtid_123659, x_123820);\n        float x_123831 = ((__global float *) mem_130122)[gtid_123654 *\n                                                         n_114534 + i_123830];\n        float defunc_0_f_res_f_res_123832 = 1.0F + x_123831;\n        \n        defunc_0_f_res_123829 = defunc_0_f_res_f_re",
                   "s_123832;\n    }\n    \n    float defunc_0_f_res_123833;\n    \n    if (cond_123828) {\n        defunc_0_f_res_123833 = 0.0F;\n    } else {\n        int64_t i_123834 = add64(gtid_123659, x_123820);\n        float x_123835 = ((__global float *) mem_130861)[gtid_123654 *\n                                                         n_114534 + i_123834];\n        \n        defunc_0_f_res_123833 = x_123835;\n    }\n    \n    float x_j_123836 = defunc_0_f_res_123829 - defunc_0_f_res_123824;\n    float abs_res_123837 = (float) fabs(x_j_123836);\n    float tmp1_123838 = abs_res_123837 / x_123821;\n    float x_123839 = tmp1_123838 * tmp1_123838;\n    float y_123840 = tmp1_123838 * x_123839;\n    float tmp2_123841 = 1.0F - y_123840;\n    float x_123842 = tmp2_123841 * tmp2_123841;\n    float tmp3_123843 = tmp2_123841 * x_123842;\n    float tmp4_123844 = defunc_0_f_res_123833 * tmp3_123843;\n    \n    ((__local float *) color_132120)[gtid_123659] = x_j_123836;\n    ((__local float *) color_132119)[gtid_123659] = tmp4_123844;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    float defunc_2_reduce_res_123845;\n    float defunc_2_reduce_res_123846;\n    float defunc_2_reduce_res_123847;\n    float defunc_2_reduce_res_123848;\n    float defunc_2_reduce_res_123849;\n    int64_t gtid_123679 = sext_i32_i64(ltid_pre_134280);\n    int32_t phys_tid_123680 = local_tid_134276;\n    __local char *red_arr_mem_134285;\n    \n    red_arr_mem_134285 = (__local char *) red_arr_mem_134285_backing_4;\n    \n    __local char *red_arr_mem_134287;\n    \n    red_arr_mem_134287 = (__local char *) red_arr_mem_134287_backing_5;\n    \n    __local char *red_arr_mem_134289;\n    \n    red_arr_mem_134289 = (__local char *) red_arr_mem_134289_backing_6;\n    \n    __local char *red_arr_mem_134291;\n    \n    red_arr_mem_134291 = (__local char *) red_arr_mem_134291_backing_7;\n    \n    __local char *red_arr_mem_134293;\n    \n    red_arr_mem_134293 = (__local char *) red_arr_mem_134293_backing_8;\n    \n    float x_123867 = ((__local float *) color_132120)[gtid_123679",
                   "];\n    float x_123868 = ((__local float *) color_132119)[gtid_123679];\n    float defunc_1_f_res_123869 = x_123867 * x_123868;\n    float defunc_1_f_res_123870 = x_123867 * defunc_1_f_res_123869;\n    float defunc_1_f_res_123871 = x_123867 * defunc_1_f_res_123870;\n    float defunc_1_f_res_123872 = x_123867 * defunc_1_f_res_123871;\n    \n    ((__local float *) red_arr_mem_134285)[gtid_123679] = x_123868;\n    ((__local float *) red_arr_mem_134287)[gtid_123679] = defunc_1_f_res_123869;\n    ((__local float *) red_arr_mem_134289)[gtid_123679] = defunc_1_f_res_123870;\n    ((__local float *) red_arr_mem_134291)[gtid_123679] = defunc_1_f_res_123871;\n    ((__local float *) red_arr_mem_134293)[gtid_123679] = defunc_1_f_res_123872;\n    ((__local float *) color_132118)[gtid_123679] = defunc_1_f_res_123870;\n    ((__local float *) color_132117)[gtid_123679] = defunc_1_f_res_123869;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_134295;\n    int32_t skip_waves_134296 = 1;\n    float x_123852;\n    float x_123853;\n    float x_123854;\n    float x_123855;\n    float x_123856;\n    float x_123857;\n    float x_123858;\n    float x_123859;\n    float x_123860;\n    float x_123861;\n    \n    offset_134295 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_134276, sext_i64_i32(l_window_114538))) {\n            x_123852 = ((__local\n                         float *) red_arr_mem_134285)[sext_i32_i64(local_tid_134276 +\n                                                      offset_134295)];\n            x_123853 = ((__local\n                         float *) red_arr_mem_134287)[sext_i32_i64(local_tid_134276 +\n                                                      offset_134295)];\n            x_123854 = ((__local\n                         float *) red_arr_mem_134289)[sext_i32_i64(local_tid_134276 +\n                                                      offset_134295)];\n            x_123855 = ((__local\n                         float *) red_arr_mem_134291)[sext_i3",
                   "2_i64(local_tid_134276 +\n                                                      offset_134295)];\n            x_123856 = ((__local\n                         float *) red_arr_mem_134293)[sext_i32_i64(local_tid_134276 +\n                                                      offset_134295)];\n        }\n    }\n    offset_134295 = 1;\n    while (slt32(offset_134295, wave_sizze_134278)) {\n        if (slt32(local_tid_134276 + offset_134295,\n                  sext_i64_i32(l_window_114538)) && ((local_tid_134276 -\n                                                      squot32(local_tid_134276,\n                                                              wave_sizze_134278) *\n                                                      wave_sizze_134278) & (2 *\n                                                                            offset_134295 -\n                                                                            1)) ==\n            0) {\n            // read array element\n            {\n                x_123857 = ((volatile __local\n                             float *) red_arr_mem_134285)[sext_i32_i64(local_tid_134276 +\n                                                          offset_134295)];\n                x_123858 = ((volatile __local\n                             float *) red_arr_mem_134287)[sext_i32_i64(local_tid_134276 +\n                                                          offset_134295)];\n                x_123859 = ((volatile __local\n                             float *) red_arr_mem_134289)[sext_i32_i64(local_tid_134276 +\n                                                          offset_134295)];\n                x_123860 = ((volatile __local\n                             float *) red_arr_mem_134291)[sext_i32_i64(local_tid_134276 +\n                                                          offset_134295)];\n                x_123861 = ((volatile __local\n                             float *) red_arr_mem_134293)[sext_i32_i64(local_tid_134276 +\n                                 ",
                   "                         offset_134295)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_123862 = x_123852 + x_123857;\n                float defunc_1_op_res_123863 = x_123853 + x_123858;\n                float defunc_1_op_res_123864 = x_123854 + x_123859;\n                float defunc_1_op_res_123865 = x_123855 + x_123860;\n                float defunc_1_op_res_123866 = x_123856 + x_123861;\n                \n                x_123852 = defunc_1_op_res_123862;\n                x_123853 = defunc_1_op_res_123863;\n                x_123854 = defunc_1_op_res_123864;\n                x_123855 = defunc_1_op_res_123865;\n                x_123856 = defunc_1_op_res_123866;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_134285)[sext_i32_i64(local_tid_134276)] =\n                    x_123852;\n                ((volatile __local\n                  float *) red_arr_mem_134287)[sext_i32_i64(local_tid_134276)] =\n                    x_123853;\n                ((volatile __local\n                  float *) red_arr_mem_134289)[sext_i32_i64(local_tid_134276)] =\n                    x_123854;\n                ((volatile __local\n                  float *) red_arr_mem_134291)[sext_i32_i64(local_tid_134276)] =\n                    x_123855;\n                ((volatile __local\n                  float *) red_arr_mem_134293)[sext_i32_i64(local_tid_134276)] =\n                    x_123856;\n            }\n        }\n        offset_134295 *= 2;\n    }\n    while (slt32(skip_waves_134296, squot32(sext_i64_i32(l_window_114538) +\n                                            wave_sizze_134278 - 1,\n                                            wave_sizze_134278))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_134295 = skip_waves_134296 * wave_sizze_134278;\n        if (slt32(local_tid_134276 + offset_134295,\n                  sext_i64_i32(l_window_114538)) && ((loc",
                   "al_tid_134276 -\n                                                      squot32(local_tid_134276,\n                                                              wave_sizze_134278) *\n                                                      wave_sizze_134278) == 0 &&\n                                                     (squot32(local_tid_134276,\n                                                              wave_sizze_134278) &\n                                                      (2 * skip_waves_134296 -\n                                                       1)) == 0)) {\n            // read array element\n            {\n                x_123857 = ((__local\n                             float *) red_arr_mem_134285)[sext_i32_i64(local_tid_134276 +\n                                                          offset_134295)];\n                x_123858 = ((__local\n                             float *) red_arr_mem_134287)[sext_i32_i64(local_tid_134276 +\n                                                          offset_134295)];\n                x_123859 = ((__local\n                             float *) red_arr_mem_134289)[sext_i32_i64(local_tid_134276 +\n                                                          offset_134295)];\n                x_123860 = ((__local\n                             float *) red_arr_mem_134291)[sext_i32_i64(local_tid_134276 +\n                                                          offset_134295)];\n                x_123861 = ((__local\n                             float *) red_arr_mem_134293)[sext_i32_i64(local_tid_134276 +\n                                                          offset_134295)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_123862 = x_123852 + x_123857;\n                float defunc_1_op_res_123863 = x_123853 + x_123858;\n                float defunc_1_op_res_123864 = x_123854 + x_123859;\n                float defunc_1_op_res_123865 = x_123855 + x_123860;\n                float defunc_1_",
                   "op_res_123866 = x_123856 + x_123861;\n                \n                x_123852 = defunc_1_op_res_123862;\n                x_123853 = defunc_1_op_res_123863;\n                x_123854 = defunc_1_op_res_123864;\n                x_123855 = defunc_1_op_res_123865;\n                x_123856 = defunc_1_op_res_123866;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_134285)[sext_i32_i64(local_tid_134276)] =\n                    x_123852;\n                ((__local\n                  float *) red_arr_mem_134287)[sext_i32_i64(local_tid_134276)] =\n                    x_123853;\n                ((__local\n                  float *) red_arr_mem_134289)[sext_i32_i64(local_tid_134276)] =\n                    x_123854;\n                ((__local\n                  float *) red_arr_mem_134291)[sext_i32_i64(local_tid_134276)] =\n                    x_123855;\n                ((__local\n                  float *) red_arr_mem_134293)[sext_i32_i64(local_tid_134276)] =\n                    x_123856;\n            }\n        }\n        skip_waves_134296 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_123845 = ((__local\n                                   float *) red_arr_mem_134285)[(int64_t) 0];\n    defunc_2_reduce_res_123846 = ((__local\n                                   float *) red_arr_mem_134287)[(int64_t) 0];\n    defunc_2_reduce_res_123847 = ((__local\n                                   float *) red_arr_mem_134289)[(int64_t) 0];\n    defunc_2_reduce_res_123848 = ((__local\n                                   float *) red_arr_mem_134291)[(int64_t) 0];\n    defunc_2_reduce_res_123849 = ((__local\n                                   float *) red_arr_mem_134293)[(int64_t) 0];\n    \n    float x_123873 = defunc_2_reduce_res_123847 * defunc_2_reduce_res_123849;\n    float y_123874 = defunc_2_reduce_res_123848 * defunc_2_reduce_res_123848;\n    float a12_123875 = x_123873 - y_123874;\n    float x_123876 = defunc_2_r",
                   "educe_res_123847 * defunc_2_reduce_res_123848;\n    float y_123877 = defunc_2_reduce_res_123846 * defunc_2_reduce_res_123849;\n    float b12_123878 = x_123876 - y_123877;\n    float x_123879 = defunc_2_reduce_res_123846 * defunc_2_reduce_res_123848;\n    float y_123880 = defunc_2_reduce_res_123847 * defunc_2_reduce_res_123847;\n    float c12_123881 = x_123879 - y_123880;\n    float x_123882 = defunc_2_reduce_res_123845 * defunc_2_reduce_res_123849;\n    float b2_123883 = x_123882 - y_123880;\n    float x_123884 = defunc_2_reduce_res_123846 * defunc_2_reduce_res_123847;\n    float y_123885 = defunc_2_reduce_res_123845 * defunc_2_reduce_res_123848;\n    float c2_123886 = x_123884 - y_123885;\n    float x_123887 = defunc_2_reduce_res_123845 * a12_123875;\n    float y_123888 = defunc_2_reduce_res_123846 * b12_123878;\n    float x_123889 = x_123887 + y_123888;\n    float y_123890 = defunc_2_reduce_res_123847 * c12_123881;\n    float y_123891 = x_123889 + y_123890;\n    float det_123892 = 1.0F / y_123891;\n    float a12_123893 = a12_123875 * det_123892;\n    float b12_123894 = b12_123878 * det_123892;\n    float c12_123895 = c12_123881 * det_123892;\n    float b2_123896 = b2_123883 * det_123892;\n    float c2_123897 = c2_123886 * det_123892;\n    float defunc_2_reduce_res_123898;\n    float defunc_2_reduce_res_123899;\n    int64_t gtid_123681 = sext_i32_i64(ltid_pre_134280);\n    int32_t phys_tid_123682 = local_tid_134276;\n    __local char *red_arr_mem_134297;\n    \n    red_arr_mem_134297 = (__local char *) red_arr_mem_134297_backing_9;\n    \n    __local char *red_arr_mem_134299;\n    \n    red_arr_mem_134299 = (__local char *) red_arr_mem_134299_backing_10;\n    \n    float x_123907 = ((__local float *) color_132119)[gtid_123681];\n    float x_123908 = ((__local float *) color_132117)[gtid_123681];\n    float x_123909 = ((__local float *) color_132118)[gtid_123681];\n    bool cond_123910 = sle64(x_123818, gtid_123681);\n    float defunc_0_f_res_123911;\n    \n    if (cond_123910) {\n        defunc_0_f_res_12",
                   "3911 = 0.0F;\n    } else {\n        int64_t i_123912 = add64(gtid_123681, x_123820);\n        float x_123913 = ((__global float *) mem_130865)[gtid_123654 *\n                                                         n_114534 + i_123912];\n        \n        defunc_0_f_res_123911 = x_123913;\n    }\n    \n    float x_123914 = a12_123893 * x_123907;\n    float y_123915 = b12_123894 * x_123908;\n    float x_123916 = x_123914 + y_123915;\n    float y_123917 = c12_123895 * x_123909;\n    float x_123918 = x_123916 + y_123917;\n    float defunc_9_fit_fun_res_123919 = defunc_0_f_res_123911 * x_123918;\n    float x_123920 = b12_123894 * x_123907;\n    float y_123921 = b2_123896 * x_123908;\n    float x_123922 = x_123920 + y_123921;\n    float y_123923 = c2_123897 * x_123909;\n    float x_123924 = x_123922 + y_123923;\n    float defunc_9_slope_fun_res_123925 = defunc_0_f_res_123911 * x_123924;\n    \n    ((__local float *) red_arr_mem_134297)[gtid_123681] =\n        defunc_9_fit_fun_res_123919;\n    ((__local float *) red_arr_mem_134299)[gtid_123681] =\n        defunc_9_slope_fun_res_123925;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_134301;\n    int32_t skip_waves_134302 = 1;\n    float x_123900;\n    float x_123901;\n    float x_123902;\n    float x_123903;\n    \n    offset_134301 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_134276, sext_i64_i32(l_window_114538))) {\n            x_123900 = ((__local\n                         float *) red_arr_mem_134297)[sext_i32_i64(local_tid_134276 +\n                                                      offset_134301)];\n            x_123901 = ((__local\n                         float *) red_arr_mem_134299)[sext_i32_i64(local_tid_134276 +\n                                                      offset_134301)];\n        }\n    }\n    offset_134301 = 1;\n    while (slt32(offset_134301, wave_sizze_134278)) {\n        if (slt32(local_tid_134276 + offset_134301,\n                  sext_i64_i32(l_window_114538)) && ((local_tid_",
                   "134276 -\n                                                      squot32(local_tid_134276,\n                                                              wave_sizze_134278) *\n                                                      wave_sizze_134278) & (2 *\n                                                                            offset_134301 -\n                                                                            1)) ==\n            0) {\n            // read array element\n            {\n                x_123902 = ((volatile __local\n                             float *) red_arr_mem_134297)[sext_i32_i64(local_tid_134276 +\n                                                          offset_134301)];\n                x_123903 = ((volatile __local\n                             float *) red_arr_mem_134299)[sext_i32_i64(local_tid_134276 +\n                                                          offset_134301)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_123904 = x_123900 + x_123902;\n                float defunc_1_op_res_123905 = x_123901 + x_123903;\n                \n                x_123900 = defunc_1_op_res_123904;\n                x_123901 = defunc_1_op_res_123905;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_134297)[sext_i32_i64(local_tid_134276)] =\n                    x_123900;\n                ((volatile __local\n                  float *) red_arr_mem_134299)[sext_i32_i64(local_tid_134276)] =\n                    x_123901;\n            }\n        }\n        offset_134301 *= 2;\n    }\n    while (slt32(skip_waves_134302, squot32(sext_i64_i32(l_window_114538) +\n                                            wave_sizze_134278 - 1,\n                                            wave_sizze_134278))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_134301 = skip_waves_134302 * wave_sizze_134278;\n        if (slt32(local_tid_1342",
                   "76 + offset_134301,\n                  sext_i64_i32(l_window_114538)) && ((local_tid_134276 -\n                                                      squot32(local_tid_134276,\n                                                              wave_sizze_134278) *\n                                                      wave_sizze_134278) == 0 &&\n                                                     (squot32(local_tid_134276,\n                                                              wave_sizze_134278) &\n                                                      (2 * skip_waves_134302 -\n                                                       1)) == 0)) {\n            // read array element\n            {\n                x_123902 = ((__local\n                             float *) red_arr_mem_134297)[sext_i32_i64(local_tid_134276 +\n                                                          offset_134301)];\n                x_123903 = ((__local\n                             float *) red_arr_mem_134299)[sext_i32_i64(local_tid_134276 +\n                                                          offset_134301)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_123904 = x_123900 + x_123902;\n                float defunc_1_op_res_123905 = x_123901 + x_123903;\n                \n                x_123900 = defunc_1_op_res_123904;\n                x_123901 = defunc_1_op_res_123905;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_134297)[sext_i32_i64(local_tid_134276)] =\n                    x_123900;\n                ((__local\n                  float *) red_arr_mem_134299)[sext_i32_i64(local_tid_134276)] =\n                    x_123901;\n            }\n        }\n        skip_waves_134302 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_123898 = ((__local\n                                   float *) red_arr_mem_134297)[(int64_t) 0];\n    defunc_2_redu",
                   "ce_res_123899 = ((__local\n                                   float *) red_arr_mem_134299)[(int64_t) 0];\n    if (local_tid_134276 == 0) {\n        ((__global float *) mem_131221)[gtid_123654 * l_n_m_114584 +\n                                        gtid_123655] =\n            defunc_2_reduce_res_123898;\n    }\n    if (local_tid_134276 == 0) {\n        ((__global float *) mem_131225)[gtid_123654 * l_n_m_114584 +\n                                        gtid_123655] =\n            defunc_2_reduce_res_123899;\n    }\n    \n  error_5:\n    return;\n}\n__kernel void mainzisegmap_intragroup_124166(__global int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                                             __local volatile\n                                             int64_t *color_132122_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_132121_backing_aligned_1,\n                                             int64_t m_114533, int64_t n_114534,\n                                             __global\n                                             unsigned char *Y_mem_130086,\n                                             __global\n                                             unsigned char *defunc_3_map_res_mem_130116,\n                                             __global unsigned char *mem_131243,\n                                             __global unsigned char *mem_131256)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict color_132122_backing_1 = (__local volatile\n                                                              char *) color_132122_backing_aligned_0;\n    __local volatile char *restrict color_132121_backing_0 = (__local volatile\n                                                              char *",
                   ") color_132121_backing_aligned_1;\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_134323;\n    int32_t local_tid_134324;\n    int64_t group_sizze_134327;\n    int32_t wave_sizze_134326;\n    int32_t group_tid_134325;\n    \n    global_tid_134323 = get_global_id(0);\n    local_tid_134324 = get_local_id(0);\n    group_sizze_134327 = get_local_size(0);\n    wave_sizze_134326 = LOCKSTEP_WIDTH;\n    group_tid_134325 = get_group_id(0);\n    \n    int32_t phys_tid_124166 = group_tid_134325;\n    int32_t ltid_pre_134328 = local_tid_134324;\n    int64_t slice_134329 = m_114533;\n    int64_t gtid_124146 = sext_i32_i64(group_tid_134325);\n    int64_t remnant_134330 = sext_i32_i64(group_tid_134325) - gtid_124146;\n    __local char *color_132121;\n    \n    color_132121 = (__local char *) color_132121_backing_0;\n    \n    __local char *color_132122;\n    \n    color_132122 = (__local char *) color_132122_backing_1;\n    \n    int64_t gtid_124149 = sext_i32_i64(ltid_pre_134328);\n    int32_t phys_tid_124150 = local_tid_134324;\n    float x_124180 = ((__global float *) Y_mem_130086)[gtid_124146 * n_114534 +\n                                                       gtid_124149];\n    float x_124181 = ((__global float *) mem_131243)[gtid_124146 * n_114534 +\n                                                     gtid_124149];\n    float defunc_1_f_res_124182 = x_124180 - x_124181;\n    \n    ((__local float *) color_132122)[gtid_124149] = defunc_1_f_res_124182;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_124154 = sext_i32_i64(ltid_pre_134328);\n    int32_t phys_tid_124155 = local_tid_134324;\n    int64_t x_124184 = ((__global\n                         int64_t *) defunc_3_map_res_mem_130116)[gtid_124146 *\n                                                                 n_114534 +\n                 ",
                   "                                                gtid_124154];\n    bool cond_124185 = sle64((int64_t) 0, x_124184);\n    float defunc_0_f_res_124186;\n    \n    if (cond_124185) {\n        bool y_124187 = slt64(x_124184, n_114534);\n        bool bounds_check_124188 = cond_124185 && y_124187;\n        bool index_certs_124189;\n        \n        if (!bounds_check_124188) {\n            {\n                if (atomic_cmpxchg_i32_global(global_failure, -1, 84) == -1) {\n                    global_failure_args[0] = x_124184;\n                    global_failure_args[1] = n_114534;\n                    ;\n                }\n                local_failure = true;\n                goto error_1;\n            }\n        }\n        \n        float defunc_0_f_res_t_res_124190 = ((__local\n                                              float *) color_132122)[x_124184];\n        \n        defunc_0_f_res_124186 = defunc_0_f_res_t_res_124190;\n    } else {\n        defunc_0_f_res_124186 = 0.0F;\n    }\n    ((__local float *) color_132121)[gtid_124154] = defunc_0_f_res_124186;\n    \n  error_1:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    ((__global float *) mem_131256)[gtid_124146 * n_114534 +\n                                    sext_i32_i64(local_tid_134324)] = ((__local\n                                                                        float *) color_132121)[sext_i32_i64(local_tid_134324)];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_126827(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_135024_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_135020_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *",
                   "color_132128_backing_aligned_2,\n                                             int64_t m_114533, int64_t n_114534,\n                                             int64_t t_window_114537,\n                                             int64_t t_jump_114541,\n                                             int64_t t_n_m_114591,\n                                             int64_t i_114610, __global\n                                             unsigned char *defunc_3_map_res_mem_130117,\n                                             __global unsigned char *mem_130122,\n                                             __global\n                                             unsigned char *defunc_3_map_res_mem_130606,\n                                             __global\n                                             unsigned char *defunc_3_map_res_mem_130607,\n                                             __global unsigned char *mem_130861,\n                                             __global\n                                             unsigned char *defunc_4_map_res_mem_131267,\n                                             __global unsigned char *mem_131586)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_135024_backing_2 =\n                          (__local volatile\n                           char *) red_arr_mem_135024_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_135020_backing_1 =\n                          (__local volatile\n                           char *) red_arr_mem_135020_backing_aligned_1;\n    __local volatile char *restrict color_132128_backing_0 = (__local volatile\n                                                              char *) color_132128_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_135010;\n    int32_t local_tid_135011;\n    int64_t group_sizze_135014;\n    int32_t wave_sizze_135013;\n    int32_t group_tid_135012",
                   ";\n    \n    global_tid_135010 = get_global_id(0);\n    local_tid_135011 = get_local_id(0);\n    group_sizze_135014 = get_local_size(0);\n    wave_sizze_135013 = LOCKSTEP_WIDTH;\n    group_tid_135012 = get_group_id(0);\n    \n    int32_t phys_tid_126827 = group_tid_135012;\n    int32_t ltid_pre_135015 = local_tid_135011;\n    int64_t slice_135016 = t_n_m_114591;\n    int64_t slice_135017 = m_114533 * slice_135016;\n    int64_t gtid_126815 = squot64(sext_i32_i64(group_tid_135012), slice_135016);\n    int64_t remnant_135018 = sext_i32_i64(group_tid_135012) - gtid_126815 *\n            slice_135016;\n    int64_t gtid_126816 = remnant_135018;\n    int64_t remnant_135019 = remnant_135018 - gtid_126816;\n    __local char *color_132128;\n    \n    color_132128 = (__local char *) color_132128_backing_0;\n    \n    int64_t x_126892 = ((__global\n                         int64_t *) defunc_3_map_res_mem_130117)[gtid_126815];\n    int64_t x_126894 = ((__global\n                         int64_t *) defunc_3_map_res_mem_130606)[gtid_126815 *\n                                                                 t_n_m_114591 +\n                                                                 gtid_126816];\n    float x_126895 = ((__global\n                       float *) defunc_3_map_res_mem_130607)[gtid_126815 *\n                                                             t_n_m_114591 +\n                                                             gtid_126816];\n    int64_t min_arg_126896 = mul64(t_jump_114541, gtid_126816);\n    int64_t min_res_126897 = smin64(i_114610, min_arg_126896);\n    float defunc_0_f_res_126898 = sitofp_i64_f32(min_res_126897);\n    float defunc_2_reduce_res_126899;\n    int64_t gtid_126820 = sext_i32_i64(ltid_pre_135015);\n    int32_t phys_tid_126821 = local_tid_135011;\n    __local char *red_arr_mem_135020;\n    \n    red_arr_mem_135020 = (__local char *) red_arr_mem_135020_backing_1;\n    \n    bool cond_126905 = sle64(x_126892, gtid_126820);\n    float defunc_0_f_res_126906;\n    \n    if (cond_1269",
                   "05) {\n        defunc_0_f_res_126906 = 0.0F;\n    } else {\n        int64_t i_126907 = add64(gtid_126820, x_126894);\n        float x_126908 = ((__global float *) mem_130122)[gtid_126815 *\n                                                         n_114534 + i_126907];\n        float defunc_0_f_res_f_res_126909 = 1.0F + x_126908;\n        \n        defunc_0_f_res_126906 = defunc_0_f_res_f_res_126909;\n    }\n    \n    float defunc_0_f_res_126910;\n    \n    if (cond_126905) {\n        defunc_0_f_res_126910 = 0.0F;\n    } else {\n        int64_t i_126911 = add64(gtid_126820, x_126894);\n        float x_126912 = ((__global float *) mem_130861)[gtid_126815 *\n                                                         n_114534 + i_126911];\n        \n        defunc_0_f_res_126910 = x_126912;\n    }\n    \n    float x_j_126913 = defunc_0_f_res_126906 - defunc_0_f_res_126898;\n    float abs_res_126914 = (float) fabs(x_j_126913);\n    float tmp1_126915 = abs_res_126914 / x_126895;\n    float x_126916 = tmp1_126915 * tmp1_126915;\n    float y_126917 = tmp1_126915 * x_126916;\n    float tmp2_126918 = 1.0F - y_126917;\n    float x_126919 = tmp2_126918 * tmp2_126918;\n    float tmp3_126920 = tmp2_126918 * x_126919;\n    float tmp4_126921 = defunc_0_f_res_126910 * tmp3_126920;\n    \n    ((__local float *) red_arr_mem_135020)[gtid_126820] = tmp4_126921;\n    ((__local float *) color_132128)[gtid_126820] = tmp4_126921;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_135022;\n    int32_t skip_waves_135023 = 1;\n    float x_126901;\n    float x_126902;\n    \n    offset_135022 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_135011, sext_i64_i32(t_window_114537))) {\n            x_126901 = ((__local\n                         float *) red_arr_mem_135020)[sext_i32_i64(local_tid_135011 +\n                                                      offset_135022)];\n        }\n    }\n    offset_135022 = 1;\n    while (slt32(offset_135022, wave_sizze_135013)) {\n        if (slt32(local_t",
                   "id_135011 + offset_135022,\n                  sext_i64_i32(t_window_114537)) && ((local_tid_135011 -\n                                                      squot32(local_tid_135011,\n                                                              wave_sizze_135013) *\n                                                      wave_sizze_135013) & (2 *\n                                                                            offset_135022 -\n                                                                            1)) ==\n            0) {\n            // read array element\n            {\n                x_126902 = ((volatile __local\n                             float *) red_arr_mem_135020)[sext_i32_i64(local_tid_135011 +\n                                                          offset_135022)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_126903 = x_126901 + x_126902;\n                \n                x_126901 = defunc_1_op_res_126903;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_135020)[sext_i32_i64(local_tid_135011)] =\n                    x_126901;\n            }\n        }\n        offset_135022 *= 2;\n    }\n    while (slt32(skip_waves_135023, squot32(sext_i64_i32(t_window_114537) +\n                                            wave_sizze_135013 - 1,\n                                            wave_sizze_135013))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_135022 = skip_waves_135023 * wave_sizze_135013;\n        if (slt32(local_tid_135011 + offset_135022,\n                  sext_i64_i32(t_window_114537)) && ((local_tid_135011 -\n                                                      squot32(local_tid_135011,\n                                                              wave_sizze_135013) *\n                                                      wave_sizze_135013) == 0 &&\n                                                ",
                   "     (squot32(local_tid_135011,\n                                                              wave_sizze_135013) &\n                                                      (2 * skip_waves_135023 -\n                                                       1)) == 0)) {\n            // read array element\n            {\n                x_126902 = ((__local\n                             float *) red_arr_mem_135020)[sext_i32_i64(local_tid_135011 +\n                                                          offset_135022)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_126903 = x_126901 + x_126902;\n                \n                x_126901 = defunc_1_op_res_126903;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_135020)[sext_i32_i64(local_tid_135011)] =\n                    x_126901;\n            }\n        }\n        skip_waves_135023 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_126899 = ((__local\n                                   float *) red_arr_mem_135020)[(int64_t) 0];\n    \n    float a0_126922 = 1.0F / defunc_2_reduce_res_126899;\n    float defunc_2_reduce_res_126923;\n    int64_t gtid_126822 = sext_i32_i64(ltid_pre_135015);\n    int32_t phys_tid_126823 = local_tid_135011;\n    __local char *red_arr_mem_135024;\n    \n    red_arr_mem_135024 = (__local char *) red_arr_mem_135024_backing_2;\n    \n    float x_126928 = ((__local float *) color_132128)[gtid_126822];\n    bool cond_126929 = sle64(x_126892, gtid_126822);\n    float defunc_0_f_res_126930;\n    \n    if (cond_126929) {\n        defunc_0_f_res_126930 = 0.0F;\n    } else {\n        int64_t i_126931 = add64(gtid_126822, x_126894);\n        float x_126932 = ((__global\n                           float *) defunc_4_map_res_mem_131267)[gtid_126815 *\n                                                                 n_114534 +\n                                                      ",
                   "           i_126931];\n        \n        defunc_0_f_res_126930 = x_126932;\n    }\n    \n    float x_126933 = a0_126922 * x_126928;\n    float defunc_9_fit_fun_res_126934 = defunc_0_f_res_126930 * x_126933;\n    \n    ((__local float *) red_arr_mem_135024)[gtid_126822] =\n        defunc_9_fit_fun_res_126934;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_135026;\n    int32_t skip_waves_135027 = 1;\n    float x_126924;\n    float x_126925;\n    \n    offset_135026 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_135011, sext_i64_i32(t_window_114537))) {\n            x_126924 = ((__local\n                         float *) red_arr_mem_135024)[sext_i32_i64(local_tid_135011 +\n                                                      offset_135026)];\n        }\n    }\n    offset_135026 = 1;\n    while (slt32(offset_135026, wave_sizze_135013)) {\n        if (slt32(local_tid_135011 + offset_135026,\n                  sext_i64_i32(t_window_114537)) && ((local_tid_135011 -\n                                                      squot32(local_tid_135011,\n                                                              wave_sizze_135013) *\n                                                      wave_sizze_135013) & (2 *\n                                                                            offset_135026 -\n                                                                            1)) ==\n            0) {\n            // read array element\n            {\n                x_126925 = ((volatile __local\n                             float *) red_arr_mem_135024)[sext_i32_i64(local_tid_135011 +\n                                                          offset_135026)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_126926 = x_126924 + x_126925;\n                \n                x_126924 = defunc_1_op_res_126926;\n            }\n            // write result of operation\n            {\n                ((volati",
                   "le __local\n                  float *) red_arr_mem_135024)[sext_i32_i64(local_tid_135011)] =\n                    x_126924;\n            }\n        }\n        offset_135026 *= 2;\n    }\n    while (slt32(skip_waves_135027, squot32(sext_i64_i32(t_window_114537) +\n                                            wave_sizze_135013 - 1,\n                                            wave_sizze_135013))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_135026 = skip_waves_135027 * wave_sizze_135013;\n        if (slt32(local_tid_135011 + offset_135026,\n                  sext_i64_i32(t_window_114537)) && ((local_tid_135011 -\n                                                      squot32(local_tid_135011,\n                                                              wave_sizze_135013) *\n                                                      wave_sizze_135013) == 0 &&\n                                                     (squot32(local_tid_135011,\n                                                              wave_sizze_135013) &\n                                                      (2 * skip_waves_135027 -\n                                                       1)) == 0)) {\n            // read array element\n            {\n                x_126925 = ((__local\n                             float *) red_arr_mem_135024)[sext_i32_i64(local_tid_135011 +\n                                                          offset_135026)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_126926 = x_126924 + x_126925;\n                \n                x_126924 = defunc_1_op_res_126926;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_135024)[sext_i32_i64(local_tid_135011)] =\n                    x_126924;\n            }\n        }\n        skip_waves_135027 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_126923 = ((__local\n                              ",
                   "     float *) red_arr_mem_135024)[(int64_t) 0];\n    if (local_tid_135011 == 0) {\n        ((__global float *) mem_131586)[gtid_126815 * t_n_m_114591 +\n                                        gtid_126816] =\n            defunc_2_reduce_res_126923;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_126956(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_135048_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_135046_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *red_arr_mem_135042_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_135040_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_135038_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_132130_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *color_132129_backing_aligned_6,\n                                             int64_t m_114533, int64_t n_114534,\n                                             int64_t t_window_114537,\n                                             int64_t t_jump_114541,\n                                             int64_t t_n_m_114591,\n                                             int64_t i_114610, __global\n                                             unsigned char *defunc_3_map_res_mem_130117,\n                                             __global unsigned char *mem_130122,\n                                             __glo",
                   "bal\n                                             unsigned char *defunc_3_map_res_mem_130606,\n                                             __global\n                                             unsigned char *defunc_3_map_res_mem_130607,\n                                             __global unsigned char *mem_130861,\n                                             __global\n                                             unsigned char *defunc_4_map_res_mem_131267,\n                                             __global unsigned char *mem_131599,\n                                             __global unsigned char *mem_131603)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_135048_backing_6 =\n                          (__local volatile\n                           char *) red_arr_mem_135048_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_135046_backing_5 =\n                          (__local volatile\n                           char *) red_arr_mem_135046_backing_aligned_1;\n    __local volatile char *restrict red_arr_mem_135042_backing_4 =\n                          (__local volatile\n                           char *) red_arr_mem_135042_backing_aligned_2;\n    __local volatile char *restrict red_arr_mem_135040_backing_3 =\n                          (__local volatile\n                           char *) red_arr_mem_135040_backing_aligned_3;\n    __local volatile char *restrict red_arr_mem_135038_backing_2 =\n                          (__local volatile\n                           char *) red_arr_mem_135038_backing_aligned_4;\n    __local volatile char *restrict color_132130_backing_1 = (__local volatile\n                                                              char *) color_132130_backing_aligned_5;\n    __local volatile char *restrict color_132129_backing_0 = (__local volatile\n                                                              char *) color_132129_backing_aligned_6;\n    ",
                   "\n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_135028;\n    int32_t local_tid_135029;\n    int64_t group_sizze_135032;\n    int32_t wave_sizze_135031;\n    int32_t group_tid_135030;\n    \n    global_tid_135028 = get_global_id(0);\n    local_tid_135029 = get_local_id(0);\n    group_sizze_135032 = get_local_size(0);\n    wave_sizze_135031 = LOCKSTEP_WIDTH;\n    group_tid_135030 = get_group_id(0);\n    \n    int32_t phys_tid_126956 = group_tid_135030;\n    int32_t ltid_pre_135033 = local_tid_135029;\n    int64_t slice_135034 = t_n_m_114591;\n    int64_t slice_135035 = m_114533 * slice_135034;\n    int64_t gtid_126944 = squot64(sext_i32_i64(group_tid_135030), slice_135034);\n    int64_t remnant_135036 = sext_i32_i64(group_tid_135030) - gtid_126944 *\n            slice_135034;\n    int64_t gtid_126945 = remnant_135036;\n    int64_t remnant_135037 = remnant_135036 - gtid_126945;\n    __local char *color_132129;\n    \n    color_132129 = (__local char *) color_132129_backing_0;\n    \n    __local char *color_132130;\n    \n    color_132130 = (__local char *) color_132130_backing_1;\n    \n    int64_t x_127052 = ((__global\n                         int64_t *) defunc_3_map_res_mem_130117)[gtid_126944];\n    int64_t x_127054 = ((__global\n                         int64_t *) defunc_3_map_res_mem_130606)[gtid_126944 *\n                                                                 t_n_m_114591 +\n                                                                 gtid_126945];\n    float x_127055 = ((__global\n                       float *) defunc_3_map_res_mem_130607)[gtid_126944 *\n                                                             t_n_m_114591 +\n                                                             gtid_126945];\n    int64_t min_arg_127056 = mul64(t_jump_114541, gtid_126945);\n    int64_t min_res_127057 = smin64(i_114610, min_arg_127056);\n    float defunc_0_f_res_127058 = sitofp_i64_f32(min_res_127057);\n    float defunc_2_reduce_res_127059;\n    float defunc_2_reduce_r",
                   "es_127060;\n    float defunc_2_reduce_res_127061;\n    int64_t gtid_126949 = sext_i32_i64(ltid_pre_135033);\n    int32_t phys_tid_126950 = local_tid_135029;\n    __local char *red_arr_mem_135038;\n    \n    red_arr_mem_135038 = (__local char *) red_arr_mem_135038_backing_2;\n    \n    __local char *red_arr_mem_135040;\n    \n    red_arr_mem_135040 = (__local char *) red_arr_mem_135040_backing_3;\n    \n    __local char *red_arr_mem_135042;\n    \n    red_arr_mem_135042 = (__local char *) red_arr_mem_135042_backing_4;\n    \n    bool cond_127074 = sle64(x_127052, gtid_126949);\n    float defunc_0_f_res_127075;\n    \n    if (cond_127074) {\n        defunc_0_f_res_127075 = 0.0F;\n    } else {\n        int64_t i_127076 = add64(gtid_126949, x_127054);\n        float x_127077 = ((__global float *) mem_130122)[gtid_126944 *\n                                                         n_114534 + i_127076];\n        float defunc_0_f_res_f_res_127078 = 1.0F + x_127077;\n        \n        defunc_0_f_res_127075 = defunc_0_f_res_f_res_127078;\n    }\n    \n    float defunc_0_f_res_127079;\n    \n    if (cond_127074) {\n        defunc_0_f_res_127079 = 0.0F;\n    } else {\n        int64_t i_127080 = add64(gtid_126949, x_127054);\n        float x_127081 = ((__global float *) mem_130861)[gtid_126944 *\n                                                         n_114534 + i_127080];\n        \n        defunc_0_f_res_127079 = x_127081;\n    }\n    \n    float x_j_127082 = defunc_0_f_res_127075 - defunc_0_f_res_127058;\n    float abs_res_127083 = (float) fabs(x_j_127082);\n    float tmp1_127084 = abs_res_127083 / x_127055;\n    float x_127085 = tmp1_127084 * tmp1_127084;\n    float y_127086 = tmp1_127084 * x_127085;\n    float tmp2_127087 = 1.0F - y_127086;\n    float x_127088 = tmp2_127087 * tmp2_127087;\n    float tmp3_127089 = tmp2_127087 * x_127088;\n    float tmp4_127090 = defunc_0_f_res_127079 * tmp3_127089;\n    float defunc_1_f_res_127091 = x_j_127082 * tmp4_127090;\n    float defunc_1_f_res_127092 = x_j_127082 * defunc_1_f_res_1270",
                   "91;\n    \n    ((__local float *) red_arr_mem_135038)[gtid_126949] = tmp4_127090;\n    ((__local float *) red_arr_mem_135040)[gtid_126949] = defunc_1_f_res_127091;\n    ((__local float *) red_arr_mem_135042)[gtid_126949] = defunc_1_f_res_127092;\n    ((__local float *) color_132130)[gtid_126949] = defunc_1_f_res_127091;\n    ((__local float *) color_132129)[gtid_126949] = tmp4_127090;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_135044;\n    int32_t skip_waves_135045 = 1;\n    float x_127064;\n    float x_127065;\n    float x_127066;\n    float x_127067;\n    float x_127068;\n    float x_127069;\n    \n    offset_135044 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_135029, sext_i64_i32(t_window_114537))) {\n            x_127064 = ((__local\n                         float *) red_arr_mem_135038)[sext_i32_i64(local_tid_135029 +\n                                                      offset_135044)];\n            x_127065 = ((__local\n                         float *) red_arr_mem_135040)[sext_i32_i64(local_tid_135029 +\n                                                      offset_135044)];\n            x_127066 = ((__local\n                         float *) red_arr_mem_135042)[sext_i32_i64(local_tid_135029 +\n                                                      offset_135044)];\n        }\n    }\n    offset_135044 = 1;\n    while (slt32(offset_135044, wave_sizze_135031)) {\n        if (slt32(local_tid_135029 + offset_135044,\n                  sext_i64_i32(t_window_114537)) && ((local_tid_135029 -\n                                                      squot32(local_tid_135029,\n                                                              wave_sizze_135031) *\n                                                      wave_sizze_135031) & (2 *\n                                                                            offset_135044 -\n                                                                            1)) ==\n            0) {\n            // r",
                   "ead array element\n            {\n                x_127067 = ((volatile __local\n                             float *) red_arr_mem_135038)[sext_i32_i64(local_tid_135029 +\n                                                          offset_135044)];\n                x_127068 = ((volatile __local\n                             float *) red_arr_mem_135040)[sext_i32_i64(local_tid_135029 +\n                                                          offset_135044)];\n                x_127069 = ((volatile __local\n                             float *) red_arr_mem_135042)[sext_i32_i64(local_tid_135029 +\n                                                          offset_135044)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_127070 = x_127064 + x_127067;\n                float defunc_1_op_res_127071 = x_127065 + x_127068;\n                float defunc_1_op_res_127072 = x_127066 + x_127069;\n                \n                x_127064 = defunc_1_op_res_127070;\n                x_127065 = defunc_1_op_res_127071;\n                x_127066 = defunc_1_op_res_127072;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_135038)[sext_i32_i64(local_tid_135029)] =\n                    x_127064;\n                ((volatile __local\n                  float *) red_arr_mem_135040)[sext_i32_i64(local_tid_135029)] =\n                    x_127065;\n                ((volatile __local\n                  float *) red_arr_mem_135042)[sext_i32_i64(local_tid_135029)] =\n                    x_127066;\n            }\n        }\n        offset_135044 *= 2;\n    }\n    while (slt32(skip_waves_135045, squot32(sext_i64_i32(t_window_114537) +\n                                            wave_sizze_135031 - 1,\n                                            wave_sizze_135031))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_135044 = skip_waves_135045 * wave_sizze_135031;\n        if (slt3",
                   "2(local_tid_135029 + offset_135044,\n                  sext_i64_i32(t_window_114537)) && ((local_tid_135029 -\n                                                      squot32(local_tid_135029,\n                                                              wave_sizze_135031) *\n                                                      wave_sizze_135031) == 0 &&\n                                                     (squot32(local_tid_135029,\n                                                              wave_sizze_135031) &\n                                                      (2 * skip_waves_135045 -\n                                                       1)) == 0)) {\n            // read array element\n            {\n                x_127067 = ((__local\n                             float *) red_arr_mem_135038)[sext_i32_i64(local_tid_135029 +\n                                                          offset_135044)];\n                x_127068 = ((__local\n                             float *) red_arr_mem_135040)[sext_i32_i64(local_tid_135029 +\n                                                          offset_135044)];\n                x_127069 = ((__local\n                             float *) red_arr_mem_135042)[sext_i32_i64(local_tid_135029 +\n                                                          offset_135044)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_127070 = x_127064 + x_127067;\n                float defunc_1_op_res_127071 = x_127065 + x_127068;\n                float defunc_1_op_res_127072 = x_127066 + x_127069;\n                \n                x_127064 = defunc_1_op_res_127070;\n                x_127065 = defunc_1_op_res_127071;\n                x_127066 = defunc_1_op_res_127072;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_135038)[sext_i32_i64(local_tid_135029)] =\n                    x_127064;\n                ((__local\n        ",
                   "          float *) red_arr_mem_135040)[sext_i32_i64(local_tid_135029)] =\n                    x_127065;\n                ((__local\n                  float *) red_arr_mem_135042)[sext_i32_i64(local_tid_135029)] =\n                    x_127066;\n            }\n        }\n        skip_waves_135045 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_127059 = ((__local\n                                   float *) red_arr_mem_135038)[(int64_t) 0];\n    defunc_2_reduce_res_127060 = ((__local\n                                   float *) red_arr_mem_135040)[(int64_t) 0];\n    defunc_2_reduce_res_127061 = ((__local\n                                   float *) red_arr_mem_135042)[(int64_t) 0];\n    \n    float x_127093 = defunc_2_reduce_res_127059 * defunc_2_reduce_res_127061;\n    float y_127094 = defunc_2_reduce_res_127060 * defunc_2_reduce_res_127060;\n    float y_127095 = x_127093 - y_127094;\n    float det1_127096 = 1.0F / y_127095;\n    float a11_127097 = defunc_2_reduce_res_127061 * det1_127096;\n    float negate_arg_127098 = defunc_2_reduce_res_127060 * det1_127096;\n    float b11_127099 = 0.0F - negate_arg_127098;\n    float c11_127100 = defunc_2_reduce_res_127059 * det1_127096;\n    float defunc_2_reduce_res_127101;\n    float defunc_2_reduce_res_127102;\n    int64_t gtid_126951 = sext_i32_i64(ltid_pre_135033);\n    int32_t phys_tid_126952 = local_tid_135029;\n    __local char *red_arr_mem_135046;\n    \n    red_arr_mem_135046 = (__local char *) red_arr_mem_135046_backing_5;\n    \n    __local char *red_arr_mem_135048;\n    \n    red_arr_mem_135048 = (__local char *) red_arr_mem_135048_backing_6;\n    \n    float x_127110 = ((__local float *) color_132129)[gtid_126951];\n    float x_127111 = ((__local float *) color_132130)[gtid_126951];\n    bool cond_127112 = sle64(x_127052, gtid_126951);\n    float defunc_0_f_res_127113;\n    \n    if (cond_127112) {\n        defunc_0_f_res_127113 = 0.0F;\n    } else {\n        int64_t i_127114 = add64(gtid_126951, x_127054);\n        float x_127115 = ((",
                   "__global\n                           float *) defunc_4_map_res_mem_131267)[gtid_126944 *\n                                                                 n_114534 +\n                                                                 i_127114];\n        \n        defunc_0_f_res_127113 = x_127115;\n    }\n    \n    float x_127116 = a11_127097 * x_127110;\n    float y_127117 = b11_127099 * x_127111;\n    float x_127118 = x_127116 + y_127117;\n    float defunc_9_fit_fun_res_127119 = defunc_0_f_res_127113 * x_127118;\n    float x_127120 = b11_127099 * x_127110;\n    float y_127121 = c11_127100 * x_127111;\n    float x_127122 = x_127120 + y_127121;\n    float defunc_9_slope_fun_res_127123 = defunc_0_f_res_127113 * x_127122;\n    \n    ((__local float *) red_arr_mem_135046)[gtid_126951] =\n        defunc_9_fit_fun_res_127119;\n    ((__local float *) red_arr_mem_135048)[gtid_126951] =\n        defunc_9_slope_fun_res_127123;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_135050;\n    int32_t skip_waves_135051 = 1;\n    float x_127103;\n    float x_127104;\n    float x_127105;\n    float x_127106;\n    \n    offset_135050 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_135029, sext_i64_i32(t_window_114537))) {\n            x_127103 = ((__local\n                         float *) red_arr_mem_135046)[sext_i32_i64(local_tid_135029 +\n                                                      offset_135050)];\n            x_127104 = ((__local\n                         float *) red_arr_mem_135048)[sext_i32_i64(local_tid_135029 +\n                                                      offset_135050)];\n        }\n    }\n    offset_135050 = 1;\n    while (slt32(offset_135050, wave_sizze_135031)) {\n        if (slt32(local_tid_135029 + offset_135050,\n                  sext_i64_i32(t_window_114537)) && ((local_tid_135029 -\n                                                      squot32(local_tid_135029,\n                                                              wave_sizze_1",
                   "35031) *\n                                                      wave_sizze_135031) & (2 *\n                                                                            offset_135050 -\n                                                                            1)) ==\n            0) {\n            // read array element\n            {\n                x_127105 = ((volatile __local\n                             float *) red_arr_mem_135046)[sext_i32_i64(local_tid_135029 +\n                                                          offset_135050)];\n                x_127106 = ((volatile __local\n                             float *) red_arr_mem_135048)[sext_i32_i64(local_tid_135029 +\n                                                          offset_135050)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_127107 = x_127103 + x_127105;\n                float defunc_1_op_res_127108 = x_127104 + x_127106;\n                \n                x_127103 = defunc_1_op_res_127107;\n                x_127104 = defunc_1_op_res_127108;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_135046)[sext_i32_i64(local_tid_135029)] =\n                    x_127103;\n                ((volatile __local\n                  float *) red_arr_mem_135048)[sext_i32_i64(local_tid_135029)] =\n                    x_127104;\n            }\n        }\n        offset_135050 *= 2;\n    }\n    while (slt32(skip_waves_135051, squot32(sext_i64_i32(t_window_114537) +\n                                            wave_sizze_135031 - 1,\n                                            wave_sizze_135031))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_135050 = skip_waves_135051 * wave_sizze_135031;\n        if (slt32(local_tid_135029 + offset_135050,\n                  sext_i64_i32(t_window_114537)) && ((local_tid_135029 -\n                                                      squot32(local_ti",
                   "d_135029,\n                                                              wave_sizze_135031) *\n                                                      wave_sizze_135031) == 0 &&\n                                                     (squot32(local_tid_135029,\n                                                              wave_sizze_135031) &\n                                                      (2 * skip_waves_135051 -\n                                                       1)) == 0)) {\n            // read array element\n            {\n                x_127105 = ((__local\n                             float *) red_arr_mem_135046)[sext_i32_i64(local_tid_135029 +\n                                                          offset_135050)];\n                x_127106 = ((__local\n                             float *) red_arr_mem_135048)[sext_i32_i64(local_tid_135029 +\n                                                          offset_135050)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_127107 = x_127103 + x_127105;\n                float defunc_1_op_res_127108 = x_127104 + x_127106;\n                \n                x_127103 = defunc_1_op_res_127107;\n                x_127104 = defunc_1_op_res_127108;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_135046)[sext_i32_i64(local_tid_135029)] =\n                    x_127103;\n                ((__local\n                  float *) red_arr_mem_135048)[sext_i32_i64(local_tid_135029)] =\n                    x_127104;\n            }\n        }\n        skip_waves_135051 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_127101 = ((__local\n                                   float *) red_arr_mem_135046)[(int64_t) 0];\n    defunc_2_reduce_res_127102 = ((__local\n                                   float *) red_arr_mem_135048)[(int64_t) 0];\n    if (local_tid_135029 == 0) {\n        ((__global float *",
                   ") mem_131599)[gtid_126944 * t_n_m_114591 +\n                                        gtid_126945] =\n            defunc_2_reduce_res_127101;\n    }\n    if (local_tid_135029 == 0) {\n        ((__global float *) mem_131603)[gtid_126944 * t_n_m_114591 +\n                                        gtid_126945] =\n            defunc_2_reduce_res_127102;\n    }\n    \n  error_4:\n    return;\n}\n__kernel void mainzisegmap_intragroup_127166(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *red_arr_mem_135076_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *red_arr_mem_135074_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *red_arr_mem_135070_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *red_arr_mem_135068_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *red_arr_mem_135066_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *red_arr_mem_135064_backing_aligned_5,\n                                             __local volatile\n                                             int64_t *red_arr_mem_135062_backing_aligned_6,\n                                             __local volatile\n                                             int64_t *color_132134_backing_aligned_7,\n                                             __local volatile\n                                             int64_t *color_132133_backing_aligned_8,\n                                             __local volatile\n                                             int64_t *color_132132_backing_aligned_9,\n                          ",
                   "                   __local volatile\n                                             int64_t *color_132131_backing_aligned_10,\n                                             int64_t m_114533, int64_t n_114534,\n                                             int64_t t_window_114537,\n                                             int64_t t_jump_114541,\n                                             int64_t t_n_m_114591,\n                                             int64_t i_114610, __global\n                                             unsigned char *defunc_3_map_res_mem_130117,\n                                             __global unsigned char *mem_130122,\n                                             __global\n                                             unsigned char *defunc_3_map_res_mem_130606,\n                                             __global\n                                             unsigned char *defunc_3_map_res_mem_130607,\n                                             __global unsigned char *mem_130861,\n                                             __global\n                                             unsigned char *defunc_4_map_res_mem_131267,\n                                             __global unsigned char *mem_131623,\n                                             __global unsigned char *mem_131627)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_135076_backing_10 =\n                          (__local volatile\n                           char *) red_arr_mem_135076_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_135074_backing_9 =\n                          (__local volatile\n                           char *) red_arr_mem_135074_backing_aligned_1;\n    __local volatile char *restrict red_arr_mem_135070_backing_8 =\n                          (__local volatile\n                           char *) red_arr_mem_135070_backing_aligned_2;\n    __local volatile char *restr",
                   "ict red_arr_mem_135068_backing_7 =\n                          (__local volatile\n                           char *) red_arr_mem_135068_backing_aligned_3;\n    __local volatile char *restrict red_arr_mem_135066_backing_6 =\n                          (__local volatile\n                           char *) red_arr_mem_135066_backing_aligned_4;\n    __local volatile char *restrict red_arr_mem_135064_backing_5 =\n                          (__local volatile\n                           char *) red_arr_mem_135064_backing_aligned_5;\n    __local volatile char *restrict red_arr_mem_135062_backing_4 =\n                          (__local volatile\n                           char *) red_arr_mem_135062_backing_aligned_6;\n    __local volatile char *restrict color_132134_backing_3 = (__local volatile\n                                                              char *) color_132134_backing_aligned_7;\n    __local volatile char *restrict color_132133_backing_2 = (__local volatile\n                                                              char *) color_132133_backing_aligned_8;\n    __local volatile char *restrict color_132132_backing_1 = (__local volatile\n                                                              char *) color_132132_backing_aligned_9;\n    __local volatile char *restrict color_132131_backing_0 = (__local volatile\n                                                              char *) color_132131_backing_aligned_10;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_135052;\n    int32_t local_tid_135053;\n    int64_t group_sizze_135056;\n    int32_t wave_sizze_135055;\n    int32_t group_tid_135054;\n    \n    global_tid_135052 = get_global_id(0);\n    local_tid_135053 = get_local_id(0);\n    group_sizze_135056 = get_local_size(0);\n    wave_sizze_135055 = LOCKSTEP_WIDTH;\n    group_tid_135054 = get_group_id(0);\n    \n    int32_t phys_tid_127166 = group_tid_135054;\n    int32_t ltid_pre_135057 = local_tid_135053;\n    int64_t slice_135058 = t_n_m_114591;\n    int6",
                   "4_t slice_135059 = m_114533 * slice_135058;\n    int64_t gtid_127134 = squot64(sext_i32_i64(group_tid_135054), slice_135058);\n    int64_t remnant_135060 = sext_i32_i64(group_tid_135054) - gtid_127134 *\n            slice_135058;\n    int64_t gtid_127135 = remnant_135060;\n    int64_t remnant_135061 = remnant_135060 - gtid_127135;\n    __local char *color_132131;\n    \n    color_132131 = (__local char *) color_132131_backing_0;\n    \n    __local char *color_132132;\n    \n    color_132132 = (__local char *) color_132132_backing_1;\n    \n    __local char *color_132133;\n    \n    color_132133 = (__local char *) color_132133_backing_2;\n    \n    __local char *color_132134;\n    \n    color_132134 = (__local char *) color_132134_backing_3;\n    \n    int64_t x_127298 = ((__global\n                         int64_t *) defunc_3_map_res_mem_130117)[gtid_127134];\n    int64_t x_127300 = ((__global\n                         int64_t *) defunc_3_map_res_mem_130606)[gtid_127134 *\n                                                                 t_n_m_114591 +\n                                                                 gtid_127135];\n    float x_127301 = ((__global\n                       float *) defunc_3_map_res_mem_130607)[gtid_127134 *\n                                                             t_n_m_114591 +\n                                                             gtid_127135];\n    int64_t min_arg_127302 = mul64(t_jump_114541, gtid_127135);\n    int64_t min_res_127303 = smin64(i_114610, min_arg_127302);\n    float defunc_0_f_res_127304 = sitofp_i64_f32(min_res_127303);\n    int64_t gtid_127139 = sext_i32_i64(ltid_pre_135057);\n    int32_t phys_tid_127140 = local_tid_135053;\n    bool cond_127308 = sle64(x_127298, gtid_127139);\n    float defunc_0_f_res_127309;\n    \n    if (cond_127308) {\n        defunc_0_f_res_127309 = 0.0F;\n    } else {\n        int64_t i_127310 = add64(gtid_127139, x_127300);\n        float x_127311 = ((__global float *) mem_130122)[gtid_127134 *\n                              ",
                   "                           n_114534 + i_127310];\n        float defunc_0_f_res_f_res_127312 = 1.0F + x_127311;\n        \n        defunc_0_f_res_127309 = defunc_0_f_res_f_res_127312;\n    }\n    \n    float defunc_0_f_res_127313;\n    \n    if (cond_127308) {\n        defunc_0_f_res_127313 = 0.0F;\n    } else {\n        int64_t i_127314 = add64(gtid_127139, x_127300);\n        float x_127315 = ((__global float *) mem_130861)[gtid_127134 *\n                                                         n_114534 + i_127314];\n        \n        defunc_0_f_res_127313 = x_127315;\n    }\n    \n    float x_j_127316 = defunc_0_f_res_127309 - defunc_0_f_res_127304;\n    float abs_res_127317 = (float) fabs(x_j_127316);\n    float tmp1_127318 = abs_res_127317 / x_127301;\n    float x_127319 = tmp1_127318 * tmp1_127318;\n    float y_127320 = tmp1_127318 * x_127319;\n    float tmp2_127321 = 1.0F - y_127320;\n    float x_127322 = tmp2_127321 * tmp2_127321;\n    float tmp3_127323 = tmp2_127321 * x_127322;\n    float tmp4_127324 = defunc_0_f_res_127313 * tmp3_127323;\n    \n    ((__local float *) color_132134)[gtid_127139] = x_j_127316;\n    ((__local float *) color_132133)[gtid_127139] = tmp4_127324;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    float defunc_2_reduce_res_127325;\n    float defunc_2_reduce_res_127326;\n    float defunc_2_reduce_res_127327;\n    float defunc_2_reduce_res_127328;\n    float defunc_2_reduce_res_127329;\n    int64_t gtid_127159 = sext_i32_i64(ltid_pre_135057);\n    int32_t phys_tid_127160 = local_tid_135053;\n    __local char *red_arr_mem_135062;\n    \n    red_arr_mem_135062 = (__local char *) red_arr_mem_135062_backing_4;\n    \n    __local char *red_arr_mem_135064;\n    \n    red_arr_mem_135064 = (__local char *) red_arr_mem_135064_backing_5;\n    \n    __local char *red_arr_mem_135066;\n    \n    red_arr_mem_135066 = (__local char *) red_arr_mem_135066_backing_6;\n    \n    __local char *red_arr_mem_135068;\n    \n    red_arr_mem_135068 = (__local char *) red_arr_mem_135068_backing_7;\n    \n    __local cha",
                   "r *red_arr_mem_135070;\n    \n    red_arr_mem_135070 = (__local char *) red_arr_mem_135070_backing_8;\n    \n    float x_127347 = ((__local float *) color_132134)[gtid_127159];\n    float x_127348 = ((__local float *) color_132133)[gtid_127159];\n    float defunc_1_f_res_127349 = x_127347 * x_127348;\n    float defunc_1_f_res_127350 = x_127347 * defunc_1_f_res_127349;\n    float defunc_1_f_res_127351 = x_127347 * defunc_1_f_res_127350;\n    float defunc_1_f_res_127352 = x_127347 * defunc_1_f_res_127351;\n    \n    ((__local float *) red_arr_mem_135062)[gtid_127159] = x_127348;\n    ((__local float *) red_arr_mem_135064)[gtid_127159] = defunc_1_f_res_127349;\n    ((__local float *) red_arr_mem_135066)[gtid_127159] = defunc_1_f_res_127350;\n    ((__local float *) red_arr_mem_135068)[gtid_127159] = defunc_1_f_res_127351;\n    ((__local float *) red_arr_mem_135070)[gtid_127159] = defunc_1_f_res_127352;\n    ((__local float *) color_132132)[gtid_127159] = defunc_1_f_res_127350;\n    ((__local float *) color_132131)[gtid_127159] = defunc_1_f_res_127349;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_135072;\n    int32_t skip_waves_135073 = 1;\n    float x_127332;\n    float x_127333;\n    float x_127334;\n    float x_127335;\n    float x_127336;\n    float x_127337;\n    float x_127338;\n    float x_127339;\n    float x_127340;\n    float x_127341;\n    \n    offset_135072 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_135053, sext_i64_i32(t_window_114537))) {\n            x_127332 = ((__local\n                         float *) red_arr_mem_135062)[sext_i32_i64(local_tid_135053 +\n                                                      offset_135072)];\n            x_127333 = ((__local\n                         float *) red_arr_mem_135064)[sext_i32_i64(local_tid_135053 +\n                                                      offset_135072)];\n            x_127334 = ((__local\n                         float *) red_arr_mem_135066)[sext_i32_i64(local_tid_1350",
                   "53 +\n                                                      offset_135072)];\n            x_127335 = ((__local\n                         float *) red_arr_mem_135068)[sext_i32_i64(local_tid_135053 +\n                                                      offset_135072)];\n            x_127336 = ((__local\n                         float *) red_arr_mem_135070)[sext_i32_i64(local_tid_135053 +\n                                                      offset_135072)];\n        }\n    }\n    offset_135072 = 1;\n    while (slt32(offset_135072, wave_sizze_135055)) {\n        if (slt32(local_tid_135053 + offset_135072,\n                  sext_i64_i32(t_window_114537)) && ((local_tid_135053 -\n                                                      squot32(local_tid_135053,\n                                                              wave_sizze_135055) *\n                                                      wave_sizze_135055) & (2 *\n                                                                            offset_135072 -\n                                                                            1)) ==\n            0) {\n            // read array element\n            {\n                x_127337 = ((volatile __local\n                             float *) red_arr_mem_135062)[sext_i32_i64(local_tid_135053 +\n                                                          offset_135072)];\n                x_127338 = ((volatile __local\n                             float *) red_arr_mem_135064)[sext_i32_i64(local_tid_135053 +\n                                                          offset_135072)];\n                x_127339 = ((volatile __local\n                             float *) red_arr_mem_135066)[sext_i32_i64(local_tid_135053 +\n                                                          offset_135072)];\n                x_127340 = ((volatile __local\n                             float *) red_arr_mem_135068)[sext_i32_i64(local_tid_135053 +\n                                                          offset_135072)];",
                   "\n                x_127341 = ((volatile __local\n                             float *) red_arr_mem_135070)[sext_i32_i64(local_tid_135053 +\n                                                          offset_135072)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_127342 = x_127332 + x_127337;\n                float defunc_1_op_res_127343 = x_127333 + x_127338;\n                float defunc_1_op_res_127344 = x_127334 + x_127339;\n                float defunc_1_op_res_127345 = x_127335 + x_127340;\n                float defunc_1_op_res_127346 = x_127336 + x_127341;\n                \n                x_127332 = defunc_1_op_res_127342;\n                x_127333 = defunc_1_op_res_127343;\n                x_127334 = defunc_1_op_res_127344;\n                x_127335 = defunc_1_op_res_127345;\n                x_127336 = defunc_1_op_res_127346;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_135062)[sext_i32_i64(local_tid_135053)] =\n                    x_127332;\n                ((volatile __local\n                  float *) red_arr_mem_135064)[sext_i32_i64(local_tid_135053)] =\n                    x_127333;\n                ((volatile __local\n                  float *) red_arr_mem_135066)[sext_i32_i64(local_tid_135053)] =\n                    x_127334;\n                ((volatile __local\n                  float *) red_arr_mem_135068)[sext_i32_i64(local_tid_135053)] =\n                    x_127335;\n                ((volatile __local\n                  float *) red_arr_mem_135070)[sext_i32_i64(local_tid_135053)] =\n                    x_127336;\n            }\n        }\n        offset_135072 *= 2;\n    }\n    while (slt32(skip_waves_135073, squot32(sext_i64_i32(t_window_114537) +\n                                            wave_sizze_135055 - 1,\n                                            wave_sizze_135055))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n  ",
                   "      offset_135072 = skip_waves_135073 * wave_sizze_135055;\n        if (slt32(local_tid_135053 + offset_135072,\n                  sext_i64_i32(t_window_114537)) && ((local_tid_135053 -\n                                                      squot32(local_tid_135053,\n                                                              wave_sizze_135055) *\n                                                      wave_sizze_135055) == 0 &&\n                                                     (squot32(local_tid_135053,\n                                                              wave_sizze_135055) &\n                                                      (2 * skip_waves_135073 -\n                                                       1)) == 0)) {\n            // read array element\n            {\n                x_127337 = ((__local\n                             float *) red_arr_mem_135062)[sext_i32_i64(local_tid_135053 +\n                                                          offset_135072)];\n                x_127338 = ((__local\n                             float *) red_arr_mem_135064)[sext_i32_i64(local_tid_135053 +\n                                                          offset_135072)];\n                x_127339 = ((__local\n                             float *) red_arr_mem_135066)[sext_i32_i64(local_tid_135053 +\n                                                          offset_135072)];\n                x_127340 = ((__local\n                             float *) red_arr_mem_135068)[sext_i32_i64(local_tid_135053 +\n                                                          offset_135072)];\n                x_127341 = ((__local\n                             float *) red_arr_mem_135070)[sext_i32_i64(local_tid_135053 +\n                                                          offset_135072)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_127342 = x_127332 + x_127337;\n                float defunc_1_op_res_127343 = x_127333 + x_12733",
                   "8;\n                float defunc_1_op_res_127344 = x_127334 + x_127339;\n                float defunc_1_op_res_127345 = x_127335 + x_127340;\n                float defunc_1_op_res_127346 = x_127336 + x_127341;\n                \n                x_127332 = defunc_1_op_res_127342;\n                x_127333 = defunc_1_op_res_127343;\n                x_127334 = defunc_1_op_res_127344;\n                x_127335 = defunc_1_op_res_127345;\n                x_127336 = defunc_1_op_res_127346;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_135062)[sext_i32_i64(local_tid_135053)] =\n                    x_127332;\n                ((__local\n                  float *) red_arr_mem_135064)[sext_i32_i64(local_tid_135053)] =\n                    x_127333;\n                ((__local\n                  float *) red_arr_mem_135066)[sext_i32_i64(local_tid_135053)] =\n                    x_127334;\n                ((__local\n                  float *) red_arr_mem_135068)[sext_i32_i64(local_tid_135053)] =\n                    x_127335;\n                ((__local\n                  float *) red_arr_mem_135070)[sext_i32_i64(local_tid_135053)] =\n                    x_127336;\n            }\n        }\n        skip_waves_135073 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_127325 = ((__local\n                                   float *) red_arr_mem_135062)[(int64_t) 0];\n    defunc_2_reduce_res_127326 = ((__local\n                                   float *) red_arr_mem_135064)[(int64_t) 0];\n    defunc_2_reduce_res_127327 = ((__local\n                                   float *) red_arr_mem_135066)[(int64_t) 0];\n    defunc_2_reduce_res_127328 = ((__local\n                                   float *) red_arr_mem_135068)[(int64_t) 0];\n    defunc_2_reduce_res_127329 = ((__local\n                                   float *) red_arr_mem_135070)[(int64_t) 0];\n    \n    float x_127353 = defunc_2_reduce_res_127327 * defunc_2_re",
                   "duce_res_127329;\n    float y_127354 = defunc_2_reduce_res_127328 * defunc_2_reduce_res_127328;\n    float a12_127355 = x_127353 - y_127354;\n    float x_127356 = defunc_2_reduce_res_127327 * defunc_2_reduce_res_127328;\n    float y_127357 = defunc_2_reduce_res_127326 * defunc_2_reduce_res_127329;\n    float b12_127358 = x_127356 - y_127357;\n    float x_127359 = defunc_2_reduce_res_127326 * defunc_2_reduce_res_127328;\n    float y_127360 = defunc_2_reduce_res_127327 * defunc_2_reduce_res_127327;\n    float c12_127361 = x_127359 - y_127360;\n    float x_127362 = defunc_2_reduce_res_127325 * defunc_2_reduce_res_127329;\n    float b2_127363 = x_127362 - y_127360;\n    float x_127364 = defunc_2_reduce_res_127326 * defunc_2_reduce_res_127327;\n    float y_127365 = defunc_2_reduce_res_127325 * defunc_2_reduce_res_127328;\n    float c2_127366 = x_127364 - y_127365;\n    float x_127367 = defunc_2_reduce_res_127325 * a12_127355;\n    float y_127368 = defunc_2_reduce_res_127326 * b12_127358;\n    float x_127369 = x_127367 + y_127368;\n    float y_127370 = defunc_2_reduce_res_127327 * c12_127361;\n    float y_127371 = x_127369 + y_127370;\n    float det_127372 = 1.0F / y_127371;\n    float a12_127373 = a12_127355 * det_127372;\n    float b12_127374 = b12_127358 * det_127372;\n    float c12_127375 = c12_127361 * det_127372;\n    float b2_127376 = b2_127363 * det_127372;\n    float c2_127377 = c2_127366 * det_127372;\n    float defunc_2_reduce_res_127378;\n    float defunc_2_reduce_res_127379;\n    int64_t gtid_127161 = sext_i32_i64(ltid_pre_135057);\n    int32_t phys_tid_127162 = local_tid_135053;\n    __local char *red_arr_mem_135074;\n    \n    red_arr_mem_135074 = (__local char *) red_arr_mem_135074_backing_9;\n    \n    __local char *red_arr_mem_135076;\n    \n    red_arr_mem_135076 = (__local char *) red_arr_mem_135076_backing_10;\n    \n    float x_127387 = ((__local float *) color_132133)[gtid_127161];\n    float x_127388 = ((__local float *) color_132131)[gtid_127161];\n    float x_127389 = ((__local float ",
                   "*) color_132132)[gtid_127161];\n    bool cond_127390 = sle64(x_127298, gtid_127161);\n    float defunc_0_f_res_127391;\n    \n    if (cond_127390) {\n        defunc_0_f_res_127391 = 0.0F;\n    } else {\n        int64_t i_127392 = add64(gtid_127161, x_127300);\n        float x_127393 = ((__global\n                           float *) defunc_4_map_res_mem_131267)[gtid_127134 *\n                                                                 n_114534 +\n                                                                 i_127392];\n        \n        defunc_0_f_res_127391 = x_127393;\n    }\n    \n    float x_127394 = a12_127373 * x_127387;\n    float y_127395 = b12_127374 * x_127388;\n    float x_127396 = x_127394 + y_127395;\n    float y_127397 = c12_127375 * x_127389;\n    float x_127398 = x_127396 + y_127397;\n    float defunc_9_fit_fun_res_127399 = defunc_0_f_res_127391 * x_127398;\n    float x_127400 = b12_127374 * x_127387;\n    float y_127401 = b2_127376 * x_127388;\n    float x_127402 = x_127400 + y_127401;\n    float y_127403 = c2_127377 * x_127389;\n    float x_127404 = x_127402 + y_127403;\n    float defunc_9_slope_fun_res_127405 = defunc_0_f_res_127391 * x_127404;\n    \n    ((__local float *) red_arr_mem_135074)[gtid_127161] =\n        defunc_9_fit_fun_res_127399;\n    ((__local float *) red_arr_mem_135076)[gtid_127161] =\n        defunc_9_slope_fun_res_127405;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int32_t offset_135078;\n    int32_t skip_waves_135079 = 1;\n    float x_127380;\n    float x_127381;\n    float x_127382;\n    float x_127383;\n    \n    offset_135078 = 0;\n    // participating threads read initial accumulator\n    {\n        if (slt32(local_tid_135053, sext_i64_i32(t_window_114537))) {\n            x_127380 = ((__local\n                         float *) red_arr_mem_135074)[sext_i32_i64(local_tid_135053 +\n                                                      offset_135078)];\n            x_127381 = ((__local\n                         float *) red_arr_mem_135076)[sext_i32_i64(local_tid_13",
                   "5053 +\n                                                      offset_135078)];\n        }\n    }\n    offset_135078 = 1;\n    while (slt32(offset_135078, wave_sizze_135055)) {\n        if (slt32(local_tid_135053 + offset_135078,\n                  sext_i64_i32(t_window_114537)) && ((local_tid_135053 -\n                                                      squot32(local_tid_135053,\n                                                              wave_sizze_135055) *\n                                                      wave_sizze_135055) & (2 *\n                                                                            offset_135078 -\n                                                                            1)) ==\n            0) {\n            // read array element\n            {\n                x_127382 = ((volatile __local\n                             float *) red_arr_mem_135074)[sext_i32_i64(local_tid_135053 +\n                                                          offset_135078)];\n                x_127383 = ((volatile __local\n                             float *) red_arr_mem_135076)[sext_i32_i64(local_tid_135053 +\n                                                          offset_135078)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_127384 = x_127380 + x_127382;\n                float defunc_1_op_res_127385 = x_127381 + x_127383;\n                \n                x_127380 = defunc_1_op_res_127384;\n                x_127381 = defunc_1_op_res_127385;\n            }\n            // write result of operation\n            {\n                ((volatile __local\n                  float *) red_arr_mem_135074)[sext_i32_i64(local_tid_135053)] =\n                    x_127380;\n                ((volatile __local\n                  float *) red_arr_mem_135076)[sext_i32_i64(local_tid_135053)] =\n                    x_127381;\n            }\n        }\n        offset_135078 *= 2;\n    }\n    while (slt32(skip_waves_135079, squot32(sext_i64_i32",
                   "(t_window_114537) +\n                                            wave_sizze_135055 - 1,\n                                            wave_sizze_135055))) {\n        barrier(CLK_LOCAL_MEM_FENCE);\n        offset_135078 = skip_waves_135079 * wave_sizze_135055;\n        if (slt32(local_tid_135053 + offset_135078,\n                  sext_i64_i32(t_window_114537)) && ((local_tid_135053 -\n                                                      squot32(local_tid_135053,\n                                                              wave_sizze_135055) *\n                                                      wave_sizze_135055) == 0 &&\n                                                     (squot32(local_tid_135053,\n                                                              wave_sizze_135055) &\n                                                      (2 * skip_waves_135079 -\n                                                       1)) == 0)) {\n            // read array element\n            {\n                x_127382 = ((__local\n                             float *) red_arr_mem_135074)[sext_i32_i64(local_tid_135053 +\n                                                          offset_135078)];\n                x_127383 = ((__local\n                             float *) red_arr_mem_135076)[sext_i32_i64(local_tid_135053 +\n                                                          offset_135078)];\n            }\n            // apply reduction operation\n            {\n                float defunc_1_op_res_127384 = x_127380 + x_127382;\n                float defunc_1_op_res_127385 = x_127381 + x_127383;\n                \n                x_127380 = defunc_1_op_res_127384;\n                x_127381 = defunc_1_op_res_127385;\n            }\n            // write result of operation\n            {\n                ((__local\n                  float *) red_arr_mem_135074)[sext_i32_i64(local_tid_135053)] =\n                    x_127380;\n                ((__local\n                  float *) red_arr_mem_135076)[sext_i32_i6",
                   "4(local_tid_135053)] =\n                    x_127381;\n            }\n        }\n        skip_waves_135079 *= 2;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    defunc_2_reduce_res_127378 = ((__local\n                                   float *) red_arr_mem_135074)[(int64_t) 0];\n    defunc_2_reduce_res_127379 = ((__local\n                                   float *) red_arr_mem_135076)[(int64_t) 0];\n    if (local_tid_135053 == 0) {\n        ((__global float *) mem_131623)[gtid_127134 * t_n_m_114591 +\n                                        gtid_127135] =\n            defunc_2_reduce_res_127378;\n    }\n    if (local_tid_135053 == 0) {\n        ((__global float *) mem_131627)[gtid_127134 * t_n_m_114591 +\n                                        gtid_127135] =\n            defunc_2_reduce_res_127379;\n    }\n    \n  error_5:\n    return;\n}\n__kernel void mainzisegmap_intragroup_127704(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *color_132148_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_132147_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_132146_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *color_132145_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *color_132144_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_132143_backing_aligned_5,\n                                             int64_t m_114533, int64_t n_114534,\n                                             int64_t i_114610,\n                                             int32_t iters_116571,",
                   " __global\n                                             unsigned char *mem_131670, __global\n                                             unsigned char *mem_131838, __global\n                                             unsigned char *color_132142)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict color_132148_backing_5 = (__local volatile\n                                                              char *) color_132148_backing_aligned_0;\n    __local volatile char *restrict color_132147_backing_4 = (__local volatile\n                                                              char *) color_132147_backing_aligned_1;\n    __local volatile char *restrict color_132146_backing_3 = (__local volatile\n                                                              char *) color_132146_backing_aligned_2;\n    __local volatile char *restrict color_132145_backing_2 = (__local volatile\n                                                              char *) color_132145_backing_aligned_3;\n    __local volatile char *restrict color_132144_backing_1 = (__local volatile\n                                                              char *) color_132144_backing_aligned_4;\n    __local volatile char *restrict color_132143_backing_0 = (__local volatile\n                                                              char *) color_132143_backing_aligned_5;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_135139;\n    int32_t local_tid_135140;\n    int64_t group_sizze_135143;\n    int32_t wave_sizze_135142;\n    int32_t group_tid_135141;\n    \n    global_tid_135139 = get_global_id(0);\n    local_tid_135140 = get_local_id(0);\n    group_sizze_135143 = get_local_size(0);\n    wave_sizze_135142 = LOCKSTEP_WIDTH;\n    group_tid_135141 = get_group_id(0);\n    \n    int32_t phys_tid_127704 = group_tid_135141;\n    int32_t ltid_pre_135144 = local_tid_135140;\n    int64_t slice_135145 = m_114533;\n    int64_t gtid_",
                   "127696 = sext_i32_i64(group_tid_135141);\n    int64_t remnant_135146 = sext_i32_i64(group_tid_135141) - gtid_127696;\n    __local char *color_132143;\n    \n    color_132143 = (__local char *) color_132143_backing_0;\n    \n    __local char *color_132144;\n    \n    color_132144 = (__local char *) color_132144_backing_1;\n    \n    __local char *color_132145;\n    \n    color_132145 = (__local char *) color_132145_backing_2;\n    \n    __local char *color_132146;\n    \n    color_132146 = (__local char *) color_132146_backing_3;\n    \n    __local char *color_132147;\n    \n    color_132147 = (__local char *) color_132147_backing_4;\n    \n    __local char *color_132148;\n    \n    color_132148 = (__local char *) color_132148_backing_5;\n    ((__global float *) color_132142)[phys_tid_127704 * n_114534 +\n                                      sext_i32_i64(local_tid_135140)] =\n        ((__global float *) mem_131670)[gtid_127696 * n_114534 +\n                                        sext_i32_i64(local_tid_135140)];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    for (int32_t i_127899 = 0; i_127899 < iters_116571; i_127899++) {\n        int32_t defunc_2_radix_sort_step_arg_127901 = mul32(2, i_127899);\n        int32_t defunc_0_get_bit_arg_127902 = add32(1,\n                                                    defunc_2_radix_sort_step_arg_127901);\n        bool cond_f_res_127903 = defunc_0_get_bit_arg_127902 == 31;\n        bool cond_f_res_127904 = defunc_2_radix_sort_step_arg_127901 == 31;\n        int64_t gtid_127699 = sext_i32_i64(ltid_pre_135144);\n        int32_t phys_tid_127700 = local_tid_135140;\n        float x_127922 = ((__global float *) color_132142)[phys_tid_127704 *\n                                                           n_114534 +\n                                                           gtid_127699];\n        int32_t i32_arg_127923;\n        \n        i32_arg_127923 = futrts_to_bits32(x_127922);\n        \n        int32_t unsign_arg_127924 = ashr32(i32_arg_127923,\n                                      ",
                   "     defunc_0_get_bit_arg_127902);\n        int32_t unsign_arg_127925 = 1 & unsign_arg_127924;\n        int32_t unsign_arg_127926 = ashr32(i32_arg_127923, 31);\n        int32_t unsign_arg_127927 = 1 & unsign_arg_127926;\n        bool cond_127928 = unsign_arg_127927 == 1;\n        bool x_127929 = !cond_127928;\n        bool y_127930 = cond_f_res_127903 && x_127929;\n        bool cond_127931 = cond_127928 || y_127930;\n        int32_t defunc_1_get_bit_res_127932;\n        \n        if (cond_127931) {\n            int32_t defunc_1_get_bit_res_t_res_127933 = 1 ^ unsign_arg_127925;\n            \n            defunc_1_get_bit_res_127932 = defunc_1_get_bit_res_t_res_127933;\n        } else {\n            defunc_1_get_bit_res_127932 = unsign_arg_127925;\n        }\n        \n        int32_t x_127934 = mul32(2, defunc_1_get_bit_res_127932);\n        int32_t unsign_arg_127935 = ashr32(i32_arg_127923,\n                                           defunc_2_radix_sort_step_arg_127901);\n        int32_t unsign_arg_127936 = 1 & unsign_arg_127935;\n        bool y_127937 = cond_f_res_127904 && x_127929;\n        bool cond_127938 = cond_127928 || y_127937;\n        int32_t defunc_1_get_bit_res_127939;\n        \n        if (cond_127938) {\n            int32_t defunc_1_get_bit_res_t_res_127940 = 1 ^ unsign_arg_127936;\n            \n            defunc_1_get_bit_res_127939 = defunc_1_get_bit_res_t_res_127940;\n        } else {\n            defunc_1_get_bit_res_127939 = unsign_arg_127936;\n        }\n        \n        int32_t defunc_0_f_res_127941 = add32(x_127934,\n                                              defunc_1_get_bit_res_127939);\n        bool cond_127942 = defunc_0_f_res_127941 == 0;\n        int64_t defunc_0_f_res_127943 = btoi_bool_i64(cond_127942);\n        int64_t defunc_0_f_res_127944;\n        int64_t defunc_0_f_res_127945;\n        int64_t defunc_0_f_res_127946;\n        \n        if (cond_127942) {\n            defunc_0_f_res_127944 = (int64_t) 0;\n            defunc_0_f_res_127945 = (int64_t) 0;\n            def",
                   "unc_0_f_res_127946 = (int64_t) 0;\n        } else {\n            bool cond_127947 = defunc_0_f_res_127941 == 1;\n            int64_t defunc_0_f_res_f_res_127948 = btoi_bool_i64(cond_127947);\n            int64_t defunc_0_f_res_f_res_127949;\n            int64_t defunc_0_f_res_f_res_127950;\n            \n            if (cond_127947) {\n                defunc_0_f_res_f_res_127949 = (int64_t) 0;\n                defunc_0_f_res_f_res_127950 = (int64_t) 0;\n            } else {\n                bool cond_127951 = defunc_0_f_res_127941 == 2;\n                int64_t defunc_0_f_res_f_res_f_res_127952 =\n                        btoi_bool_i64(cond_127951);\n                bool cond_neg_127953 = !cond_127951;\n                int64_t defunc_0_f_res_f_res_f_res_127954 =\n                        btoi_bool_i64(cond_neg_127953);\n                \n                defunc_0_f_res_f_res_127949 = defunc_0_f_res_f_res_f_res_127952;\n                defunc_0_f_res_f_res_127950 = defunc_0_f_res_f_res_f_res_127954;\n            }\n            defunc_0_f_res_127944 = defunc_0_f_res_f_res_127948;\n            defunc_0_f_res_127945 = defunc_0_f_res_f_res_127949;\n            defunc_0_f_res_127946 = defunc_0_f_res_f_res_127950;\n        }\n        ((__local int64_t *) color_132148)[gtid_127699] = defunc_0_f_res_127943;\n        ((__local int64_t *) color_132147)[gtid_127699] = defunc_0_f_res_127944;\n        ((__local int64_t *) color_132146)[gtid_127699] = defunc_0_f_res_127945;\n        ((__local int64_t *) color_132145)[gtid_127699] = defunc_0_f_res_127946;\n        ((__local int32_t *) color_132144)[gtid_127699] = defunc_0_f_res_127941;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t dims_flat_135148 = n_114534;\n        int64_t x_127910;\n        int64_t x_127911;\n        int64_t x_127912;\n        int64_t x_127913;\n        int64_t x_127914;\n        int64_t x_127915;\n        int64_t x_127916;\n        int64_t x_127917;\n        int64_t x_135153;\n        int64_t x_135154;\n        int64_t x_135155;\n      ",
                   "  int64_t x_135156;\n        int64_t x_135157;\n        int64_t x_135158;\n        int64_t x_135159;\n        int64_t x_135160;\n        bool ltid_in_bounds_135165 = slt64(sext_i32_i64(local_tid_135140),\n                                           n_114534);\n        int32_t skip_threads_135166;\n        \n        // read input for in-block scan\n        {\n            if (ltid_in_bounds_135165) {\n                x_127914 = ((volatile __local\n                             int64_t *) color_132148)[sext_i32_i64(local_tid_135140)];\n                x_127915 = ((volatile __local\n                             int64_t *) color_132147)[sext_i32_i64(local_tid_135140)];\n                x_127916 = ((volatile __local\n                             int64_t *) color_132146)[sext_i32_i64(local_tid_135140)];\n                x_127917 = ((volatile __local\n                             int64_t *) color_132145)[sext_i32_i64(local_tid_135140)];\n                if ((local_tid_135140 - squot32(local_tid_135140, 32) * 32) ==\n                    0) {\n                    x_127910 = x_127914;\n                    x_127911 = x_127915;\n                    x_127912 = x_127916;\n                    x_127913 = x_127917;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_135166 = 1;\n            while (slt32(skip_threads_135166, 32)) {\n                if (sle32(skip_threads_135166, local_tid_135140 -\n                          squot32(local_tid_135140, 32) * 32) &&\n                    ltid_in_bounds_135165) {\n                    // read operands\n                    {\n                        x_127910 = ((volatile __local\n                                     int64_t *) color_132148)[sext_i32_i64(local_tid_135140) -\n                                                              sext_i32_i64(skip_threads_135166)];\n                        x_127911 = ((volatile __local\n                                     int64_t *) color_132147)[sext_i32_i64(l",
                   "ocal_tid_135140) -\n                                                              sext_i32_i64(skip_threads_135166)];\n                        x_127912 = ((volatile __local\n                                     int64_t *) color_132146)[sext_i32_i64(local_tid_135140) -\n                                                              sext_i32_i64(skip_threads_135166)];\n                        x_127913 = ((volatile __local\n                                     int64_t *) color_132145)[sext_i32_i64(local_tid_135140) -\n                                                              sext_i32_i64(skip_threads_135166)];\n                    }\n                    // perform operation\n                    {\n                        bool inactive_135167 =\n                             slt64(srem64(sext_i32_i64(local_tid_135140),\n                                          n_114534),\n                                   sext_i32_i64(local_tid_135140) -\n                                   sext_i32_i64(local_tid_135140 -\n                                   skip_threads_135166));\n                        \n                        if (inactive_135167) {\n                            x_127910 = x_127914;\n                            x_127911 = x_127915;\n                            x_127912 = x_127916;\n                            x_127913 = x_127917;\n                        }\n                        if (!inactive_135167) {\n                            int64_t defunc_1_op_res_127918 = add64(x_127910,\n                                                                   x_127914);\n                            int64_t defunc_1_op_res_127919 = add64(x_127911,\n                                                                   x_127915);\n                            int64_t defunc_1_op_res_127920 = add64(x_127912,\n                                                                   x_127916);\n                            int64_t defunc_1_op_res_127921 = add64(x_127913,\n                                                     ",
                   "              x_127917);\n                            \n                            x_127910 = defunc_1_op_res_127918;\n                            x_127911 = defunc_1_op_res_127919;\n                            x_127912 = defunc_1_op_res_127920;\n                            x_127913 = defunc_1_op_res_127921;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_135142, skip_threads_135166)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (sle32(skip_threads_135166, local_tid_135140 -\n                          squot32(local_tid_135140, 32) * 32) &&\n                    ltid_in_bounds_135165) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_132148)[sext_i32_i64(local_tid_135140)] =\n                            x_127910;\n                        x_127914 = x_127910;\n                        ((volatile __local\n                          int64_t *) color_132147)[sext_i32_i64(local_tid_135140)] =\n                            x_127911;\n                        x_127915 = x_127911;\n                        ((volatile __local\n                          int64_t *) color_132146)[sext_i32_i64(local_tid_135140)] =\n                            x_127912;\n                        x_127916 = x_127912;\n                        ((volatile __local\n                          int64_t *) color_132145)[sext_i32_i64(local_tid_135140)] =\n                            x_127913;\n                        x_127917 = x_127913;\n                    }\n                }\n                if (sle32(wave_sizze_135142, skip_threads_135166)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_135166 *= 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_135140 - squot32(local_tid_",
                   "135140, 32) * 32) == 31 &&\n                ltid_in_bounds_135165) {\n                ((volatile __local\n                  int64_t *) color_132148)[sext_i32_i64(squot32(local_tid_135140,\n                                                                32))] =\n                    x_127910;\n                ((volatile __local\n                  int64_t *) color_132147)[sext_i32_i64(squot32(local_tid_135140,\n                                                                32))] =\n                    x_127911;\n                ((volatile __local\n                  int64_t *) color_132146)[sext_i32_i64(squot32(local_tid_135140,\n                                                                32))] =\n                    x_127912;\n                ((volatile __local\n                  int64_t *) color_132145)[sext_i32_i64(squot32(local_tid_135140,\n                                                                32))] =\n                    x_127913;\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_135168;\n            \n            // read input for in-block scan\n            {\n                if (squot32(local_tid_135140, 32) == 0 &&\n                    ltid_in_bounds_135165) {\n                    x_135157 = ((volatile __local\n                                 int64_t *) color_132148)[sext_i32_i64(local_tid_135140)];\n                    x_135158 = ((volatile __local\n                                 int64_t *) color_132147)[sext_i32_i64(local_tid_135140)];\n                    x_135159 = ((volatile __local\n                                 int64_t *) color_132146)[sext_i32_i64(local_tid_135140)];\n                    x_135160 = ((volatile __local\n                                 int64_t *) color_132145)[sext_i32_i64(local_tid_135140)];\n                    if ((local_tid_135140 - squot32(local_tid_135140, 32) *\n                         32) == 0) {\n  ",
                   "                      x_135153 = x_135157;\n                        x_135154 = x_135158;\n                        x_135155 = x_135159;\n                        x_135156 = x_135160;\n                    }\n                }\n            }\n            // in-block scan (hopefully no barriers needed)\n            {\n                skip_threads_135168 = 1;\n                while (slt32(skip_threads_135168, 32)) {\n                    if (sle32(skip_threads_135168, local_tid_135140 -\n                              squot32(local_tid_135140, 32) * 32) &&\n                        (squot32(local_tid_135140, 32) == 0 &&\n                         ltid_in_bounds_135165)) {\n                        // read operands\n                        {\n                            x_135153 = ((volatile __local\n                                         int64_t *) color_132148)[sext_i32_i64(local_tid_135140) -\n                                                                  sext_i32_i64(skip_threads_135168)];\n                            x_135154 = ((volatile __local\n                                         int64_t *) color_132147)[sext_i32_i64(local_tid_135140) -\n                                                                  sext_i32_i64(skip_threads_135168)];\n                            x_135155 = ((volatile __local\n                                         int64_t *) color_132146)[sext_i32_i64(local_tid_135140) -\n                                                                  sext_i32_i64(skip_threads_135168)];\n                            x_135156 = ((volatile __local\n                                         int64_t *) color_132145)[sext_i32_i64(local_tid_135140) -\n                                                                  sext_i32_i64(skip_threads_135168)];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_135169 =\n                                 slt64(srem64(sext_i32_i64(local_tid_135140 *\n              ",
                   "                                32 + 32 - 1), n_114534),\n                                       sext_i32_i64(local_tid_135140 * 32 + 32 -\n                                       1) - sext_i32_i64((local_tid_135140 -\n                                                          skip_threads_135168) *\n                                       32 + 32 - 1));\n                            \n                            if (inactive_135169) {\n                                x_135153 = x_135157;\n                                x_135154 = x_135158;\n                                x_135155 = x_135159;\n                                x_135156 = x_135160;\n                            }\n                            if (!inactive_135169) {\n                                int64_t defunc_1_op_res_135161 = add64(x_135153,\n                                                                       x_135157);\n                                int64_t defunc_1_op_res_135162 = add64(x_135154,\n                                                                       x_135158);\n                                int64_t defunc_1_op_res_135163 = add64(x_135155,\n                                                                       x_135159);\n                                int64_t defunc_1_op_res_135164 = add64(x_135156,\n                                                                       x_135160);\n                                \n                                x_135153 = defunc_1_op_res_135161;\n                                x_135154 = defunc_1_op_res_135162;\n                                x_135155 = defunc_1_op_res_135163;\n                                x_135156 = defunc_1_op_res_135164;\n                            }\n                        }\n                    }\n                    if (sle32(wave_sizze_135142, skip_threads_135168)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    if (sle32(skip_threads_135168, local_tid_135140 -\n                          ",
                   "    squot32(local_tid_135140, 32) * 32) &&\n                        (squot32(local_tid_135140, 32) == 0 &&\n                         ltid_in_bounds_135165)) {\n                        // write result\n                        {\n                            ((volatile __local\n                              int64_t *) color_132148)[sext_i32_i64(local_tid_135140)] =\n                                x_135153;\n                            x_135157 = x_135153;\n                            ((volatile __local\n                              int64_t *) color_132147)[sext_i32_i64(local_tid_135140)] =\n                                x_135154;\n                            x_135158 = x_135154;\n                            ((volatile __local\n                              int64_t *) color_132146)[sext_i32_i64(local_tid_135140)] =\n                                x_135155;\n                            x_135159 = x_135155;\n                            ((volatile __local\n                              int64_t *) color_132145)[sext_i32_i64(local_tid_135140)] =\n                                x_135156;\n                            x_135160 = x_135156;\n                        }\n                    }\n                    if (sle32(wave_sizze_135142, skip_threads_135168)) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                    }\n                    skip_threads_135168 *= 2;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // carry-in for every block except the first\n        {\n            if (!(squot32(local_tid_135140, 32) == 0 ||\n                  !ltid_in_bounds_135165)) {\n                // read operands\n                {\n                    x_127914 = x_127910;\n                    x_127915 = x_127911;\n                    x_127916 = x_127912;\n                    x_127917 = x_127913;\n                    x_127910 = ((__local\n                                 int64_t *) color_132148)[sext_i32_i64(squot32(local_tid_135140,\n                             ",
                   "                                                  32)) -\n                                                          (int64_t) 1];\n                    x_127911 = ((__local\n                                 int64_t *) color_132147)[sext_i32_i64(squot32(local_tid_135140,\n                                                                               32)) -\n                                                          (int64_t) 1];\n                    x_127912 = ((__local\n                                 int64_t *) color_132146)[sext_i32_i64(squot32(local_tid_135140,\n                                                                               32)) -\n                                                          (int64_t) 1];\n                    x_127913 = ((__local\n                                 int64_t *) color_132145)[sext_i32_i64(squot32(local_tid_135140,\n                                                                               32)) -\n                                                          (int64_t) 1];\n                }\n                // perform operation\n                {\n                    bool inactive_135170 =\n                         slt64(srem64(sext_i32_i64(local_tid_135140), n_114534),\n                               sext_i32_i64(local_tid_135140) -\n                               sext_i32_i64(squot32(local_tid_135140, 32) * 32 -\n                               1));\n                    \n                    if (inactive_135170) {\n                        x_127910 = x_127914;\n                        x_127911 = x_127915;\n                        x_127912 = x_127916;\n                        x_127913 = x_127917;\n                    }\n                    if (!inactive_135170) {\n                        int64_t defunc_1_op_res_127918 = add64(x_127910,\n                                                               x_127914);\n                        int64_t defunc_1_op_res_127919 = add64(x_127911,\n                                                               x_127915);\n ",
                   "                       int64_t defunc_1_op_res_127920 = add64(x_127912,\n                                                               x_127916);\n                        int64_t defunc_1_op_res_127921 = add64(x_127913,\n                                                               x_127917);\n                        \n                        x_127910 = defunc_1_op_res_127918;\n                        x_127911 = defunc_1_op_res_127919;\n                        x_127912 = defunc_1_op_res_127920;\n                        x_127913 = defunc_1_op_res_127921;\n                    }\n                }\n                // write final result\n                {\n                    ((__local\n                      int64_t *) color_132148)[sext_i32_i64(local_tid_135140)] =\n                        x_127910;\n                    ((__local\n                      int64_t *) color_132147)[sext_i32_i64(local_tid_135140)] =\n                        x_127911;\n                    ((__local\n                      int64_t *) color_132146)[sext_i32_i64(local_tid_135140)] =\n                        x_127912;\n                    ((__local\n                      int64_t *) color_132145)[sext_i32_i64(local_tid_135140)] =\n                        x_127913;\n                }\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // restore correct values for first block\n        {\n            if (squot32(local_tid_135140, 32) == 0) {\n                ((__local\n                  int64_t *) color_132148)[sext_i32_i64(local_tid_135140)] =\n                    x_127914;\n                ((__local\n                  int64_t *) color_132147)[sext_i32_i64(local_tid_135140)] =\n                    x_127915;\n                ((__local\n                  int64_t *) color_132146)[sext_i32_i64(local_tid_135140)] =\n                    x_127916;\n                ((__local\n                  int64_t *) color_132145)[sext_i32_i64(local_tid_135140)] =\n                    x_127917;\n            }\n        }\n        barrier(CLK_",
                   "LOCAL_MEM_FENCE);\n        \n        int64_t last_res_127955 = ((__local int64_t *) color_132148)[i_114610];\n        int64_t last_res_127956 = ((__local int64_t *) color_132147)[i_114610];\n        int64_t last_res_127957 = ((__local int64_t *) color_132146)[i_114610];\n        \n        ((__local float *) color_132143)[sext_i32_i64(local_tid_135140)] =\n            ((__global float *) color_132142)[phys_tid_127704 * n_114534 +\n                                              sext_i32_i64(local_tid_135140)];\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t write_i_127701 = sext_i32_i64(ltid_pre_135144);\n        int32_t phys_tid_127702 = local_tid_135140;\n        int32_t x_127960 = ((__local int32_t *) color_132144)[write_i_127701];\n        float write_value_127965 = ((__global\n                                     float *) color_132142)[phys_tid_127704 *\n                                                            n_114534 +\n                                                            write_i_127701];\n        bool match_lit_127966 = 0 == x_127960;\n        int64_t defunc_1_f_res_127967;\n        \n        if (match_lit_127966) {\n            int64_t x_127961 = ((__local\n                                 int64_t *) color_132148)[write_i_127701];\n            int64_t case_res_127968 = sub64(x_127961, (int64_t) 1);\n            \n            defunc_1_f_res_127967 = case_res_127968;\n        } else {\n            bool match_lit_127969 = 1 == x_127960;\n            int64_t x_127970;\n            \n            if (match_lit_127969) {\n                int64_t x_127962 = ((__local\n                                     int64_t *) color_132147)[write_i_127701];\n                int64_t x_127971 = add64(last_res_127955, x_127962);\n                int64_t case_res_127972 = sub64(x_127971, (int64_t) 1);\n                \n                x_127970 = case_res_127972;\n            } else {\n                bool match_lit_127973 = 2 == x_127960;\n                int64_t x_127974;\n                \n    ",
                   "            if (match_lit_127973) {\n                    int64_t x_127963 = ((__local\n                                         int64_t *) color_132146)[write_i_127701];\n                    int64_t x_127975 = add64(last_res_127955, last_res_127956);\n                    int64_t x_127976 = add64(x_127963, x_127975);\n                    int64_t case_res_127977 = sub64(x_127976, (int64_t) 1);\n                    \n                    x_127974 = case_res_127977;\n                } else {\n                    int64_t x_127964 = ((__local\n                                         int64_t *) color_132145)[write_i_127701];\n                    int64_t x_127978 = add64(last_res_127955, last_res_127956);\n                    int64_t x_127979 = add64(last_res_127957, x_127978);\n                    int64_t x_127980 = add64(x_127964, x_127979);\n                    int64_t defunc_1_f_res_res_127981 = sub64(x_127980,\n                                                              (int64_t) 1);\n                    \n                    x_127974 = defunc_1_f_res_res_127981;\n                }\n                x_127970 = x_127974;\n            }\n            defunc_1_f_res_127967 = x_127970;\n        }\n        if (sle64((int64_t) 0, defunc_1_f_res_127967) &&\n            slt64(defunc_1_f_res_127967, n_114534)) {\n            ((__local float *) color_132143)[defunc_1_f_res_127967] =\n                write_value_127965;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        ((__global float *) color_132142)[phys_tid_127704 * n_114534 +\n                                          sext_i32_i64(local_tid_135140)] =\n            ((__local float *) color_132143)[sext_i32_i64(local_tid_135140)];\n        barrier(CLK_LOCAL_MEM_FENCE);\n    }\n    if (local_tid_135140 == 0) {\n        for (int64_t i_135171 = 0; i_135171 < n_114534; i_135171++) {\n            ((__global float *) mem_131838)[gtid_127696 * n_114534 + i_135171] =\n                ((__global float *) color_132142)[phys_tid_127704 * n_114534 +\n                ",
                   "                                  i_135171];\n        }\n    }\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_127994(__global int *global_failure,\n                                             __local volatile\n                                             int64_t *color_132154_backing_aligned_0,\n                                             __local volatile\n                                             int64_t *color_132153_backing_aligned_1,\n                                             __local volatile\n                                             int64_t *color_132152_backing_aligned_2,\n                                             __local volatile\n                                             int64_t *color_132151_backing_aligned_3,\n                                             __local volatile\n                                             int64_t *color_132150_backing_aligned_4,\n                                             __local volatile\n                                             int64_t *color_132149_backing_aligned_5,\n                                             int64_t m_114533, int64_t n_114534,\n                                             int64_t i_114610,\n                                             int32_t defunc_2_radix_sort_step_arg_128292,\n                                             int32_t defunc_0_get_bit_arg_128293,\n                                             unsigned char cond_f_res_128294,\n                                             unsigned char cond_f_res_128295,\n                                             __global\n                                             unsigned char *mem_param_131846,\n                                             __global unsigned char *mem_131852,\n                                             __global unsigned char *mem_131877)\n{\n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict color_132154_backing_5 = (__local volatile\n         ",
                   "                                                     char *) color_132154_backing_aligned_0;\n    __local volatile char *restrict color_132153_backing_4 = (__local volatile\n                                                              char *) color_132153_backing_aligned_1;\n    __local volatile char *restrict color_132152_backing_3 = (__local volatile\n                                                              char *) color_132152_backing_aligned_2;\n    __local volatile char *restrict color_132151_backing_2 = (__local volatile\n                                                              char *) color_132151_backing_aligned_3;\n    __local volatile char *restrict color_132150_backing_1 = (__local volatile\n                                                              char *) color_132150_backing_aligned_4;\n    __local volatile char *restrict color_132149_backing_0 = (__local volatile\n                                                              char *) color_132149_backing_aligned_5;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_135174;\n    int32_t local_tid_135175;\n    int64_t group_sizze_135178;\n    int32_t wave_sizze_135177;\n    int32_t group_tid_135176;\n    \n    global_tid_135174 = get_global_id(0);\n    local_tid_135175 = get_local_id(0);\n    group_sizze_135178 = get_local_size(0);\n    wave_sizze_135177 = LOCKSTEP_WIDTH;\n    group_tid_135176 = get_group_id(0);\n    \n    int32_t phys_tid_127994 = group_tid_135176;\n    int32_t ltid_pre_135179 = local_tid_135175;\n    int64_t slice_135180 = m_114533;\n    int64_t gtid_127985 = sext_i32_i64(group_tid_135176);\n    int64_t remnant_135181 = sext_i32_i64(group_tid_135176) - gtid_127985;\n    __local char *color_132149;\n    \n    color_132149 = (__local char *) color_132149_backing_0;\n    \n    __local char *color_132150;\n    \n    color_132150 = (__local char *) color_132150_backing_1;\n    \n    __local char *color_132151;\n    \n    color_132151 = (__local char *) color_132151_backing_2;\n    \n    ",
                   "__local char *color_132152;\n    \n    color_132152 = (__local char *) color_132152_backing_3;\n    \n    __local char *color_132153;\n    \n    color_132153 = (__local char *) color_132153_backing_4;\n    \n    __local char *color_132154;\n    \n    color_132154 = (__local char *) color_132154_backing_5;\n    ((__local float *) color_132154)[sext_i32_i64(local_tid_135175)] =\n        ((__global float *) mem_131852)[gtid_127985 * n_114534 +\n                                        sext_i32_i64(local_tid_135175)];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t gtid_127988 = sext_i32_i64(ltid_pre_135179);\n    int32_t phys_tid_127989 = local_tid_135175;\n    float x_128327 = ((__global float *) mem_param_131846)[gtid_127985 *\n                                                           n_114534 +\n                                                           gtid_127988];\n    int32_t i32_arg_128328;\n    \n    i32_arg_128328 = futrts_to_bits32(x_128327);\n    \n    int32_t unsign_arg_128329 = ashr32(i32_arg_128328,\n                                       defunc_0_get_bit_arg_128293);\n    int32_t unsign_arg_128330 = 1 & unsign_arg_128329;\n    int32_t unsign_arg_128331 = ashr32(i32_arg_128328, 31);\n    int32_t unsign_arg_128332 = 1 & unsign_arg_128331;\n    bool cond_128333 = unsign_arg_128332 == 1;\n    bool x_128334 = !cond_128333;\n    bool y_128335 = cond_f_res_128294 && x_128334;\n    bool cond_128336 = cond_128333 || y_128335;\n    int32_t defunc_1_get_bit_res_128337;\n    \n    if (cond_128336) {\n        int32_t defunc_1_get_bit_res_t_res_128338 = 1 ^ unsign_arg_128330;\n        \n        defunc_1_get_bit_res_128337 = defunc_1_get_bit_res_t_res_128338;\n    } else {\n        defunc_1_get_bit_res_128337 = unsign_arg_128330;\n    }\n    \n    int32_t x_128339 = mul32(2, defunc_1_get_bit_res_128337);\n    int32_t unsign_arg_128340 = ashr32(i32_arg_128328,\n                                       defunc_2_radix_sort_step_arg_128292);\n    int32_t unsign_arg_128341 = 1 & unsign_arg_128340;\n    bool y_128342",
                   " = cond_f_res_128295 && x_128334;\n    bool cond_128343 = cond_128333 || y_128342;\n    int32_t defunc_1_get_bit_res_128344;\n    \n    if (cond_128343) {\n        int32_t defunc_1_get_bit_res_t_res_128345 = 1 ^ unsign_arg_128341;\n        \n        defunc_1_get_bit_res_128344 = defunc_1_get_bit_res_t_res_128345;\n    } else {\n        defunc_1_get_bit_res_128344 = unsign_arg_128341;\n    }\n    \n    int32_t defunc_0_f_res_128346 = add32(x_128339,\n                                          defunc_1_get_bit_res_128344);\n    bool cond_128347 = defunc_0_f_res_128346 == 0;\n    int64_t defunc_0_f_res_128348 = btoi_bool_i64(cond_128347);\n    int64_t defunc_0_f_res_128349;\n    int64_t defunc_0_f_res_128350;\n    int64_t defunc_0_f_res_128351;\n    \n    if (cond_128347) {\n        defunc_0_f_res_128349 = (int64_t) 0;\n        defunc_0_f_res_128350 = (int64_t) 0;\n        defunc_0_f_res_128351 = (int64_t) 0;\n    } else {\n        bool cond_128352 = defunc_0_f_res_128346 == 1;\n        int64_t defunc_0_f_res_f_res_128353 = btoi_bool_i64(cond_128352);\n        int64_t defunc_0_f_res_f_res_128354;\n        int64_t defunc_0_f_res_f_res_128355;\n        \n        if (cond_128352) {\n            defunc_0_f_res_f_res_128354 = (int64_t) 0;\n            defunc_0_f_res_f_res_128355 = (int64_t) 0;\n        } else {\n            bool cond_128356 = defunc_0_f_res_128346 == 2;\n            int64_t defunc_0_f_res_f_res_f_res_128357 =\n                    btoi_bool_i64(cond_128356);\n            bool cond_neg_128358 = !cond_128356;\n            int64_t defunc_0_f_res_f_res_f_res_128359 =\n                    btoi_bool_i64(cond_neg_128358);\n            \n            defunc_0_f_res_f_res_128354 = defunc_0_f_res_f_res_f_res_128357;\n            defunc_0_f_res_f_res_128355 = defunc_0_f_res_f_res_f_res_128359;\n        }\n        defunc_0_f_res_128349 = defunc_0_f_res_f_res_128353;\n        defunc_0_f_res_128350 = defunc_0_f_res_f_res_128354;\n        defunc_0_f_res_128351 = defunc_0_f_res_f_res_128355;\n    }\n    ((__local int64_t *",
                   ") color_132153)[gtid_127988] = defunc_0_f_res_128348;\n    ((__local int64_t *) color_132152)[gtid_127988] = defunc_0_f_res_128349;\n    ((__local int64_t *) color_132151)[gtid_127988] = defunc_0_f_res_128350;\n    ((__local int64_t *) color_132150)[gtid_127988] = defunc_0_f_res_128351;\n    ((__local int32_t *) color_132149)[gtid_127988] = defunc_0_f_res_128346;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t dims_flat_135182 = n_114534;\n    int64_t x_128315;\n    int64_t x_128316;\n    int64_t x_128317;\n    int64_t x_128318;\n    int64_t x_128319;\n    int64_t x_128320;\n    int64_t x_128321;\n    int64_t x_128322;\n    int64_t x_135187;\n    int64_t x_135188;\n    int64_t x_135189;\n    int64_t x_135190;\n    int64_t x_135191;\n    int64_t x_135192;\n    int64_t x_135193;\n    int64_t x_135194;\n    bool ltid_in_bounds_135199 = slt64(sext_i32_i64(local_tid_135175),\n                                       n_114534);\n    int32_t skip_threads_135200;\n    \n    // read input for in-block scan\n    {\n        if (ltid_in_bounds_135199) {\n            x_128319 = ((volatile __local\n                         int64_t *) color_132153)[sext_i32_i64(local_tid_135175)];\n            x_128320 = ((volatile __local\n                         int64_t *) color_132152)[sext_i32_i64(local_tid_135175)];\n            x_128321 = ((volatile __local\n                         int64_t *) color_132151)[sext_i32_i64(local_tid_135175)];\n            x_128322 = ((volatile __local\n                         int64_t *) color_132150)[sext_i32_i64(local_tid_135175)];\n            if ((local_tid_135175 - squot32(local_tid_135175, 32) * 32) == 0) {\n                x_128315 = x_128319;\n                x_128316 = x_128320;\n                x_128317 = x_128321;\n                x_128318 = x_128322;\n            }\n        }\n    }\n    // in-block scan (hopefully no barriers needed)\n    {\n        skip_threads_135200 = 1;\n        while (slt32(skip_threads_135200, 32)) {\n            if (sle32(skip_threads_135200, local_tid_135175 -\n        ",
                   "              squot32(local_tid_135175, 32) * 32) &&\n                ltid_in_bounds_135199) {\n                // read operands\n                {\n                    x_128315 = ((volatile __local\n                                 int64_t *) color_132153)[sext_i32_i64(local_tid_135175) -\n                                                          sext_i32_i64(skip_threads_135200)];\n                    x_128316 = ((volatile __local\n                                 int64_t *) color_132152)[sext_i32_i64(local_tid_135175) -\n                                                          sext_i32_i64(skip_threads_135200)];\n                    x_128317 = ((volatile __local\n                                 int64_t *) color_132151)[sext_i32_i64(local_tid_135175) -\n                                                          sext_i32_i64(skip_threads_135200)];\n                    x_128318 = ((volatile __local\n                                 int64_t *) color_132150)[sext_i32_i64(local_tid_135175) -\n                                                          sext_i32_i64(skip_threads_135200)];\n                }\n                // perform operation\n                {\n                    bool inactive_135201 =\n                         slt64(srem64(sext_i32_i64(local_tid_135175), n_114534),\n                               sext_i32_i64(local_tid_135175) -\n                               sext_i32_i64(local_tid_135175 -\n                               skip_threads_135200));\n                    \n                    if (inactive_135201) {\n                        x_128315 = x_128319;\n                        x_128316 = x_128320;\n                        x_128317 = x_128321;\n                        x_128318 = x_128322;\n                    }\n                    if (!inactive_135201) {\n                        int64_t defunc_1_op_res_128323 = add64(x_128315,\n                                                               x_128319);\n                        int64_t defunc_1_op_res_128324 = add64(x_128316,\n       ",
                   "                                                        x_128320);\n                        int64_t defunc_1_op_res_128325 = add64(x_128317,\n                                                               x_128321);\n                        int64_t defunc_1_op_res_128326 = add64(x_128318,\n                                                               x_128322);\n                        \n                        x_128315 = defunc_1_op_res_128323;\n                        x_128316 = defunc_1_op_res_128324;\n                        x_128317 = defunc_1_op_res_128325;\n                        x_128318 = defunc_1_op_res_128326;\n                    }\n                }\n            }\n            if (sle32(wave_sizze_135177, skip_threads_135200)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            if (sle32(skip_threads_135200, local_tid_135175 -\n                      squot32(local_tid_135175, 32) * 32) &&\n                ltid_in_bounds_135199) {\n                // write result\n                {\n                    ((volatile __local\n                      int64_t *) color_132153)[sext_i32_i64(local_tid_135175)] =\n                        x_128315;\n                    x_128319 = x_128315;\n                    ((volatile __local\n                      int64_t *) color_132152)[sext_i32_i64(local_tid_135175)] =\n                        x_128316;\n                    x_128320 = x_128316;\n                    ((volatile __local\n                      int64_t *) color_132151)[sext_i32_i64(local_tid_135175)] =\n                        x_128317;\n                    x_128321 = x_128317;\n                    ((volatile __local\n                      int64_t *) color_132150)[sext_i32_i64(local_tid_135175)] =\n                        x_128318;\n                    x_128322 = x_128318;\n                }\n            }\n            if (sle32(wave_sizze_135177, skip_threads_135200)) {\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n            skip_threads_135200 *= 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_135175 - squot32(local_tid_135175, 32) * 32) == 31 &&\n            ltid_in_bounds_135199) {\n            ((volatile __local\n              int64_t *) color_132153)[sext_i32_i64(squot32(local_tid_135175,\n                                                            32))] = x_128315;\n            ((volatile __local\n              int64_t *) color_132152)[sext_i32_i64(squot32(local_tid_135175,\n                                                            32))] = x_128316;\n            ((volatile __local\n              int64_t *) color_132151)[sext_i32_i64(squot32(local_tid_135175,\n                                                            32))] = x_128317;\n            ((volatile __local\n              int64_t *) color_132150)[sext_i32_i64(squot32(local_tid_135175,\n                                                            32))] = x_128318;\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_135202;\n        \n        // read input for in-block scan\n        {\n            if (squot32(local_tid_135175, 32) == 0 && ltid_in_bounds_135199) {\n                x_135191 = ((volatile __local\n                             int64_t *) color_132153)[sext_i32_i64(local_tid_135175)];\n                x_135192 = ((volatile __local\n                             int64_t *) color_132152)[sext_i32_i64(local_tid_135175)];\n                x_135193 = ((volatile __local\n                             int64_t *) color_132151)[sext_i32_i64(local_tid_135175)];\n                x_135194 = ((volatile __local\n                             int64_t *) color_132150)[sext_i32_i64(local_tid_135175)];\n                if ((local_tid_135175 - squot32(local_tid_135175, 32) * 32) ==\n                    0) {\n                    x_135187 = x_135191;\n                    x_135188 = x_1",
                   "35192;\n                    x_135189 = x_135193;\n                    x_135190 = x_135194;\n                }\n            }\n        }\n        // in-block scan (hopefully no barriers needed)\n        {\n            skip_threads_135202 = 1;\n            while (slt32(skip_threads_135202, 32)) {\n                if (sle32(skip_threads_135202, local_tid_135175 -\n                          squot32(local_tid_135175, 32) * 32) &&\n                    (squot32(local_tid_135175, 32) == 0 &&\n                     ltid_in_bounds_135199)) {\n                    // read operands\n                    {\n                        x_135187 = ((volatile __local\n                                     int64_t *) color_132153)[sext_i32_i64(local_tid_135175) -\n                                                              sext_i32_i64(skip_threads_135202)];\n                        x_135188 = ((volatile __local\n                                     int64_t *) color_132152)[sext_i32_i64(local_tid_135175) -\n                                                              sext_i32_i64(skip_threads_135202)];\n                        x_135189 = ((volatile __local\n                                     int64_t *) color_132151)[sext_i32_i64(local_tid_135175) -\n                                                              sext_i32_i64(skip_threads_135202)];\n                        x_135190 = ((volatile __local\n                                     int64_t *) color_132150)[sext_i32_i64(local_tid_135175) -\n                                                              sext_i32_i64(skip_threads_135202)];\n                    }\n                    // perform operation\n                    {\n                        bool inactive_135203 =\n                             slt64(srem64(sext_i32_i64(local_tid_135175 * 32 +\n                                          32 - 1), n_114534),\n                                   sext_i32_i64(local_tid_135175 * 32 + 32 -\n                                   1) - sext_i32_i64((local_tid_135175 -\n      ",
                   "                                                skip_threads_135202) *\n                                   32 + 32 - 1));\n                        \n                        if (inactive_135203) {\n                            x_135187 = x_135191;\n                            x_135188 = x_135192;\n                            x_135189 = x_135193;\n                            x_135190 = x_135194;\n                        }\n                        if (!inactive_135203) {\n                            int64_t defunc_1_op_res_135195 = add64(x_135187,\n                                                                   x_135191);\n                            int64_t defunc_1_op_res_135196 = add64(x_135188,\n                                                                   x_135192);\n                            int64_t defunc_1_op_res_135197 = add64(x_135189,\n                                                                   x_135193);\n                            int64_t defunc_1_op_res_135198 = add64(x_135190,\n                                                                   x_135194);\n                            \n                            x_135187 = defunc_1_op_res_135195;\n                            x_135188 = defunc_1_op_res_135196;\n                            x_135189 = defunc_1_op_res_135197;\n                            x_135190 = defunc_1_op_res_135198;\n                        }\n                    }\n                }\n                if (sle32(wave_sizze_135177, skip_threads_135202)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                if (sle32(skip_threads_135202, local_tid_135175 -\n                          squot32(local_tid_135175, 32) * 32) &&\n                    (squot32(local_tid_135175, 32) == 0 &&\n                     ltid_in_bounds_135199)) {\n                    // write result\n                    {\n                        ((volatile __local\n                          int64_t *) color_132153)[sext_i32_i64(local_tid_135175)] =\n          ",
                   "                  x_135187;\n                        x_135191 = x_135187;\n                        ((volatile __local\n                          int64_t *) color_132152)[sext_i32_i64(local_tid_135175)] =\n                            x_135188;\n                        x_135192 = x_135188;\n                        ((volatile __local\n                          int64_t *) color_132151)[sext_i32_i64(local_tid_135175)] =\n                            x_135189;\n                        x_135193 = x_135189;\n                        ((volatile __local\n                          int64_t *) color_132150)[sext_i32_i64(local_tid_135175)] =\n                            x_135190;\n                        x_135194 = x_135190;\n                    }\n                }\n                if (sle32(wave_sizze_135177, skip_threads_135202)) {\n                    barrier(CLK_LOCAL_MEM_FENCE);\n                }\n                skip_threads_135202 *= 2;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // carry-in for every block except the first\n    {\n        if (!(squot32(local_tid_135175, 32) == 0 || !ltid_in_bounds_135199)) {\n            // read operands\n            {\n                x_128319 = x_128315;\n                x_128320 = x_128316;\n                x_128321 = x_128317;\n                x_128322 = x_128318;\n                x_128315 = ((__local\n                             int64_t *) color_132153)[sext_i32_i64(squot32(local_tid_135175,\n                                                                           32)) -\n                                                      (int64_t) 1];\n                x_128316 = ((__local\n                             int64_t *) color_132152)[sext_i32_i64(squot32(local_tid_135175,\n                                                                           32)) -\n                                                      (int64_t) 1];\n                x_128317 = ((__local\n                             int64_t *) color_132151)[sext_i32_i64(squot32(local_tid_1351",
                   "75,\n                                                                           32)) -\n                                                      (int64_t) 1];\n                x_128318 = ((__local\n                             int64_t *) color_132150)[sext_i32_i64(squot32(local_tid_135175,\n                                                                           32)) -\n                                                      (int64_t) 1];\n            }\n            // perform operation\n            {\n                bool inactive_135204 =\n                     slt64(srem64(sext_i32_i64(local_tid_135175), n_114534),\n                           sext_i32_i64(local_tid_135175) -\n                           sext_i32_i64(squot32(local_tid_135175, 32) * 32 -\n                           1));\n                \n                if (inactive_135204) {\n                    x_128315 = x_128319;\n                    x_128316 = x_128320;\n                    x_128317 = x_128321;\n                    x_128318 = x_128322;\n                }\n                if (!inactive_135204) {\n                    int64_t defunc_1_op_res_128323 = add64(x_128315, x_128319);\n                    int64_t defunc_1_op_res_128324 = add64(x_128316, x_128320);\n                    int64_t defunc_1_op_res_128325 = add64(x_128317, x_128321);\n                    int64_t defunc_1_op_res_128326 = add64(x_128318, x_128322);\n                    \n                    x_128315 = defunc_1_op_res_128323;\n                    x_128316 = defunc_1_op_res_128324;\n                    x_128317 = defunc_1_op_res_128325;\n                    x_128318 = defunc_1_op_res_128326;\n                }\n            }\n            // write final result\n            {\n                ((__local\n                  int64_t *) color_132153)[sext_i32_i64(local_tid_135175)] =\n                    x_128315;\n                ((__local\n                  int64_t *) color_132152)[sext_i32_i64(local_tid_135175)] =\n                    x_128316;\n                ((__local\n         ",
                   "         int64_t *) color_132151)[sext_i32_i64(local_tid_135175)] =\n                    x_128317;\n                ((__local\n                  int64_t *) color_132150)[sext_i32_i64(local_tid_135175)] =\n                    x_128318;\n            }\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    // restore correct values for first block\n    {\n        if (squot32(local_tid_135175, 32) == 0) {\n            ((__local int64_t *) color_132153)[sext_i32_i64(local_tid_135175)] =\n                x_128319;\n            ((__local int64_t *) color_132152)[sext_i32_i64(local_tid_135175)] =\n                x_128320;\n            ((__local int64_t *) color_132151)[sext_i32_i64(local_tid_135175)] =\n                x_128321;\n            ((__local int64_t *) color_132150)[sext_i32_i64(local_tid_135175)] =\n                x_128322;\n        }\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t last_res_128360 = ((__local int64_t *) color_132153)[i_114610];\n    int64_t last_res_128361 = ((__local int64_t *) color_132152)[i_114610];\n    int64_t last_res_128362 = ((__local int64_t *) color_132151)[i_114610];\n    int64_t write_i_127990 = sext_i32_i64(ltid_pre_135179);\n    int32_t phys_tid_127991 = local_tid_135175;\n    int32_t x_128364 = ((__local int32_t *) color_132149)[write_i_127990];\n    float write_value_128369 = ((__global\n                                 float *) mem_param_131846)[gtid_127985 *\n                                                            n_114534 +\n                                                            write_i_127990];\n    bool match_lit_128370 = 0 == x_128364;\n    int64_t defunc_1_f_res_128371;\n    \n    if (match_lit_128370) {\n        int64_t x_128365 = ((__local int64_t *) color_132153)[write_i_127990];\n        int64_t case_res_128372 = sub64(x_128365, (int64_t) 1);\n        \n        defunc_1_f_res_128371 = case_res_128372;\n    } else {\n        bool match_lit_128373 = 1 == x_128364;\n        int64_t x_128374;\n        \n        if (match_lit_128373) {\n      ",
                   "      int64_t x_128366 = ((__local\n                                 int64_t *) color_132152)[write_i_127990];\n            int64_t x_128375 = add64(last_res_128360, x_128366);\n            int64_t case_res_128376 = sub64(x_128375, (int64_t) 1);\n            \n            x_128374 = case_res_128376;\n        } else {\n            bool match_lit_128377 = 2 == x_128364;\n            int64_t x_128378;\n            \n            if (match_lit_128377) {\n                int64_t x_128367 = ((__local\n                                     int64_t *) color_132151)[write_i_127990];\n                int64_t x_128379 = add64(last_res_128360, last_res_128361);\n                int64_t x_128380 = add64(x_128367, x_128379);\n                int64_t case_res_128381 = sub64(x_128380, (int64_t) 1);\n                \n                x_128378 = case_res_128381;\n            } else {\n                int64_t x_128368 = ((__local\n                                     int64_t *) color_132150)[write_i_127990];\n                int64_t x_128382 = add64(last_res_128360, last_res_128361);\n                int64_t x_128383 = add64(last_res_128362, x_128382);\n                int64_t x_128384 = add64(x_128368, x_128383);\n                int64_t defunc_1_f_res_res_128385 = sub64(x_128384,\n                                                          (int64_t) 1);\n                \n                x_128378 = defunc_1_f_res_res_128385;\n            }\n            x_128374 = x_128378;\n        }\n        defunc_1_f_res_128371 = x_128374;\n    }\n    if (sle64((int64_t) 0, defunc_1_f_res_128371) &&\n        slt64(defunc_1_f_res_128371, n_114534)) {\n        ((__local float *) color_132154)[defunc_1_f_res_128371] =\n            write_value_128369;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    ((__global float *) mem_131877)[gtid_127985 * n_114534 +\n                                    sext_i32_i64(local_tid_135175)] = ((__local\n                                                                        float *) color_132154)[sext_i32_i64(loca",
                   "l_tid_135175)];\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n  error_2:\n    return;\n}\n__kernel void mainzisegmap_intragroup_129249(__global int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                                             __local volatile\n                                             int64_t *color_132069_backing_aligned_0,\n                                             int64_t m_114533, int64_t n_114534,\n                                             int64_t n_p_114536,\n                                             int64_t css_chunk_len_114580,\n                                             int64_t num_groups_x_129246,\n                                             int64_t num_groups_y_129247,\n                                             int64_t num_whole_tiles_129265,\n                                             int64_t residual_input_129400,\n                                             unsigned char cond_129401, __global\n                                             unsigned char *Y_mem_130086,\n                                             __global unsigned char *mem_130152,\n                                             __global unsigned char *mem_130186)\n{\n    #define tile_sizze_129244 (mainzitile_sizze_129243)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict color_132069_backing_0 = (__local volatile\n                                                              char *) color_132069_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_132421;\n    int32_t local_tid_132422;\n    int64_t group_sizze_132425;\n    int32_t wave_sizze_132424;\n   ",
                   " int32_t group_tid_132423;\n    \n    global_tid_132421 = get_global_id(0);\n    local_tid_132422 = get_local_id(0);\n    group_sizze_132425 = get_local_size(0);\n    wave_sizze_132424 = LOCKSTEP_WIDTH;\n    group_tid_132423 = get_group_id(0);\n    \n    int32_t gid_flat_129249 = group_tid_132423;\n    int32_t ltid_pre_132426 = squot32(local_tid_132422,\n                                      sext_i64_i32(tile_sizze_129244));\n    int32_t ltid_pre_132427 = local_tid_132422 - squot32(local_tid_132422,\n                                                         sext_i64_i32(tile_sizze_129244)) *\n            sext_i64_i32(tile_sizze_129244);\n    int64_t slice_132428 = num_groups_y_129247;\n    int64_t slice_132429 = num_groups_x_129246 * slice_132428;\n    int64_t gid_x_129241 = squot64(sext_i32_i64(group_tid_132423),\n                                   slice_132428);\n    int64_t remnant_132430 = sext_i32_i64(group_tid_132423) - gid_x_129241 *\n            slice_132428;\n    int64_t gid_y_129242 = remnant_132430;\n    int64_t remnant_132431 = remnant_132430 - gid_y_129242;\n    float color_132067[1];\n    float color_132068[1];\n    __local char *color_132069;\n    \n    color_132069 = (__local char *) color_132069_backing_0;\n    \n    int64_t ltid_y_129268 = sext_i32_i64(ltid_pre_132426);\n    int64_t ltid_x_129266 = sext_i32_i64(ltid_pre_132427);\n    int32_t ltid_flat_129267 = local_tid_132422;\n    \n    if (slt64(ltid_y_129268, tile_sizze_129244) && slt64(ltid_x_129266,\n                                                         tile_sizze_129244)) {\n        color_132068[(int64_t) 0] = 0.0F;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t binop_x_129353 = gid_y_129242 * tile_sizze_129244;\n    int64_t binop_x_129363 = gid_x_129241 * tile_sizze_129244;\n    float accs_mem_130168[1];\n    float mem_param_130158[1];\n    \n    for (int32_t i_1 = 0; i_1 < 1; i_1++)\n        mem_param_130158[i_1] = color_132068[i_1];\n    for (int64_t tile_id_129277 = 0; tile_id_129277 < num_whole_tiles_129265;\n      ",
                   "   tile_id_129277++) {\n        int64_t binop_x_129347 = tile_sizze_129244 * tile_id_129277;\n        int64_t ltid_y_129280 = sext_i32_i64(ltid_pre_132426);\n        int64_t ltid_x_129278 = sext_i32_i64(ltid_pre_132427);\n        int32_t ltid_flat_129279 = local_tid_132422;\n        int64_t i_129348 = ltid_y_129280 + binop_x_129347;\n        int64_t gtid_129354 = ltid_x_129278 + binop_x_129353;\n        bool binop_x_129356 = slt64(i_129348, css_chunk_len_114580);\n        bool binop_y_129357 = slt64(gtid_129354, n_p_114536);\n        bool cond_129358 = binop_x_129356 && binop_y_129357;\n        int64_t pre_129359;\n        \n        if (cond_129358) {\n            int64_t x_129360 = ((__global int64_t *) mem_130152)[i_129348 *\n                                                                 n_p_114536 +\n                                                                 gtid_129354];\n            \n            pre_129359 = x_129360;\n        } else {\n            pre_129359 = (int64_t) 0;\n        }\n        ((__local int64_t *) color_132069)[ltid_y_129280 * tile_sizze_129244 +\n                                           ltid_x_129278] = pre_129359;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t ltid_y_129311 = sext_i32_i64(ltid_pre_132426);\n        int64_t ltid_x_129309 = sext_i32_i64(ltid_pre_132427);\n        int32_t ltid_flat_129310 = local_tid_132422;\n        int64_t gtid_129364 = ltid_y_129311 + binop_x_129363;\n        int64_t gtid_129366 = ltid_x_129309 + binop_x_129353;\n        float acc_129368 = mem_param_130158[(int64_t) 0];\n        bool binop_x_129370 = slt64(gtid_129364, m_114533);\n        bool binop_y_129371 = slt64(gtid_129366, n_p_114536);\n        bool cond_129372 = binop_x_129370 && binop_y_129371;\n        float acc_129373;\n        \n        if (cond_129372) {\n            float x_129374;\n            float redout_129842 = acc_129368;\n            \n            for (int64_t i_129843 = 0; i_129843 < tile_sizze_129244;\n                 i_129843++) {\n               ",
                   " int64_t x_129378 = ((__local int64_t *) color_132069)[i_129843 *\n                                                                      tile_sizze_129244 +\n                                                                      ltid_x_129309];\n                bool cond_129379 = sle64((int64_t) 0, x_129378);\n                float defunc_0_f_res_129380;\n                \n                if (cond_129379) {\n                    bool y_129381 = slt64(x_129378, n_114534);\n                    bool bounds_check_129382 = cond_129379 && y_129381;\n                    bool index_certs_129383;\n                    \n                    if (!bounds_check_129382) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          2) == -1) {\n                                global_failure_args[0] = x_129378;\n                                global_failure_args[1] = n_114534;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_2;\n                        }\n                    }\n                    \n                    float defunc_0_f_res_t_res_129384 = ((__global\n                                                          float *) Y_mem_130086)[gtid_129364 *\n                                                                                 n_114534 +\n                                                                                 x_129378];\n                    \n                    defunc_0_f_res_129380 = defunc_0_f_res_t_res_129384;\n                } else {\n                    defunc_0_f_res_129380 = NAN;\n                }\n                \n                bool isnan_res_129385;\n                \n                isnan_res_129385 = futrts_isnan32(defunc_0_f_res_129380);\n                \n                float defunc_0_f_res_129386;\n                \n                if (isnan_res_129385) {\n                ",
                   "    defunc_0_f_res_129386 = 0.0F;\n                } else {\n                    defunc_0_f_res_129386 = 1.0F;\n                }\n                \n                float defunc_1_op_res_129377 = defunc_0_f_res_129386 +\n                      redout_129842;\n                float redout_tmp_132434 = defunc_1_op_res_129377;\n                \n                redout_129842 = redout_tmp_132434;\n            }\n            x_129374 = redout_129842;\n            acc_129373 = x_129374;\n        } else {\n            acc_129373 = acc_129368;\n        }\n        color_132067[(int64_t) 0] = acc_129373;\n        \n      error_2:\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_failure)\n            return;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        float mem_param_tmp_132432[1];\n        \n        for (int32_t i_2 = 0; i_2 < 1; i_2++)\n            mem_param_tmp_132432[i_2] = color_132067[i_2];\n        for (int32_t i_3 = 0; i_3 < 1; i_3++)\n            mem_param_130158[i_3] = mem_param_tmp_132432[i_3];\n    }\n    for (int32_t i_4 = 0; i_4 < 1; i_4++)\n        accs_mem_130168[i_4] = mem_param_130158[i_4];\n    if (cond_129401) {\n        color_132067[(int64_t) 0] = accs_mem_130168[(int64_t) 0];\n    } else {\n        int64_t binop_x_129472 = tile_sizze_129244 * num_whole_tiles_129265;\n        int64_t ltid_y_129404 = sext_i32_i64(ltid_pre_132426);\n        int64_t ltid_x_129402 = sext_i32_i64(ltid_pre_132427);\n        int32_t ltid_flat_129403 = local_tid_132422;\n        int64_t i_129473 = ltid_y_129404 + binop_x_129472;\n        int64_t gtid_129479 = binop_x_129353 + ltid_x_129402;\n        bool binop_x_129481 = slt64(i_129473, css_chunk_len_114580);\n        bool binop_y_129482 = slt64(gtid_129479, n_p_114536);\n        bool cond_129483 = binop_x_129481 && binop_y_129482;\n        int64_t pre_129484;\n        \n        if (cond_129483) {\n            int64_t x_129485 = ((__global int64_t *) mem_130152)[i_129473 *\n                                                                 n_p_114536 +\n      ",
                   "                                                           gtid_129479];\n            \n            pre_129484 = x_129485;\n        } else {\n            pre_129484 = (int64_t) 0;\n        }\n        ((__local int64_t *) color_132069)[ltid_y_129404 * tile_sizze_129244 +\n                                           ltid_x_129402] = pre_129484;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t ltid_y_129436 = sext_i32_i64(ltid_pre_132426);\n        int64_t ltid_x_129434 = sext_i32_i64(ltid_pre_132427);\n        int32_t ltid_flat_129435 = local_tid_132422;\n        int64_t gtid_129490 = binop_x_129363 + ltid_y_129436;\n        int64_t gtid_129492 = binop_x_129353 + ltid_x_129434;\n        float acc_129494 = accs_mem_130168[(int64_t) 0];\n        bool binop_x_129496 = slt64(gtid_129490, m_114533);\n        bool binop_y_129497 = slt64(gtid_129492, n_p_114536);\n        bool cond_129498 = binop_x_129496 && binop_y_129497;\n        float acc_129499;\n        \n        if (cond_129498) {\n            float x_129500;\n            float redout_129844 = acc_129494;\n            \n            for (int64_t i_129845 = 0; i_129845 < residual_input_129400;\n                 i_129845++) {\n                int64_t x_129504 = ((__local int64_t *) color_132069)[i_129845 *\n                                                                      tile_sizze_129244 +\n                                                                      ltid_x_129434];\n                bool cond_129505 = sle64((int64_t) 0, x_129504);\n                float defunc_0_f_res_129506;\n                \n                if (cond_129505) {\n                    bool y_129507 = slt64(x_129504, n_114534);\n                    bool bounds_check_129508 = cond_129505 && y_129507;\n                    bool index_certs_129509;\n                    \n                    if (!bounds_check_129508) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                ",
                   "          3) == -1) {\n                                global_failure_args[0] = x_129504;\n                                global_failure_args[1] = n_114534;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_4;\n                        }\n                    }\n                    \n                    float defunc_0_f_res_t_res_129510 = ((__global\n                                                          float *) Y_mem_130086)[gtid_129490 *\n                                                                                 n_114534 +\n                                                                                 x_129504];\n                    \n                    defunc_0_f_res_129506 = defunc_0_f_res_t_res_129510;\n                } else {\n                    defunc_0_f_res_129506 = NAN;\n                }\n                \n                bool isnan_res_129511;\n                \n                isnan_res_129511 = futrts_isnan32(defunc_0_f_res_129506);\n                \n                float defunc_0_f_res_129512;\n                \n                if (isnan_res_129511) {\n                    defunc_0_f_res_129512 = 0.0F;\n                } else {\n                    defunc_0_f_res_129512 = 1.0F;\n                }\n                \n                float defunc_1_op_res_129503 = defunc_0_f_res_129512 +\n                      redout_129844;\n                float redout_tmp_132435 = defunc_1_op_res_129503;\n                \n                redout_129844 = redout_tmp_132435;\n            }\n            x_129500 = redout_129844;\n            acc_129499 = x_129500;\n        } else {\n            acc_129499 = acc_129494;\n        }\n        color_132068[(int64_t) 0] = acc_129499;\n        \n      error_4:\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_failure)\n            return;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        color_132067[(int64_t) 0] = color_132068[(int64_t) 0];\n    }\n    ",
                   "\n    int64_t ltid_y_129516 = sext_i32_i64(ltid_pre_132426);\n    int64_t ltid_x_129514 = sext_i32_i64(ltid_pre_132427);\n    int32_t ltid_flat_129515 = local_tid_132422;\n    \n    if (slt64(ltid_y_129516, tile_sizze_129244) && slt64(ltid_x_129514,\n                                                         tile_sizze_129244)) {\n        int64_t gtid_129525 = binop_x_129363 + ltid_y_129516;\n        int64_t gtid_129527 = binop_x_129353 + ltid_x_129514;\n        bool binop_x_129529 = slt64(gtid_129525, m_114533);\n        bool binop_y_129530 = slt64(gtid_129527, n_p_114536);\n        bool cond_129531 = binop_x_129529 && binop_y_129530;\n        float postlude_129532;\n        \n        if (cond_129531) {\n            float defunc_2_reduce_res_129528 = color_132067[(int64_t) 0];\n            bool sub_series_is_not_all_nan_129534 = 0.0F <\n                 defunc_2_reduce_res_129528;\n            bool assert_c_129535;\n            \n            if (!sub_series_is_not_all_nan_129534) {\n                {\n                    if (atomic_cmpxchg_i32_global(global_failure, -1, 4) ==\n                        -1) {\n                        ;\n                    }\n                    local_failure = true;\n                    goto error_5;\n                }\n            }\n            \n            float lam_res_129536 = defunc_2_reduce_res_129528;\n            \n            postlude_129532 = lam_res_129536;\n        } else {\n            postlude_129532 = 0.0F;\n        }\n        color_132068[(int64_t) 0] = postlude_129532;\n    }\n    \n  error_5:\n    barrier(CLK_LOCAL_MEM_FENCE);\n    if (local_failure)\n        return;\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t thread_out_index_132436 = gid_x_129241 * tile_sizze_129244 +\n            sext_i32_i64(ltid_pre_132426);\n    int64_t thread_out_index_132437 = gid_y_129242 * tile_sizze_129244 +\n            sext_i32_i64(ltid_pre_132427);\n    \n    if (slt64(thread_out_index_132436, m_114533) &&\n        slt64(thread_out_index_132437, n_p_114536)) {\n        ((__glob",
                   "al float *) mem_130186)[thread_out_index_132436 * n_p_114536 +\n                                        thread_out_index_132437] =\n            color_132068[(int64_t) 0];\n    }\n    \n  error_6:\n    return;\n    #undef tile_sizze_129244\n}\n__kernel void mainzisegmap_intragroup_129547(__global int *global_failure,\n                                             int failure_is_an_option, __global\n                                             int64_t *global_failure_args,\n                                             __local volatile\n                                             int64_t *color_132102_backing_aligned_0,\n                                             int64_t m_114533, int64_t n_114534,\n                                             int64_t n_p_114536,\n                                             int64_t css_chunk_len_114580,\n                                             int64_t num_groups_x_129544,\n                                             int64_t num_groups_y_129545,\n                                             int64_t num_whole_tiles_129563,\n                                             int64_t residual_input_129698,\n                                             unsigned char cond_129699, __global\n                                             unsigned char *defunc_3_map_res_mem_130203,\n                                             __global unsigned char *mem_130621,\n                                             __global unsigned char *mem_130672,\n                                             __global unsigned char *mem_130728)\n{\n    #define tile_sizze_129542 (mainzitile_sizze_129541)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict color_132102_backing_0 = (__local volatile\n                                                              char *) color_132102_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_133017;\n    int32_t local_tid_133018;\n    int64_t group_sizze_133021;\n    int32_t wave_sizze_133020;\n    int32_t group_tid_133019;\n    \n    global_tid_133017 = get_global_id(0);\n    local_tid_133018 = get_local_id(0);\n    group_sizze_133021 = get_local_size(0);\n    wave_sizze_133020 = LOCKSTEP_WIDTH;\n    group_tid_133019 = get_group_id(0);\n    \n    int32_t gid_flat_129547 = group_tid_133019;\n    int32_t ltid_pre_133022 = squot32(local_tid_133018,\n                                      sext_i64_i32(tile_sizze_129542));\n    int32_t ltid_pre_133023 = local_tid_133018 - squot32(local_tid_133018,\n                                                         sext_i64_i32(tile_sizze_129542)) *\n            sext_i64_i32(tile_sizze_129542);\n    int64_t slice_133024 = num_groups_y_129545;\n    int64_t slice_133025 = num_groups_x_129544 * slice_133024;\n    int64_t gid_x_129539 = squot64(sext_i32_i64(group_tid_133019),\n                                   slice_133024);\n    int64_t remnant_133026 = sext_i32_i64(group_tid_133019) - gid_x_129539 *\n            slice_133024;\n    int64_t gid_y_129540 = remnant_133026;\n    int64_t remnant_133027 = remnant_133026 - gid_y_129540;\n    float color_132100[1];\n    float color_132101[1];\n    __local char *color_132102;\n    \n    color_132102 = (__local char *) color_132102_backing_0;\n    \n    int64_t ltid_y_129566 = sext_i32_i64(ltid_pre_133022);\n    int64_t ltid_x_129564 = sext_i32_i64(ltid_pre_133023);\n    int32_t ltid_flat_129565 = local_tid_133018;\n    \n    if (slt64(ltid_y_129566, tile_sizze_129542) && slt64(ltid_x_129564,\n                                                         tile_sizze_129542)) {\n        color_132101[(int64_t) 0] = 0.0F;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t binop_x_129651 = gid_y_129540 * tile_sizze_129542;\n    int64_t binop_x_129661 = gid_x_129539 * tile_sizze_1",
                   "29542;\n    float accs_mem_130710[1];\n    float mem_param_130700[1];\n    \n    for (int32_t i_1 = 0; i_1 < 1; i_1++)\n        mem_param_130700[i_1] = color_132101[i_1];\n    for (int64_t tile_id_129575 = 0; tile_id_129575 < num_whole_tiles_129563;\n         tile_id_129575++) {\n        int64_t binop_x_129645 = tile_sizze_129542 * tile_id_129575;\n        int64_t ltid_y_129578 = sext_i32_i64(ltid_pre_133022);\n        int64_t ltid_x_129576 = sext_i32_i64(ltid_pre_133023);\n        int32_t ltid_flat_129577 = local_tid_133018;\n        int64_t i_129646 = ltid_y_129578 + binop_x_129645;\n        int64_t gtid_129652 = ltid_x_129576 + binop_x_129651;\n        bool binop_x_129654 = slt64(i_129646, css_chunk_len_114580);\n        bool binop_y_129655 = slt64(gtid_129652, n_p_114536);\n        bool cond_129656 = binop_x_129654 && binop_y_129655;\n        int64_t pre_129657;\n        \n        if (cond_129656) {\n            int64_t x_129658 = ((__global int64_t *) mem_130621)[i_129646 *\n                                                                 n_p_114536 +\n                                                                 gtid_129652];\n            \n            pre_129657 = x_129658;\n        } else {\n            pre_129657 = (int64_t) 0;\n        }\n        ((__local int64_t *) color_132102)[ltid_y_129578 * tile_sizze_129542 +\n                                           ltid_x_129576] = pre_129657;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t ltid_y_129609 = sext_i32_i64(ltid_pre_133022);\n        int64_t ltid_x_129607 = sext_i32_i64(ltid_pre_133023);\n        int32_t ltid_flat_129608 = local_tid_133018;\n        int64_t gtid_129662 = ltid_y_129609 + binop_x_129661;\n        int64_t gtid_129664 = ltid_x_129607 + binop_x_129651;\n        float acc_129666 = mem_param_130700[(int64_t) 0];\n        bool binop_x_129668 = slt64(gtid_129662, m_114533);\n        bool binop_y_129669 = slt64(gtid_129664, n_p_114536);\n        bool cond_129670 = binop_x_129668 && binop_y_129669;\n        float ",
                   "acc_129671;\n        \n        if (cond_129670) {\n            float x_129672;\n            float redout_129888 = acc_129666;\n            \n            for (int64_t i_129889 = 0; i_129889 < tile_sizze_129542;\n                 i_129889++) {\n                int64_t x_129676 = ((__local int64_t *) color_132102)[i_129889 *\n                                                                      tile_sizze_129542 +\n                                                                      ltid_x_129607];\n                bool cond_129677 = sle64((int64_t) 0, x_129676);\n                float defunc_0_f_res_129678;\n                \n                if (cond_129677) {\n                    bool y_129679 = slt64(x_129676, n_114534);\n                    bool bounds_check_129680 = cond_129677 && y_129679;\n                    bool index_certs_129681;\n                    \n                    if (!bounds_check_129680) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          57) == -1) {\n                                global_failure_args[0] = x_129676;\n                                global_failure_args[1] = n_114534;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_2;\n                        }\n                    }\n                    \n                    float defunc_0_f_res_t_res_129682 = ((__global\n                                                          float *) mem_130672)[gtid_129662 *\n                                                                               n_114534 +\n                                                                               x_129676];\n                    \n                    defunc_0_f_res_129678 = defunc_0_f_res_t_res_129682;\n                } else {\n                    defunc_0_f_res_129678 = NAN;\n                }\n                \n                bool",
                   " isnan_res_129683;\n                \n                isnan_res_129683 = futrts_isnan32(defunc_0_f_res_129678);\n                \n                float defunc_0_f_res_129684;\n                \n                if (isnan_res_129683) {\n                    defunc_0_f_res_129684 = 0.0F;\n                } else {\n                    defunc_0_f_res_129684 = defunc_0_f_res_129678;\n                }\n                \n                float defunc_1_op_res_129675 = defunc_0_f_res_129684 +\n                      redout_129888;\n                float redout_tmp_133030 = defunc_1_op_res_129675;\n                \n                redout_129888 = redout_tmp_133030;\n            }\n            x_129672 = redout_129888;\n            acc_129671 = x_129672;\n        } else {\n            acc_129671 = acc_129666;\n        }\n        color_132100[(int64_t) 0] = acc_129671;\n        \n      error_2:\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_failure)\n            return;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        float mem_param_tmp_133028[1];\n        \n        for (int32_t i_2 = 0; i_2 < 1; i_2++)\n            mem_param_tmp_133028[i_2] = color_132100[i_2];\n        for (int32_t i_3 = 0; i_3 < 1; i_3++)\n            mem_param_130700[i_3] = mem_param_tmp_133028[i_3];\n    }\n    for (int32_t i_4 = 0; i_4 < 1; i_4++)\n        accs_mem_130710[i_4] = mem_param_130700[i_4];\n    if (cond_129699) {\n        color_132100[(int64_t) 0] = accs_mem_130710[(int64_t) 0];\n    } else {\n        int64_t binop_x_129770 = tile_sizze_129542 * num_whole_tiles_129563;\n        int64_t ltid_y_129702 = sext_i32_i64(ltid_pre_133022);\n        int64_t ltid_x_129700 = sext_i32_i64(ltid_pre_133023);\n        int32_t ltid_flat_129701 = local_tid_133018;\n        int64_t i_129771 = ltid_y_129702 + binop_x_129770;\n        int64_t gtid_129777 = binop_x_129651 + ltid_x_129700;\n        bool binop_x_129779 = slt64(i_129771, css_chunk_len_114580);\n        bool binop_y_129780 = slt64(gtid_129777, n_p_114536);\n        bool cond_12978",
                   "1 = binop_x_129779 && binop_y_129780;\n        int64_t pre_129782;\n        \n        if (cond_129781) {\n            int64_t x_129783 = ((__global int64_t *) mem_130621)[i_129771 *\n                                                                 n_p_114536 +\n                                                                 gtid_129777];\n            \n            pre_129782 = x_129783;\n        } else {\n            pre_129782 = (int64_t) 0;\n        }\n        ((__local int64_t *) color_132102)[ltid_y_129702 * tile_sizze_129542 +\n                                           ltid_x_129700] = pre_129782;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int64_t ltid_y_129734 = sext_i32_i64(ltid_pre_133022);\n        int64_t ltid_x_129732 = sext_i32_i64(ltid_pre_133023);\n        int32_t ltid_flat_129733 = local_tid_133018;\n        int64_t gtid_129788 = binop_x_129661 + ltid_y_129734;\n        int64_t gtid_129790 = binop_x_129651 + ltid_x_129732;\n        float acc_129792 = accs_mem_130710[(int64_t) 0];\n        bool binop_x_129794 = slt64(gtid_129788, m_114533);\n        bool binop_y_129795 = slt64(gtid_129790, n_p_114536);\n        bool cond_129796 = binop_x_129794 && binop_y_129795;\n        float acc_129797;\n        \n        if (cond_129796) {\n            float x_129798;\n            float redout_129890 = acc_129792;\n            \n            for (int64_t i_129891 = 0; i_129891 < residual_input_129698;\n                 i_129891++) {\n                int64_t x_129802 = ((__local int64_t *) color_132102)[i_129891 *\n                                                                      tile_sizze_129542 +\n                                                                      ltid_x_129732];\n                bool cond_129803 = sle64((int64_t) 0, x_129802);\n                float defunc_0_f_res_129804;\n                \n                if (cond_129803) {\n                    bool y_129805 = slt64(x_129802, n_114534);\n                    bool bounds_check_129806 = cond_129803 && y_129805;\n    ",
                   "                bool index_certs_129807;\n                    \n                    if (!bounds_check_129806) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          58) == -1) {\n                                global_failure_args[0] = x_129802;\n                                global_failure_args[1] = n_114534;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_4;\n                        }\n                    }\n                    \n                    float defunc_0_f_res_t_res_129808 = ((__global\n                                                          float *) mem_130672)[gtid_129788 *\n                                                                               n_114534 +\n                                                                               x_129802];\n                    \n                    defunc_0_f_res_129804 = defunc_0_f_res_t_res_129808;\n                } else {\n                    defunc_0_f_res_129804 = NAN;\n                }\n                \n                bool isnan_res_129809;\n                \n                isnan_res_129809 = futrts_isnan32(defunc_0_f_res_129804);\n                \n                float defunc_0_f_res_129810;\n                \n                if (isnan_res_129809) {\n                    defunc_0_f_res_129810 = 0.0F;\n                } else {\n                    defunc_0_f_res_129810 = defunc_0_f_res_129804;\n                }\n                \n                float defunc_1_op_res_129801 = defunc_0_f_res_129810 +\n                      redout_129890;\n                float redout_tmp_133031 = defunc_1_op_res_129801;\n                \n                redout_129890 = redout_tmp_133031;\n            }\n            x_129798 = redout_129890;\n            acc_129797 = x_129798;\n        } else {\n            acc_129797 = acc_129792;\n    ",
                   "    }\n        color_132101[(int64_t) 0] = acc_129797;\n        \n      error_4:\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_failure)\n            return;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        color_132100[(int64_t) 0] = color_132101[(int64_t) 0];\n    }\n    \n    int64_t ltid_y_129814 = sext_i32_i64(ltid_pre_133022);\n    int64_t ltid_x_129812 = sext_i32_i64(ltid_pre_133023);\n    int32_t ltid_flat_129813 = local_tid_133018;\n    \n    if (slt64(ltid_y_129814, tile_sizze_129542) && slt64(ltid_x_129812,\n                                                         tile_sizze_129542)) {\n        int64_t gtid_129823 = binop_x_129661 + ltid_y_129814;\n        int64_t gtid_129825 = binop_x_129651 + ltid_x_129812;\n        bool binop_x_129827 = slt64(gtid_129823, m_114533);\n        bool binop_y_129828 = slt64(gtid_129825, n_p_114536);\n        bool cond_129829 = binop_x_129827 && binop_y_129828;\n        float postlude_129830;\n        \n        if (cond_129829) {\n            float defunc_2_reduce_res_129826 = color_132100[(int64_t) 0];\n            float x_129832 = ((__global\n                               float *) defunc_3_map_res_mem_130203)[gtid_129823 *\n                                                                     n_p_114536 +\n                                                                     gtid_129825];\n            float defunc_1_f_res_129833 = defunc_2_reduce_res_129826 / x_129832;\n            \n            postlude_129830 = defunc_1_f_res_129833;\n        } else {\n            postlude_129830 = 0.0F;\n        }\n        color_132101[(int64_t) 0] = postlude_129830;\n    }\n    barrier(CLK_LOCAL_MEM_FENCE);\n    \n    int64_t thread_out_index_133032 = gid_x_129539 * tile_sizze_129542 +\n            sext_i32_i64(ltid_pre_133022);\n    int64_t thread_out_index_133033 = gid_y_129540 * tile_sizze_129542 +\n            sext_i32_i64(ltid_pre_133023);\n    \n    if (slt64(thread_out_index_133032, m_114533) &&\n        slt64(thread_out_index_133033, n_p_114536)) {\n        ((__glo",
                   "bal float *) mem_130728)[thread_out_index_133032 * n_p_114536 +\n                                        thread_out_index_133033] =\n            color_132101[(int64_t) 0];\n    }\n    \n  error_6:\n    return;\n    #undef tile_sizze_129542\n}\n__kernel void mainzisegred_large_117097(__global int *global_failure,\n                                        int failure_is_an_option, __global\n                                        int64_t *global_failure_args,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_132479_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_132477_backing_aligned_1,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t n_p_114536,\n                                        int64_t css_chunk_len_114580,\n                                        int64_t num_groups_117174,\n                                        int64_t groups_per_segment_132463,\n                                        int64_t elements_per_thread_132464,\n                                        int64_t virt_num_groups_132465,\n                                        int64_t threads_per_segment_132467,\n                                        __global unsigned char *Y_mem_130086,\n                                        __global unsigned char *mem_130127,\n                                        __global unsigned char *mem_130191,\n                                        __global\n                                        unsigned char *segred_tmp_mem_132468,\n                                        __global\n                                        unsigned char *mainzicounter_mem_132470)\n{\n    #define segred_group_sizze_117173 (mainzisegred_group_sizze_117091)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restri",
                   "ct sync_arr_mem_132479_backing_1 =\n                          (__local volatile\n                           char *) sync_arr_mem_132479_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_132477_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_132477_backing_aligned_1;\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_132472;\n    int32_t local_tid_132473;\n    int64_t group_sizze_132476;\n    int32_t wave_sizze_132475;\n    int32_t group_tid_132474;\n    \n    global_tid_132472 = get_global_id(0);\n    local_tid_132473 = get_local_id(0);\n    group_sizze_132476 = get_local_size(0);\n    wave_sizze_132475 = LOCKSTEP_WIDTH;\n    group_tid_132474 = get_group_id(0);\n    \n    int32_t phys_tid_117097 = global_tid_132472;\n    __local char *red_arr_mem_132477;\n    \n    red_arr_mem_132477 = (__local char *) red_arr_mem_132477_backing_0;\n    \n    __local char *sync_arr_mem_132479;\n    \n    sync_arr_mem_132479 = (__local char *) sync_arr_mem_132479_backing_1;\n    \n    int32_t phys_group_id_132481;\n    \n    phys_group_id_132481 = get_group_id(0);\n    for (int32_t i_132482 = 0; i_132482 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_132465) - phys_group_id_132481,\n                   sext_i64_i32(num_groups_117174)); i_132482++) {\n        int32_t virt_group_id_132483 = phys_group_id_132481 + i_132482 *\n                sext_i64_i32(num_groups_117174);\n        int32_t flat_segment_id_132484 = squot32(virt_group_id_132483,\n                                                 sext_i64_i32(groups_per_segment_132463));\n        int64_t global_tid_132485 = srem64(sext_i32_i64(virt_group_id_132483) *\n                                           segred_group_sizze_117173 +\n                                           sext_i32_",
                   "i64(local_tid_132473),\n                                           segred_group_sizze_117173 *\n                                           groups_per_segment_132463);\n        int64_t slice_132486 = n_p_114536;\n        int64_t slice_132487 = m_114533 * slice_132486;\n        int64_t gtid_117086 = squot64(sext_i32_i64(flat_segment_id_132484),\n                                      slice_132486);\n        int64_t remnant_132488 = sext_i32_i64(flat_segment_id_132484) -\n                gtid_117086 * slice_132486;\n        int64_t gtid_117087 = remnant_132488;\n        int64_t remnant_132489 = remnant_132488 - gtid_117087;\n        int64_t gtid_117096;\n        float x_acc_132490;\n        int64_t chunk_sizze_132491 = smin64(elements_per_thread_132464,\n                                            sdiv_up64(css_chunk_len_114580 -\n                                                      global_tid_132485,\n                                                      threads_per_segment_132467));\n        float x_117177;\n        float x_117178;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_132490 = 0.0F;\n        }\n        for (int64_t i_132495 = 0; i_132495 < chunk_sizze_132491; i_132495++) {\n            gtid_117096 = global_tid_132485 + threads_per_segment_132467 *\n                i_132495;\n            // apply map function\n            {\n                int64_t x_117182 = ((__global\n                                     int64_t *) mem_130127)[gtid_117087 *\n                                                            css_chunk_len_114580 +\n                                                            gtid_117096];\n                bool cond_117183 = sle64((int64_t) 0, x_117182);\n                float defunc_0_f_res_117184;\n                \n                if (cond_117183) {\n                    bool y_117185 = slt64(x_117182, n_114534);\n                    bool bounds_check_117186 = cond_117183 && y_117185;\n                    bool index_certs_117187;\n              ",
                   "      \n                    if (!bounds_check_117186) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          6) == -1) {\n                                global_failure_args[0] = x_117182;\n                                global_failure_args[1] = n_114534;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    float defunc_0_f_res_t_res_117188 = ((__global\n                                                          float *) Y_mem_130086)[gtid_117086 *\n                                                                                 n_114534 +\n                                                                                 x_117182];\n                    \n                    defunc_0_f_res_117184 = defunc_0_f_res_t_res_117188;\n                } else {\n                    defunc_0_f_res_117184 = NAN;\n                }\n                \n                bool isnan_res_117189;\n                \n                isnan_res_117189 = futrts_isnan32(defunc_0_f_res_117184);\n                \n                float defunc_0_f_res_117190;\n                \n                if (isnan_res_117189) {\n                    defunc_0_f_res_117190 = 0.0F;\n                } else {\n                    defunc_0_f_res_117190 = 1.0F;\n                }\n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_117177 = x_acc_132490;\n                }\n                // load new values\n                {\n                    x_117178 = defunc_0_f_res_117190;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_117179 = x_117177 + x_117178;\n                    \n              ",
                   "      // store in accumulator\n                    {\n                        x_acc_132490 = defunc_1_op_res_117179;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_117177 = x_acc_132490;\n            ((__local\n              float *) red_arr_mem_132477)[sext_i32_i64(local_tid_132473)] =\n                x_117177;\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        int32_t offset_132496;\n        int32_t skip_waves_132497 = 1;\n        float x_132492;\n        float x_132493;\n        \n        offset_132496 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_132473,\n                      sext_i64_i32(segred_group_sizze_117173))) {\n                x_132492 = ((__local\n                             float *) red_arr_mem_132477)[sext_i32_i64(local_tid_132473 +\n                                                          offset_132496)];\n            }\n        }\n        offset_132496 = 1;\n        while (slt32(offset_132496, wave_sizze_132475)) {\n            if (slt32(local_tid_132473 + offset_132496,\n                      sext_i64_i32(segred_group_sizze_117173)) &&\n                ((local_tid_132473 - squot32(local_tid_132473,\n                                             wave_sizze_132475) *\n                  wave_sizze_132475) & (2 * offset_132496 - 1)) == 0) {\n                // read array element\n                {\n                    x_132493 = ((volatile __local\n                                 float *) red_arr_mem_132477)[sext_i32_i64(local_tid_132473 +\n                                                              offset_132496)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_132494 = x_132492 + x_132493;\n                    ",
                   "\n                    x_132492 = defunc_1_op_res_132494;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_132477)[sext_i32_i64(local_tid_132473)] =\n                        x_132492;\n                }\n            }\n            offset_132496 *= 2;\n        }\n        while (slt32(skip_waves_132497,\n                     squot32(sext_i64_i32(segred_group_sizze_117173) +\n                             wave_sizze_132475 - 1, wave_sizze_132475))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_132496 = skip_waves_132497 * wave_sizze_132475;\n            if (slt32(local_tid_132473 + offset_132496,\n                      sext_i64_i32(segred_group_sizze_117173)) &&\n                ((local_tid_132473 - squot32(local_tid_132473,\n                                             wave_sizze_132475) *\n                  wave_sizze_132475) == 0 && (squot32(local_tid_132473,\n                                                      wave_sizze_132475) & (2 *\n                                                                            skip_waves_132497 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_132493 = ((__local\n                                 float *) red_arr_mem_132477)[sext_i32_i64(local_tid_132473 +\n                                                              offset_132496)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_132494 = x_132492 + x_132493;\n                    \n                    x_132492 = defunc_1_op_res_132494;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_132477)[sext_i32_i64(local_tid_132473)] =\n                        x_132492;\n  ",
                   "              }\n            }\n            skip_waves_132497 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_132473) == (int64_t) 0) {\n                x_acc_132490 = x_132492;\n            }\n        }\n        if (groups_per_segment_132463 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_132473 == 0) {\n                    ((__global float *) mem_130191)[gtid_117086 * n_p_114536 +\n                                                    gtid_117087] = x_acc_132490;\n                }\n            }\n        } else {\n            int32_t old_counter_132498;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_132473 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_132468)[sext_i32_i64(virt_group_id_132483)] =\n                        x_acc_132490;\n                    mem_fence_global();\n                    old_counter_132498 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_132470)[sext_i32_i64(srem32(flat_segment_id_132484,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_132479)[(int64_t) 0] =\n                        old_counter_132498 == groups_per_segment_132463 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_132499 = ((__local\n                                          bool *) sync_arr_mem_132479)[(int64_t) 0];\n            \n            if (is_last_group_132499) {\n                if (local_tid",
                   "_132473 == 0) {\n                    old_counter_132498 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_132470)[sext_i32_i64(srem32(flat_segment_id_132484,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_132463));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_132500 =\n                            sdiv_up64(groups_per_segment_132463,\n                                      segred_group_sizze_117173);\n                    \n                    x_117177 = 0.0F;\n                    for (int64_t i_132501 = 0; i_132501 <\n                         read_per_thread_132500; i_132501++) {\n                        int64_t group_res_id_132502 =\n                                sext_i32_i64(local_tid_132473) *\n                                read_per_thread_132500 + i_132501;\n                        int64_t index_of_group_res_132503 =\n                                sext_i32_i64(flat_segment_id_132484) *\n                                groups_per_segment_132463 + group_res_id_132502;\n                        \n                        if (slt64(group_res_id_132502,\n                                  groups_per_segment_132463)) {\n                            x_117178 = ((__global\n                                         float *) segred_tmp_mem_132468)[index_of_group_res_132503];\n                            \n                            float defunc_1_op_res_117179 = x_117177 + x_117178;\n                            \n                            x_117177 = defunc_1_op_res_117179;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_132477)[sext_i32",
                   "_i64(local_tid_132473)] =\n                    x_117177;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_132504;\n                    int32_t skip_waves_132505 = 1;\n                    float x_132492;\n                    float x_132493;\n                    \n                    offset_132504 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_132473,\n                                  sext_i64_i32(segred_group_sizze_117173))) {\n                            x_132492 = ((__local\n                                         float *) red_arr_mem_132477)[sext_i32_i64(local_tid_132473 +\n                                                                      offset_132504)];\n                        }\n                    }\n                    offset_132504 = 1;\n                    while (slt32(offset_132504, wave_sizze_132475)) {\n                        if (slt32(local_tid_132473 + offset_132504,\n                                  sext_i64_i32(segred_group_sizze_117173)) &&\n                            ((local_tid_132473 - squot32(local_tid_132473,\n                                                         wave_sizze_132475) *\n                              wave_sizze_132475) & (2 * offset_132504 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_132493 = ((volatile __local\n                                             float *) red_arr_mem_132477)[sext_i32_i64(local_tid_132473 +\n                                                                          offset_132504)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_132494 = x_132492 +\n                                      x_132493;\n",
                   "                                \n                                x_132492 = defunc_1_op_res_132494;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_132477)[sext_i32_i64(local_tid_132473)] =\n                                    x_132492;\n                            }\n                        }\n                        offset_132504 *= 2;\n                    }\n                    while (slt32(skip_waves_132505,\n                                 squot32(sext_i64_i32(segred_group_sizze_117173) +\n                                         wave_sizze_132475 - 1,\n                                         wave_sizze_132475))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_132504 = skip_waves_132505 * wave_sizze_132475;\n                        if (slt32(local_tid_132473 + offset_132504,\n                                  sext_i64_i32(segred_group_sizze_117173)) &&\n                            ((local_tid_132473 - squot32(local_tid_132473,\n                                                         wave_sizze_132475) *\n                              wave_sizze_132475) == 0 &&\n                             (squot32(local_tid_132473, wave_sizze_132475) &\n                              (2 * skip_waves_132505 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_132493 = ((__local\n                                             float *) red_arr_mem_132477)[sext_i32_i64(local_tid_132473 +\n                                                                          offset_132504)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_132494 = x_132492 +\n                                      x_132493;\n ",
                   "                               \n                                x_132492 = defunc_1_op_res_132494;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_132477)[sext_i32_i64(local_tid_132473)] =\n                                    x_132492;\n                            }\n                        }\n                        skip_waves_132505 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_132473 == 0) {\n                            ((__global float *) mem_130191)[gtid_117086 *\n                                                            n_p_114536 +\n                                                            gtid_117087] =\n                                x_132492;\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_117173\n}\n__kernel void mainzisegred_large_117941(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_132692_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_132690_backing_aligned_1,\n                                        int64_t m_114533, int64_t l_jump_114542,\n                                        int64_t l_n_m_114584, int64_t i_114610,\n                                        int64_t min_res_114683,\n                                        int64_t num_groups_118414,\n                                        int64_t groups_per_segment_132676,\n                                        int64_t elements_per_thread_132677,\n                                        int6",
                   "4_t virt_num_groups_132678,\n                                        int64_t threads_per_segment_132680,\n                                        __global unsigned char *mem_130375,\n                                        __global unsigned char *mem_130380,\n                                        __global\n                                        unsigned char *segred_tmp_mem_132681,\n                                        __global\n                                        unsigned char *mainzicounter_mem_132683)\n{\n    #define segred_group_sizze_118413 (mainzisegred_group_sizze_117935)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict sync_arr_mem_132692_backing_1 =\n                          (__local volatile\n                           char *) sync_arr_mem_132692_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_132690_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_132690_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_132685;\n    int32_t local_tid_132686;\n    int64_t group_sizze_132689;\n    int32_t wave_sizze_132688;\n    int32_t group_tid_132687;\n    \n    global_tid_132685 = get_global_id(0);\n    local_tid_132686 = get_local_id(0);\n    group_sizze_132689 = get_local_size(0);\n    wave_sizze_132688 = LOCKSTEP_WIDTH;\n    group_tid_132687 = get_group_id(0);\n    \n    int32_t phys_tid_117941 = global_tid_132685;\n    __local char *red_arr_mem_132690;\n    \n    red_arr_mem_132690 = (__local char *) red_arr_mem_132690_backing_0;\n    \n    __local char *sync_arr_mem_132692;\n    \n    sync_arr_mem_132692 = (__local char *) sync_arr_mem_132692_backing_1;\n    \n    int32_t phys_group_id_132694;\n    \n    phys_group_id_132694 = get_group_id(0);\n    for (int32_t i_132695 = 0; i_132695 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_132678) - phys_group_id_132694,\n                   sext_i",
                   "64_i32(num_groups_118414)); i_132695++) {\n        int32_t virt_group_id_132696 = phys_group_id_132694 + i_132695 *\n                sext_i64_i32(num_groups_118414);\n        int32_t flat_segment_id_132697 = squot32(virt_group_id_132696,\n                                                 sext_i64_i32(groups_per_segment_132676));\n        int64_t global_tid_132698 = srem64(sext_i32_i64(virt_group_id_132696) *\n                                           segred_group_sizze_118413 +\n                                           sext_i32_i64(local_tid_132686),\n                                           segred_group_sizze_118413 *\n                                           groups_per_segment_132676);\n        int64_t slice_132699 = l_n_m_114584;\n        int64_t slice_132700 = m_114533 * slice_132699;\n        int64_t gtid_117930 = squot64(sext_i32_i64(flat_segment_id_132697),\n                                      slice_132699);\n        int64_t remnant_132701 = sext_i32_i64(flat_segment_id_132697) -\n                gtid_117930 * slice_132699;\n        int64_t gtid_117931 = remnant_132701;\n        int64_t remnant_132702 = remnant_132701 - gtid_117931;\n        int64_t gtid_117940;\n        int64_t x_acc_132703;\n        int64_t chunk_sizze_132704 = smin64(elements_per_thread_132677,\n                                            sdiv_up64(min_res_114683 -\n                                                      global_tid_132698,\n                                                      threads_per_segment_132680));\n        int64_t x_118417;\n        int64_t x_118418;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_132703 = (int64_t) 0;\n        }\n        for (int64_t i_132708 = 0; i_132708 < chunk_sizze_132704; i_132708++) {\n            gtid_117940 = global_tid_132698 + threads_per_segment_132680 *\n                i_132708;\n            // apply map function\n            {\n                int64_t binop_y_128737 = mul64(l_jump_114542, gtid_117931);\n                int",
                   "64_t binop_y_128738 = smin64(i_114610, binop_y_128737);\n                int64_t index_primexp_128739 = add64((int64_t) 1,\n                                                     binop_y_128738);\n                int64_t x_118424 = ((__global\n                                     int64_t *) mem_130375)[gtid_117930 *\n                                                            (min_res_114683 *\n                                                             l_n_m_114584) +\n                                                            gtid_117931 *\n                                                            min_res_114683 +\n                                                            gtid_117940];\n                int64_t abs_arg_118425 = sub64(x_118424, index_primexp_128739);\n                int64_t abs_res_118426 = abs(abs_arg_118425);\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_118417 = x_acc_132703;\n                }\n                // load new values\n                {\n                    x_118418 = abs_res_118426;\n                }\n                // apply reduction operator\n                {\n                    int64_t defunc_1_op_res_118419 = add64(x_118417, x_118418);\n                    \n                    // store in accumulator\n                    {\n                        x_acc_132703 = defunc_1_op_res_118419;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_118417 = x_acc_132703;\n            ((__local\n              int64_t *) red_arr_mem_132690)[sext_i32_i64(local_tid_132686)] =\n                x_118417;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_132709;\n        int32_t skip_waves_132710 = 1;\n        int64_t x_132705;\n        int64_t x_132706;\n        \n        offset_132709 = 0;\n        // participating threads read in",
                   "itial accumulator\n        {\n            if (slt32(local_tid_132686,\n                      sext_i64_i32(segred_group_sizze_118413))) {\n                x_132705 = ((__local\n                             int64_t *) red_arr_mem_132690)[sext_i32_i64(local_tid_132686 +\n                                                            offset_132709)];\n            }\n        }\n        offset_132709 = 1;\n        while (slt32(offset_132709, wave_sizze_132688)) {\n            if (slt32(local_tid_132686 + offset_132709,\n                      sext_i64_i32(segred_group_sizze_118413)) &&\n                ((local_tid_132686 - squot32(local_tid_132686,\n                                             wave_sizze_132688) *\n                  wave_sizze_132688) & (2 * offset_132709 - 1)) == 0) {\n                // read array element\n                {\n                    x_132706 = ((volatile __local\n                                 int64_t *) red_arr_mem_132690)[sext_i32_i64(local_tid_132686 +\n                                                                offset_132709)];\n                }\n                // apply reduction operation\n                {\n                    int64_t defunc_1_op_res_132707 = add64(x_132705, x_132706);\n                    \n                    x_132705 = defunc_1_op_res_132707;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      int64_t *) red_arr_mem_132690)[sext_i32_i64(local_tid_132686)] =\n                        x_132705;\n                }\n            }\n            offset_132709 *= 2;\n        }\n        while (slt32(skip_waves_132710,\n                     squot32(sext_i64_i32(segred_group_sizze_118413) +\n                             wave_sizze_132688 - 1, wave_sizze_132688))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_132709 = skip_waves_132710 * wave_sizze_132688;\n            if (slt32(local_tid_132686 + offset_132709,\n                      sext_i64_i32(segred_",
                   "group_sizze_118413)) &&\n                ((local_tid_132686 - squot32(local_tid_132686,\n                                             wave_sizze_132688) *\n                  wave_sizze_132688) == 0 && (squot32(local_tid_132686,\n                                                      wave_sizze_132688) & (2 *\n                                                                            skip_waves_132710 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_132706 = ((__local\n                                 int64_t *) red_arr_mem_132690)[sext_i32_i64(local_tid_132686 +\n                                                                offset_132709)];\n                }\n                // apply reduction operation\n                {\n                    int64_t defunc_1_op_res_132707 = add64(x_132705, x_132706);\n                    \n                    x_132705 = defunc_1_op_res_132707;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      int64_t *) red_arr_mem_132690)[sext_i32_i64(local_tid_132686)] =\n                        x_132705;\n                }\n            }\n            skip_waves_132710 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_132686) == (int64_t) 0) {\n                x_acc_132703 = x_132705;\n            }\n        }\n        if (groups_per_segment_132676 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_132686 == 0) {\n                    ((__global int64_t *) mem_130380)[gtid_117930 *\n                                                      l_n_m_114584 +\n                                                      gtid_117931] =\n                        x_acc_132703;\n             ",
                   "   }\n            }\n        } else {\n            int32_t old_counter_132711;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_132686 == 0) {\n                    ((__global\n                      int64_t *) segred_tmp_mem_132681)[sext_i32_i64(virt_group_id_132696)] =\n                        x_acc_132703;\n                    mem_fence_global();\n                    old_counter_132711 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_132683)[sext_i32_i64(srem32(flat_segment_id_132697,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_132692)[(int64_t) 0] =\n                        old_counter_132711 == groups_per_segment_132676 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_132712 = ((__local\n                                          bool *) sync_arr_mem_132692)[(int64_t) 0];\n            \n            if (is_last_group_132712) {\n                if (local_tid_132686 == 0) {\n                    old_counter_132711 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_132683)[sext_i32_i64(srem32(flat_segment_id_132697,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_132676));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_132713 =\n             ",
                   "               sdiv_up64(groups_per_segment_132676,\n                                      segred_group_sizze_118413);\n                    \n                    x_118417 = (int64_t) 0;\n                    for (int64_t i_132714 = 0; i_132714 <\n                         read_per_thread_132713; i_132714++) {\n                        int64_t group_res_id_132715 =\n                                sext_i32_i64(local_tid_132686) *\n                                read_per_thread_132713 + i_132714;\n                        int64_t index_of_group_res_132716 =\n                                sext_i32_i64(flat_segment_id_132697) *\n                                groups_per_segment_132676 + group_res_id_132715;\n                        \n                        if (slt64(group_res_id_132715,\n                                  groups_per_segment_132676)) {\n                            x_118418 = ((__global\n                                         int64_t *) segred_tmp_mem_132681)[index_of_group_res_132716];\n                            \n                            int64_t defunc_1_op_res_118419 = add64(x_118417,\n                                                                   x_118418);\n                            \n                            x_118417 = defunc_1_op_res_118419;\n                        }\n                    }\n                }\n                ((__local\n                  int64_t *) red_arr_mem_132690)[sext_i32_i64(local_tid_132686)] =\n                    x_118417;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_132717;\n                    int32_t skip_waves_132718 = 1;\n                    int64_t x_132705;\n                    int64_t x_132706;\n                    \n                    offset_132717 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_132686,\n                                  ",
                   "sext_i64_i32(segred_group_sizze_118413))) {\n                            x_132705 = ((__local\n                                         int64_t *) red_arr_mem_132690)[sext_i32_i64(local_tid_132686 +\n                                                                        offset_132717)];\n                        }\n                    }\n                    offset_132717 = 1;\n                    while (slt32(offset_132717, wave_sizze_132688)) {\n                        if (slt32(local_tid_132686 + offset_132717,\n                                  sext_i64_i32(segred_group_sizze_118413)) &&\n                            ((local_tid_132686 - squot32(local_tid_132686,\n                                                         wave_sizze_132688) *\n                              wave_sizze_132688) & (2 * offset_132717 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_132706 = ((volatile __local\n                                             int64_t *) red_arr_mem_132690)[sext_i32_i64(local_tid_132686 +\n                                                                            offset_132717)];\n                            }\n                            // apply reduction operation\n                            {\n                                int64_t defunc_1_op_res_132707 = add64(x_132705,\n                                                                       x_132706);\n                                \n                                x_132705 = defunc_1_op_res_132707;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  int64_t *) red_arr_mem_132690)[sext_i32_i64(local_tid_132686)] =\n                                    x_132705;\n                            }\n                        }\n                        offset_132717 *= 2;\n          ",
                   "          }\n                    while (slt32(skip_waves_132718,\n                                 squot32(sext_i64_i32(segred_group_sizze_118413) +\n                                         wave_sizze_132688 - 1,\n                                         wave_sizze_132688))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_132717 = skip_waves_132718 * wave_sizze_132688;\n                        if (slt32(local_tid_132686 + offset_132717,\n                                  sext_i64_i32(segred_group_sizze_118413)) &&\n                            ((local_tid_132686 - squot32(local_tid_132686,\n                                                         wave_sizze_132688) *\n                              wave_sizze_132688) == 0 &&\n                             (squot32(local_tid_132686, wave_sizze_132688) &\n                              (2 * skip_waves_132718 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_132706 = ((__local\n                                             int64_t *) red_arr_mem_132690)[sext_i32_i64(local_tid_132686 +\n                                                                            offset_132717)];\n                            }\n                            // apply reduction operation\n                            {\n                                int64_t defunc_1_op_res_132707 = add64(x_132705,\n                                                                       x_132706);\n                                \n                                x_132705 = defunc_1_op_res_132707;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  int64_t *) red_arr_mem_132690)[sext_i32_i64(local_tid_132686)] =\n                                    x_132705;\n                            }\n                        }\n                 ",
                   "       skip_waves_132718 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_132686 == 0) {\n                            ((__global int64_t *) mem_130380)[gtid_117930 *\n                                                              l_n_m_114584 +\n                                                              gtid_117931] =\n                                x_132705;\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_118413\n}\n__kernel void mainzisegred_large_119241(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_132910_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_132908_backing_aligned_1,\n                                        int64_t m_114533, int64_t t_jump_114541,\n                                        int64_t t_n_m_114591, int64_t i_114610,\n                                        int64_t min_res_114809,\n                                        int64_t num_groups_119714,\n                                        int64_t groups_per_segment_132894,\n                                        int64_t elements_per_thread_132895,\n                                        int64_t virt_num_groups_132896,\n                                        int64_t threads_per_segment_132898,\n                                        __global unsigned char *mem_130577,\n                                        __global unsigned char *mem_130582,\n                                        __global\n                                        unsigned char *segred_tmp_mem_132899,\n                                        __global\n                                  ",
                   "      unsigned char *mainzicounter_mem_132901)\n{\n    #define segred_group_sizze_119713 (mainzisegred_group_sizze_119235)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict sync_arr_mem_132910_backing_1 =\n                          (__local volatile\n                           char *) sync_arr_mem_132910_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_132908_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_132908_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_132903;\n    int32_t local_tid_132904;\n    int64_t group_sizze_132907;\n    int32_t wave_sizze_132906;\n    int32_t group_tid_132905;\n    \n    global_tid_132903 = get_global_id(0);\n    local_tid_132904 = get_local_id(0);\n    group_sizze_132907 = get_local_size(0);\n    wave_sizze_132906 = LOCKSTEP_WIDTH;\n    group_tid_132905 = get_group_id(0);\n    \n    int32_t phys_tid_119241 = global_tid_132903;\n    __local char *red_arr_mem_132908;\n    \n    red_arr_mem_132908 = (__local char *) red_arr_mem_132908_backing_0;\n    \n    __local char *sync_arr_mem_132910;\n    \n    sync_arr_mem_132910 = (__local char *) sync_arr_mem_132910_backing_1;\n    \n    int32_t phys_group_id_132912;\n    \n    phys_group_id_132912 = get_group_id(0);\n    for (int32_t i_132913 = 0; i_132913 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_132896) - phys_group_id_132912,\n                   sext_i64_i32(num_groups_119714)); i_132913++) {\n        int32_t virt_group_id_132914 = phys_group_id_132912 + i_132913 *\n                sext_i64_i32(num_groups_119714);\n        int32_t flat_segment_id_132915 = squot32(virt_group_id_132914,\n                                                 sext_i64_i32(groups_per_segment_132894));\n        int64_t global_tid_132916 = srem64(sext_i32_i64(virt_group_id_132914) *\n                                           segred_group_sizz",
                   "e_119713 +\n                                           sext_i32_i64(local_tid_132904),\n                                           segred_group_sizze_119713 *\n                                           groups_per_segment_132894);\n        int64_t slice_132917 = t_n_m_114591;\n        int64_t slice_132918 = m_114533 * slice_132917;\n        int64_t gtid_119230 = squot64(sext_i32_i64(flat_segment_id_132915),\n                                      slice_132917);\n        int64_t remnant_132919 = sext_i32_i64(flat_segment_id_132915) -\n                gtid_119230 * slice_132917;\n        int64_t gtid_119231 = remnant_132919;\n        int64_t remnant_132920 = remnant_132919 - gtid_119231;\n        int64_t gtid_119240;\n        int64_t x_acc_132921;\n        int64_t chunk_sizze_132922 = smin64(elements_per_thread_132895,\n                                            sdiv_up64(min_res_114809 -\n                                                      global_tid_132916,\n                                                      threads_per_segment_132898));\n        int64_t x_119717;\n        int64_t x_119718;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_132921 = (int64_t) 0;\n        }\n        for (int64_t i_132926 = 0; i_132926 < chunk_sizze_132922; i_132926++) {\n            gtid_119240 = global_tid_132916 + threads_per_segment_132898 *\n                i_132926;\n            // apply map function\n            {\n                int64_t binop_y_128771 = mul64(t_jump_114541, gtid_119231);\n                int64_t binop_y_128772 = smin64(i_114610, binop_y_128771);\n                int64_t index_primexp_128773 = add64((int64_t) 1,\n                                                     binop_y_128772);\n                int64_t x_119724 = ((__global\n                                     int64_t *) mem_130577)[gtid_119230 *\n                                                            (min_res_114809 *\n                                                             t_n_m_114591) +",
                   "\n                                                            gtid_119231 *\n                                                            min_res_114809 +\n                                                            gtid_119240];\n                int64_t abs_arg_119725 = sub64(x_119724, index_primexp_128773);\n                int64_t abs_res_119726 = abs(abs_arg_119725);\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_119717 = x_acc_132921;\n                }\n                // load new values\n                {\n                    x_119718 = abs_res_119726;\n                }\n                // apply reduction operator\n                {\n                    int64_t defunc_1_op_res_119719 = add64(x_119717, x_119718);\n                    \n                    // store in accumulator\n                    {\n                        x_acc_132921 = defunc_1_op_res_119719;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_119717 = x_acc_132921;\n            ((__local\n              int64_t *) red_arr_mem_132908)[sext_i32_i64(local_tid_132904)] =\n                x_119717;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_132927;\n        int32_t skip_waves_132928 = 1;\n        int64_t x_132923;\n        int64_t x_132924;\n        \n        offset_132927 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_132904,\n                      sext_i64_i32(segred_group_sizze_119713))) {\n                x_132923 = ((__local\n                             int64_t *) red_arr_mem_132908)[sext_i32_i64(local_tid_132904 +\n                                                            offset_132927)];\n            }\n        }\n        offset_132927 = 1;\n        while (slt32(offset_132927, wave_sizze_132906)) {\n            if (s",
                   "lt32(local_tid_132904 + offset_132927,\n                      sext_i64_i32(segred_group_sizze_119713)) &&\n                ((local_tid_132904 - squot32(local_tid_132904,\n                                             wave_sizze_132906) *\n                  wave_sizze_132906) & (2 * offset_132927 - 1)) == 0) {\n                // read array element\n                {\n                    x_132924 = ((volatile __local\n                                 int64_t *) red_arr_mem_132908)[sext_i32_i64(local_tid_132904 +\n                                                                offset_132927)];\n                }\n                // apply reduction operation\n                {\n                    int64_t defunc_1_op_res_132925 = add64(x_132923, x_132924);\n                    \n                    x_132923 = defunc_1_op_res_132925;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      int64_t *) red_arr_mem_132908)[sext_i32_i64(local_tid_132904)] =\n                        x_132923;\n                }\n            }\n            offset_132927 *= 2;\n        }\n        while (slt32(skip_waves_132928,\n                     squot32(sext_i64_i32(segred_group_sizze_119713) +\n                             wave_sizze_132906 - 1, wave_sizze_132906))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_132927 = skip_waves_132928 * wave_sizze_132906;\n            if (slt32(local_tid_132904 + offset_132927,\n                      sext_i64_i32(segred_group_sizze_119713)) &&\n                ((local_tid_132904 - squot32(local_tid_132904,\n                                             wave_sizze_132906) *\n                  wave_sizze_132906) == 0 && (squot32(local_tid_132904,\n                                                      wave_sizze_132906) & (2 *\n                                                                            skip_waves_132928 -\n                                                                 ",
                   "           1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_132924 = ((__local\n                                 int64_t *) red_arr_mem_132908)[sext_i32_i64(local_tid_132904 +\n                                                                offset_132927)];\n                }\n                // apply reduction operation\n                {\n                    int64_t defunc_1_op_res_132925 = add64(x_132923, x_132924);\n                    \n                    x_132923 = defunc_1_op_res_132925;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      int64_t *) red_arr_mem_132908)[sext_i32_i64(local_tid_132904)] =\n                        x_132923;\n                }\n            }\n            skip_waves_132928 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_132904) == (int64_t) 0) {\n                x_acc_132921 = x_132923;\n            }\n        }\n        if (groups_per_segment_132894 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_132904 == 0) {\n                    ((__global int64_t *) mem_130582)[gtid_119230 *\n                                                      t_n_m_114591 +\n                                                      gtid_119231] =\n                        x_acc_132921;\n                }\n            }\n        } else {\n            int32_t old_counter_132929;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_132904 == 0) {\n                    ((__global\n                      int64_t *) segred_tmp_mem_132899)[sext_i32_i64(virt_group_id_132914)] =\n                        x_acc_132921;\n                    mem_fence_global();\n                    old_counter_132929 =\n ",
                   "                       atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_132901)[sext_i32_i64(srem32(flat_segment_id_132915,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_132910)[(int64_t) 0] =\n                        old_counter_132929 == groups_per_segment_132894 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_132930 = ((__local\n                                          bool *) sync_arr_mem_132910)[(int64_t) 0];\n            \n            if (is_last_group_132930) {\n                if (local_tid_132904 == 0) {\n                    old_counter_132929 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_132901)[sext_i32_i64(srem32(flat_segment_id_132915,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_132894));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_132931 =\n                            sdiv_up64(groups_per_segment_132894,\n                                      segred_group_sizze_119713);\n                    \n                    x_119717 = (int64_t) 0;\n                    for (int64_t i_132932 = 0; i_132932 <\n                         read_per_thread_132931; i_132932++) {\n                        int64_t group_res_id_132933 =\n                                sext_i32_i64(local_tid_132904) *\n                                read_per_th",
                   "read_132931 + i_132932;\n                        int64_t index_of_group_res_132934 =\n                                sext_i32_i64(flat_segment_id_132915) *\n                                groups_per_segment_132894 + group_res_id_132933;\n                        \n                        if (slt64(group_res_id_132933,\n                                  groups_per_segment_132894)) {\n                            x_119718 = ((__global\n                                         int64_t *) segred_tmp_mem_132899)[index_of_group_res_132934];\n                            \n                            int64_t defunc_1_op_res_119719 = add64(x_119717,\n                                                                   x_119718);\n                            \n                            x_119717 = defunc_1_op_res_119719;\n                        }\n                    }\n                }\n                ((__local\n                  int64_t *) red_arr_mem_132908)[sext_i32_i64(local_tid_132904)] =\n                    x_119717;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_132935;\n                    int32_t skip_waves_132936 = 1;\n                    int64_t x_132923;\n                    int64_t x_132924;\n                    \n                    offset_132935 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_132904,\n                                  sext_i64_i32(segred_group_sizze_119713))) {\n                            x_132923 = ((__local\n                                         int64_t *) red_arr_mem_132908)[sext_i32_i64(local_tid_132904 +\n                                                                        offset_132935)];\n                        }\n                    }\n                    offset_132935 = 1;\n                    while (slt32(offset_132935, wave_sizze_132906)) {\n                       ",
                   " if (slt32(local_tid_132904 + offset_132935,\n                                  sext_i64_i32(segred_group_sizze_119713)) &&\n                            ((local_tid_132904 - squot32(local_tid_132904,\n                                                         wave_sizze_132906) *\n                              wave_sizze_132906) & (2 * offset_132935 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_132924 = ((volatile __local\n                                             int64_t *) red_arr_mem_132908)[sext_i32_i64(local_tid_132904 +\n                                                                            offset_132935)];\n                            }\n                            // apply reduction operation\n                            {\n                                int64_t defunc_1_op_res_132925 = add64(x_132923,\n                                                                       x_132924);\n                                \n                                x_132923 = defunc_1_op_res_132925;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  int64_t *) red_arr_mem_132908)[sext_i32_i64(local_tid_132904)] =\n                                    x_132923;\n                            }\n                        }\n                        offset_132935 *= 2;\n                    }\n                    while (slt32(skip_waves_132936,\n                                 squot32(sext_i64_i32(segred_group_sizze_119713) +\n                                         wave_sizze_132906 - 1,\n                                         wave_sizze_132906))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_132935 = skip_waves_132936 * wave_sizze_132906;\n                        if (slt32(local_tid_132904 + offse",
                   "t_132935,\n                                  sext_i64_i32(segred_group_sizze_119713)) &&\n                            ((local_tid_132904 - squot32(local_tid_132904,\n                                                         wave_sizze_132906) *\n                              wave_sizze_132906) == 0 &&\n                             (squot32(local_tid_132904, wave_sizze_132906) &\n                              (2 * skip_waves_132936 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_132924 = ((__local\n                                             int64_t *) red_arr_mem_132908)[sext_i32_i64(local_tid_132904 +\n                                                                            offset_132935)];\n                            }\n                            // apply reduction operation\n                            {\n                                int64_t defunc_1_op_res_132925 = add64(x_132923,\n                                                                       x_132924);\n                                \n                                x_132923 = defunc_1_op_res_132925;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  int64_t *) red_arr_mem_132908)[sext_i32_i64(local_tid_132904)] =\n                                    x_132923;\n                            }\n                        }\n                        skip_waves_132936 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_132904 == 0) {\n                            ((__global int64_t *) mem_130582)[gtid_119230 *\n                                                              t_n_m_114591 +\n                                                              gtid_119231] =\n                                x_132923;\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_119713\n}\n__kernel void mainzisegred_large_119948(__global int *global_failure,\n                                        int failure_is_an_option, __global\n                                        int64_t *global_failure_args,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_133075_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133073_backing_aligned_1,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t n_p_114536,\n                                        int64_t css_chunk_len_114580,\n                                        int64_t num_groups_120023,\n                                        int64_t groups_per_segment_133059,\n                                        int64_t elements_per_thread_133060,\n                                        int64_t virt_num_groups_133061,\n                                        int64_t threads_per_segment_133063,\n                                        __global unsigned char *mem_130127,\n                                        __global unsigned char *mem_130672,\n                                        __global unsigned char *mem_130733,\n                                        __global\n                                        unsigned char *segred_tmp_mem_133064,\n                                        __global\n                                        unsigned char *mainzicounter_mem_133066)\n{\n    #define segred_group_sizze_120022 (mainzisegred_group_sizze_119942)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict sync_arr_mem",
                   "_133075_backing_1 =\n                          (__local volatile\n                           char *) sync_arr_mem_133075_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_133073_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_133073_backing_aligned_1;\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_133068;\n    int32_t local_tid_133069;\n    int64_t group_sizze_133072;\n    int32_t wave_sizze_133071;\n    int32_t group_tid_133070;\n    \n    global_tid_133068 = get_global_id(0);\n    local_tid_133069 = get_local_id(0);\n    group_sizze_133072 = get_local_size(0);\n    wave_sizze_133071 = LOCKSTEP_WIDTH;\n    group_tid_133070 = get_group_id(0);\n    \n    int32_t phys_tid_119948 = global_tid_133068;\n    __local char *red_arr_mem_133073;\n    \n    red_arr_mem_133073 = (__local char *) red_arr_mem_133073_backing_0;\n    \n    __local char *sync_arr_mem_133075;\n    \n    sync_arr_mem_133075 = (__local char *) sync_arr_mem_133075_backing_1;\n    \n    int32_t phys_group_id_133077;\n    \n    phys_group_id_133077 = get_group_id(0);\n    for (int32_t i_133078 = 0; i_133078 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_133061) - phys_group_id_133077,\n                   sext_i64_i32(num_groups_120023)); i_133078++) {\n        int32_t virt_group_id_133079 = phys_group_id_133077 + i_133078 *\n                sext_i64_i32(num_groups_120023);\n        int32_t flat_segment_id_133080 = squot32(virt_group_id_133079,\n                                                 sext_i64_i32(groups_per_segment_133059));\n        int64_t global_tid_133081 = srem64(sext_i32_i64(virt_group_id_133079) *\n                                           segred_group_sizze_120022 +\n                                           sext_i32_i64(local_tid_1",
                   "33069),\n                                           segred_group_sizze_120022 *\n                                           groups_per_segment_133059);\n        int64_t slice_133082 = n_p_114536;\n        int64_t slice_133083 = m_114533 * slice_133082;\n        int64_t gtid_119937 = squot64(sext_i32_i64(flat_segment_id_133080),\n                                      slice_133082);\n        int64_t remnant_133084 = sext_i32_i64(flat_segment_id_133080) -\n                gtid_119937 * slice_133082;\n        int64_t gtid_119938 = remnant_133084;\n        int64_t remnant_133085 = remnant_133084 - gtid_119938;\n        int64_t gtid_119947;\n        float x_acc_133086;\n        int64_t chunk_sizze_133087 = smin64(elements_per_thread_133060,\n                                            sdiv_up64(css_chunk_len_114580 -\n                                                      global_tid_133081,\n                                                      threads_per_segment_133063));\n        float x_120026;\n        float x_120027;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_133086 = 0.0F;\n        }\n        for (int64_t i_133091 = 0; i_133091 < chunk_sizze_133087; i_133091++) {\n            gtid_119947 = global_tid_133081 + threads_per_segment_133063 *\n                i_133091;\n            // apply map function\n            {\n                int64_t x_120031 = ((__global\n                                     int64_t *) mem_130127)[gtid_119938 *\n                                                            css_chunk_len_114580 +\n                                                            gtid_119947];\n                bool cond_120032 = sle64((int64_t) 0, x_120031);\n                float defunc_0_f_res_120033;\n                \n                if (cond_120032) {\n                    bool y_120034 = slt64(x_120031, n_114534);\n                    bool bounds_check_120035 = cond_120032 && y_120034;\n                    bool index_certs_120036;\n                    \n        ",
                   "            if (!bounds_check_120035) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          60) == -1) {\n                                global_failure_args[0] = x_120031;\n                                global_failure_args[1] = n_114534;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    float defunc_0_f_res_t_res_120037 = ((__global\n                                                          float *) mem_130672)[gtid_119937 *\n                                                                               n_114534 +\n                                                                               x_120031];\n                    \n                    defunc_0_f_res_120033 = defunc_0_f_res_t_res_120037;\n                } else {\n                    defunc_0_f_res_120033 = NAN;\n                }\n                \n                bool isnan_res_120038;\n                \n                isnan_res_120038 = futrts_isnan32(defunc_0_f_res_120033);\n                \n                float defunc_0_f_res_120039;\n                \n                if (isnan_res_120038) {\n                    defunc_0_f_res_120039 = 0.0F;\n                } else {\n                    defunc_0_f_res_120039 = defunc_0_f_res_120033;\n                }\n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_120026 = x_acc_133086;\n                }\n                // load new values\n                {\n                    x_120027 = defunc_0_f_res_120039;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_120028 = x_120026 + x_120027;\n                    \n                 ",
                   "   // store in accumulator\n                    {\n                        x_acc_133086 = defunc_1_op_res_120028;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_120026 = x_acc_133086;\n            ((__local\n              float *) red_arr_mem_133073)[sext_i32_i64(local_tid_133069)] =\n                x_120026;\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        int32_t offset_133092;\n        int32_t skip_waves_133093 = 1;\n        float x_133088;\n        float x_133089;\n        \n        offset_133092 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_133069,\n                      sext_i64_i32(segred_group_sizze_120022))) {\n                x_133088 = ((__local\n                             float *) red_arr_mem_133073)[sext_i32_i64(local_tid_133069 +\n                                                          offset_133092)];\n            }\n        }\n        offset_133092 = 1;\n        while (slt32(offset_133092, wave_sizze_133071)) {\n            if (slt32(local_tid_133069 + offset_133092,\n                      sext_i64_i32(segred_group_sizze_120022)) &&\n                ((local_tid_133069 - squot32(local_tid_133069,\n                                             wave_sizze_133071) *\n                  wave_sizze_133071) & (2 * offset_133092 - 1)) == 0) {\n                // read array element\n                {\n                    x_133089 = ((volatile __local\n                                 float *) red_arr_mem_133073)[sext_i32_i64(local_tid_133069 +\n                                                              offset_133092)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_133090 = x_133088 + x_133089;\n                    \n  ",
                   "                  x_133088 = defunc_1_op_res_133090;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_133073)[sext_i32_i64(local_tid_133069)] =\n                        x_133088;\n                }\n            }\n            offset_133092 *= 2;\n        }\n        while (slt32(skip_waves_133093,\n                     squot32(sext_i64_i32(segred_group_sizze_120022) +\n                             wave_sizze_133071 - 1, wave_sizze_133071))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_133092 = skip_waves_133093 * wave_sizze_133071;\n            if (slt32(local_tid_133069 + offset_133092,\n                      sext_i64_i32(segred_group_sizze_120022)) &&\n                ((local_tid_133069 - squot32(local_tid_133069,\n                                             wave_sizze_133071) *\n                  wave_sizze_133071) == 0 && (squot32(local_tid_133069,\n                                                      wave_sizze_133071) & (2 *\n                                                                            skip_waves_133093 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_133089 = ((__local\n                                 float *) red_arr_mem_133073)[sext_i32_i64(local_tid_133069 +\n                                                              offset_133092)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_133090 = x_133088 + x_133089;\n                    \n                    x_133088 = defunc_1_op_res_133090;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_133073)[sext_i32_i64(local_tid_133069)] =\n                        x_133088;\n     ",
                   "           }\n            }\n            skip_waves_133093 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_133069) == (int64_t) 0) {\n                x_acc_133086 = x_133088;\n            }\n        }\n        if (groups_per_segment_133059 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_133069 == 0) {\n                    ((__global float *) mem_130733)[gtid_119937 * n_p_114536 +\n                                                    gtid_119938] = x_acc_133086;\n                }\n            }\n        } else {\n            int32_t old_counter_133094;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_133069 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_133064)[sext_i32_i64(virt_group_id_133079)] =\n                        x_acc_133086;\n                    mem_fence_global();\n                    old_counter_133094 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_133066)[sext_i32_i64(srem32(flat_segment_id_133080,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_133075)[(int64_t) 0] =\n                        old_counter_133094 == groups_per_segment_133059 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_133095 = ((__local\n                                          bool *) sync_arr_mem_133075)[(int64_t) 0];\n            \n            if (is_last_group_133095) {\n                if (local_tid_13",
                   "3069 == 0) {\n                    old_counter_133094 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_133066)[sext_i32_i64(srem32(flat_segment_id_133080,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_133059));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_133096 =\n                            sdiv_up64(groups_per_segment_133059,\n                                      segred_group_sizze_120022);\n                    \n                    x_120026 = 0.0F;\n                    for (int64_t i_133097 = 0; i_133097 <\n                         read_per_thread_133096; i_133097++) {\n                        int64_t group_res_id_133098 =\n                                sext_i32_i64(local_tid_133069) *\n                                read_per_thread_133096 + i_133097;\n                        int64_t index_of_group_res_133099 =\n                                sext_i32_i64(flat_segment_id_133080) *\n                                groups_per_segment_133059 + group_res_id_133098;\n                        \n                        if (slt64(group_res_id_133098,\n                                  groups_per_segment_133059)) {\n                            x_120027 = ((__global\n                                         float *) segred_tmp_mem_133064)[index_of_group_res_133099];\n                            \n                            float defunc_1_op_res_120028 = x_120026 + x_120027;\n                            \n                            x_120026 = defunc_1_op_res_120028;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_133073)[sext_i32_i6",
                   "4(local_tid_133069)] =\n                    x_120026;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_133100;\n                    int32_t skip_waves_133101 = 1;\n                    float x_133088;\n                    float x_133089;\n                    \n                    offset_133100 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_133069,\n                                  sext_i64_i32(segred_group_sizze_120022))) {\n                            x_133088 = ((__local\n                                         float *) red_arr_mem_133073)[sext_i32_i64(local_tid_133069 +\n                                                                      offset_133100)];\n                        }\n                    }\n                    offset_133100 = 1;\n                    while (slt32(offset_133100, wave_sizze_133071)) {\n                        if (slt32(local_tid_133069 + offset_133100,\n                                  sext_i64_i32(segred_group_sizze_120022)) &&\n                            ((local_tid_133069 - squot32(local_tid_133069,\n                                                         wave_sizze_133071) *\n                              wave_sizze_133071) & (2 * offset_133100 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_133089 = ((volatile __local\n                                             float *) red_arr_mem_133073)[sext_i32_i64(local_tid_133069 +\n                                                                          offset_133100)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_133090 = x_133088 +\n                                      x_133089;\n   ",
                   "                             \n                                x_133088 = defunc_1_op_res_133090;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_133073)[sext_i32_i64(local_tid_133069)] =\n                                    x_133088;\n                            }\n                        }\n                        offset_133100 *= 2;\n                    }\n                    while (slt32(skip_waves_133101,\n                                 squot32(sext_i64_i32(segred_group_sizze_120022) +\n                                         wave_sizze_133071 - 1,\n                                         wave_sizze_133071))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_133100 = skip_waves_133101 * wave_sizze_133071;\n                        if (slt32(local_tid_133069 + offset_133100,\n                                  sext_i64_i32(segred_group_sizze_120022)) &&\n                            ((local_tid_133069 - squot32(local_tid_133069,\n                                                         wave_sizze_133071) *\n                              wave_sizze_133071) == 0 &&\n                             (squot32(local_tid_133069, wave_sizze_133071) &\n                              (2 * skip_waves_133101 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_133089 = ((__local\n                                             float *) red_arr_mem_133073)[sext_i32_i64(local_tid_133069 +\n                                                                          offset_133100)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_133090 = x_133088 +\n                                      x_133089;\n    ",
                   "                            \n                                x_133088 = defunc_1_op_res_133090;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_133073)[sext_i32_i64(local_tid_133069)] =\n                                    x_133088;\n                            }\n                        }\n                        skip_waves_133101 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_133069 == 0) {\n                            ((__global float *) mem_130733)[gtid_119937 *\n                                                            n_p_114536 +\n                                                            gtid_119938] =\n                                x_133088;\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_120022\n}\n__kernel void mainzisegred_large_120463(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_133482_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133480_backing_aligned_1,\n                                        int64_t m_114533,\n                                        int64_t lifted_single_ma_arg_114976,\n                                        int64_t num_groups_120692,\n                                        int64_t groups_per_segment_133466,\n                                        int64_t elements_per_thread_133467,\n                                        int64_t virt_num_groups_133468,\n                                        int64_t threads_per_segme",
                   "nt_133470,\n                                        __global unsigned char *mem_130840,\n                                        __global unsigned char *mem_130844,\n                                        __global\n                                        unsigned char *segred_tmp_mem_133471,\n                                        __global\n                                        unsigned char *mainzicounter_mem_133473)\n{\n    #define segred_group_sizze_120691 (mainzisegred_group_sizze_120457)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict sync_arr_mem_133482_backing_1 =\n                          (__local volatile\n                           char *) sync_arr_mem_133482_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_133480_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_133480_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_133475;\n    int32_t local_tid_133476;\n    int64_t group_sizze_133479;\n    int32_t wave_sizze_133478;\n    int32_t group_tid_133477;\n    \n    global_tid_133475 = get_global_id(0);\n    local_tid_133476 = get_local_id(0);\n    group_sizze_133479 = get_local_size(0);\n    wave_sizze_133478 = LOCKSTEP_WIDTH;\n    group_tid_133477 = get_group_id(0);\n    \n    int32_t phys_tid_120463 = global_tid_133475;\n    __local char *red_arr_mem_133480;\n    \n    red_arr_mem_133480 = (__local char *) red_arr_mem_133480_backing_0;\n    \n    __local char *sync_arr_mem_133482;\n    \n    sync_arr_mem_133482 = (__local char *) sync_arr_mem_133482_backing_1;\n    \n    int32_t phys_group_id_133484;\n    \n    phys_group_id_133484 = get_group_id(0);\n    for (int32_t i_133485 = 0; i_133485 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_133468) - phys_group_id_133484,\n                   sext_i64_i32(num_groups_120692)); i_133485++) {\n        int32_t virt_group_id_133486 = phys_group_i",
                   "d_133484 + i_133485 *\n                sext_i64_i32(num_groups_120692);\n        int32_t flat_segment_id_133487 = squot32(virt_group_id_133486,\n                                                 sext_i64_i32(groups_per_segment_133466));\n        int64_t global_tid_133488 = srem64(sext_i32_i64(virt_group_id_133486) *\n                                           segred_group_sizze_120691 +\n                                           sext_i32_i64(local_tid_133476),\n                                           segred_group_sizze_120691 *\n                                           groups_per_segment_133466);\n        int64_t slice_133489 = m_114533;\n        int64_t gtid_120454 = sext_i32_i64(flat_segment_id_133487);\n        int64_t remnant_133490 = sext_i32_i64(flat_segment_id_133487) -\n                gtid_120454;\n        int64_t gtid_120462;\n        float x_acc_133491;\n        int64_t chunk_sizze_133492 = smin64(elements_per_thread_133467,\n                                            sdiv_up64((int64_t) 3 -\n                                                      global_tid_133488,\n                                                      threads_per_segment_133470));\n        float x_120695;\n        float x_120696;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_133491 = 0.0F;\n        }\n        for (int64_t i_133496 = 0; i_133496 < chunk_sizze_133492; i_133496++) {\n            gtid_120462 = global_tid_133488 + threads_per_segment_133470 *\n                i_133496;\n            // apply map function\n            {\n                float x_120699 = ((__global float *) mem_130840)[gtid_120454 *\n                                                                 lifted_single_ma_arg_114976 +\n                                                                 gtid_120462];\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_120695 = x_acc_133491;\n                }\n  ",
                   "              // load new values\n                {\n                    x_120696 = x_120699;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_120697 = x_120695 + x_120696;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_133491 = defunc_1_op_res_120697;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_120695 = x_acc_133491;\n            ((__local\n              float *) red_arr_mem_133480)[sext_i32_i64(local_tid_133476)] =\n                x_120695;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_133497;\n        int32_t skip_waves_133498 = 1;\n        float x_133493;\n        float x_133494;\n        \n        offset_133497 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_133476,\n                      sext_i64_i32(segred_group_sizze_120691))) {\n                x_133493 = ((__local\n                             float *) red_arr_mem_133480)[sext_i32_i64(local_tid_133476 +\n                                                          offset_133497)];\n            }\n        }\n        offset_133497 = 1;\n        while (slt32(offset_133497, wave_sizze_133478)) {\n            if (slt32(local_tid_133476 + offset_133497,\n                      sext_i64_i32(segred_group_sizze_120691)) &&\n                ((local_tid_133476 - squot32(local_tid_133476,\n                                             wave_sizze_133478) *\n                  wave_sizze_133478) & (2 * offset_133497 - 1)) == 0) {\n                // read array element\n                {\n                    x_133494 = ((volatile __local\n                                 float *) red_arr_mem_133480)[sext_i32_i64(local_tid_133476 +\n                                                              offset_133497)];\n   ",
                   "             }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_133495 = x_133493 + x_133494;\n                    \n                    x_133493 = defunc_1_op_res_133495;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_133480)[sext_i32_i64(local_tid_133476)] =\n                        x_133493;\n                }\n            }\n            offset_133497 *= 2;\n        }\n        while (slt32(skip_waves_133498,\n                     squot32(sext_i64_i32(segred_group_sizze_120691) +\n                             wave_sizze_133478 - 1, wave_sizze_133478))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_133497 = skip_waves_133498 * wave_sizze_133478;\n            if (slt32(local_tid_133476 + offset_133497,\n                      sext_i64_i32(segred_group_sizze_120691)) &&\n                ((local_tid_133476 - squot32(local_tid_133476,\n                                             wave_sizze_133478) *\n                  wave_sizze_133478) == 0 && (squot32(local_tid_133476,\n                                                      wave_sizze_133478) & (2 *\n                                                                            skip_waves_133498 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_133494 = ((__local\n                                 float *) red_arr_mem_133480)[sext_i32_i64(local_tid_133476 +\n                                                              offset_133497)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_133495 = x_133493 + x_133494;\n                    \n                    x_133493 = defunc_1_op_res_133495;\n                }\n                // write result of operation",
                   "\n                {\n                    ((__local\n                      float *) red_arr_mem_133480)[sext_i32_i64(local_tid_133476)] =\n                        x_133493;\n                }\n            }\n            skip_waves_133498 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_133476) == (int64_t) 0) {\n                x_acc_133491 = x_133493;\n            }\n        }\n        if (groups_per_segment_133466 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_133476 == 0) {\n                    ((__global float *) mem_130844)[gtid_120454] = x_acc_133491;\n                }\n            }\n        } else {\n            int32_t old_counter_133499;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_133476 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_133471)[sext_i32_i64(virt_group_id_133486)] =\n                        x_acc_133491;\n                    mem_fence_global();\n                    old_counter_133499 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_133473)[sext_i32_i64(srem32(flat_segment_id_133487,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_133482)[(int64_t) 0] =\n                        old_counter_133499 == groups_per_segment_133466 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_133500 = ((__local\n                                          bool *) sync_arr_mem_133482)[(int6",
                   "4_t) 0];\n            \n            if (is_last_group_133500) {\n                if (local_tid_133476 == 0) {\n                    old_counter_133499 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_133473)[sext_i32_i64(srem32(flat_segment_id_133487,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_133466));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_133501 =\n                            sdiv_up64(groups_per_segment_133466,\n                                      segred_group_sizze_120691);\n                    \n                    x_120695 = 0.0F;\n                    for (int64_t i_133502 = 0; i_133502 <\n                         read_per_thread_133501; i_133502++) {\n                        int64_t group_res_id_133503 =\n                                sext_i32_i64(local_tid_133476) *\n                                read_per_thread_133501 + i_133502;\n                        int64_t index_of_group_res_133504 =\n                                sext_i32_i64(flat_segment_id_133487) *\n                                groups_per_segment_133466 + group_res_id_133503;\n                        \n                        if (slt64(group_res_id_133503,\n                                  groups_per_segment_133466)) {\n                            x_120696 = ((__global\n                                         float *) segred_tmp_mem_133471)[index_of_group_res_133504];\n                            \n                            float defunc_1_op_res_120697 = x_120695 + x_120696;\n                            \n                            x_120695 = defunc_1_op_res_120697;\n                        }\n                    }\n        ",
                   "        }\n                ((__local\n                  float *) red_arr_mem_133480)[sext_i32_i64(local_tid_133476)] =\n                    x_120695;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_133505;\n                    int32_t skip_waves_133506 = 1;\n                    float x_133493;\n                    float x_133494;\n                    \n                    offset_133505 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_133476,\n                                  sext_i64_i32(segred_group_sizze_120691))) {\n                            x_133493 = ((__local\n                                         float *) red_arr_mem_133480)[sext_i32_i64(local_tid_133476 +\n                                                                      offset_133505)];\n                        }\n                    }\n                    offset_133505 = 1;\n                    while (slt32(offset_133505, wave_sizze_133478)) {\n                        if (slt32(local_tid_133476 + offset_133505,\n                                  sext_i64_i32(segred_group_sizze_120691)) &&\n                            ((local_tid_133476 - squot32(local_tid_133476,\n                                                         wave_sizze_133478) *\n                              wave_sizze_133478) & (2 * offset_133505 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_133494 = ((volatile __local\n                                             float *) red_arr_mem_133480)[sext_i32_i64(local_tid_133476 +\n                                                                          offset_133505)];\n                            }\n                            // apply reduction operation\n                            {\n                               ",
                   " float defunc_1_op_res_133495 = x_133493 +\n                                      x_133494;\n                                \n                                x_133493 = defunc_1_op_res_133495;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_133480)[sext_i32_i64(local_tid_133476)] =\n                                    x_133493;\n                            }\n                        }\n                        offset_133505 *= 2;\n                    }\n                    while (slt32(skip_waves_133506,\n                                 squot32(sext_i64_i32(segred_group_sizze_120691) +\n                                         wave_sizze_133478 - 1,\n                                         wave_sizze_133478))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_133505 = skip_waves_133506 * wave_sizze_133478;\n                        if (slt32(local_tid_133476 + offset_133505,\n                                  sext_i64_i32(segred_group_sizze_120691)) &&\n                            ((local_tid_133476 - squot32(local_tid_133476,\n                                                         wave_sizze_133478) *\n                              wave_sizze_133478) == 0 &&\n                             (squot32(local_tid_133476, wave_sizze_133478) &\n                              (2 * skip_waves_133506 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_133494 = ((__local\n                                             float *) red_arr_mem_133480)[sext_i32_i64(local_tid_133476 +\n                                                                          offset_133505)];\n                            }\n                            // apply reduction operation\n                            {\n                                ",
                   "float defunc_1_op_res_133495 = x_133493 +\n                                      x_133494;\n                                \n                                x_133493 = defunc_1_op_res_133495;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_133480)[sext_i32_i64(local_tid_133476)] =\n                                    x_133493;\n                            }\n                        }\n                        skip_waves_133506 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_133476 == 0) {\n                            ((__global float *) mem_130844)[gtid_120454] =\n                                x_133493;\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_120691\n}\n__kernel void mainzisegred_large_120526(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_133362_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133360_backing_aligned_1,\n                                        int64_t m_114533, int64_t n_p_114536,\n                                        int64_t lifted_single_ma_arg_114959,\n                                        int64_t num_groups_120644,\n                                        int64_t groups_per_segment_133346,\n                                        int64_t elements_per_thread_133347,\n                                        int64_t virt_num_groups_133348,\n                                        int64_t threads_per_segment_133350,\n                      ",
                   "                  __global unsigned char *mem_130831,\n                                        __global unsigned char *mem_130835,\n                                        __global\n                                        unsigned char *segred_tmp_mem_133351,\n                                        __global\n                                        unsigned char *mainzicounter_mem_133353)\n{\n    #define segred_group_sizze_120643 (mainzisegred_group_sizze_120520)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict sync_arr_mem_133362_backing_1 =\n                          (__local volatile\n                           char *) sync_arr_mem_133362_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_133360_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_133360_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_133355;\n    int32_t local_tid_133356;\n    int64_t group_sizze_133359;\n    int32_t wave_sizze_133358;\n    int32_t group_tid_133357;\n    \n    global_tid_133355 = get_global_id(0);\n    local_tid_133356 = get_local_id(0);\n    group_sizze_133359 = get_local_size(0);\n    wave_sizze_133358 = LOCKSTEP_WIDTH;\n    group_tid_133357 = get_group_id(0);\n    \n    int32_t phys_tid_120526 = global_tid_133355;\n    __local char *red_arr_mem_133360;\n    \n    red_arr_mem_133360 = (__local char *) red_arr_mem_133360_backing_0;\n    \n    __local char *sync_arr_mem_133362;\n    \n    sync_arr_mem_133362 = (__local char *) sync_arr_mem_133362_backing_1;\n    \n    int32_t phys_group_id_133364;\n    \n    phys_group_id_133364 = get_group_id(0);\n    for (int32_t i_133365 = 0; i_133365 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_133348) - phys_group_id_133364,\n                   sext_i64_i32(num_groups_120644)); i_133365++) {\n        int32_t virt_group_id_133366 = phys_group_id_133364 + i_133365 *\n           ",
                   "     sext_i64_i32(num_groups_120644);\n        int32_t flat_segment_id_133367 = squot32(virt_group_id_133366,\n                                                 sext_i64_i32(groups_per_segment_133346));\n        int64_t global_tid_133368 = srem64(sext_i32_i64(virt_group_id_133366) *\n                                           segred_group_sizze_120643 +\n                                           sext_i32_i64(local_tid_133356),\n                                           segred_group_sizze_120643 *\n                                           groups_per_segment_133346);\n        int64_t slice_133369 = m_114533;\n        int64_t gtid_120517 = sext_i32_i64(flat_segment_id_133367);\n        int64_t remnant_133370 = sext_i32_i64(flat_segment_id_133367) -\n                gtid_120517;\n        int64_t gtid_120525;\n        float x_acc_133371;\n        int64_t chunk_sizze_133372 = smin64(elements_per_thread_133347,\n                                            sdiv_up64(n_p_114536 -\n                                                      global_tid_133368,\n                                                      threads_per_segment_133350));\n        float x_120647;\n        float x_120648;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_133371 = 0.0F;\n        }\n        for (int64_t i_133376 = 0; i_133376 < chunk_sizze_133372; i_133376++) {\n            gtid_120525 = global_tid_133368 + threads_per_segment_133350 *\n                i_133376;\n            // apply map function\n            {\n                float x_120651 = ((__global float *) mem_130831)[gtid_120517 *\n                                                                 lifted_single_ma_arg_114959 +\n                                                                 gtid_120525];\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_120647 = x_acc_133371;\n                }\n                // load new values\n ",
                   "               {\n                    x_120648 = x_120651;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_120649 = x_120647 + x_120648;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_133371 = defunc_1_op_res_120649;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_120647 = x_acc_133371;\n            ((__local\n              float *) red_arr_mem_133360)[sext_i32_i64(local_tid_133356)] =\n                x_120647;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_133377;\n        int32_t skip_waves_133378 = 1;\n        float x_133373;\n        float x_133374;\n        \n        offset_133377 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_133356,\n                      sext_i64_i32(segred_group_sizze_120643))) {\n                x_133373 = ((__local\n                             float *) red_arr_mem_133360)[sext_i32_i64(local_tid_133356 +\n                                                          offset_133377)];\n            }\n        }\n        offset_133377 = 1;\n        while (slt32(offset_133377, wave_sizze_133358)) {\n            if (slt32(local_tid_133356 + offset_133377,\n                      sext_i64_i32(segred_group_sizze_120643)) &&\n                ((local_tid_133356 - squot32(local_tid_133356,\n                                             wave_sizze_133358) *\n                  wave_sizze_133358) & (2 * offset_133377 - 1)) == 0) {\n                // read array element\n                {\n                    x_133374 = ((volatile __local\n                                 float *) red_arr_mem_133360)[sext_i32_i64(local_tid_133356 +\n                                                              offset_133377)];\n                }\n                // ",
                   "apply reduction operation\n                {\n                    float defunc_1_op_res_133375 = x_133373 + x_133374;\n                    \n                    x_133373 = defunc_1_op_res_133375;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_133360)[sext_i32_i64(local_tid_133356)] =\n                        x_133373;\n                }\n            }\n            offset_133377 *= 2;\n        }\n        while (slt32(skip_waves_133378,\n                     squot32(sext_i64_i32(segred_group_sizze_120643) +\n                             wave_sizze_133358 - 1, wave_sizze_133358))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_133377 = skip_waves_133378 * wave_sizze_133358;\n            if (slt32(local_tid_133356 + offset_133377,\n                      sext_i64_i32(segred_group_sizze_120643)) &&\n                ((local_tid_133356 - squot32(local_tid_133356,\n                                             wave_sizze_133358) *\n                  wave_sizze_133358) == 0 && (squot32(local_tid_133356,\n                                                      wave_sizze_133358) & (2 *\n                                                                            skip_waves_133378 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_133374 = ((__local\n                                 float *) red_arr_mem_133360)[sext_i32_i64(local_tid_133356 +\n                                                              offset_133377)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_133375 = x_133373 + x_133374;\n                    \n                    x_133373 = defunc_1_op_res_133375;\n                }\n                // write result of operation\n                {\n               ",
                   "     ((__local\n                      float *) red_arr_mem_133360)[sext_i32_i64(local_tid_133356)] =\n                        x_133373;\n                }\n            }\n            skip_waves_133378 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_133356) == (int64_t) 0) {\n                x_acc_133371 = x_133373;\n            }\n        }\n        if (groups_per_segment_133346 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_133356 == 0) {\n                    ((__global float *) mem_130835)[gtid_120517] = x_acc_133371;\n                }\n            }\n        } else {\n            int32_t old_counter_133379;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_133356 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_133351)[sext_i32_i64(virt_group_id_133366)] =\n                        x_acc_133371;\n                    mem_fence_global();\n                    old_counter_133379 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_133353)[sext_i32_i64(srem32(flat_segment_id_133367,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_133362)[(int64_t) 0] =\n                        old_counter_133379 == groups_per_segment_133346 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_133380 = ((__local\n                                          bool *) sync_arr_mem_133362)[(int64_t) 0];\n            \n            ",
                   "if (is_last_group_133380) {\n                if (local_tid_133356 == 0) {\n                    old_counter_133379 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_133353)[sext_i32_i64(srem32(flat_segment_id_133367,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_133346));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_133381 =\n                            sdiv_up64(groups_per_segment_133346,\n                                      segred_group_sizze_120643);\n                    \n                    x_120647 = 0.0F;\n                    for (int64_t i_133382 = 0; i_133382 <\n                         read_per_thread_133381; i_133382++) {\n                        int64_t group_res_id_133383 =\n                                sext_i32_i64(local_tid_133356) *\n                                read_per_thread_133381 + i_133382;\n                        int64_t index_of_group_res_133384 =\n                                sext_i32_i64(flat_segment_id_133367) *\n                                groups_per_segment_133346 + group_res_id_133383;\n                        \n                        if (slt64(group_res_id_133383,\n                                  groups_per_segment_133346)) {\n                            x_120648 = ((__global\n                                         float *) segred_tmp_mem_133351)[index_of_group_res_133384];\n                            \n                            float defunc_1_op_res_120649 = x_120647 + x_120648;\n                            \n                            x_120647 = defunc_1_op_res_120649;\n                        }\n                    }\n                }\n                ((__loca",
                   "l\n                  float *) red_arr_mem_133360)[sext_i32_i64(local_tid_133356)] =\n                    x_120647;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_133385;\n                    int32_t skip_waves_133386 = 1;\n                    float x_133373;\n                    float x_133374;\n                    \n                    offset_133385 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_133356,\n                                  sext_i64_i32(segred_group_sizze_120643))) {\n                            x_133373 = ((__local\n                                         float *) red_arr_mem_133360)[sext_i32_i64(local_tid_133356 +\n                                                                      offset_133385)];\n                        }\n                    }\n                    offset_133385 = 1;\n                    while (slt32(offset_133385, wave_sizze_133358)) {\n                        if (slt32(local_tid_133356 + offset_133385,\n                                  sext_i64_i32(segred_group_sizze_120643)) &&\n                            ((local_tid_133356 - squot32(local_tid_133356,\n                                                         wave_sizze_133358) *\n                              wave_sizze_133358) & (2 * offset_133385 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_133374 = ((volatile __local\n                                             float *) red_arr_mem_133360)[sext_i32_i64(local_tid_133356 +\n                                                                          offset_133385)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_133375 = x_",
                   "133373 +\n                                      x_133374;\n                                \n                                x_133373 = defunc_1_op_res_133375;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_133360)[sext_i32_i64(local_tid_133356)] =\n                                    x_133373;\n                            }\n                        }\n                        offset_133385 *= 2;\n                    }\n                    while (slt32(skip_waves_133386,\n                                 squot32(sext_i64_i32(segred_group_sizze_120643) +\n                                         wave_sizze_133358 - 1,\n                                         wave_sizze_133358))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_133385 = skip_waves_133386 * wave_sizze_133358;\n                        if (slt32(local_tid_133356 + offset_133385,\n                                  sext_i64_i32(segred_group_sizze_120643)) &&\n                            ((local_tid_133356 - squot32(local_tid_133356,\n                                                         wave_sizze_133358) *\n                              wave_sizze_133358) == 0 &&\n                             (squot32(local_tid_133356, wave_sizze_133358) &\n                              (2 * skip_waves_133386 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_133374 = ((__local\n                                             float *) red_arr_mem_133360)[sext_i32_i64(local_tid_133356 +\n                                                                          offset_133385)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_133375 = x_1",
                   "33373 +\n                                      x_133374;\n                                \n                                x_133373 = defunc_1_op_res_133375;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_133360)[sext_i32_i64(local_tid_133356)] =\n                                    x_133373;\n                            }\n                        }\n                        skip_waves_133386 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_133356 == 0) {\n                            ((__global float *) mem_130835)[gtid_120517] =\n                                x_133373;\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_120643\n}\n__kernel void mainzisegred_large_120587(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_133242_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133240_backing_aligned_1,\n                                        int64_t m_114533, int64_t n_p_114536,\n                                        int64_t C_len_114582,\n                                        int64_t num_groups_120596,\n                                        int64_t groups_per_segment_133226,\n                                        int64_t elements_per_thread_133227,\n                                        int64_t virt_num_groups_133228,\n                                        int64_t threads_per_segment_133230,\n                                        __global unsigned char *mem_130",
                   "750,\n                                        __global unsigned char *mem_130826,\n                                        __global\n                                        unsigned char *segred_tmp_mem_133231,\n                                        __global\n                                        unsigned char *mainzicounter_mem_133233)\n{\n    #define segred_group_sizze_120595 (mainzisegred_group_sizze_120581)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict sync_arr_mem_133242_backing_1 =\n                          (__local volatile\n                           char *) sync_arr_mem_133242_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_133240_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_133240_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_133235;\n    int32_t local_tid_133236;\n    int64_t group_sizze_133239;\n    int32_t wave_sizze_133238;\n    int32_t group_tid_133237;\n    \n    global_tid_133235 = get_global_id(0);\n    local_tid_133236 = get_local_id(0);\n    group_sizze_133239 = get_local_size(0);\n    wave_sizze_133238 = LOCKSTEP_WIDTH;\n    group_tid_133237 = get_group_id(0);\n    \n    int32_t phys_tid_120587 = global_tid_133235;\n    __local char *red_arr_mem_133240;\n    \n    red_arr_mem_133240 = (__local char *) red_arr_mem_133240_backing_0;\n    \n    __local char *sync_arr_mem_133242;\n    \n    sync_arr_mem_133242 = (__local char *) sync_arr_mem_133242_backing_1;\n    \n    int32_t phys_group_id_133244;\n    \n    phys_group_id_133244 = get_group_id(0);\n    for (int32_t i_133245 = 0; i_133245 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_133228) - phys_group_id_133244,\n                   sext_i64_i32(num_groups_120596)); i_133245++) {\n        int32_t virt_group_id_133246 = phys_group_id_133244 + i_133245 *\n                sext_i64_i32(num_groups_120596);\n        int",
                   "32_t flat_segment_id_133247 = squot32(virt_group_id_133246,\n                                                 sext_i64_i32(groups_per_segment_133226));\n        int64_t global_tid_133248 = srem64(sext_i32_i64(virt_group_id_133246) *\n                                           segred_group_sizze_120595 +\n                                           sext_i32_i64(local_tid_133236),\n                                           segred_group_sizze_120595 *\n                                           groups_per_segment_133226);\n        int64_t slice_133249 = m_114533;\n        int64_t gtid_120578 = sext_i32_i64(flat_segment_id_133247);\n        int64_t remnant_133250 = sext_i32_i64(flat_segment_id_133247) -\n                gtid_120578;\n        int64_t gtid_120586;\n        float x_acc_133251;\n        int64_t chunk_sizze_133252 = smin64(elements_per_thread_133227,\n                                            sdiv_up64(n_p_114536 -\n                                                      global_tid_133248,\n                                                      threads_per_segment_133230));\n        float x_120599;\n        float x_120600;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_133251 = 0.0F;\n        }\n        for (int64_t i_133256 = 0; i_133256 < chunk_sizze_133252; i_133256++) {\n            gtid_120586 = global_tid_133248 + threads_per_segment_133230 *\n                i_133256;\n            // apply map function\n            {\n                float x_120603 = ((__global float *) mem_130750)[gtid_120578 *\n                                                                 C_len_114582 +\n                                                                 gtid_120586];\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_120599 = x_acc_133251;\n                }\n                // load new values\n                {\n                    x_120600 = x_120603;\n      ",
                   "          }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_120601 = x_120599 + x_120600;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_133251 = defunc_1_op_res_120601;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_120599 = x_acc_133251;\n            ((__local\n              float *) red_arr_mem_133240)[sext_i32_i64(local_tid_133236)] =\n                x_120599;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_133257;\n        int32_t skip_waves_133258 = 1;\n        float x_133253;\n        float x_133254;\n        \n        offset_133257 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_133236,\n                      sext_i64_i32(segred_group_sizze_120595))) {\n                x_133253 = ((__local\n                             float *) red_arr_mem_133240)[sext_i32_i64(local_tid_133236 +\n                                                          offset_133257)];\n            }\n        }\n        offset_133257 = 1;\n        while (slt32(offset_133257, wave_sizze_133238)) {\n            if (slt32(local_tid_133236 + offset_133257,\n                      sext_i64_i32(segred_group_sizze_120595)) &&\n                ((local_tid_133236 - squot32(local_tid_133236,\n                                             wave_sizze_133238) *\n                  wave_sizze_133238) & (2 * offset_133257 - 1)) == 0) {\n                // read array element\n                {\n                    x_133254 = ((volatile __local\n                                 float *) red_arr_mem_133240)[sext_i32_i64(local_tid_133236 +\n                                                              offset_133257)];\n                }\n                // apply reduction operation\n                {\n                    ",
                   "float defunc_1_op_res_133255 = x_133253 + x_133254;\n                    \n                    x_133253 = defunc_1_op_res_133255;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_133240)[sext_i32_i64(local_tid_133236)] =\n                        x_133253;\n                }\n            }\n            offset_133257 *= 2;\n        }\n        while (slt32(skip_waves_133258,\n                     squot32(sext_i64_i32(segred_group_sizze_120595) +\n                             wave_sizze_133238 - 1, wave_sizze_133238))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_133257 = skip_waves_133258 * wave_sizze_133238;\n            if (slt32(local_tid_133236 + offset_133257,\n                      sext_i64_i32(segred_group_sizze_120595)) &&\n                ((local_tid_133236 - squot32(local_tid_133236,\n                                             wave_sizze_133238) *\n                  wave_sizze_133238) == 0 && (squot32(local_tid_133236,\n                                                      wave_sizze_133238) & (2 *\n                                                                            skip_waves_133258 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_133254 = ((__local\n                                 float *) red_arr_mem_133240)[sext_i32_i64(local_tid_133236 +\n                                                              offset_133257)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_133255 = x_133253 + x_133254;\n                    \n                    x_133253 = defunc_1_op_res_133255;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_133240",
                   ")[sext_i32_i64(local_tid_133236)] =\n                        x_133253;\n                }\n            }\n            skip_waves_133258 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_133236) == (int64_t) 0) {\n                x_acc_133251 = x_133253;\n            }\n        }\n        if (groups_per_segment_133226 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_133236 == 0) {\n                    ((__global float *) mem_130826)[gtid_120578] = x_acc_133251;\n                }\n            }\n        } else {\n            int32_t old_counter_133259;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_133236 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_133231)[sext_i32_i64(virt_group_id_133246)] =\n                        x_acc_133251;\n                    mem_fence_global();\n                    old_counter_133259 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_133233)[sext_i32_i64(srem32(flat_segment_id_133247,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_133242)[(int64_t) 0] =\n                        old_counter_133259 == groups_per_segment_133226 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_133260 = ((__local\n                                          bool *) sync_arr_mem_133242)[(int64_t) 0];\n            \n            if (is_last_group_133260) {\n                if (local_tid_133236",
                   " == 0) {\n                    old_counter_133259 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_133233)[sext_i32_i64(srem32(flat_segment_id_133247,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_133226));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_133261 =\n                            sdiv_up64(groups_per_segment_133226,\n                                      segred_group_sizze_120595);\n                    \n                    x_120599 = 0.0F;\n                    for (int64_t i_133262 = 0; i_133262 <\n                         read_per_thread_133261; i_133262++) {\n                        int64_t group_res_id_133263 =\n                                sext_i32_i64(local_tid_133236) *\n                                read_per_thread_133261 + i_133262;\n                        int64_t index_of_group_res_133264 =\n                                sext_i32_i64(flat_segment_id_133247) *\n                                groups_per_segment_133226 + group_res_id_133263;\n                        \n                        if (slt64(group_res_id_133263,\n                                  groups_per_segment_133226)) {\n                            x_120600 = ((__global\n                                         float *) segred_tmp_mem_133231)[index_of_group_res_133264];\n                            \n                            float defunc_1_op_res_120601 = x_120599 + x_120600;\n                            \n                            x_120599 = defunc_1_op_res_120601;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_133240)[sext_i32_i64(lo",
                   "cal_tid_133236)] =\n                    x_120599;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_133265;\n                    int32_t skip_waves_133266 = 1;\n                    float x_133253;\n                    float x_133254;\n                    \n                    offset_133265 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_133236,\n                                  sext_i64_i32(segred_group_sizze_120595))) {\n                            x_133253 = ((__local\n                                         float *) red_arr_mem_133240)[sext_i32_i64(local_tid_133236 +\n                                                                      offset_133265)];\n                        }\n                    }\n                    offset_133265 = 1;\n                    while (slt32(offset_133265, wave_sizze_133238)) {\n                        if (slt32(local_tid_133236 + offset_133265,\n                                  sext_i64_i32(segred_group_sizze_120595)) &&\n                            ((local_tid_133236 - squot32(local_tid_133236,\n                                                         wave_sizze_133238) *\n                              wave_sizze_133238) & (2 * offset_133265 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_133254 = ((volatile __local\n                                             float *) red_arr_mem_133240)[sext_i32_i64(local_tid_133236 +\n                                                                          offset_133265)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_133255 = x_133253 +\n                                      x_133254;\n       ",
                   "                         \n                                x_133253 = defunc_1_op_res_133255;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_133240)[sext_i32_i64(local_tid_133236)] =\n                                    x_133253;\n                            }\n                        }\n                        offset_133265 *= 2;\n                    }\n                    while (slt32(skip_waves_133266,\n                                 squot32(sext_i64_i32(segred_group_sizze_120595) +\n                                         wave_sizze_133238 - 1,\n                                         wave_sizze_133238))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_133265 = skip_waves_133266 * wave_sizze_133238;\n                        if (slt32(local_tid_133236 + offset_133265,\n                                  sext_i64_i32(segred_group_sizze_120595)) &&\n                            ((local_tid_133236 - squot32(local_tid_133236,\n                                                         wave_sizze_133238) *\n                              wave_sizze_133238) == 0 &&\n                             (squot32(local_tid_133236, wave_sizze_133238) &\n                              (2 * skip_waves_133266 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_133254 = ((__local\n                                             float *) red_arr_mem_133240)[sext_i32_i64(local_tid_133236 +\n                                                                          offset_133265)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_133255 = x_133253 +\n                                      x_133254;\n        ",
                   "                        \n                                x_133253 = defunc_1_op_res_133255;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_133240)[sext_i32_i64(local_tid_133236)] =\n                                    x_133253;\n                            }\n                        }\n                        skip_waves_133266 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_133236 == 0) {\n                            ((__global float *) mem_130826)[gtid_120578] =\n                                x_133253;\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_120595\n}\n__kernel void mainzisegred_large_121036(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_133724_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133722_backing_aligned_1,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t l_window_114538,\n                                        int64_t t_jump_114541,\n                                        int64_t l_n_m_114584, int64_t i_114610,\n                                        int64_t num_groups_121366,\n                                        int64_t groups_per_segment_133708,\n                                        int64_t elements_per_thread_133709,\n                                        int64_t virt_num_groups_133710,\n                                        int64_t threads_per_segment",
                   "_133712,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130404,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130405,\n                                        __global unsigned char *mem_130861,\n                                        __global unsigned char *mem_130865,\n                                        __global unsigned char *mem_130918,\n                                        __global unsigned char *mem_130923,\n                                        __global\n                                        unsigned char *segred_tmp_mem_133713,\n                                        __global\n                                        unsigned char *mainzicounter_mem_133715)\n{\n    #define segred_group_sizze_121365 (mainzisegred_group_sizze_121030)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict sync_arr_mem_133724_backing_1 =\n                          (__local volatile\n                           char *) sync_arr_mem_133724_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_133722_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_133722_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_133717;\n    int32_t local_tid_133718;\n    int64_t group_sizze_133721;\n    int32_t wave_sizze_133720;\n    int32_t group_tid_133719;\n    \n    global_tid_133717 = get_global_id(0);\n    local_tid_133718 = get_local_id(0);\n    group_sizze_133721 = get_local_size(0);\n    wave_sizze_133720 = LOCKSTEP_WIDTH;\n    group_tid_133719 = get_group_id",
                   "(0);\n    \n    int32_t phys_tid_121036 = global_tid_133717;\n    __local char *red_arr_mem_133722;\n    \n    red_arr_mem_133722 = (__local char *) red_arr_mem_133722_backing_0;\n    \n    __local char *sync_arr_mem_133724;\n    \n    sync_arr_mem_133724 = (__local char *) sync_arr_mem_133724_backing_1;\n    \n    int32_t phys_group_id_133726;\n    \n    phys_group_id_133726 = get_group_id(0);\n    for (int32_t i_133727 = 0; i_133727 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_133710) - phys_group_id_133726,\n                   sext_i64_i32(num_groups_121366)); i_133727++) {\n        int32_t virt_group_id_133728 = phys_group_id_133726 + i_133727 *\n                sext_i64_i32(num_groups_121366);\n        int32_t flat_segment_id_133729 = squot32(virt_group_id_133728,\n                                                 sext_i64_i32(groups_per_segment_133708));\n        int64_t global_tid_133730 = srem64(sext_i32_i64(virt_group_id_133728) *\n                                           segred_group_sizze_121365 +\n                                           sext_i32_i64(local_tid_133718),\n                                           segred_group_sizze_121365 *\n                                           groups_per_segment_133708);\n        int64_t slice_133731 = l_n_m_114584;\n        int64_t slice_133732 = m_114533 * slice_133731;\n        int64_t gtid_121025 = squot64(sext_i32_i64(flat_segment_id_133729),\n                                      slice_133731);\n        int64_t remnant_133733 = sext_i32_i64(flat_segment_id_133729) -\n                gtid_121025 * slice_133731;\n        int64_t gtid_121026 = remnant_133733;\n        int64_t remnant_133734 = remnant_133733 - gtid_121026;\n        int64_t gtid_121035;\n        float x_acc_133735;\n        int64_t chunk_sizze_133736 = smin64(elements_per_thread_133709,\n                                            sdiv_up64(l_window_114538 -\n                                                      global_tid_133730,\n                                             ",
                   "         threads_per_segment_133712));\n        float x_121369;\n        float x_121370;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_133735 = 0.0F;\n        }\n        for (int64_t i_133740 = 0; i_133740 < chunk_sizze_133736; i_133740++) {\n            gtid_121035 = global_tid_133730 + threads_per_segment_133712 *\n                i_133740;\n            // apply map function\n            {\n                int64_t x_121377 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_121025];\n                int64_t x_121380 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130404)[gtid_121025 *\n                                                                             l_n_m_114584 +\n                                                                             gtid_121026];\n                float x_121381 = ((__global\n                                   float *) defunc_3_map_res_mem_130405)[gtid_121025 *\n                                                                         l_n_m_114584 +\n                                                                         gtid_121026];\n                int64_t binop_y_128820 = mul64(t_jump_114541, gtid_121026);\n                int64_t convop_x_128821 = smin64(i_114610, binop_y_128820);\n                float index_primexp_128822 = sitofp_i64_f32(convop_x_128821);\n                float a0_121383 = ((__global float *) mem_130918)[gtid_121025 *\n                                                                  l_n_m_114584 +\n                                                                  gtid_121026];\n                bool cond_121385 = sle64(x_121377, gtid_121035);\n                float defunc_0_f_res_121386;\n                \n                if (cond_121385) {\n                    defunc_0_f_res_121386 = 0.0F;\n                } else {\n                    int64_t i_121387 = add64(gtid_121035, x_121380);\n                    float x_121388 ",
                   "= ((__global\n                                       float *) mem_130122)[gtid_121025 *\n                                                            n_114534 +\n                                                            i_121387];\n                    float defunc_0_f_res_f_res_121389 = 1.0F + x_121388;\n                    \n                    defunc_0_f_res_121386 = defunc_0_f_res_f_res_121389;\n                }\n                \n                float defunc_0_f_res_121390;\n                \n                if (cond_121385) {\n                    defunc_0_f_res_121390 = 0.0F;\n                } else {\n                    int64_t i_121391 = add64(gtid_121035, x_121380);\n                    float x_121392 = ((__global\n                                       float *) mem_130861)[gtid_121025 *\n                                                            n_114534 +\n                                                            i_121391];\n                    \n                    defunc_0_f_res_121390 = x_121392;\n                }\n                \n                float x_j_121393 = defunc_0_f_res_121386 - index_primexp_128822;\n                float abs_res_121394 = (float) fabs(x_j_121393);\n                float tmp1_121395 = abs_res_121394 / x_121381;\n                float x_121396 = tmp1_121395 * tmp1_121395;\n                float y_121397 = tmp1_121395 * x_121396;\n                float tmp2_121398 = 1.0F - y_121397;\n                float x_121399 = tmp2_121398 * tmp2_121398;\n                float tmp3_121400 = tmp2_121398 * x_121399;\n                float tmp4_121401 = defunc_0_f_res_121390 * tmp3_121400;\n                float defunc_0_f_res_121402;\n                \n                if (cond_121385) {\n                    defunc_0_f_res_121402 = 0.0F;\n                } else {\n                    int64_t i_121403 = add64(gtid_121035, x_121380);\n                    float x_121404 = ((__global\n                                       float *) mem_130865)[gtid_121025 *\n                   ",
                   "                                         n_114534 +\n                                                            i_121403];\n                    \n                    defunc_0_f_res_121402 = x_121404;\n                }\n                \n                float x_121405 = a0_121383 * tmp4_121401;\n                float defunc_9_fit_fun_res_121406 = defunc_0_f_res_121402 *\n                      x_121405;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_121369 = x_acc_133735;\n                }\n                // load new values\n                {\n                    x_121370 = defunc_9_fit_fun_res_121406;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_121371 = x_121369 + x_121370;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_133735 = defunc_1_op_res_121371;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_121369 = x_acc_133735;\n            ((__local\n              float *) red_arr_mem_133722)[sext_i32_i64(local_tid_133718)] =\n                x_121369;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_133741;\n        int32_t skip_waves_133742 = 1;\n        float x_133737;\n        float x_133738;\n        \n        offset_133741 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_133718,\n                      sext_i64_i32(segred_group_sizze_121365))) {\n                x_133737 = ((__local\n                             float *) red_arr_mem_133722)[sext_i32_i64(local_tid_133718 +\n                                                          offset_133741)];\n            }\n        }\n        offset_133741 = 1;\n        while (slt32(offset_133741, wave_sizze_13",
                   "3720)) {\n            if (slt32(local_tid_133718 + offset_133741,\n                      sext_i64_i32(segred_group_sizze_121365)) &&\n                ((local_tid_133718 - squot32(local_tid_133718,\n                                             wave_sizze_133720) *\n                  wave_sizze_133720) & (2 * offset_133741 - 1)) == 0) {\n                // read array element\n                {\n                    x_133738 = ((volatile __local\n                                 float *) red_arr_mem_133722)[sext_i32_i64(local_tid_133718 +\n                                                              offset_133741)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_133739 = x_133737 + x_133738;\n                    \n                    x_133737 = defunc_1_op_res_133739;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_133722)[sext_i32_i64(local_tid_133718)] =\n                        x_133737;\n                }\n            }\n            offset_133741 *= 2;\n        }\n        while (slt32(skip_waves_133742,\n                     squot32(sext_i64_i32(segred_group_sizze_121365) +\n                             wave_sizze_133720 - 1, wave_sizze_133720))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_133741 = skip_waves_133742 * wave_sizze_133720;\n            if (slt32(local_tid_133718 + offset_133741,\n                      sext_i64_i32(segred_group_sizze_121365)) &&\n                ((local_tid_133718 - squot32(local_tid_133718,\n                                             wave_sizze_133720) *\n                  wave_sizze_133720) == 0 && (squot32(local_tid_133718,\n                                                      wave_sizze_133720) & (2 *\n                                                                            skip_waves_133742 -\n                                                     ",
                   "                       1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_133738 = ((__local\n                                 float *) red_arr_mem_133722)[sext_i32_i64(local_tid_133718 +\n                                                              offset_133741)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_133739 = x_133737 + x_133738;\n                    \n                    x_133737 = defunc_1_op_res_133739;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_133722)[sext_i32_i64(local_tid_133718)] =\n                        x_133737;\n                }\n            }\n            skip_waves_133742 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_133718) == (int64_t) 0) {\n                x_acc_133735 = x_133737;\n            }\n        }\n        if (groups_per_segment_133708 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_133718 == 0) {\n                    ((__global float *) mem_130923)[gtid_121025 * l_n_m_114584 +\n                                                    gtid_121026] = x_acc_133735;\n                }\n            }\n        } else {\n            int32_t old_counter_133743;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_133718 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_133713)[sext_i32_i64(virt_group_id_133728)] =\n                        x_acc_133735;\n                    mem_fence_global();\n                    old_counter_133743 =\n                        atomic_add_i32_global(&((volatile __global\n                    ",
                   "                             int *) mainzicounter_mem_133715)[sext_i32_i64(srem32(flat_segment_id_133729,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_133724)[(int64_t) 0] =\n                        old_counter_133743 == groups_per_segment_133708 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_133744 = ((__local\n                                          bool *) sync_arr_mem_133724)[(int64_t) 0];\n            \n            if (is_last_group_133744) {\n                if (local_tid_133718 == 0) {\n                    old_counter_133743 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_133715)[sext_i32_i64(srem32(flat_segment_id_133729,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_133708));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_133745 =\n                            sdiv_up64(groups_per_segment_133708,\n                                      segred_group_sizze_121365);\n                    \n                    x_121369 = 0.0F;\n                    for (int64_t i_133746 = 0; i_133746 <\n                         read_per_thread_133745; i_133746++) {\n                        int64_t group_res_id_133747 =\n                                sext_i32_i64(local_tid_133718) *\n                                read_per_thread_133745 + i_133746;\n                        int64_t index_of_group_res_133748 =\n         ",
                   "                       sext_i32_i64(flat_segment_id_133729) *\n                                groups_per_segment_133708 + group_res_id_133747;\n                        \n                        if (slt64(group_res_id_133747,\n                                  groups_per_segment_133708)) {\n                            x_121370 = ((__global\n                                         float *) segred_tmp_mem_133713)[index_of_group_res_133748];\n                            \n                            float defunc_1_op_res_121371 = x_121369 + x_121370;\n                            \n                            x_121369 = defunc_1_op_res_121371;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_133722)[sext_i32_i64(local_tid_133718)] =\n                    x_121369;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_133749;\n                    int32_t skip_waves_133750 = 1;\n                    float x_133737;\n                    float x_133738;\n                    \n                    offset_133749 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_133718,\n                                  sext_i64_i32(segred_group_sizze_121365))) {\n                            x_133737 = ((__local\n                                         float *) red_arr_mem_133722)[sext_i32_i64(local_tid_133718 +\n                                                                      offset_133749)];\n                        }\n                    }\n                    offset_133749 = 1;\n                    while (slt32(offset_133749, wave_sizze_133720)) {\n                        if (slt32(local_tid_133718 + offset_133749,\n                                  sext_i64_i32(segred_group_sizze_121365)) &&\n                            ((local_tid_133718 - squot32(",
                   "local_tid_133718,\n                                                         wave_sizze_133720) *\n                              wave_sizze_133720) & (2 * offset_133749 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_133738 = ((volatile __local\n                                             float *) red_arr_mem_133722)[sext_i32_i64(local_tid_133718 +\n                                                                          offset_133749)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_133739 = x_133737 +\n                                      x_133738;\n                                \n                                x_133737 = defunc_1_op_res_133739;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_133722)[sext_i32_i64(local_tid_133718)] =\n                                    x_133737;\n                            }\n                        }\n                        offset_133749 *= 2;\n                    }\n                    while (slt32(skip_waves_133750,\n                                 squot32(sext_i64_i32(segred_group_sizze_121365) +\n                                         wave_sizze_133720 - 1,\n                                         wave_sizze_133720))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_133749 = skip_waves_133750 * wave_sizze_133720;\n                        if (slt32(local_tid_133718 + offset_133749,\n                                  sext_i64_i32(segred_group_sizze_121365)) &&\n                            ((local_tid_133718 - squot32(local_tid_133718,\n                                                         wave_si",
                   "zze_133720) *\n                              wave_sizze_133720) == 0 &&\n                             (squot32(local_tid_133718, wave_sizze_133720) &\n                              (2 * skip_waves_133750 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_133738 = ((__local\n                                             float *) red_arr_mem_133722)[sext_i32_i64(local_tid_133718 +\n                                                                          offset_133749)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_133739 = x_133737 +\n                                      x_133738;\n                                \n                                x_133737 = defunc_1_op_res_133739;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_133722)[sext_i32_i64(local_tid_133718)] =\n                                    x_133737;\n                            }\n                        }\n                        skip_waves_133750 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_133718 == 0) {\n                            ((__global float *) mem_130923)[gtid_121025 *\n                                                            l_n_m_114584 +\n                                                            gtid_121026] =\n                                x_133737;\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_121365\n}\n__kernel void mainzisegred_large_121098(__global int *glob",
                   "al_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_133646_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133644_backing_aligned_1,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t l_window_114538,\n                                        int64_t t_jump_114541,\n                                        int64_t l_n_m_114584, int64_t i_114610,\n                                        int64_t num_groups_121322,\n                                        int64_t groups_per_segment_133630,\n                                        int64_t elements_per_thread_133631,\n                                        int64_t virt_num_groups_133632,\n                                        int64_t threads_per_segment_133634,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130404,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130405,\n                                        __global unsigned char *mem_130861,\n                                        __global unsigned char *mem_130913,\n                                        __global\n                                        unsigned char *segred_tmp_mem_133635,\n                                        __global\n                                        unsigned char *mainzicounter_mem_133637)\n{\n    #define segred_group_sizze_121321 (mainzisegred_group_sizze_121092)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 =",
                   " 2;\n    __local volatile char *restrict sync_arr_mem_133646_backing_1 =\n                          (__local volatile\n                           char *) sync_arr_mem_133646_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_133644_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_133644_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_133639;\n    int32_t local_tid_133640;\n    int64_t group_sizze_133643;\n    int32_t wave_sizze_133642;\n    int32_t group_tid_133641;\n    \n    global_tid_133639 = get_global_id(0);\n    local_tid_133640 = get_local_id(0);\n    group_sizze_133643 = get_local_size(0);\n    wave_sizze_133642 = LOCKSTEP_WIDTH;\n    group_tid_133641 = get_group_id(0);\n    \n    int32_t phys_tid_121098 = global_tid_133639;\n    __local char *red_arr_mem_133644;\n    \n    red_arr_mem_133644 = (__local char *) red_arr_mem_133644_backing_0;\n    \n    __local char *sync_arr_mem_133646;\n    \n    sync_arr_mem_133646 = (__local char *) sync_arr_mem_133646_backing_1;\n    \n    int32_t phys_group_id_133648;\n    \n    phys_group_id_133648 = get_group_id(0);\n    for (int32_t i_133649 = 0; i_133649 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_133632) - phys_group_id_133648,\n                   sext_i64_i32(num_groups_121322)); i_133649++) {\n        int32_t virt_group_id_133650 = phys_group_id_133648 + i_133649 *\n                sext_i64_i32(num_groups_121322);\n        int32_t flat_segment_id_133651 = squot32(virt_group_id_133650,\n                                                 sext_i64_i32(groups_per_segment_133630));\n        int64_t global_tid_133652 = srem64(sext_i32_i64(virt_group_id_133650) *\n                                           segred_group_sizze_121321 +\n                                           sext_i32_i64(local_tid_133640),\n                                           segred_group_sizze_121321 *\n                                           groups_per_s",
                   "egment_133630);\n        int64_t slice_133653 = l_n_m_114584;\n        int64_t slice_133654 = m_114533 * slice_133653;\n        int64_t gtid_121087 = squot64(sext_i32_i64(flat_segment_id_133651),\n                                      slice_133653);\n        int64_t remnant_133655 = sext_i32_i64(flat_segment_id_133651) -\n                gtid_121087 * slice_133653;\n        int64_t gtid_121088 = remnant_133655;\n        int64_t remnant_133656 = remnant_133655 - gtid_121088;\n        int64_t gtid_121097;\n        float x_acc_133657;\n        int64_t chunk_sizze_133658 = smin64(elements_per_thread_133631,\n                                            sdiv_up64(l_window_114538 -\n                                                      global_tid_133652,\n                                                      threads_per_segment_133634));\n        float x_121325;\n        float x_121326;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_133657 = 0.0F;\n        }\n        for (int64_t i_133662 = 0; i_133662 < chunk_sizze_133658; i_133662++) {\n            gtid_121097 = global_tid_133652 + threads_per_segment_133634 *\n                i_133662;\n            // apply map function\n            {\n                int64_t x_121332 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_121087];\n                int64_t x_121334 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130404)[gtid_121087 *\n                                                                             l_n_m_114584 +\n                                                                             gtid_121088];\n                float x_121335 = ((__global\n                                   float *) defunc_3_map_res_mem_130405)[gtid_121087 *\n                                                                         l_n_m_114584 +\n                                                                         gtid_121088];\n                int64_",
                   "t binop_y_128813 = mul64(t_jump_114541, gtid_121088);\n                int64_t convop_x_128814 = smin64(i_114610, binop_y_128813);\n                float index_primexp_128815 = sitofp_i64_f32(convop_x_128814);\n                bool cond_121338 = sle64(x_121332, gtid_121097);\n                float defunc_0_f_res_121339;\n                \n                if (cond_121338) {\n                    defunc_0_f_res_121339 = 0.0F;\n                } else {\n                    int64_t i_121340 = add64(gtid_121097, x_121334);\n                    float x_121341 = ((__global\n                                       float *) mem_130122)[gtid_121087 *\n                                                            n_114534 +\n                                                            i_121340];\n                    float defunc_0_f_res_f_res_121342 = 1.0F + x_121341;\n                    \n                    defunc_0_f_res_121339 = defunc_0_f_res_f_res_121342;\n                }\n                \n                float defunc_0_f_res_121343;\n                \n                if (cond_121338) {\n                    defunc_0_f_res_121343 = 0.0F;\n                } else {\n                    int64_t i_121344 = add64(gtid_121097, x_121334);\n                    float x_121345 = ((__global\n                                       float *) mem_130861)[gtid_121087 *\n                                                            n_114534 +\n                                                            i_121344];\n                    \n                    defunc_0_f_res_121343 = x_121345;\n                }\n                \n                float x_j_121346 = defunc_0_f_res_121339 - index_primexp_128815;\n                float abs_res_121347 = (float) fabs(x_j_121346);\n                float tmp1_121348 = abs_res_121347 / x_121335;\n                float x_121349 = tmp1_121348 * tmp1_121348;\n                float y_121350 = tmp1_121348 * x_121349;\n                float tmp2_121351 = 1.0F - y_121350;\n                float x_12",
                   "1352 = tmp2_121351 * tmp2_121351;\n                float tmp3_121353 = tmp2_121351 * x_121352;\n                float w_j_121354 = defunc_0_f_res_121343 * tmp3_121353;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_121325 = x_acc_133657;\n                }\n                // load new values\n                {\n                    x_121326 = w_j_121354;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_121327 = x_121325 + x_121326;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_133657 = defunc_1_op_res_121327;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_121325 = x_acc_133657;\n            ((__local\n              float *) red_arr_mem_133644)[sext_i32_i64(local_tid_133640)] =\n                x_121325;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_133663;\n        int32_t skip_waves_133664 = 1;\n        float x_133659;\n        float x_133660;\n        \n        offset_133663 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_133640,\n                      sext_i64_i32(segred_group_sizze_121321))) {\n                x_133659 = ((__local\n                             float *) red_arr_mem_133644)[sext_i32_i64(local_tid_133640 +\n                                                          offset_133663)];\n            }\n        }\n        offset_133663 = 1;\n        while (slt32(offset_133663, wave_sizze_133642)) {\n            if (slt32(local_tid_133640 + offset_133663,\n                      sext_i64_i32(segred_group_sizze_121321)) &&\n                ((local_tid_133640 - squot32(local_tid_133640,\n                                             wave_sizze_",
                   "133642) *\n                  wave_sizze_133642) & (2 * offset_133663 - 1)) == 0) {\n                // read array element\n                {\n                    x_133660 = ((volatile __local\n                                 float *) red_arr_mem_133644)[sext_i32_i64(local_tid_133640 +\n                                                              offset_133663)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_133661 = x_133659 + x_133660;\n                    \n                    x_133659 = defunc_1_op_res_133661;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_133644)[sext_i32_i64(local_tid_133640)] =\n                        x_133659;\n                }\n            }\n            offset_133663 *= 2;\n        }\n        while (slt32(skip_waves_133664,\n                     squot32(sext_i64_i32(segred_group_sizze_121321) +\n                             wave_sizze_133642 - 1, wave_sizze_133642))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_133663 = skip_waves_133664 * wave_sizze_133642;\n            if (slt32(local_tid_133640 + offset_133663,\n                      sext_i64_i32(segred_group_sizze_121321)) &&\n                ((local_tid_133640 - squot32(local_tid_133640,\n                                             wave_sizze_133642) *\n                  wave_sizze_133642) == 0 && (squot32(local_tid_133640,\n                                                      wave_sizze_133642) & (2 *\n                                                                            skip_waves_133664 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_133660 = ((__local\n                                 float *) red_arr_mem_133644)[sext_i32_i64(local_tid_133640 +\n      ",
                   "                                                        offset_133663)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_133661 = x_133659 + x_133660;\n                    \n                    x_133659 = defunc_1_op_res_133661;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_133644)[sext_i32_i64(local_tid_133640)] =\n                        x_133659;\n                }\n            }\n            skip_waves_133664 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_133640) == (int64_t) 0) {\n                x_acc_133657 = x_133659;\n            }\n        }\n        if (groups_per_segment_133630 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_133640 == 0) {\n                    ((__global float *) mem_130913)[gtid_121087 * l_n_m_114584 +\n                                                    gtid_121088] = x_acc_133657;\n                }\n            }\n        } else {\n            int32_t old_counter_133665;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_133640 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_133635)[sext_i32_i64(virt_group_id_133650)] =\n                        x_acc_133657;\n                    mem_fence_global();\n                    old_counter_133665 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_133637)[sext_i32_i64(srem32(flat_segment_id_133651,\n                                                                                                      10240))],\n                                ",
                   "              (int) 1);\n                    ((__local bool *) sync_arr_mem_133646)[(int64_t) 0] =\n                        old_counter_133665 == groups_per_segment_133630 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_133666 = ((__local\n                                          bool *) sync_arr_mem_133646)[(int64_t) 0];\n            \n            if (is_last_group_133666) {\n                if (local_tid_133640 == 0) {\n                    old_counter_133665 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_133637)[sext_i32_i64(srem32(flat_segment_id_133651,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_133630));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_133667 =\n                            sdiv_up64(groups_per_segment_133630,\n                                      segred_group_sizze_121321);\n                    \n                    x_121325 = 0.0F;\n                    for (int64_t i_133668 = 0; i_133668 <\n                         read_per_thread_133667; i_133668++) {\n                        int64_t group_res_id_133669 =\n                                sext_i32_i64(local_tid_133640) *\n                                read_per_thread_133667 + i_133668;\n                        int64_t index_of_group_res_133670 =\n                                sext_i32_i64(flat_segment_id_133651) *\n                                groups_per_segment_133630 + group_res_id_133669;\n                        \n                        if (slt64(group_res_id_133669,\n                           ",
                   "       groups_per_segment_133630)) {\n                            x_121326 = ((__global\n                                         float *) segred_tmp_mem_133635)[index_of_group_res_133670];\n                            \n                            float defunc_1_op_res_121327 = x_121325 + x_121326;\n                            \n                            x_121325 = defunc_1_op_res_121327;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_133644)[sext_i32_i64(local_tid_133640)] =\n                    x_121325;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_133671;\n                    int32_t skip_waves_133672 = 1;\n                    float x_133659;\n                    float x_133660;\n                    \n                    offset_133671 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_133640,\n                                  sext_i64_i32(segred_group_sizze_121321))) {\n                            x_133659 = ((__local\n                                         float *) red_arr_mem_133644)[sext_i32_i64(local_tid_133640 +\n                                                                      offset_133671)];\n                        }\n                    }\n                    offset_133671 = 1;\n                    while (slt32(offset_133671, wave_sizze_133642)) {\n                        if (slt32(local_tid_133640 + offset_133671,\n                                  sext_i64_i32(segred_group_sizze_121321)) &&\n                            ((local_tid_133640 - squot32(local_tid_133640,\n                                                         wave_sizze_133642) *\n                              wave_sizze_133642) & (2 * offset_133671 - 1)) ==\n                            0) {\n                            // read array ",
                   "element\n                            {\n                                x_133660 = ((volatile __local\n                                             float *) red_arr_mem_133644)[sext_i32_i64(local_tid_133640 +\n                                                                          offset_133671)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_133661 = x_133659 +\n                                      x_133660;\n                                \n                                x_133659 = defunc_1_op_res_133661;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_133644)[sext_i32_i64(local_tid_133640)] =\n                                    x_133659;\n                            }\n                        }\n                        offset_133671 *= 2;\n                    }\n                    while (slt32(skip_waves_133672,\n                                 squot32(sext_i64_i32(segred_group_sizze_121321) +\n                                         wave_sizze_133642 - 1,\n                                         wave_sizze_133642))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_133671 = skip_waves_133672 * wave_sizze_133642;\n                        if (slt32(local_tid_133640 + offset_133671,\n                                  sext_i64_i32(segred_group_sizze_121321)) &&\n                            ((local_tid_133640 - squot32(local_tid_133640,\n                                                         wave_sizze_133642) *\n                              wave_sizze_133642) == 0 &&\n                             (squot32(local_tid_133640, wave_sizze_133642) &\n                              (2 * skip_waves_133672 - 1)) == 0)) {\n                            // rea",
                   "d array element\n                            {\n                                x_133660 = ((__local\n                                             float *) red_arr_mem_133644)[sext_i32_i64(local_tid_133640 +\n                                                                          offset_133671)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_133661 = x_133659 +\n                                      x_133660;\n                                \n                                x_133659 = defunc_1_op_res_133661;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_133644)[sext_i32_i64(local_tid_133640)] =\n                                    x_133659;\n                            }\n                        }\n                        skip_waves_133672 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_133640 == 0) {\n                            ((__global float *) mem_130913)[gtid_121087 *\n                                                            l_n_m_114584 +\n                                                            gtid_121088] =\n                                x_133659;\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_121321\n}\n__kernel void mainzisegred_large_121729(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_133945_backing_aligned_0,\n                                        __local volatile\n                                    ",
                   "    int64_t *red_arr_mem_133943_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133941_backing_aligned_2,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t l_window_114538,\n                                        int64_t t_jump_114541,\n                                        int64_t l_n_m_114584, int64_t i_114610,\n                                        int64_t num_groups_122182,\n                                        int64_t groups_per_segment_133925,\n                                        int64_t elements_per_thread_133926,\n                                        int64_t virt_num_groups_133927,\n                                        int64_t threads_per_segment_133929,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130404,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130405,\n                                        __global unsigned char *mem_130861,\n                                        __global unsigned char *mem_130865,\n                                        __global unsigned char *mem_131009,\n                                        __global unsigned char *mem_131013,\n                                        __global unsigned char *mem_131017,\n                                        __global unsigned char *mem_131022,\n                                        __global unsigned char *mem_131026,\n                                        __global\n                                        unsigned char *segred_tmp_mem_133930,\n                     ",
                   "                   __global\n                                        unsigned char *segred_tmp_mem_133932,\n                                        __global\n                                        unsigned char *mainzicounter_mem_133934)\n{\n    #define segred_group_sizze_122181 (mainzisegred_group_sizze_121723)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict sync_arr_mem_133945_backing_2 =\n                          (__local volatile\n                           char *) sync_arr_mem_133945_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_133943_backing_1 =\n                          (__local volatile\n                           char *) red_arr_mem_133943_backing_aligned_1;\n    __local volatile char *restrict red_arr_mem_133941_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_133941_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_133936;\n    int32_t local_tid_133937;\n    int64_t group_sizze_133940;\n    int32_t wave_sizze_133939;\n    int32_t group_tid_133938;\n    \n    global_tid_133936 = get_global_id(0);\n    local_tid_133937 = get_local_id(0);\n    group_sizze_133940 = get_local_size(0);\n    wave_sizze_133939 = LOCKSTEP_WIDTH;\n    group_tid_133938 = get_group_id(0);\n    \n    int32_t phys_tid_121729 = global_tid_133936;\n    __local char *red_arr_mem_133941;\n    \n    red_arr_mem_133941 = (__local char *) red_arr_mem_133941_backing_0;\n    \n    __local char *red_arr_mem_133943;\n    \n    red_arr_mem_133943 = (__local char *) red_arr_mem_133943_backing_1;\n    \n    __local char *sync_arr_mem_133945;\n    \n    sync_arr_mem_133945 = (__local char *) sync_arr_mem_133945_backing_2;\n    \n    int32_t phys_group_id_133947;\n    \n    phys_group_id_133947 = get_group_id(0);\n    for (int32_t i_133948 = 0; i_133948 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_133927) - phys_group_id_133947",
                   ",\n                   sext_i64_i32(num_groups_122182)); i_133948++) {\n        int32_t virt_group_id_133949 = phys_group_id_133947 + i_133948 *\n                sext_i64_i32(num_groups_122182);\n        int32_t flat_segment_id_133950 = squot32(virt_group_id_133949,\n                                                 sext_i64_i32(groups_per_segment_133925));\n        int64_t global_tid_133951 = srem64(sext_i32_i64(virt_group_id_133949) *\n                                           segred_group_sizze_122181 +\n                                           sext_i32_i64(local_tid_133937),\n                                           segred_group_sizze_122181 *\n                                           groups_per_segment_133925);\n        int64_t slice_133952 = l_n_m_114584;\n        int64_t slice_133953 = m_114533 * slice_133952;\n        int64_t gtid_121718 = squot64(sext_i32_i64(flat_segment_id_133950),\n                                      slice_133952);\n        int64_t remnant_133954 = sext_i32_i64(flat_segment_id_133950) -\n                gtid_121718 * slice_133952;\n        int64_t gtid_121719 = remnant_133954;\n        int64_t remnant_133955 = remnant_133954 - gtid_121719;\n        int64_t gtid_121728;\n        float x_acc_133956;\n        float x_acc_133957;\n        int64_t chunk_sizze_133958 = smin64(elements_per_thread_133926,\n                                            sdiv_up64(l_window_114538 -\n                                                      global_tid_133951,\n                                                      threads_per_segment_133929));\n        float x_122186;\n        float x_122187;\n        float x_122188;\n        float x_122189;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_133956 = 0.0F;\n            x_acc_133957 = 0.0F;\n        }\n        for (int64_t i_133965 = 0; i_133965 < chunk_sizze_133958; i_133965++) {\n            gtid_121728 = global_tid_133951 + threads_per_segment_133929 *\n                i_133965;\n            // appl",
                   "y map function\n            {\n                int64_t x_122197 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_121718];\n                int64_t x_122202 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130404)[gtid_121718 *\n                                                                             l_n_m_114584 +\n                                                                             gtid_121719];\n                float x_122203 = ((__global\n                                   float *) defunc_3_map_res_mem_130405)[gtid_121718 *\n                                                                         l_n_m_114584 +\n                                                                         gtid_121719];\n                int64_t binop_y_128852 = mul64(t_jump_114541, gtid_121719);\n                int64_t convop_x_128853 = smin64(i_114610, binop_y_128852);\n                float index_primexp_128854 = sitofp_i64_f32(convop_x_128853);\n                float a11_122205 = ((__global float *) mem_131009)[gtid_121718 *\n                                                                   l_n_m_114584 +\n                                                                   gtid_121719];\n                float b11_122206 = ((__global float *) mem_131013)[gtid_121718 *\n                                                                   l_n_m_114584 +\n                                                                   gtid_121719];\n                float c11_122207 = ((__global float *) mem_131017)[gtid_121718 *\n                                                                   l_n_m_114584 +\n                                                                   gtid_121719];\n                bool cond_122209 = sle64(x_122197, gtid_121728);\n                float defunc_0_f_res_122210;\n                \n                if (cond_122209) {\n                    defunc_0_f_res_122210 = 0.0F;\n                } else {\n         ",
                   "           int64_t i_122211 = add64(gtid_121728, x_122202);\n                    float x_122212 = ((__global\n                                       float *) mem_130122)[gtid_121718 *\n                                                            n_114534 +\n                                                            i_122211];\n                    float defunc_0_f_res_f_res_122213 = 1.0F + x_122212;\n                    \n                    defunc_0_f_res_122210 = defunc_0_f_res_f_res_122213;\n                }\n                \n                float defunc_0_f_res_122214;\n                \n                if (cond_122209) {\n                    defunc_0_f_res_122214 = 0.0F;\n                } else {\n                    int64_t i_122215 = add64(gtid_121728, x_122202);\n                    float x_122216 = ((__global\n                                       float *) mem_130861)[gtid_121718 *\n                                                            n_114534 +\n                                                            i_122215];\n                    \n                    defunc_0_f_res_122214 = x_122216;\n                }\n                \n                float x_j_122217 = defunc_0_f_res_122210 - index_primexp_128854;\n                float abs_res_122218 = (float) fabs(x_j_122217);\n                float tmp1_122219 = abs_res_122218 / x_122203;\n                float x_122220 = tmp1_122219 * tmp1_122219;\n                float y_122221 = tmp1_122219 * x_122220;\n                float tmp2_122222 = 1.0F - y_122221;\n                float x_122223 = tmp2_122222 * tmp2_122222;\n                float tmp3_122224 = tmp2_122222 * x_122223;\n                float tmp4_122225 = defunc_0_f_res_122214 * tmp3_122224;\n                float defunc_1_f_res_122226 = x_j_122217 * tmp4_122225;\n                float defunc_0_f_res_122227;\n                \n                if (cond_122209) {\n                    defunc_0_f_res_122227 = 0.0F;\n                } else {\n                    int64_t i_122228 = add6",
                   "4(gtid_121728, x_122202);\n                    float x_122229 = ((__global\n                                       float *) mem_130865)[gtid_121718 *\n                                                            n_114534 +\n                                                            i_122228];\n                    \n                    defunc_0_f_res_122227 = x_122229;\n                }\n                \n                float x_122230 = a11_122205 * tmp4_122225;\n                float y_122231 = b11_122206 * defunc_1_f_res_122226;\n                float x_122232 = x_122230 + y_122231;\n                float defunc_9_fit_fun_res_122233 = defunc_0_f_res_122227 *\n                      x_122232;\n                float x_122234 = b11_122206 * tmp4_122225;\n                float y_122235 = c11_122207 * defunc_1_f_res_122226;\n                float x_122236 = x_122234 + y_122235;\n                float defunc_9_slope_fun_res_122237 = defunc_0_f_res_122227 *\n                      x_122236;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_122186 = x_acc_133956;\n                    x_122187 = x_acc_133957;\n                }\n                // load new values\n                {\n                    x_122188 = defunc_9_fit_fun_res_122233;\n                    x_122189 = defunc_9_slope_fun_res_122237;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_122190 = x_122186 + x_122188;\n                    float defunc_1_op_res_122191 = x_122187 + x_122189;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_133956 = defunc_1_op_res_122190;\n                        x_acc_133957 = defunc_1_op_res_122191;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_122186 = x",
                   "_acc_133956;\n            x_122187 = x_acc_133957;\n            ((__local\n              float *) red_arr_mem_133941)[sext_i32_i64(local_tid_133937)] =\n                x_122186;\n            ((__local\n              float *) red_arr_mem_133943)[sext_i32_i64(local_tid_133937)] =\n                x_122187;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_133966;\n        int32_t skip_waves_133967 = 1;\n        float x_133959;\n        float x_133960;\n        float x_133961;\n        float x_133962;\n        \n        offset_133966 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_133937,\n                      sext_i64_i32(segred_group_sizze_122181))) {\n                x_133959 = ((__local\n                             float *) red_arr_mem_133941)[sext_i32_i64(local_tid_133937 +\n                                                          offset_133966)];\n                x_133960 = ((__local\n                             float *) red_arr_mem_133943)[sext_i32_i64(local_tid_133937 +\n                                                          offset_133966)];\n            }\n        }\n        offset_133966 = 1;\n        while (slt32(offset_133966, wave_sizze_133939)) {\n            if (slt32(local_tid_133937 + offset_133966,\n                      sext_i64_i32(segred_group_sizze_122181)) &&\n                ((local_tid_133937 - squot32(local_tid_133937,\n                                             wave_sizze_133939) *\n                  wave_sizze_133939) & (2 * offset_133966 - 1)) == 0) {\n                // read array element\n                {\n                    x_133961 = ((volatile __local\n                                 float *) red_arr_mem_133941)[sext_i32_i64(local_tid_133937 +\n                                                              offset_133966)];\n                    x_133962 = ((volatile __local\n                                 float *) red_arr_mem_133943)[sext_i32_i64(local_tid_133937 +\n        ",
                   "                                                      offset_133966)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_133963 = x_133959 + x_133961;\n                    float defunc_1_op_res_133964 = x_133960 + x_133962;\n                    \n                    x_133959 = defunc_1_op_res_133963;\n                    x_133960 = defunc_1_op_res_133964;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_133941)[sext_i32_i64(local_tid_133937)] =\n                        x_133959;\n                    ((volatile __local\n                      float *) red_arr_mem_133943)[sext_i32_i64(local_tid_133937)] =\n                        x_133960;\n                }\n            }\n            offset_133966 *= 2;\n        }\n        while (slt32(skip_waves_133967,\n                     squot32(sext_i64_i32(segred_group_sizze_122181) +\n                             wave_sizze_133939 - 1, wave_sizze_133939))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_133966 = skip_waves_133967 * wave_sizze_133939;\n            if (slt32(local_tid_133937 + offset_133966,\n                      sext_i64_i32(segred_group_sizze_122181)) &&\n                ((local_tid_133937 - squot32(local_tid_133937,\n                                             wave_sizze_133939) *\n                  wave_sizze_133939) == 0 && (squot32(local_tid_133937,\n                                                      wave_sizze_133939) & (2 *\n                                                                            skip_waves_133967 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_133961 = ((__local\n                                 float *) red_arr_mem_133941)[sext_i32_i64(local_tid_133937 +\n           ",
                   "                                                   offset_133966)];\n                    x_133962 = ((__local\n                                 float *) red_arr_mem_133943)[sext_i32_i64(local_tid_133937 +\n                                                              offset_133966)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_133963 = x_133959 + x_133961;\n                    float defunc_1_op_res_133964 = x_133960 + x_133962;\n                    \n                    x_133959 = defunc_1_op_res_133963;\n                    x_133960 = defunc_1_op_res_133964;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_133941)[sext_i32_i64(local_tid_133937)] =\n                        x_133959;\n                    ((__local\n                      float *) red_arr_mem_133943)[sext_i32_i64(local_tid_133937)] =\n                        x_133960;\n                }\n            }\n            skip_waves_133967 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_133937) == (int64_t) 0) {\n                x_acc_133956 = x_133959;\n                x_acc_133957 = x_133960;\n            }\n        }\n        if (groups_per_segment_133925 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_133937 == 0) {\n                    ((__global float *) mem_131022)[gtid_121718 * l_n_m_114584 +\n                                                    gtid_121719] = x_acc_133956;\n                    ((__global float *) mem_131026)[gtid_121718 * l_n_m_114584 +\n                                                    gtid_121719] = x_acc_133957;\n                }\n            }\n        } else {\n            int32_t old_counter_133968;\n            \n            // first th",
                   "read in group saves group result to global memory\n            {\n                if (local_tid_133937 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_133930)[sext_i32_i64(virt_group_id_133949)] =\n                        x_acc_133956;\n                    ((__global\n                      float *) segred_tmp_mem_133932)[sext_i32_i64(virt_group_id_133949)] =\n                        x_acc_133957;\n                    mem_fence_global();\n                    old_counter_133968 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_133934)[sext_i32_i64(srem32(flat_segment_id_133950,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_133945)[(int64_t) 0] =\n                        old_counter_133968 == groups_per_segment_133925 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_133969 = ((__local\n                                          bool *) sync_arr_mem_133945)[(int64_t) 0];\n            \n            if (is_last_group_133969) {\n                if (local_tid_133937 == 0) {\n                    old_counter_133968 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_133934)[sext_i32_i64(srem32(flat_segment_id_133950,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_133925));\n                }\n                // read in the per-group-results\n                {\n                   ",
                   " int64_t read_per_thread_133970 =\n                            sdiv_up64(groups_per_segment_133925,\n                                      segred_group_sizze_122181);\n                    \n                    x_122186 = 0.0F;\n                    x_122187 = 0.0F;\n                    for (int64_t i_133971 = 0; i_133971 <\n                         read_per_thread_133970; i_133971++) {\n                        int64_t group_res_id_133972 =\n                                sext_i32_i64(local_tid_133937) *\n                                read_per_thread_133970 + i_133971;\n                        int64_t index_of_group_res_133973 =\n                                sext_i32_i64(flat_segment_id_133950) *\n                                groups_per_segment_133925 + group_res_id_133972;\n                        \n                        if (slt64(group_res_id_133972,\n                                  groups_per_segment_133925)) {\n                            x_122188 = ((__global\n                                         float *) segred_tmp_mem_133930)[index_of_group_res_133973];\n                            x_122189 = ((__global\n                                         float *) segred_tmp_mem_133932)[index_of_group_res_133973];\n                            \n                            float defunc_1_op_res_122190 = x_122186 + x_122188;\n                            float defunc_1_op_res_122191 = x_122187 + x_122189;\n                            \n                            x_122186 = defunc_1_op_res_122190;\n                            x_122187 = defunc_1_op_res_122191;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_133941)[sext_i32_i64(local_tid_133937)] =\n                    x_122186;\n                ((__local\n                  float *) red_arr_mem_133943)[sext_i32_i64(local_tid_133937)] =\n                    x_122187;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group resul",
                   "ts\n                {\n                    int32_t offset_133974;\n                    int32_t skip_waves_133975 = 1;\n                    float x_133959;\n                    float x_133960;\n                    float x_133961;\n                    float x_133962;\n                    \n                    offset_133974 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_133937,\n                                  sext_i64_i32(segred_group_sizze_122181))) {\n                            x_133959 = ((__local\n                                         float *) red_arr_mem_133941)[sext_i32_i64(local_tid_133937 +\n                                                                      offset_133974)];\n                            x_133960 = ((__local\n                                         float *) red_arr_mem_133943)[sext_i32_i64(local_tid_133937 +\n                                                                      offset_133974)];\n                        }\n                    }\n                    offset_133974 = 1;\n                    while (slt32(offset_133974, wave_sizze_133939)) {\n                        if (slt32(local_tid_133937 + offset_133974,\n                                  sext_i64_i32(segred_group_sizze_122181)) &&\n                            ((local_tid_133937 - squot32(local_tid_133937,\n                                                         wave_sizze_133939) *\n                              wave_sizze_133939) & (2 * offset_133974 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_133961 = ((volatile __local\n                                             float *) red_arr_mem_133941)[sext_i32_i64(local_tid_133937 +\n                                                                          offset_133974)];\n                                x_133962 = ((volatile __local\n              ",
                   "                               float *) red_arr_mem_133943)[sext_i32_i64(local_tid_133937 +\n                                                                          offset_133974)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_133963 = x_133959 +\n                                      x_133961;\n                                float defunc_1_op_res_133964 = x_133960 +\n                                      x_133962;\n                                \n                                x_133959 = defunc_1_op_res_133963;\n                                x_133960 = defunc_1_op_res_133964;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_133941)[sext_i32_i64(local_tid_133937)] =\n                                    x_133959;\n                                ((volatile __local\n                                  float *) red_arr_mem_133943)[sext_i32_i64(local_tid_133937)] =\n                                    x_133960;\n                            }\n                        }\n                        offset_133974 *= 2;\n                    }\n                    while (slt32(skip_waves_133975,\n                                 squot32(sext_i64_i32(segred_group_sizze_122181) +\n                                         wave_sizze_133939 - 1,\n                                         wave_sizze_133939))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_133974 = skip_waves_133975 * wave_sizze_133939;\n                        if (slt32(local_tid_133937 + offset_133974,\n                                  sext_i64_i32(segred_group_sizze_122181)) &&\n                            ((local_tid_133937 - squot32(local_tid_133937,\n                                             ",
                   "            wave_sizze_133939) *\n                              wave_sizze_133939) == 0 &&\n                             (squot32(local_tid_133937, wave_sizze_133939) &\n                              (2 * skip_waves_133975 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_133961 = ((__local\n                                             float *) red_arr_mem_133941)[sext_i32_i64(local_tid_133937 +\n                                                                          offset_133974)];\n                                x_133962 = ((__local\n                                             float *) red_arr_mem_133943)[sext_i32_i64(local_tid_133937 +\n                                                                          offset_133974)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_133963 = x_133959 +\n                                      x_133961;\n                                float defunc_1_op_res_133964 = x_133960 +\n                                      x_133962;\n                                \n                                x_133959 = defunc_1_op_res_133963;\n                                x_133960 = defunc_1_op_res_133964;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_133941)[sext_i32_i64(local_tid_133937)] =\n                                    x_133959;\n                                ((__local\n                                  float *) red_arr_mem_133943)[sext_i32_i64(local_tid_133937)] =\n                                    x_133960;\n                            }\n                        }\n                        skip_waves_133975 *= 2;\n                    }\n                    // and back to memory wi",
                   "th the final result\n                    {\n                        if (local_tid_133937 == 0) {\n                            ((__global float *) mem_131022)[gtid_121718 *\n                                                            l_n_m_114584 +\n                                                            gtid_121719] =\n                                x_133959;\n                            ((__global float *) mem_131026)[gtid_121718 *\n                                                            l_n_m_114584 +\n                                                            gtid_121719] =\n                                x_133960;\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_122181\n}\n__kernel void mainzisegred_large_121818(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_133850_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133848_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133846_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133844_backing_aligned_3,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t l_window_114538,\n                                        int64_t t_jump_114541,\n                                        int64_t l_n_m_114584, int64_t i_114610,\n                                        int64_t num_groups_122117,\n                                        int64_t groups_per_segment_133826,\n                                        int64_t elements_per_thread_133827,\n",
                   "                                        int64_t virt_num_groups_133828,\n                                        int64_t threads_per_segment_133830,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130404,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130405,\n                                        __global unsigned char *mem_130861,\n                                        __global unsigned char *mem_130996,\n                                        __global unsigned char *mem_131000,\n                                        __global unsigned char *mem_131004,\n                                        __global\n                                        unsigned char *segred_tmp_mem_133831,\n                                        __global\n                                        unsigned char *segred_tmp_mem_133833,\n                                        __global\n                                        unsigned char *segred_tmp_mem_133835,\n                                        __global\n                                        unsigned char *mainzicounter_mem_133837)\n{\n    #define segred_group_sizze_122116 (mainzisegred_group_sizze_121812)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict sync_arr_mem_133850_backing_3 =\n                          (__local volatile\n                           char *) sync_arr_mem_133850_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_133848_backing_2 =\n                          (__local volatile\n                           char *) red_arr_mem_133848_backing_aligned_1;\n    __local volatile ch",
                   "ar *restrict red_arr_mem_133846_backing_1 =\n                          (__local volatile\n                           char *) red_arr_mem_133846_backing_aligned_2;\n    __local volatile char *restrict red_arr_mem_133844_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_133844_backing_aligned_3;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_133839;\n    int32_t local_tid_133840;\n    int64_t group_sizze_133843;\n    int32_t wave_sizze_133842;\n    int32_t group_tid_133841;\n    \n    global_tid_133839 = get_global_id(0);\n    local_tid_133840 = get_local_id(0);\n    group_sizze_133843 = get_local_size(0);\n    wave_sizze_133842 = LOCKSTEP_WIDTH;\n    group_tid_133841 = get_group_id(0);\n    \n    int32_t phys_tid_121818 = global_tid_133839;\n    __local char *red_arr_mem_133844;\n    \n    red_arr_mem_133844 = (__local char *) red_arr_mem_133844_backing_0;\n    \n    __local char *red_arr_mem_133846;\n    \n    red_arr_mem_133846 = (__local char *) red_arr_mem_133846_backing_1;\n    \n    __local char *red_arr_mem_133848;\n    \n    red_arr_mem_133848 = (__local char *) red_arr_mem_133848_backing_2;\n    \n    __local char *sync_arr_mem_133850;\n    \n    sync_arr_mem_133850 = (__local char *) sync_arr_mem_133850_backing_3;\n    \n    int32_t phys_group_id_133852;\n    \n    phys_group_id_133852 = get_group_id(0);\n    for (int32_t i_133853 = 0; i_133853 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_133828) - phys_group_id_133852,\n                   sext_i64_i32(num_groups_122117)); i_133853++) {\n        int32_t virt_group_id_133854 = phys_group_id_133852 + i_133853 *\n                sext_i64_i32(num_groups_122117);\n        int32_t flat_segment_id_133855 = squot32(virt_group_id_133854,\n                                                 sext_i64_i32(groups_per_segment_133826));\n        int64_t global_tid_133856 = srem64(sext_i32_i64(virt_group_id_133854) *\n                                           segred_group_sizze",
                   "_122116 +\n                                           sext_i32_i64(local_tid_133840),\n                                           segred_group_sizze_122116 *\n                                           groups_per_segment_133826);\n        int64_t slice_133857 = l_n_m_114584;\n        int64_t slice_133858 = m_114533 * slice_133857;\n        int64_t gtid_121807 = squot64(sext_i32_i64(flat_segment_id_133855),\n                                      slice_133857);\n        int64_t remnant_133859 = sext_i32_i64(flat_segment_id_133855) -\n                gtid_121807 * slice_133857;\n        int64_t gtid_121808 = remnant_133859;\n        int64_t remnant_133860 = remnant_133859 - gtid_121808;\n        int64_t gtid_121817;\n        float x_acc_133861;\n        float x_acc_133862;\n        float x_acc_133863;\n        int64_t chunk_sizze_133864 = smin64(elements_per_thread_133827,\n                                            sdiv_up64(l_window_114538 -\n                                                      global_tid_133856,\n                                                      threads_per_segment_133830));\n        float x_122122;\n        float x_122123;\n        float x_122124;\n        float x_122125;\n        float x_122126;\n        float x_122127;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_133861 = 0.0F;\n            x_acc_133862 = 0.0F;\n            x_acc_133863 = 0.0F;\n        }\n        for (int64_t i_133874 = 0; i_133874 < chunk_sizze_133864; i_133874++) {\n            gtid_121817 = global_tid_133856 + threads_per_segment_133830 *\n                i_133874;\n            // apply map function\n            {\n                int64_t x_122135 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_121807];\n                int64_t x_122137 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130404)[gtid_121807 *\n                                                                             l_n_m",
                   "_114584 +\n                                                                             gtid_121808];\n                float x_122138 = ((__global\n                                   float *) defunc_3_map_res_mem_130405)[gtid_121807 *\n                                                                         l_n_m_114584 +\n                                                                         gtid_121808];\n                int64_t binop_y_128845 = mul64(t_jump_114541, gtid_121808);\n                int64_t convop_x_128846 = smin64(i_114610, binop_y_128845);\n                float index_primexp_128847 = sitofp_i64_f32(convop_x_128846);\n                bool cond_122141 = sle64(x_122135, gtid_121817);\n                float defunc_0_f_res_122142;\n                \n                if (cond_122141) {\n                    defunc_0_f_res_122142 = 0.0F;\n                } else {\n                    int64_t i_122143 = add64(gtid_121817, x_122137);\n                    float x_122144 = ((__global\n                                       float *) mem_130122)[gtid_121807 *\n                                                            n_114534 +\n                                                            i_122143];\n                    float defunc_0_f_res_f_res_122145 = 1.0F + x_122144;\n                    \n                    defunc_0_f_res_122142 = defunc_0_f_res_f_res_122145;\n                }\n                \n                float defunc_0_f_res_122146;\n                \n                if (cond_122141) {\n                    defunc_0_f_res_122146 = 0.0F;\n                } else {\n                    int64_t i_122147 = add64(gtid_121817, x_122137);\n                    float x_122148 = ((__global\n                                       float *) mem_130861)[gtid_121807 *\n                                                            n_114534 +\n                                                            i_122147];\n                    \n                    defunc_0_f_res_122146 = x_122148;\n           ",
                   "     }\n                \n                float x_j_122149 = defunc_0_f_res_122142 - index_primexp_128847;\n                float abs_res_122150 = (float) fabs(x_j_122149);\n                float tmp1_122151 = abs_res_122150 / x_122138;\n                float x_122152 = tmp1_122151 * tmp1_122151;\n                float y_122153 = tmp1_122151 * x_122152;\n                float tmp2_122154 = 1.0F - y_122153;\n                float x_122155 = tmp2_122154 * tmp2_122154;\n                float tmp3_122156 = tmp2_122154 * x_122155;\n                float w_j_122157 = defunc_0_f_res_122146 * tmp3_122156;\n                float xw_j_122158 = x_j_122149 * w_j_122157;\n                float x2w_j_122159 = x_j_122149 * xw_j_122158;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_122122 = x_acc_133861;\n                    x_122123 = x_acc_133862;\n                    x_122124 = x_acc_133863;\n                }\n                // load new values\n                {\n                    x_122125 = w_j_122157;\n                    x_122126 = xw_j_122158;\n                    x_122127 = x2w_j_122159;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_122128 = x_122122 + x_122125;\n                    float defunc_1_op_res_122129 = x_122123 + x_122126;\n                    float defunc_1_op_res_122130 = x_122124 + x_122127;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_133861 = defunc_1_op_res_122128;\n                        x_acc_133862 = defunc_1_op_res_122129;\n                        x_acc_133863 = defunc_1_op_res_122130;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_122122 = x_acc_133861;\n            x_122123 = x_acc_133862;\n            x_122124 = ",
                   "x_acc_133863;\n            ((__local\n              float *) red_arr_mem_133844)[sext_i32_i64(local_tid_133840)] =\n                x_122122;\n            ((__local\n              float *) red_arr_mem_133846)[sext_i32_i64(local_tid_133840)] =\n                x_122123;\n            ((__local\n              float *) red_arr_mem_133848)[sext_i32_i64(local_tid_133840)] =\n                x_122124;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_133875;\n        int32_t skip_waves_133876 = 1;\n        float x_133865;\n        float x_133866;\n        float x_133867;\n        float x_133868;\n        float x_133869;\n        float x_133870;\n        \n        offset_133875 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_133840,\n                      sext_i64_i32(segred_group_sizze_122116))) {\n                x_133865 = ((__local\n                             float *) red_arr_mem_133844)[sext_i32_i64(local_tid_133840 +\n                                                          offset_133875)];\n                x_133866 = ((__local\n                             float *) red_arr_mem_133846)[sext_i32_i64(local_tid_133840 +\n                                                          offset_133875)];\n                x_133867 = ((__local\n                             float *) red_arr_mem_133848)[sext_i32_i64(local_tid_133840 +\n                                                          offset_133875)];\n            }\n        }\n        offset_133875 = 1;\n        while (slt32(offset_133875, wave_sizze_133842)) {\n            if (slt32(local_tid_133840 + offset_133875,\n                      sext_i64_i32(segred_group_sizze_122116)) &&\n                ((local_tid_133840 - squot32(local_tid_133840,\n                                             wave_sizze_133842) *\n                  wave_sizze_133842) & (2 * offset_133875 - 1)) == 0) {\n                // read array element\n                {\n                    x_133868 = ((vol",
                   "atile __local\n                                 float *) red_arr_mem_133844)[sext_i32_i64(local_tid_133840 +\n                                                              offset_133875)];\n                    x_133869 = ((volatile __local\n                                 float *) red_arr_mem_133846)[sext_i32_i64(local_tid_133840 +\n                                                              offset_133875)];\n                    x_133870 = ((volatile __local\n                                 float *) red_arr_mem_133848)[sext_i32_i64(local_tid_133840 +\n                                                              offset_133875)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_133871 = x_133865 + x_133868;\n                    float defunc_1_op_res_133872 = x_133866 + x_133869;\n                    float defunc_1_op_res_133873 = x_133867 + x_133870;\n                    \n                    x_133865 = defunc_1_op_res_133871;\n                    x_133866 = defunc_1_op_res_133872;\n                    x_133867 = defunc_1_op_res_133873;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_133844)[sext_i32_i64(local_tid_133840)] =\n                        x_133865;\n                    ((volatile __local\n                      float *) red_arr_mem_133846)[sext_i32_i64(local_tid_133840)] =\n                        x_133866;\n                    ((volatile __local\n                      float *) red_arr_mem_133848)[sext_i32_i64(local_tid_133840)] =\n                        x_133867;\n                }\n            }\n            offset_133875 *= 2;\n        }\n        while (slt32(skip_waves_133876,\n                     squot32(sext_i64_i32(segred_group_sizze_122116) +\n                             wave_sizze_133842 - 1, wave_sizze_133842))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_133875 =",
                   " skip_waves_133876 * wave_sizze_133842;\n            if (slt32(local_tid_133840 + offset_133875,\n                      sext_i64_i32(segred_group_sizze_122116)) &&\n                ((local_tid_133840 - squot32(local_tid_133840,\n                                             wave_sizze_133842) *\n                  wave_sizze_133842) == 0 && (squot32(local_tid_133840,\n                                                      wave_sizze_133842) & (2 *\n                                                                            skip_waves_133876 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_133868 = ((__local\n                                 float *) red_arr_mem_133844)[sext_i32_i64(local_tid_133840 +\n                                                              offset_133875)];\n                    x_133869 = ((__local\n                                 float *) red_arr_mem_133846)[sext_i32_i64(local_tid_133840 +\n                                                              offset_133875)];\n                    x_133870 = ((__local\n                                 float *) red_arr_mem_133848)[sext_i32_i64(local_tid_133840 +\n                                                              offset_133875)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_133871 = x_133865 + x_133868;\n                    float defunc_1_op_res_133872 = x_133866 + x_133869;\n                    float defunc_1_op_res_133873 = x_133867 + x_133870;\n                    \n                    x_133865 = defunc_1_op_res_133871;\n                    x_133866 = defunc_1_op_res_133872;\n                    x_133867 = defunc_1_op_res_133873;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_133844)[sext_i32_i64",
                   "(local_tid_133840)] =\n                        x_133865;\n                    ((__local\n                      float *) red_arr_mem_133846)[sext_i32_i64(local_tid_133840)] =\n                        x_133866;\n                    ((__local\n                      float *) red_arr_mem_133848)[sext_i32_i64(local_tid_133840)] =\n                        x_133867;\n                }\n            }\n            skip_waves_133876 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_133840) == (int64_t) 0) {\n                x_acc_133861 = x_133865;\n                x_acc_133862 = x_133866;\n                x_acc_133863 = x_133867;\n            }\n        }\n        if (groups_per_segment_133826 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_133840 == 0) {\n                    ((__global float *) mem_130996)[gtid_121807 * l_n_m_114584 +\n                                                    gtid_121808] = x_acc_133861;\n                    ((__global float *) mem_131000)[gtid_121807 * l_n_m_114584 +\n                                                    gtid_121808] = x_acc_133862;\n                    ((__global float *) mem_131004)[gtid_121807 * l_n_m_114584 +\n                                                    gtid_121808] = x_acc_133863;\n                }\n            }\n        } else {\n            int32_t old_counter_133877;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_133840 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_133831)[sext_i32_i64(virt_group_id_133854)] =\n                        x_acc_133861;\n                    ((__global\n                      float *) segred_tmp_mem_133833)[sext_i32_i64(virt_group_id_133854)] =\n                        x_acc_133862;\n                    ((__globa",
                   "l\n                      float *) segred_tmp_mem_133835)[sext_i32_i64(virt_group_id_133854)] =\n                        x_acc_133863;\n                    mem_fence_global();\n                    old_counter_133877 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_133837)[sext_i32_i64(srem32(flat_segment_id_133855,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_133850)[(int64_t) 0] =\n                        old_counter_133877 == groups_per_segment_133826 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_133878 = ((__local\n                                          bool *) sync_arr_mem_133850)[(int64_t) 0];\n            \n            if (is_last_group_133878) {\n                if (local_tid_133840 == 0) {\n                    old_counter_133877 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_133837)[sext_i32_i64(srem32(flat_segment_id_133855,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_133826));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_133879 =\n                            sdiv_up64(groups_per_segment_133826,\n                                      segred_group_sizze_122116);\n                    \n                    x_122122 = 0.0F;\n                    x_122123 = 0.0F;\n                    x_122124 = 0.0F;\n  ",
                   "                  for (int64_t i_133880 = 0; i_133880 <\n                         read_per_thread_133879; i_133880++) {\n                        int64_t group_res_id_133881 =\n                                sext_i32_i64(local_tid_133840) *\n                                read_per_thread_133879 + i_133880;\n                        int64_t index_of_group_res_133882 =\n                                sext_i32_i64(flat_segment_id_133855) *\n                                groups_per_segment_133826 + group_res_id_133881;\n                        \n                        if (slt64(group_res_id_133881,\n                                  groups_per_segment_133826)) {\n                            x_122125 = ((__global\n                                         float *) segred_tmp_mem_133831)[index_of_group_res_133882];\n                            x_122126 = ((__global\n                                         float *) segred_tmp_mem_133833)[index_of_group_res_133882];\n                            x_122127 = ((__global\n                                         float *) segred_tmp_mem_133835)[index_of_group_res_133882];\n                            \n                            float defunc_1_op_res_122128 = x_122122 + x_122125;\n                            float defunc_1_op_res_122129 = x_122123 + x_122126;\n                            float defunc_1_op_res_122130 = x_122124 + x_122127;\n                            \n                            x_122122 = defunc_1_op_res_122128;\n                            x_122123 = defunc_1_op_res_122129;\n                            x_122124 = defunc_1_op_res_122130;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_133844)[sext_i32_i64(local_tid_133840)] =\n                    x_122122;\n                ((__local\n                  float *) red_arr_mem_133846)[sext_i32_i64(local_tid_133840)] =\n                    x_122123;\n                ((__local\n                  float *) red_ar",
                   "r_mem_133848)[sext_i32_i64(local_tid_133840)] =\n                    x_122124;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_133883;\n                    int32_t skip_waves_133884 = 1;\n                    float x_133865;\n                    float x_133866;\n                    float x_133867;\n                    float x_133868;\n                    float x_133869;\n                    float x_133870;\n                    \n                    offset_133883 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_133840,\n                                  sext_i64_i32(segred_group_sizze_122116))) {\n                            x_133865 = ((__local\n                                         float *) red_arr_mem_133844)[sext_i32_i64(local_tid_133840 +\n                                                                      offset_133883)];\n                            x_133866 = ((__local\n                                         float *) red_arr_mem_133846)[sext_i32_i64(local_tid_133840 +\n                                                                      offset_133883)];\n                            x_133867 = ((__local\n                                         float *) red_arr_mem_133848)[sext_i32_i64(local_tid_133840 +\n                                                                      offset_133883)];\n                        }\n                    }\n                    offset_133883 = 1;\n                    while (slt32(offset_133883, wave_sizze_133842)) {\n                        if (slt32(local_tid_133840 + offset_133883,\n                                  sext_i64_i32(segred_group_sizze_122116)) &&\n                            ((local_tid_133840 - squot32(local_tid_133840,\n                                                         wave_sizze_133842) *\n                              wave_sizze_133842)",
                   " & (2 * offset_133883 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_133868 = ((volatile __local\n                                             float *) red_arr_mem_133844)[sext_i32_i64(local_tid_133840 +\n                                                                          offset_133883)];\n                                x_133869 = ((volatile __local\n                                             float *) red_arr_mem_133846)[sext_i32_i64(local_tid_133840 +\n                                                                          offset_133883)];\n                                x_133870 = ((volatile __local\n                                             float *) red_arr_mem_133848)[sext_i32_i64(local_tid_133840 +\n                                                                          offset_133883)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_133871 = x_133865 +\n                                      x_133868;\n                                float defunc_1_op_res_133872 = x_133866 +\n                                      x_133869;\n                                float defunc_1_op_res_133873 = x_133867 +\n                                      x_133870;\n                                \n                                x_133865 = defunc_1_op_res_133871;\n                                x_133866 = defunc_1_op_res_133872;\n                                x_133867 = defunc_1_op_res_133873;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_133844)[sext_i32_i64(local_tid_133840)] =\n                                    x_133865;\n                                ((volatile __local\n",
                   "                                  float *) red_arr_mem_133846)[sext_i32_i64(local_tid_133840)] =\n                                    x_133866;\n                                ((volatile __local\n                                  float *) red_arr_mem_133848)[sext_i32_i64(local_tid_133840)] =\n                                    x_133867;\n                            }\n                        }\n                        offset_133883 *= 2;\n                    }\n                    while (slt32(skip_waves_133884,\n                                 squot32(sext_i64_i32(segred_group_sizze_122116) +\n                                         wave_sizze_133842 - 1,\n                                         wave_sizze_133842))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_133883 = skip_waves_133884 * wave_sizze_133842;\n                        if (slt32(local_tid_133840 + offset_133883,\n                                  sext_i64_i32(segred_group_sizze_122116)) &&\n                            ((local_tid_133840 - squot32(local_tid_133840,\n                                                         wave_sizze_133842) *\n                              wave_sizze_133842) == 0 &&\n                             (squot32(local_tid_133840, wave_sizze_133842) &\n                              (2 * skip_waves_133884 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_133868 = ((__local\n                                             float *) red_arr_mem_133844)[sext_i32_i64(local_tid_133840 +\n                                                                          offset_133883)];\n                                x_133869 = ((__local\n                                             float *) red_arr_mem_133846)[sext_i32_i64(local_tid_133840 +\n                                                                          offset_133883)];\n                                x_133870 = ((__local\n           ",
                   "                                  float *) red_arr_mem_133848)[sext_i32_i64(local_tid_133840 +\n                                                                          offset_133883)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_133871 = x_133865 +\n                                      x_133868;\n                                float defunc_1_op_res_133872 = x_133866 +\n                                      x_133869;\n                                float defunc_1_op_res_133873 = x_133867 +\n                                      x_133870;\n                                \n                                x_133865 = defunc_1_op_res_133871;\n                                x_133866 = defunc_1_op_res_133872;\n                                x_133867 = defunc_1_op_res_133873;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_133844)[sext_i32_i64(local_tid_133840)] =\n                                    x_133865;\n                                ((__local\n                                  float *) red_arr_mem_133846)[sext_i32_i64(local_tid_133840)] =\n                                    x_133866;\n                                ((__local\n                                  float *) red_arr_mem_133848)[sext_i32_i64(local_tid_133840)] =\n                                    x_133867;\n                            }\n                        }\n                        skip_waves_133884 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_133840 == 0) {\n                            ((__global float *) mem_130996)[gtid_121807 *\n                                                            l_n_m_114584 +\n           ",
                   "                                                 gtid_121808] =\n                                x_133865;\n                            ((__global float *) mem_131000)[gtid_121807 *\n                                                            l_n_m_114584 +\n                                                            gtid_121808] =\n                                x_133866;\n                            ((__global float *) mem_131004)[gtid_121807 *\n                                                            l_n_m_114584 +\n                                                            gtid_121808] =\n                                x_133867;\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_122116\n}\n__kernel void mainzisegred_large_122662(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_134200_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134198_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134196_backing_aligned_2,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t l_window_114538,\n                                        int64_t t_jump_114541,\n                                        int64_t l_n_m_114584, int64_t i_114610,\n                                        int64_t num_groups_123258,\n                                        int64_t groups_per_segment_134180,\n                                        int64_t elements_per_thread_134181,\n                                        int64_t virt_num_groups_134182,\n                                        int64_t threads_per_s",
                   "egment_134184,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130404,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130405,\n                                        __global unsigned char *mem_130861,\n                                        __global unsigned char *mem_130865,\n                                        __global unsigned char *mem_131127,\n                                        __global unsigned char *mem_131131,\n                                        __global unsigned char *mem_131135,\n                                        __global unsigned char *mem_131139,\n                                        __global unsigned char *mem_131143,\n                                        __global unsigned char *mem_131148,\n                                        __global unsigned char *mem_131152,\n                                        __global\n                                        unsigned char *segred_tmp_mem_134185,\n                                        __global\n                                        unsigned char *segred_tmp_mem_134187,\n                                        __global\n                                        unsigned char *mainzicounter_mem_134189)\n{\n    #define segred_group_sizze_123257 (mainzisegred_group_sizze_122656)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict sync_arr_mem_134200_backing_2 =\n                          (__local volatile\n                           char *) sync_arr_mem_134200_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_134198_backing_1 =\n                    ",
                   "      (__local volatile\n                           char *) red_arr_mem_134198_backing_aligned_1;\n    __local volatile char *restrict red_arr_mem_134196_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_134196_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_134191;\n    int32_t local_tid_134192;\n    int64_t group_sizze_134195;\n    int32_t wave_sizze_134194;\n    int32_t group_tid_134193;\n    \n    global_tid_134191 = get_global_id(0);\n    local_tid_134192 = get_local_id(0);\n    group_sizze_134195 = get_local_size(0);\n    wave_sizze_134194 = LOCKSTEP_WIDTH;\n    group_tid_134193 = get_group_id(0);\n    \n    int32_t phys_tid_122662 = global_tid_134191;\n    __local char *red_arr_mem_134196;\n    \n    red_arr_mem_134196 = (__local char *) red_arr_mem_134196_backing_0;\n    \n    __local char *red_arr_mem_134198;\n    \n    red_arr_mem_134198 = (__local char *) red_arr_mem_134198_backing_1;\n    \n    __local char *sync_arr_mem_134200;\n    \n    sync_arr_mem_134200 = (__local char *) sync_arr_mem_134200_backing_2;\n    \n    int32_t phys_group_id_134202;\n    \n    phys_group_id_134202 = get_group_id(0);\n    for (int32_t i_134203 = 0; i_134203 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_134182) - phys_group_id_134202,\n                   sext_i64_i32(num_groups_123258)); i_134203++) {\n        int32_t virt_group_id_134204 = phys_group_id_134202 + i_134203 *\n                sext_i64_i32(num_groups_123258);\n        int32_t flat_segment_id_134205 = squot32(virt_group_id_134204,\n                                                 sext_i64_i32(groups_per_segment_134180));\n        int64_t global_tid_134206 = srem64(sext_i32_i64(virt_group_id_134204) *\n                                           segred_group_sizze_123257 +\n                                           sext_i32_i64(local_tid_134192),\n                                           segred_group_sizze_123257 *\n                            ",
                   "               groups_per_segment_134180);\n        int64_t slice_134207 = l_n_m_114584;\n        int64_t slice_134208 = m_114533 * slice_134207;\n        int64_t gtid_122651 = squot64(sext_i32_i64(flat_segment_id_134205),\n                                      slice_134207);\n        int64_t remnant_134209 = sext_i32_i64(flat_segment_id_134205) -\n                gtid_122651 * slice_134207;\n        int64_t gtid_122652 = remnant_134209;\n        int64_t remnant_134210 = remnant_134209 - gtid_122652;\n        int64_t gtid_122661;\n        float x_acc_134211;\n        float x_acc_134212;\n        int64_t chunk_sizze_134213 = smin64(elements_per_thread_134181,\n                                            sdiv_up64(l_window_114538 -\n                                                      global_tid_134206,\n                                                      threads_per_segment_134184));\n        float x_123262;\n        float x_123263;\n        float x_123264;\n        float x_123265;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_134211 = 0.0F;\n            x_acc_134212 = 0.0F;\n        }\n        for (int64_t i_134220 = 0; i_134220 < chunk_sizze_134213; i_134220++) {\n            gtid_122661 = global_tid_134206 + threads_per_segment_134184 *\n                i_134220;\n            // apply map function\n            {\n                int64_t x_123273 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_122651];\n                int64_t x_123280 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130404)[gtid_122651 *\n                                                                             l_n_m_114584 +\n                                                                             gtid_122652];\n                float x_123281 = ((__global\n                                   float *) defunc_3_map_res_mem_130405)[gtid_122651 *\n                                                             ",
                   "            l_n_m_114584 +\n                                                                         gtid_122652];\n                int64_t binop_y_128888 = mul64(t_jump_114541, gtid_122652);\n                int64_t convop_x_128889 = smin64(i_114610, binop_y_128888);\n                float index_primexp_128890 = sitofp_i64_f32(convop_x_128889);\n                float a12_123283 = ((__global float *) mem_131127)[gtid_122651 *\n                                                                   l_n_m_114584 +\n                                                                   gtid_122652];\n                float b12_123284 = ((__global float *) mem_131131)[gtid_122651 *\n                                                                   l_n_m_114584 +\n                                                                   gtid_122652];\n                float c12_123285 = ((__global float *) mem_131135)[gtid_122651 *\n                                                                   l_n_m_114584 +\n                                                                   gtid_122652];\n                float b2_123286 = ((__global float *) mem_131139)[gtid_122651 *\n                                                                  l_n_m_114584 +\n                                                                  gtid_122652];\n                float c2_123287 = ((__global float *) mem_131143)[gtid_122651 *\n                                                                  l_n_m_114584 +\n                                                                  gtid_122652];\n                bool cond_123289 = sle64(x_123273, gtid_122661);\n                float defunc_0_f_res_123290;\n                \n                if (cond_123289) {\n                    defunc_0_f_res_123290 = 0.0F;\n                } else {\n                    int64_t i_123291 = add64(gtid_122661, x_123280);\n                    float x_123292 = ((__global\n                                       float *) mem_130122)[gtid_122651 *\n              ",
                   "                                              n_114534 +\n                                                            i_123291];\n                    float defunc_0_f_res_f_res_123293 = 1.0F + x_123292;\n                    \n                    defunc_0_f_res_123290 = defunc_0_f_res_f_res_123293;\n                }\n                \n                float defunc_0_f_res_123294;\n                \n                if (cond_123289) {\n                    defunc_0_f_res_123294 = 0.0F;\n                } else {\n                    int64_t i_123295 = add64(gtid_122661, x_123280);\n                    float x_123296 = ((__global\n                                       float *) mem_130861)[gtid_122651 *\n                                                            n_114534 +\n                                                            i_123295];\n                    \n                    defunc_0_f_res_123294 = x_123296;\n                }\n                \n                float x_j_123297 = defunc_0_f_res_123290 - index_primexp_128890;\n                float abs_res_123298 = (float) fabs(x_j_123297);\n                float tmp1_123299 = abs_res_123298 / x_123281;\n                float x_123300 = tmp1_123299 * tmp1_123299;\n                float y_123301 = tmp1_123299 * x_123300;\n                float tmp2_123302 = 1.0F - y_123301;\n                float x_123303 = tmp2_123302 * tmp2_123302;\n                float tmp3_123304 = tmp2_123302 * x_123303;\n                float tmp4_123305 = defunc_0_f_res_123294 * tmp3_123304;\n                float defunc_1_f_res_123306 = x_j_123297 * tmp4_123305;\n                float defunc_1_f_res_123307 = x_j_123297 *\n                      defunc_1_f_res_123306;\n                float defunc_0_f_res_123308;\n                \n                if (cond_123289) {\n                    defunc_0_f_res_123308 = 0.0F;\n                } else {\n                    int64_t i_123309 = add64(gtid_122661, x_123280);\n                    float x_123310 = ((__global\n                  ",
                   "                     float *) mem_130865)[gtid_122651 *\n                                                            n_114534 +\n                                                            i_123309];\n                    \n                    defunc_0_f_res_123308 = x_123310;\n                }\n                \n                float x_123311 = a12_123283 * tmp4_123305;\n                float y_123312 = b12_123284 * defunc_1_f_res_123306;\n                float x_123313 = x_123311 + y_123312;\n                float y_123314 = c12_123285 * defunc_1_f_res_123307;\n                float x_123315 = x_123313 + y_123314;\n                float defunc_9_fit_fun_res_123316 = defunc_0_f_res_123308 *\n                      x_123315;\n                float x_123317 = b12_123284 * tmp4_123305;\n                float y_123318 = b2_123286 * defunc_1_f_res_123306;\n                float x_123319 = x_123317 + y_123318;\n                float y_123320 = c2_123287 * defunc_1_f_res_123307;\n                float x_123321 = x_123319 + y_123320;\n                float defunc_9_slope_fun_res_123322 = defunc_0_f_res_123308 *\n                      x_123321;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_123262 = x_acc_134211;\n                    x_123263 = x_acc_134212;\n                }\n                // load new values\n                {\n                    x_123264 = defunc_9_fit_fun_res_123316;\n                    x_123265 = defunc_9_slope_fun_res_123322;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_123266 = x_123262 + x_123264;\n                    float defunc_1_op_res_123267 = x_123263 + x_123265;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_134211 = defunc_1_op_res_123266;\n                        x_acc_134212 = defunc_1_op_res_123267;\n               ",
                   "     }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_123262 = x_acc_134211;\n            x_123263 = x_acc_134212;\n            ((__local\n              float *) red_arr_mem_134196)[sext_i32_i64(local_tid_134192)] =\n                x_123262;\n            ((__local\n              float *) red_arr_mem_134198)[sext_i32_i64(local_tid_134192)] =\n                x_123263;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_134221;\n        int32_t skip_waves_134222 = 1;\n        float x_134214;\n        float x_134215;\n        float x_134216;\n        float x_134217;\n        \n        offset_134221 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_134192,\n                      sext_i64_i32(segred_group_sizze_123257))) {\n                x_134214 = ((__local\n                             float *) red_arr_mem_134196)[sext_i32_i64(local_tid_134192 +\n                                                          offset_134221)];\n                x_134215 = ((__local\n                             float *) red_arr_mem_134198)[sext_i32_i64(local_tid_134192 +\n                                                          offset_134221)];\n            }\n        }\n        offset_134221 = 1;\n        while (slt32(offset_134221, wave_sizze_134194)) {\n            if (slt32(local_tid_134192 + offset_134221,\n                      sext_i64_i32(segred_group_sizze_123257)) &&\n                ((local_tid_134192 - squot32(local_tid_134192,\n                                             wave_sizze_134194) *\n                  wave_sizze_134194) & (2 * offset_134221 - 1)) == 0) {\n                // read array element\n                {\n                    x_134216 = ((volatile __local\n                                 float *) red_arr_mem_134196)[sext_i32_i64(local_tid_134192 +\n                                                              offset_134221)];\n",
                   "                    x_134217 = ((volatile __local\n                                 float *) red_arr_mem_134198)[sext_i32_i64(local_tid_134192 +\n                                                              offset_134221)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_134218 = x_134214 + x_134216;\n                    float defunc_1_op_res_134219 = x_134215 + x_134217;\n                    \n                    x_134214 = defunc_1_op_res_134218;\n                    x_134215 = defunc_1_op_res_134219;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_134196)[sext_i32_i64(local_tid_134192)] =\n                        x_134214;\n                    ((volatile __local\n                      float *) red_arr_mem_134198)[sext_i32_i64(local_tid_134192)] =\n                        x_134215;\n                }\n            }\n            offset_134221 *= 2;\n        }\n        while (slt32(skip_waves_134222,\n                     squot32(sext_i64_i32(segred_group_sizze_123257) +\n                             wave_sizze_134194 - 1, wave_sizze_134194))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_134221 = skip_waves_134222 * wave_sizze_134194;\n            if (slt32(local_tid_134192 + offset_134221,\n                      sext_i64_i32(segred_group_sizze_123257)) &&\n                ((local_tid_134192 - squot32(local_tid_134192,\n                                             wave_sizze_134194) *\n                  wave_sizze_134194) == 0 && (squot32(local_tid_134192,\n                                                      wave_sizze_134194) & (2 *\n                                                                            skip_waves_134222 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n            ",
                   "    {\n                    x_134216 = ((__local\n                                 float *) red_arr_mem_134196)[sext_i32_i64(local_tid_134192 +\n                                                              offset_134221)];\n                    x_134217 = ((__local\n                                 float *) red_arr_mem_134198)[sext_i32_i64(local_tid_134192 +\n                                                              offset_134221)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_134218 = x_134214 + x_134216;\n                    float defunc_1_op_res_134219 = x_134215 + x_134217;\n                    \n                    x_134214 = defunc_1_op_res_134218;\n                    x_134215 = defunc_1_op_res_134219;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_134196)[sext_i32_i64(local_tid_134192)] =\n                        x_134214;\n                    ((__local\n                      float *) red_arr_mem_134198)[sext_i32_i64(local_tid_134192)] =\n                        x_134215;\n                }\n            }\n            skip_waves_134222 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_134192) == (int64_t) 0) {\n                x_acc_134211 = x_134214;\n                x_acc_134212 = x_134215;\n            }\n        }\n        if (groups_per_segment_134180 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_134192 == 0) {\n                    ((__global float *) mem_131148)[gtid_122651 * l_n_m_114584 +\n                                                    gtid_122652] = x_acc_134211;\n                    ((__global float *) mem_131152)[gtid_122651 * l_n_m_114584 +\n                                                    gt",
                   "id_122652] = x_acc_134212;\n                }\n            }\n        } else {\n            int32_t old_counter_134223;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_134192 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_134185)[sext_i32_i64(virt_group_id_134204)] =\n                        x_acc_134211;\n                    ((__global\n                      float *) segred_tmp_mem_134187)[sext_i32_i64(virt_group_id_134204)] =\n                        x_acc_134212;\n                    mem_fence_global();\n                    old_counter_134223 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_134189)[sext_i32_i64(srem32(flat_segment_id_134205,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_134200)[(int64_t) 0] =\n                        old_counter_134223 == groups_per_segment_134180 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_134224 = ((__local\n                                          bool *) sync_arr_mem_134200)[(int64_t) 0];\n            \n            if (is_last_group_134224) {\n                if (local_tid_134192 == 0) {\n                    old_counter_134223 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_134189)[sext_i32_i64(srem32(flat_segment_id_134205,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                  ",
                   "                   groups_per_segment_134180));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_134225 =\n                            sdiv_up64(groups_per_segment_134180,\n                                      segred_group_sizze_123257);\n                    \n                    x_123262 = 0.0F;\n                    x_123263 = 0.0F;\n                    for (int64_t i_134226 = 0; i_134226 <\n                         read_per_thread_134225; i_134226++) {\n                        int64_t group_res_id_134227 =\n                                sext_i32_i64(local_tid_134192) *\n                                read_per_thread_134225 + i_134226;\n                        int64_t index_of_group_res_134228 =\n                                sext_i32_i64(flat_segment_id_134205) *\n                                groups_per_segment_134180 + group_res_id_134227;\n                        \n                        if (slt64(group_res_id_134227,\n                                  groups_per_segment_134180)) {\n                            x_123264 = ((__global\n                                         float *) segred_tmp_mem_134185)[index_of_group_res_134228];\n                            x_123265 = ((__global\n                                         float *) segred_tmp_mem_134187)[index_of_group_res_134228];\n                            \n                            float defunc_1_op_res_123266 = x_123262 + x_123264;\n                            float defunc_1_op_res_123267 = x_123263 + x_123265;\n                            \n                            x_123262 = defunc_1_op_res_123266;\n                            x_123263 = defunc_1_op_res_123267;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_134196)[sext_i32_i64(local_tid_134192)] =\n                    x_123262;\n                ((__local\n                  float *) red_arr_mem_134198)[sex",
                   "t_i32_i64(local_tid_134192)] =\n                    x_123263;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_134229;\n                    int32_t skip_waves_134230 = 1;\n                    float x_134214;\n                    float x_134215;\n                    float x_134216;\n                    float x_134217;\n                    \n                    offset_134229 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_134192,\n                                  sext_i64_i32(segred_group_sizze_123257))) {\n                            x_134214 = ((__local\n                                         float *) red_arr_mem_134196)[sext_i32_i64(local_tid_134192 +\n                                                                      offset_134229)];\n                            x_134215 = ((__local\n                                         float *) red_arr_mem_134198)[sext_i32_i64(local_tid_134192 +\n                                                                      offset_134229)];\n                        }\n                    }\n                    offset_134229 = 1;\n                    while (slt32(offset_134229, wave_sizze_134194)) {\n                        if (slt32(local_tid_134192 + offset_134229,\n                                  sext_i64_i32(segred_group_sizze_123257)) &&\n                            ((local_tid_134192 - squot32(local_tid_134192,\n                                                         wave_sizze_134194) *\n                              wave_sizze_134194) & (2 * offset_134229 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_134216 = ((volatile __local\n                                             float *) red_arr_mem_134196)[sext_i32_i64(local_tid_134192 +\n               ",
                   "                                                           offset_134229)];\n                                x_134217 = ((volatile __local\n                                             float *) red_arr_mem_134198)[sext_i32_i64(local_tid_134192 +\n                                                                          offset_134229)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_134218 = x_134214 +\n                                      x_134216;\n                                float defunc_1_op_res_134219 = x_134215 +\n                                      x_134217;\n                                \n                                x_134214 = defunc_1_op_res_134218;\n                                x_134215 = defunc_1_op_res_134219;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_134196)[sext_i32_i64(local_tid_134192)] =\n                                    x_134214;\n                                ((volatile __local\n                                  float *) red_arr_mem_134198)[sext_i32_i64(local_tid_134192)] =\n                                    x_134215;\n                            }\n                        }\n                        offset_134229 *= 2;\n                    }\n                    while (slt32(skip_waves_134230,\n                                 squot32(sext_i64_i32(segred_group_sizze_123257) +\n                                         wave_sizze_134194 - 1,\n                                         wave_sizze_134194))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_134229 = skip_waves_134230 * wave_sizze_134194;\n                        if (slt32(local_tid_134192 + offset_134229,\n                                  sext_i64_i32",
                   "(segred_group_sizze_123257)) &&\n                            ((local_tid_134192 - squot32(local_tid_134192,\n                                                         wave_sizze_134194) *\n                              wave_sizze_134194) == 0 &&\n                             (squot32(local_tid_134192, wave_sizze_134194) &\n                              (2 * skip_waves_134230 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_134216 = ((__local\n                                             float *) red_arr_mem_134196)[sext_i32_i64(local_tid_134192 +\n                                                                          offset_134229)];\n                                x_134217 = ((__local\n                                             float *) red_arr_mem_134198)[sext_i32_i64(local_tid_134192 +\n                                                                          offset_134229)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_134218 = x_134214 +\n                                      x_134216;\n                                float defunc_1_op_res_134219 = x_134215 +\n                                      x_134217;\n                                \n                                x_134214 = defunc_1_op_res_134218;\n                                x_134215 = defunc_1_op_res_134219;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_134196)[sext_i32_i64(local_tid_134192)] =\n                                    x_134214;\n                                ((__local\n                                  float *) red_arr_mem_134198)[sext_i32_i64(local_tid_134192)] =\n                                    x_134215;\n                  ",
                   "          }\n                        }\n                        skip_waves_134230 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_134192 == 0) {\n                            ((__global float *) mem_131148)[gtid_122651 *\n                                                            l_n_m_114584 +\n                                                            gtid_122652] =\n                                x_134214;\n                            ((__global float *) mem_131152)[gtid_122651 *\n                                                            l_n_m_114584 +\n                                                            gtid_122652] =\n                                x_134215;\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_123257\n}\n__kernel void mainzisegred_large_122783(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_134097_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134095_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134093_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134091_backing_aligned_3,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134089_backing_aligned_4,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134087_backing_aligned_5,\n                                        int64_t m_114533, int6",
                   "4_t n_114534,\n                                        int64_t l_window_114538,\n                                        int64_t t_jump_114541,\n                                        int64_t l_n_m_114584, int64_t i_114610,\n                                        int64_t num_groups_123162,\n                                        int64_t groups_per_segment_134065,\n                                        int64_t elements_per_thread_134066,\n                                        int64_t virt_num_groups_134067,\n                                        int64_t threads_per_segment_134069,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130404,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130405,\n                                        __global unsigned char *mem_130861,\n                                        __global unsigned char *mem_131106,\n                                        __global unsigned char *mem_131110,\n                                        __global unsigned char *mem_131114,\n                                        __global unsigned char *mem_131118,\n                                        __global unsigned char *mem_131122,\n                                        __global\n                                        unsigned char *segred_tmp_mem_134070,\n                                        __global\n                                        unsigned char *segred_tmp_mem_134072,\n                                        __global\n                                        unsigned char *segred_tmp_mem_134074,\n                                        __global\n                                        unsigned ch",
                   "ar *segred_tmp_mem_134076,\n                                        __global\n                                        unsigned char *segred_tmp_mem_134078,\n                                        __global\n                                        unsigned char *mainzicounter_mem_134080)\n{\n    #define segred_group_sizze_123161 (mainzisegred_group_sizze_122777)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict sync_arr_mem_134097_backing_5 =\n                          (__local volatile\n                           char *) sync_arr_mem_134097_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_134095_backing_4 =\n                          (__local volatile\n                           char *) red_arr_mem_134095_backing_aligned_1;\n    __local volatile char *restrict red_arr_mem_134093_backing_3 =\n                          (__local volatile\n                           char *) red_arr_mem_134093_backing_aligned_2;\n    __local volatile char *restrict red_arr_mem_134091_backing_2 =\n                          (__local volatile\n                           char *) red_arr_mem_134091_backing_aligned_3;\n    __local volatile char *restrict red_arr_mem_134089_backing_1 =\n                          (__local volatile\n                           char *) red_arr_mem_134089_backing_aligned_4;\n    __local volatile char *restrict red_arr_mem_134087_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_134087_backing_aligned_5;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_134082;\n    int32_t local_tid_134083;\n    int64_t group_sizze_134086;\n    int32_t wave_sizze_134085;\n    int32_t group_tid_134084;\n    \n    global_tid_134082 = get_global_id(0);\n    local_tid_134083 = get_local_id(0);\n    group_sizze_134086 = get_local_size(0);\n    wave_sizze_134085 = LOCKSTEP_WIDTH;\n    group_tid_134084 = get_group_id(0);\n    \n    int32_t phy",
                   "s_tid_122783 = global_tid_134082;\n    __local char *red_arr_mem_134087;\n    \n    red_arr_mem_134087 = (__local char *) red_arr_mem_134087_backing_0;\n    \n    __local char *red_arr_mem_134089;\n    \n    red_arr_mem_134089 = (__local char *) red_arr_mem_134089_backing_1;\n    \n    __local char *red_arr_mem_134091;\n    \n    red_arr_mem_134091 = (__local char *) red_arr_mem_134091_backing_2;\n    \n    __local char *red_arr_mem_134093;\n    \n    red_arr_mem_134093 = (__local char *) red_arr_mem_134093_backing_3;\n    \n    __local char *red_arr_mem_134095;\n    \n    red_arr_mem_134095 = (__local char *) red_arr_mem_134095_backing_4;\n    \n    __local char *sync_arr_mem_134097;\n    \n    sync_arr_mem_134097 = (__local char *) sync_arr_mem_134097_backing_5;\n    \n    int32_t phys_group_id_134099;\n    \n    phys_group_id_134099 = get_group_id(0);\n    for (int32_t i_134100 = 0; i_134100 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_134067) - phys_group_id_134099,\n                   sext_i64_i32(num_groups_123162)); i_134100++) {\n        int32_t virt_group_id_134101 = phys_group_id_134099 + i_134100 *\n                sext_i64_i32(num_groups_123162);\n        int32_t flat_segment_id_134102 = squot32(virt_group_id_134101,\n                                                 sext_i64_i32(groups_per_segment_134065));\n        int64_t global_tid_134103 = srem64(sext_i32_i64(virt_group_id_134101) *\n                                           segred_group_sizze_123161 +\n                                           sext_i32_i64(local_tid_134083),\n                                           segred_group_sizze_123161 *\n                                           groups_per_segment_134065);\n        int64_t slice_134104 = l_n_m_114584;\n        int64_t slice_134105 = m_114533 * slice_134104;\n        int64_t gtid_122772 = squot64(sext_i32_i64(flat_segment_id_134102),\n                                      slice_134104);\n        int64_t remnant_134106 = sext_i32_i64(flat_segment_id_134102) -\n                g",
                   "tid_122772 * slice_134104;\n        int64_t gtid_122773 = remnant_134106;\n        int64_t remnant_134107 = remnant_134106 - gtid_122773;\n        int64_t gtid_122782;\n        float x_acc_134108;\n        float x_acc_134109;\n        float x_acc_134110;\n        float x_acc_134111;\n        float x_acc_134112;\n        int64_t chunk_sizze_134113 = smin64(elements_per_thread_134066,\n                                            sdiv_up64(l_window_114538 -\n                                                      global_tid_134103,\n                                                      threads_per_segment_134069));\n        float x_123169;\n        float x_123170;\n        float x_123171;\n        float x_123172;\n        float x_123173;\n        float x_123174;\n        float x_123175;\n        float x_123176;\n        float x_123177;\n        float x_123178;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_134108 = 0.0F;\n            x_acc_134109 = 0.0F;\n            x_acc_134110 = 0.0F;\n            x_acc_134111 = 0.0F;\n            x_acc_134112 = 0.0F;\n        }\n        for (int64_t i_134129 = 0; i_134129 < chunk_sizze_134113; i_134129++) {\n            gtid_122782 = global_tid_134103 + threads_per_segment_134069 *\n                i_134129;\n            // apply map function\n            {\n                int64_t x_123188 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_122772];\n                int64_t x_123190 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130404)[gtid_122772 *\n                                                                             l_n_m_114584 +\n                                                                             gtid_122773];\n                float x_123191 = ((__global\n                                   float *) defunc_3_map_res_mem_130405)[gtid_122772 *\n                                                                         l_n_m_114584 +\n        ",
                   "                                                                 gtid_122773];\n                int64_t binop_y_128881 = mul64(t_jump_114541, gtid_122773);\n                int64_t convop_x_128882 = smin64(i_114610, binop_y_128881);\n                float index_primexp_128883 = sitofp_i64_f32(convop_x_128882);\n                bool cond_123194 = sle64(x_123188, gtid_122782);\n                float defunc_0_f_res_123195;\n                \n                if (cond_123194) {\n                    defunc_0_f_res_123195 = 0.0F;\n                } else {\n                    int64_t i_123196 = add64(gtid_122782, x_123190);\n                    float x_123197 = ((__global\n                                       float *) mem_130122)[gtid_122772 *\n                                                            n_114534 +\n                                                            i_123196];\n                    float defunc_0_f_res_f_res_123198 = 1.0F + x_123197;\n                    \n                    defunc_0_f_res_123195 = defunc_0_f_res_f_res_123198;\n                }\n                \n                float defunc_0_f_res_123199;\n                \n                if (cond_123194) {\n                    defunc_0_f_res_123199 = 0.0F;\n                } else {\n                    int64_t i_123200 = add64(gtid_122782, x_123190);\n                    float x_123201 = ((__global\n                                       float *) mem_130861)[gtid_122772 *\n                                                            n_114534 +\n                                                            i_123200];\n                    \n                    defunc_0_f_res_123199 = x_123201;\n                }\n                \n                float x_j_123202 = defunc_0_f_res_123195 - index_primexp_128883;\n                float abs_res_123203 = (float) fabs(x_j_123202);\n                float tmp1_123204 = abs_res_123203 / x_123191;\n                float x_123205 = tmp1_123204 * tmp1_123204;\n                float y_123206 = tm",
                   "p1_123204 * x_123205;\n                float tmp2_123207 = 1.0F - y_123206;\n                float x_123208 = tmp2_123207 * tmp2_123207;\n                float tmp3_123209 = tmp2_123207 * x_123208;\n                float w_j_123210 = defunc_0_f_res_123199 * tmp3_123209;\n                float xw_j_123211 = x_j_123202 * w_j_123210;\n                float x2w_j_123212 = x_j_123202 * xw_j_123211;\n                float x3w_j_123213 = x_j_123202 * x2w_j_123212;\n                float x4w_j_123214 = x_j_123202 * x3w_j_123213;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_123169 = x_acc_134108;\n                    x_123170 = x_acc_134109;\n                    x_123171 = x_acc_134110;\n                    x_123172 = x_acc_134111;\n                    x_123173 = x_acc_134112;\n                }\n                // load new values\n                {\n                    x_123174 = w_j_123210;\n                    x_123175 = xw_j_123211;\n                    x_123176 = x2w_j_123212;\n                    x_123177 = x3w_j_123213;\n                    x_123178 = x4w_j_123214;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_123179 = x_123169 + x_123174;\n                    float defunc_1_op_res_123180 = x_123170 + x_123175;\n                    float defunc_1_op_res_123181 = x_123171 + x_123176;\n                    float defunc_1_op_res_123182 = x_123172 + x_123177;\n                    float defunc_1_op_res_123183 = x_123173 + x_123178;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_134108 = defunc_1_op_res_123179;\n                        x_acc_134109 = defunc_1_op_res_123180;\n                        x_acc_134110 = defunc_1_op_res_123181;\n                        x_acc_134111 = defunc_1_op_res_123182;\n                        x_acc_134112 = defunc_1_op_re",
                   "s_123183;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_123169 = x_acc_134108;\n            x_123170 = x_acc_134109;\n            x_123171 = x_acc_134110;\n            x_123172 = x_acc_134111;\n            x_123173 = x_acc_134112;\n            ((__local\n              float *) red_arr_mem_134087)[sext_i32_i64(local_tid_134083)] =\n                x_123169;\n            ((__local\n              float *) red_arr_mem_134089)[sext_i32_i64(local_tid_134083)] =\n                x_123170;\n            ((__local\n              float *) red_arr_mem_134091)[sext_i32_i64(local_tid_134083)] =\n                x_123171;\n            ((__local\n              float *) red_arr_mem_134093)[sext_i32_i64(local_tid_134083)] =\n                x_123172;\n            ((__local\n              float *) red_arr_mem_134095)[sext_i32_i64(local_tid_134083)] =\n                x_123173;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_134130;\n        int32_t skip_waves_134131 = 1;\n        float x_134114;\n        float x_134115;\n        float x_134116;\n        float x_134117;\n        float x_134118;\n        float x_134119;\n        float x_134120;\n        float x_134121;\n        float x_134122;\n        float x_134123;\n        \n        offset_134130 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_134083,\n                      sext_i64_i32(segred_group_sizze_123161))) {\n                x_134114 = ((__local\n                             float *) red_arr_mem_134087)[sext_i32_i64(local_tid_134083 +\n                                                          offset_134130)];\n                x_134115 = ((__local\n                             float *) red_arr_mem_134089)[sext_i32_i64(local_tid_134083 +\n                                                          offset_134130)];\n                x_134116 = ((__local\n                   ",
                   "          float *) red_arr_mem_134091)[sext_i32_i64(local_tid_134083 +\n                                                          offset_134130)];\n                x_134117 = ((__local\n                             float *) red_arr_mem_134093)[sext_i32_i64(local_tid_134083 +\n                                                          offset_134130)];\n                x_134118 = ((__local\n                             float *) red_arr_mem_134095)[sext_i32_i64(local_tid_134083 +\n                                                          offset_134130)];\n            }\n        }\n        offset_134130 = 1;\n        while (slt32(offset_134130, wave_sizze_134085)) {\n            if (slt32(local_tid_134083 + offset_134130,\n                      sext_i64_i32(segred_group_sizze_123161)) &&\n                ((local_tid_134083 - squot32(local_tid_134083,\n                                             wave_sizze_134085) *\n                  wave_sizze_134085) & (2 * offset_134130 - 1)) == 0) {\n                // read array element\n                {\n                    x_134119 = ((volatile __local\n                                 float *) red_arr_mem_134087)[sext_i32_i64(local_tid_134083 +\n                                                              offset_134130)];\n                    x_134120 = ((volatile __local\n                                 float *) red_arr_mem_134089)[sext_i32_i64(local_tid_134083 +\n                                                              offset_134130)];\n                    x_134121 = ((volatile __local\n                                 float *) red_arr_mem_134091)[sext_i32_i64(local_tid_134083 +\n                                                              offset_134130)];\n                    x_134122 = ((volatile __local\n                                 float *) red_arr_mem_134093)[sext_i32_i64(local_tid_134083 +\n                                                              offset_134130)];\n                    x_134123 = ((volatile __local\n                    ",
                   "             float *) red_arr_mem_134095)[sext_i32_i64(local_tid_134083 +\n                                                              offset_134130)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_134124 = x_134114 + x_134119;\n                    float defunc_1_op_res_134125 = x_134115 + x_134120;\n                    float defunc_1_op_res_134126 = x_134116 + x_134121;\n                    float defunc_1_op_res_134127 = x_134117 + x_134122;\n                    float defunc_1_op_res_134128 = x_134118 + x_134123;\n                    \n                    x_134114 = defunc_1_op_res_134124;\n                    x_134115 = defunc_1_op_res_134125;\n                    x_134116 = defunc_1_op_res_134126;\n                    x_134117 = defunc_1_op_res_134127;\n                    x_134118 = defunc_1_op_res_134128;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_134087)[sext_i32_i64(local_tid_134083)] =\n                        x_134114;\n                    ((volatile __local\n                      float *) red_arr_mem_134089)[sext_i32_i64(local_tid_134083)] =\n                        x_134115;\n                    ((volatile __local\n                      float *) red_arr_mem_134091)[sext_i32_i64(local_tid_134083)] =\n                        x_134116;\n                    ((volatile __local\n                      float *) red_arr_mem_134093)[sext_i32_i64(local_tid_134083)] =\n                        x_134117;\n                    ((volatile __local\n                      float *) red_arr_mem_134095)[sext_i32_i64(local_tid_134083)] =\n                        x_134118;\n                }\n            }\n            offset_134130 *= 2;\n        }\n        while (slt32(skip_waves_134131,\n                     squot32(sext_i64_i32(segred_group_sizze_123161) +\n                             wave_sizze_134085 - 1, wa",
                   "ve_sizze_134085))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_134130 = skip_waves_134131 * wave_sizze_134085;\n            if (slt32(local_tid_134083 + offset_134130,\n                      sext_i64_i32(segred_group_sizze_123161)) &&\n                ((local_tid_134083 - squot32(local_tid_134083,\n                                             wave_sizze_134085) *\n                  wave_sizze_134085) == 0 && (squot32(local_tid_134083,\n                                                      wave_sizze_134085) & (2 *\n                                                                            skip_waves_134131 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_134119 = ((__local\n                                 float *) red_arr_mem_134087)[sext_i32_i64(local_tid_134083 +\n                                                              offset_134130)];\n                    x_134120 = ((__local\n                                 float *) red_arr_mem_134089)[sext_i32_i64(local_tid_134083 +\n                                                              offset_134130)];\n                    x_134121 = ((__local\n                                 float *) red_arr_mem_134091)[sext_i32_i64(local_tid_134083 +\n                                                              offset_134130)];\n                    x_134122 = ((__local\n                                 float *) red_arr_mem_134093)[sext_i32_i64(local_tid_134083 +\n                                                              offset_134130)];\n                    x_134123 = ((__local\n                                 float *) red_arr_mem_134095)[sext_i32_i64(local_tid_134083 +\n                                                              offset_134130)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_134124 = x_13411",
                   "4 + x_134119;\n                    float defunc_1_op_res_134125 = x_134115 + x_134120;\n                    float defunc_1_op_res_134126 = x_134116 + x_134121;\n                    float defunc_1_op_res_134127 = x_134117 + x_134122;\n                    float defunc_1_op_res_134128 = x_134118 + x_134123;\n                    \n                    x_134114 = defunc_1_op_res_134124;\n                    x_134115 = defunc_1_op_res_134125;\n                    x_134116 = defunc_1_op_res_134126;\n                    x_134117 = defunc_1_op_res_134127;\n                    x_134118 = defunc_1_op_res_134128;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_134087)[sext_i32_i64(local_tid_134083)] =\n                        x_134114;\n                    ((__local\n                      float *) red_arr_mem_134089)[sext_i32_i64(local_tid_134083)] =\n                        x_134115;\n                    ((__local\n                      float *) red_arr_mem_134091)[sext_i32_i64(local_tid_134083)] =\n                        x_134116;\n                    ((__local\n                      float *) red_arr_mem_134093)[sext_i32_i64(local_tid_134083)] =\n                        x_134117;\n                    ((__local\n                      float *) red_arr_mem_134095)[sext_i32_i64(local_tid_134083)] =\n                        x_134118;\n                }\n            }\n            skip_waves_134131 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_134083) == (int64_t) 0) {\n                x_acc_134108 = x_134114;\n                x_acc_134109 = x_134115;\n                x_acc_134110 = x_134116;\n                x_acc_134111 = x_134117;\n                x_acc_134112 = x_134118;\n            }\n        }\n        if (groups_per_segment_134065 == (int64_t) 1) {\n            // first thread in group saves f",
                   "inal result to memory\n            {\n                if (local_tid_134083 == 0) {\n                    ((__global float *) mem_131106)[gtid_122772 * l_n_m_114584 +\n                                                    gtid_122773] = x_acc_134108;\n                    ((__global float *) mem_131110)[gtid_122772 * l_n_m_114584 +\n                                                    gtid_122773] = x_acc_134109;\n                    ((__global float *) mem_131114)[gtid_122772 * l_n_m_114584 +\n                                                    gtid_122773] = x_acc_134110;\n                    ((__global float *) mem_131118)[gtid_122772 * l_n_m_114584 +\n                                                    gtid_122773] = x_acc_134111;\n                    ((__global float *) mem_131122)[gtid_122772 * l_n_m_114584 +\n                                                    gtid_122773] = x_acc_134112;\n                }\n            }\n        } else {\n            int32_t old_counter_134132;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_134083 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_134070)[sext_i32_i64(virt_group_id_134101)] =\n                        x_acc_134108;\n                    ((__global\n                      float *) segred_tmp_mem_134072)[sext_i32_i64(virt_group_id_134101)] =\n                        x_acc_134109;\n                    ((__global\n                      float *) segred_tmp_mem_134074)[sext_i32_i64(virt_group_id_134101)] =\n                        x_acc_134110;\n                    ((__global\n                      float *) segred_tmp_mem_134076)[sext_i32_i64(virt_group_id_134101)] =\n                        x_acc_134111;\n                    ((__global\n                      float *) segred_tmp_mem_134078)[sext_i32_i64(virt_group_id_134101)] =\n                        x_acc_134112;\n                    mem_fence_global();\n                    old_counte",
                   "r_134132 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_134080)[sext_i32_i64(srem32(flat_segment_id_134102,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_134097)[(int64_t) 0] =\n                        old_counter_134132 == groups_per_segment_134065 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_134133 = ((__local\n                                          bool *) sync_arr_mem_134097)[(int64_t) 0];\n            \n            if (is_last_group_134133) {\n                if (local_tid_134083 == 0) {\n                    old_counter_134132 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_134080)[sext_i32_i64(srem32(flat_segment_id_134102,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_134065));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_134134 =\n                            sdiv_up64(groups_per_segment_134065,\n                                      segred_group_sizze_123161);\n                    \n                    x_123169 = 0.0F;\n                    x_123170 = 0.0F;\n                    x_123171 = 0.0F;\n                    x_123172 = 0.0F;\n                    x_123173 = 0.0F;\n                    for (int64_t i_134135 = 0; i_134135 <\n                         read_per_thread_134134; i_134135++) {\n         ",
                   "               int64_t group_res_id_134136 =\n                                sext_i32_i64(local_tid_134083) *\n                                read_per_thread_134134 + i_134135;\n                        int64_t index_of_group_res_134137 =\n                                sext_i32_i64(flat_segment_id_134102) *\n                                groups_per_segment_134065 + group_res_id_134136;\n                        \n                        if (slt64(group_res_id_134136,\n                                  groups_per_segment_134065)) {\n                            x_123174 = ((__global\n                                         float *) segred_tmp_mem_134070)[index_of_group_res_134137];\n                            x_123175 = ((__global\n                                         float *) segred_tmp_mem_134072)[index_of_group_res_134137];\n                            x_123176 = ((__global\n                                         float *) segred_tmp_mem_134074)[index_of_group_res_134137];\n                            x_123177 = ((__global\n                                         float *) segred_tmp_mem_134076)[index_of_group_res_134137];\n                            x_123178 = ((__global\n                                         float *) segred_tmp_mem_134078)[index_of_group_res_134137];\n                            \n                            float defunc_1_op_res_123179 = x_123169 + x_123174;\n                            float defunc_1_op_res_123180 = x_123170 + x_123175;\n                            float defunc_1_op_res_123181 = x_123171 + x_123176;\n                            float defunc_1_op_res_123182 = x_123172 + x_123177;\n                            float defunc_1_op_res_123183 = x_123173 + x_123178;\n                            \n                            x_123169 = defunc_1_op_res_123179;\n                            x_123170 = defunc_1_op_res_123180;\n                            x_123171 = defunc_1_op_res_123181;\n                            x_123172 = defunc_1_op_res_123182;\n  ",
                   "                          x_123173 = defunc_1_op_res_123183;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_134087)[sext_i32_i64(local_tid_134083)] =\n                    x_123169;\n                ((__local\n                  float *) red_arr_mem_134089)[sext_i32_i64(local_tid_134083)] =\n                    x_123170;\n                ((__local\n                  float *) red_arr_mem_134091)[sext_i32_i64(local_tid_134083)] =\n                    x_123171;\n                ((__local\n                  float *) red_arr_mem_134093)[sext_i32_i64(local_tid_134083)] =\n                    x_123172;\n                ((__local\n                  float *) red_arr_mem_134095)[sext_i32_i64(local_tid_134083)] =\n                    x_123173;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_134138;\n                    int32_t skip_waves_134139 = 1;\n                    float x_134114;\n                    float x_134115;\n                    float x_134116;\n                    float x_134117;\n                    float x_134118;\n                    float x_134119;\n                    float x_134120;\n                    float x_134121;\n                    float x_134122;\n                    float x_134123;\n                    \n                    offset_134138 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_134083,\n                                  sext_i64_i32(segred_group_sizze_123161))) {\n                            x_134114 = ((__local\n                                         float *) red_arr_mem_134087)[sext_i32_i64(local_tid_134083 +\n                                                                      offset_134138)];\n                            x_134115 = ((__local\n                                         float *) red",
                   "_arr_mem_134089)[sext_i32_i64(local_tid_134083 +\n                                                                      offset_134138)];\n                            x_134116 = ((__local\n                                         float *) red_arr_mem_134091)[sext_i32_i64(local_tid_134083 +\n                                                                      offset_134138)];\n                            x_134117 = ((__local\n                                         float *) red_arr_mem_134093)[sext_i32_i64(local_tid_134083 +\n                                                                      offset_134138)];\n                            x_134118 = ((__local\n                                         float *) red_arr_mem_134095)[sext_i32_i64(local_tid_134083 +\n                                                                      offset_134138)];\n                        }\n                    }\n                    offset_134138 = 1;\n                    while (slt32(offset_134138, wave_sizze_134085)) {\n                        if (slt32(local_tid_134083 + offset_134138,\n                                  sext_i64_i32(segred_group_sizze_123161)) &&\n                            ((local_tid_134083 - squot32(local_tid_134083,\n                                                         wave_sizze_134085) *\n                              wave_sizze_134085) & (2 * offset_134138 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_134119 = ((volatile __local\n                                             float *) red_arr_mem_134087)[sext_i32_i64(local_tid_134083 +\n                                                                          offset_134138)];\n                                x_134120 = ((volatile __local\n                                             float *) red_arr_mem_134089)[sext_i32_i64(local_tid_134083 +\n                                                                          o",
                   "ffset_134138)];\n                                x_134121 = ((volatile __local\n                                             float *) red_arr_mem_134091)[sext_i32_i64(local_tid_134083 +\n                                                                          offset_134138)];\n                                x_134122 = ((volatile __local\n                                             float *) red_arr_mem_134093)[sext_i32_i64(local_tid_134083 +\n                                                                          offset_134138)];\n                                x_134123 = ((volatile __local\n                                             float *) red_arr_mem_134095)[sext_i32_i64(local_tid_134083 +\n                                                                          offset_134138)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_134124 = x_134114 +\n                                      x_134119;\n                                float defunc_1_op_res_134125 = x_134115 +\n                                      x_134120;\n                                float defunc_1_op_res_134126 = x_134116 +\n                                      x_134121;\n                                float defunc_1_op_res_134127 = x_134117 +\n                                      x_134122;\n                                float defunc_1_op_res_134128 = x_134118 +\n                                      x_134123;\n                                \n                                x_134114 = defunc_1_op_res_134124;\n                                x_134115 = defunc_1_op_res_134125;\n                                x_134116 = defunc_1_op_res_134126;\n                                x_134117 = defunc_1_op_res_134127;\n                                x_134118 = defunc_1_op_res_134128;\n                            }\n                            // write result of operation\n                         ",
                   "   {\n                                ((volatile __local\n                                  float *) red_arr_mem_134087)[sext_i32_i64(local_tid_134083)] =\n                                    x_134114;\n                                ((volatile __local\n                                  float *) red_arr_mem_134089)[sext_i32_i64(local_tid_134083)] =\n                                    x_134115;\n                                ((volatile __local\n                                  float *) red_arr_mem_134091)[sext_i32_i64(local_tid_134083)] =\n                                    x_134116;\n                                ((volatile __local\n                                  float *) red_arr_mem_134093)[sext_i32_i64(local_tid_134083)] =\n                                    x_134117;\n                                ((volatile __local\n                                  float *) red_arr_mem_134095)[sext_i32_i64(local_tid_134083)] =\n                                    x_134118;\n                            }\n                        }\n                        offset_134138 *= 2;\n                    }\n                    while (slt32(skip_waves_134139,\n                                 squot32(sext_i64_i32(segred_group_sizze_123161) +\n                                         wave_sizze_134085 - 1,\n                                         wave_sizze_134085))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_134138 = skip_waves_134139 * wave_sizze_134085;\n                        if (slt32(local_tid_134083 + offset_134138,\n                                  sext_i64_i32(segred_group_sizze_123161)) &&\n                            ((local_tid_134083 - squot32(local_tid_134083,\n                                                         wave_sizze_134085) *\n                              wave_sizze_134085) == 0 &&\n                             (squot32(local_tid_134083, wave_sizze_134085) &\n                              (2 * skip_waves_134139 - 1)) == 0)) {\n      ",
                   "                      // read array element\n                            {\n                                x_134119 = ((__local\n                                             float *) red_arr_mem_134087)[sext_i32_i64(local_tid_134083 +\n                                                                          offset_134138)];\n                                x_134120 = ((__local\n                                             float *) red_arr_mem_134089)[sext_i32_i64(local_tid_134083 +\n                                                                          offset_134138)];\n                                x_134121 = ((__local\n                                             float *) red_arr_mem_134091)[sext_i32_i64(local_tid_134083 +\n                                                                          offset_134138)];\n                                x_134122 = ((__local\n                                             float *) red_arr_mem_134093)[sext_i32_i64(local_tid_134083 +\n                                                                          offset_134138)];\n                                x_134123 = ((__local\n                                             float *) red_arr_mem_134095)[sext_i32_i64(local_tid_134083 +\n                                                                          offset_134138)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_134124 = x_134114 +\n                                      x_134119;\n                                float defunc_1_op_res_134125 = x_134115 +\n                                      x_134120;\n                                float defunc_1_op_res_134126 = x_134116 +\n                                      x_134121;\n                                float defunc_1_op_res_134127 = x_134117 +\n                                      x_134122;\n                                float defunc_1_op_res_134128 = x_134118",
                   " +\n                                      x_134123;\n                                \n                                x_134114 = defunc_1_op_res_134124;\n                                x_134115 = defunc_1_op_res_134125;\n                                x_134116 = defunc_1_op_res_134126;\n                                x_134117 = defunc_1_op_res_134127;\n                                x_134118 = defunc_1_op_res_134128;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_134087)[sext_i32_i64(local_tid_134083)] =\n                                    x_134114;\n                                ((__local\n                                  float *) red_arr_mem_134089)[sext_i32_i64(local_tid_134083)] =\n                                    x_134115;\n                                ((__local\n                                  float *) red_arr_mem_134091)[sext_i32_i64(local_tid_134083)] =\n                                    x_134116;\n                                ((__local\n                                  float *) red_arr_mem_134093)[sext_i32_i64(local_tid_134083)] =\n                                    x_134117;\n                                ((__local\n                                  float *) red_arr_mem_134095)[sext_i32_i64(local_tid_134083)] =\n                                    x_134118;\n                            }\n                        }\n                        skip_waves_134139 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_134083 == 0) {\n                            ((__global float *) mem_131106)[gtid_122772 *\n                                                            l_n_m_114584 +\n                                                            gtid_122773] =\n                                x_134114;\n        ",
                   "                    ((__global float *) mem_131110)[gtid_122772 *\n                                                            l_n_m_114584 +\n                                                            gtid_122773] =\n                                x_134115;\n                            ((__global float *) mem_131114)[gtid_122772 *\n                                                            l_n_m_114584 +\n                                                            gtid_122773] =\n                                x_134116;\n                            ((__global float *) mem_131118)[gtid_122772 *\n                                                            l_n_m_114584 +\n                                                            gtid_122773] =\n                                x_134117;\n                            ((__global float *) mem_131122)[gtid_122772 *\n                                                            l_n_m_114584 +\n                                                            gtid_122773] =\n                                x_134118;\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_123161\n}\n__kernel void mainzisegred_large_124516(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_134501_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134499_backing_aligned_1,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t t_window_114537,\n                                        int64_t t_jump_114541,\n                                        int64_t t_n_m_114591, int64_t i_114610,\n                                        int64_t num_groups_124846,\n          ",
                   "                              int64_t groups_per_segment_134485,\n                                        int64_t elements_per_thread_134486,\n                                        int64_t virt_num_groups_134487,\n                                        int64_t threads_per_segment_134489,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130606,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130607,\n                                        __global unsigned char *mem_130861,\n                                        __global\n                                        unsigned char *defunc_4_map_res_mem_131267,\n                                        __global unsigned char *mem_131320,\n                                        __global unsigned char *mem_131325,\n                                        __global\n                                        unsigned char *segred_tmp_mem_134490,\n                                        __global\n                                        unsigned char *mainzicounter_mem_134492)\n{\n    #define segred_group_sizze_124845 (mainzisegred_group_sizze_124510)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict sync_arr_mem_134501_backing_1 =\n                          (__local volatile\n                           char *) sync_arr_mem_134501_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_134499_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_134499_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_",
                   "134494;\n    int32_t local_tid_134495;\n    int64_t group_sizze_134498;\n    int32_t wave_sizze_134497;\n    int32_t group_tid_134496;\n    \n    global_tid_134494 = get_global_id(0);\n    local_tid_134495 = get_local_id(0);\n    group_sizze_134498 = get_local_size(0);\n    wave_sizze_134497 = LOCKSTEP_WIDTH;\n    group_tid_134496 = get_group_id(0);\n    \n    int32_t phys_tid_124516 = global_tid_134494;\n    __local char *red_arr_mem_134499;\n    \n    red_arr_mem_134499 = (__local char *) red_arr_mem_134499_backing_0;\n    \n    __local char *sync_arr_mem_134501;\n    \n    sync_arr_mem_134501 = (__local char *) sync_arr_mem_134501_backing_1;\n    \n    int32_t phys_group_id_134503;\n    \n    phys_group_id_134503 = get_group_id(0);\n    for (int32_t i_134504 = 0; i_134504 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_134487) - phys_group_id_134503,\n                   sext_i64_i32(num_groups_124846)); i_134504++) {\n        int32_t virt_group_id_134505 = phys_group_id_134503 + i_134504 *\n                sext_i64_i32(num_groups_124846);\n        int32_t flat_segment_id_134506 = squot32(virt_group_id_134505,\n                                                 sext_i64_i32(groups_per_segment_134485));\n        int64_t global_tid_134507 = srem64(sext_i32_i64(virt_group_id_134505) *\n                                           segred_group_sizze_124845 +\n                                           sext_i32_i64(local_tid_134495),\n                                           segred_group_sizze_124845 *\n                                           groups_per_segment_134485);\n        int64_t slice_134508 = t_n_m_114591;\n        int64_t slice_134509 = m_114533 * slice_134508;\n        int64_t gtid_124505 = squot64(sext_i32_i64(flat_segment_id_134506),\n                                      slice_134508);\n        int64_t remnant_134510 = sext_i32_i64(flat_segment_id_134506) -\n                gtid_124505 * slice_134508;\n        int64_t gtid_124506 = remnant_134510;\n        int64_t remnant_134511 = remnant_1345",
                   "10 - gtid_124506;\n        int64_t gtid_124515;\n        float x_acc_134512;\n        int64_t chunk_sizze_134513 = smin64(elements_per_thread_134486,\n                                            sdiv_up64(t_window_114537 -\n                                                      global_tid_134507,\n                                                      threads_per_segment_134489));\n        float x_124849;\n        float x_124850;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_134512 = 0.0F;\n        }\n        for (int64_t i_134517 = 0; i_134517 < chunk_sizze_134513; i_134517++) {\n            gtid_124515 = global_tid_134507 + threads_per_segment_134489 *\n                i_134517;\n            // apply map function\n            {\n                int64_t x_124857 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_124505];\n                int64_t x_124860 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130606)[gtid_124505 *\n                                                                             t_n_m_114591 +\n                                                                             gtid_124506];\n                float x_124861 = ((__global\n                                   float *) defunc_3_map_res_mem_130607)[gtid_124505 *\n                                                                         t_n_m_114591 +\n                                                                         gtid_124506];\n                int64_t binop_y_128935 = mul64(t_jump_114541, gtid_124506);\n                int64_t convop_x_128936 = smin64(i_114610, binop_y_128935);\n                float index_primexp_128937 = sitofp_i64_f32(convop_x_128936);\n                float a0_124863 = ((__global float *) mem_131320)[gtid_124505 *\n                                                                  t_n_m_114591 +\n                                                                  gtid_124506];\n    ",
                   "            bool cond_124865 = sle64(x_124857, gtid_124515);\n                float defunc_0_f_res_124866;\n                \n                if (cond_124865) {\n                    defunc_0_f_res_124866 = 0.0F;\n                } else {\n                    int64_t i_124867 = add64(gtid_124515, x_124860);\n                    float x_124868 = ((__global\n                                       float *) mem_130122)[gtid_124505 *\n                                                            n_114534 +\n                                                            i_124867];\n                    float defunc_0_f_res_f_res_124869 = 1.0F + x_124868;\n                    \n                    defunc_0_f_res_124866 = defunc_0_f_res_f_res_124869;\n                }\n                \n                float defunc_0_f_res_124870;\n                \n                if (cond_124865) {\n                    defunc_0_f_res_124870 = 0.0F;\n                } else {\n                    int64_t i_124871 = add64(gtid_124515, x_124860);\n                    float x_124872 = ((__global\n                                       float *) mem_130861)[gtid_124505 *\n                                                            n_114534 +\n                                                            i_124871];\n                    \n                    defunc_0_f_res_124870 = x_124872;\n                }\n                \n                float x_j_124873 = defunc_0_f_res_124866 - index_primexp_128937;\n                float abs_res_124874 = (float) fabs(x_j_124873);\n                float tmp1_124875 = abs_res_124874 / x_124861;\n                float x_124876 = tmp1_124875 * tmp1_124875;\n                float y_124877 = tmp1_124875 * x_124876;\n                float tmp2_124878 = 1.0F - y_124877;\n                float x_124879 = tmp2_124878 * tmp2_124878;\n                float tmp3_124880 = tmp2_124878 * x_124879;\n                float tmp4_124881 = defunc_0_f_res_124870 * tmp3_124880;\n                float defunc_0_f_res_124882;\n",
                   "                \n                if (cond_124865) {\n                    defunc_0_f_res_124882 = 0.0F;\n                } else {\n                    int64_t i_124883 = add64(gtid_124515, x_124860);\n                    float x_124884 = ((__global\n                                       float *) defunc_4_map_res_mem_131267)[gtid_124505 *\n                                                                             n_114534 +\n                                                                             i_124883];\n                    \n                    defunc_0_f_res_124882 = x_124884;\n                }\n                \n                float x_124885 = a0_124863 * tmp4_124881;\n                float defunc_9_fit_fun_res_124886 = defunc_0_f_res_124882 *\n                      x_124885;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_124849 = x_acc_134512;\n                }\n                // load new values\n                {\n                    x_124850 = defunc_9_fit_fun_res_124886;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_124851 = x_124849 + x_124850;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_134512 = defunc_1_op_res_124851;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_124849 = x_acc_134512;\n            ((__local\n              float *) red_arr_mem_134499)[sext_i32_i64(local_tid_134495)] =\n                x_124849;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_134518;\n        int32_t skip_waves_134519 = 1;\n        float x_134514;\n        float x_134515;\n        \n        offset_134518 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt3",
                   "2(local_tid_134495,\n                      sext_i64_i32(segred_group_sizze_124845))) {\n                x_134514 = ((__local\n                             float *) red_arr_mem_134499)[sext_i32_i64(local_tid_134495 +\n                                                          offset_134518)];\n            }\n        }\n        offset_134518 = 1;\n        while (slt32(offset_134518, wave_sizze_134497)) {\n            if (slt32(local_tid_134495 + offset_134518,\n                      sext_i64_i32(segred_group_sizze_124845)) &&\n                ((local_tid_134495 - squot32(local_tid_134495,\n                                             wave_sizze_134497) *\n                  wave_sizze_134497) & (2 * offset_134518 - 1)) == 0) {\n                // read array element\n                {\n                    x_134515 = ((volatile __local\n                                 float *) red_arr_mem_134499)[sext_i32_i64(local_tid_134495 +\n                                                              offset_134518)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_134516 = x_134514 + x_134515;\n                    \n                    x_134514 = defunc_1_op_res_134516;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_134499)[sext_i32_i64(local_tid_134495)] =\n                        x_134514;\n                }\n            }\n            offset_134518 *= 2;\n        }\n        while (slt32(skip_waves_134519,\n                     squot32(sext_i64_i32(segred_group_sizze_124845) +\n                             wave_sizze_134497 - 1, wave_sizze_134497))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_134518 = skip_waves_134519 * wave_sizze_134497;\n            if (slt32(local_tid_134495 + offset_134518,\n                      sext_i64_i32(segred_group_sizze_124845)) &&\n                ((local_tid_134495 - squot",
                   "32(local_tid_134495,\n                                             wave_sizze_134497) *\n                  wave_sizze_134497) == 0 && (squot32(local_tid_134495,\n                                                      wave_sizze_134497) & (2 *\n                                                                            skip_waves_134519 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_134515 = ((__local\n                                 float *) red_arr_mem_134499)[sext_i32_i64(local_tid_134495 +\n                                                              offset_134518)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_134516 = x_134514 + x_134515;\n                    \n                    x_134514 = defunc_1_op_res_134516;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_134499)[sext_i32_i64(local_tid_134495)] =\n                        x_134514;\n                }\n            }\n            skip_waves_134519 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_134495) == (int64_t) 0) {\n                x_acc_134512 = x_134514;\n            }\n        }\n        if (groups_per_segment_134485 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_134495 == 0) {\n                    ((__global float *) mem_131325)[gtid_124505 * t_n_m_114591 +\n                                                    gtid_124506] = x_acc_134512;\n                }\n            }\n        } else {\n            int32_t old_counter_134520;\n            \n            // first thread in group saves group result to global memory\n",
                   "            {\n                if (local_tid_134495 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_134490)[sext_i32_i64(virt_group_id_134505)] =\n                        x_acc_134512;\n                    mem_fence_global();\n                    old_counter_134520 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_134492)[sext_i32_i64(srem32(flat_segment_id_134506,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_134501)[(int64_t) 0] =\n                        old_counter_134520 == groups_per_segment_134485 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_134521 = ((__local\n                                          bool *) sync_arr_mem_134501)[(int64_t) 0];\n            \n            if (is_last_group_134521) {\n                if (local_tid_134495 == 0) {\n                    old_counter_134520 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_134492)[sext_i32_i64(srem32(flat_segment_id_134506,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_134485));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_134522 =\n                            sdiv_up64(groups_per_segment_134485,\n                                      segred_group_sizze_124845);\n                    \n                    x_124",
                   "849 = 0.0F;\n                    for (int64_t i_134523 = 0; i_134523 <\n                         read_per_thread_134522; i_134523++) {\n                        int64_t group_res_id_134524 =\n                                sext_i32_i64(local_tid_134495) *\n                                read_per_thread_134522 + i_134523;\n                        int64_t index_of_group_res_134525 =\n                                sext_i32_i64(flat_segment_id_134506) *\n                                groups_per_segment_134485 + group_res_id_134524;\n                        \n                        if (slt64(group_res_id_134524,\n                                  groups_per_segment_134485)) {\n                            x_124850 = ((__global\n                                         float *) segred_tmp_mem_134490)[index_of_group_res_134525];\n                            \n                            float defunc_1_op_res_124851 = x_124849 + x_124850;\n                            \n                            x_124849 = defunc_1_op_res_124851;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_134499)[sext_i32_i64(local_tid_134495)] =\n                    x_124849;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_134526;\n                    int32_t skip_waves_134527 = 1;\n                    float x_134514;\n                    float x_134515;\n                    \n                    offset_134526 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_134495,\n                                  sext_i64_i32(segred_group_sizze_124845))) {\n                            x_134514 = ((__local\n                                         float *) red_arr_mem_134499)[sext_i32_i64(local_tid_134495 +\n                                                           ",
                   "           offset_134526)];\n                        }\n                    }\n                    offset_134526 = 1;\n                    while (slt32(offset_134526, wave_sizze_134497)) {\n                        if (slt32(local_tid_134495 + offset_134526,\n                                  sext_i64_i32(segred_group_sizze_124845)) &&\n                            ((local_tid_134495 - squot32(local_tid_134495,\n                                                         wave_sizze_134497) *\n                              wave_sizze_134497) & (2 * offset_134526 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_134515 = ((volatile __local\n                                             float *) red_arr_mem_134499)[sext_i32_i64(local_tid_134495 +\n                                                                          offset_134526)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_134516 = x_134514 +\n                                      x_134515;\n                                \n                                x_134514 = defunc_1_op_res_134516;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_134499)[sext_i32_i64(local_tid_134495)] =\n                                    x_134514;\n                            }\n                        }\n                        offset_134526 *= 2;\n                    }\n                    while (slt32(skip_waves_134527,\n                                 squot32(sext_i64_i32(segred_group_sizze_124845) +\n                                         wave_sizze_134497 - 1,\n                                         wave_sizze_134497))) {\n                        barrie",
                   "r(CLK_LOCAL_MEM_FENCE);\n                        offset_134526 = skip_waves_134527 * wave_sizze_134497;\n                        if (slt32(local_tid_134495 + offset_134526,\n                                  sext_i64_i32(segred_group_sizze_124845)) &&\n                            ((local_tid_134495 - squot32(local_tid_134495,\n                                                         wave_sizze_134497) *\n                              wave_sizze_134497) == 0 &&\n                             (squot32(local_tid_134495, wave_sizze_134497) &\n                              (2 * skip_waves_134527 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_134515 = ((__local\n                                             float *) red_arr_mem_134499)[sext_i32_i64(local_tid_134495 +\n                                                                          offset_134526)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_134516 = x_134514 +\n                                      x_134515;\n                                \n                                x_134514 = defunc_1_op_res_134516;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_134499)[sext_i32_i64(local_tid_134495)] =\n                                    x_134514;\n                            }\n                        }\n                        skip_waves_134527 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_134495 == 0) {\n                            ((__global float *) mem_131325)[gtid_124505 *\n                                                            t_n_m_114591 +\n           ",
                   "                                                 gtid_124506] =\n                                x_134514;\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_124845\n}\n__kernel void mainzisegred_large_124578(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_134423_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134421_backing_aligned_1,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t t_window_114537,\n                                        int64_t t_jump_114541,\n                                        int64_t t_n_m_114591, int64_t i_114610,\n                                        int64_t num_groups_124802,\n                                        int64_t groups_per_segment_134407,\n                                        int64_t elements_per_thread_134408,\n                                        int64_t virt_num_groups_134409,\n                                        int64_t threads_per_segment_134411,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130606,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130607,\n                                        __global unsigned char *mem_130861,\n                                        __global unsigned char *mem_131315,\n                                  ",
                   "      __global\n                                        unsigned char *segred_tmp_mem_134412,\n                                        __global\n                                        unsigned char *mainzicounter_mem_134414)\n{\n    #define segred_group_sizze_124801 (mainzisegred_group_sizze_124572)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict sync_arr_mem_134423_backing_1 =\n                          (__local volatile\n                           char *) sync_arr_mem_134423_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_134421_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_134421_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_134416;\n    int32_t local_tid_134417;\n    int64_t group_sizze_134420;\n    int32_t wave_sizze_134419;\n    int32_t group_tid_134418;\n    \n    global_tid_134416 = get_global_id(0);\n    local_tid_134417 = get_local_id(0);\n    group_sizze_134420 = get_local_size(0);\n    wave_sizze_134419 = LOCKSTEP_WIDTH;\n    group_tid_134418 = get_group_id(0);\n    \n    int32_t phys_tid_124578 = global_tid_134416;\n    __local char *red_arr_mem_134421;\n    \n    red_arr_mem_134421 = (__local char *) red_arr_mem_134421_backing_0;\n    \n    __local char *sync_arr_mem_134423;\n    \n    sync_arr_mem_134423 = (__local char *) sync_arr_mem_134423_backing_1;\n    \n    int32_t phys_group_id_134425;\n    \n    phys_group_id_134425 = get_group_id(0);\n    for (int32_t i_134426 = 0; i_134426 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_134409) - phys_group_id_134425,\n                   sext_i64_i32(num_groups_124802)); i_134426++) {\n        int32_t virt_group_id_134427 = phys_group_id_134425 + i_134426 *\n                sext_i64_i32(num_groups_124802);\n        int32_t flat_segment_id_134428 = squot32(virt_group_id_134427,\n                                                 sext_i",
                   "64_i32(groups_per_segment_134407));\n        int64_t global_tid_134429 = srem64(sext_i32_i64(virt_group_id_134427) *\n                                           segred_group_sizze_124801 +\n                                           sext_i32_i64(local_tid_134417),\n                                           segred_group_sizze_124801 *\n                                           groups_per_segment_134407);\n        int64_t slice_134430 = t_n_m_114591;\n        int64_t slice_134431 = m_114533 * slice_134430;\n        int64_t gtid_124567 = squot64(sext_i32_i64(flat_segment_id_134428),\n                                      slice_134430);\n        int64_t remnant_134432 = sext_i32_i64(flat_segment_id_134428) -\n                gtid_124567 * slice_134430;\n        int64_t gtid_124568 = remnant_134432;\n        int64_t remnant_134433 = remnant_134432 - gtid_124568;\n        int64_t gtid_124577;\n        float x_acc_134434;\n        int64_t chunk_sizze_134435 = smin64(elements_per_thread_134408,\n                                            sdiv_up64(t_window_114537 -\n                                                      global_tid_134429,\n                                                      threads_per_segment_134411));\n        float x_124805;\n        float x_124806;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_134434 = 0.0F;\n        }\n        for (int64_t i_134439 = 0; i_134439 < chunk_sizze_134435; i_134439++) {\n            gtid_124577 = global_tid_134429 + threads_per_segment_134411 *\n                i_134439;\n            // apply map function\n            {\n                int64_t x_124812 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_124567];\n                int64_t x_124814 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130606)[gtid_124567 *\n                                                                             t_n_m_114591 +\n                               ",
                   "                                              gtid_124568];\n                float x_124815 = ((__global\n                                   float *) defunc_3_map_res_mem_130607)[gtid_124567 *\n                                                                         t_n_m_114591 +\n                                                                         gtid_124568];\n                int64_t binop_y_128928 = mul64(t_jump_114541, gtid_124568);\n                int64_t convop_x_128929 = smin64(i_114610, binop_y_128928);\n                float index_primexp_128930 = sitofp_i64_f32(convop_x_128929);\n                bool cond_124818 = sle64(x_124812, gtid_124577);\n                float defunc_0_f_res_124819;\n                \n                if (cond_124818) {\n                    defunc_0_f_res_124819 = 0.0F;\n                } else {\n                    int64_t i_124820 = add64(gtid_124577, x_124814);\n                    float x_124821 = ((__global\n                                       float *) mem_130122)[gtid_124567 *\n                                                            n_114534 +\n                                                            i_124820];\n                    float defunc_0_f_res_f_res_124822 = 1.0F + x_124821;\n                    \n                    defunc_0_f_res_124819 = defunc_0_f_res_f_res_124822;\n                }\n                \n                float defunc_0_f_res_124823;\n                \n                if (cond_124818) {\n                    defunc_0_f_res_124823 = 0.0F;\n                } else {\n                    int64_t i_124824 = add64(gtid_124577, x_124814);\n                    float x_124825 = ((__global\n                                       float *) mem_130861)[gtid_124567 *\n                                                            n_114534 +\n                                                            i_124824];\n                    \n                    defunc_0_f_res_124823 = x_124825;\n                }\n                \n                f",
                   "loat x_j_124826 = defunc_0_f_res_124819 - index_primexp_128930;\n                float abs_res_124827 = (float) fabs(x_j_124826);\n                float tmp1_124828 = abs_res_124827 / x_124815;\n                float x_124829 = tmp1_124828 * tmp1_124828;\n                float y_124830 = tmp1_124828 * x_124829;\n                float tmp2_124831 = 1.0F - y_124830;\n                float x_124832 = tmp2_124831 * tmp2_124831;\n                float tmp3_124833 = tmp2_124831 * x_124832;\n                float w_j_124834 = defunc_0_f_res_124823 * tmp3_124833;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_124805 = x_acc_134434;\n                }\n                // load new values\n                {\n                    x_124806 = w_j_124834;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_124807 = x_124805 + x_124806;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_134434 = defunc_1_op_res_124807;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_124805 = x_acc_134434;\n            ((__local\n              float *) red_arr_mem_134421)[sext_i32_i64(local_tid_134417)] =\n                x_124805;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_134440;\n        int32_t skip_waves_134441 = 1;\n        float x_134436;\n        float x_134437;\n        \n        offset_134440 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_134417,\n                      sext_i64_i32(segred_group_sizze_124801))) {\n                x_134436 = ((__local\n                             float *) red_arr_mem_134421)[sext_i32_i64(local_tid_134417 +\n                                     ",
                   "                     offset_134440)];\n            }\n        }\n        offset_134440 = 1;\n        while (slt32(offset_134440, wave_sizze_134419)) {\n            if (slt32(local_tid_134417 + offset_134440,\n                      sext_i64_i32(segred_group_sizze_124801)) &&\n                ((local_tid_134417 - squot32(local_tid_134417,\n                                             wave_sizze_134419) *\n                  wave_sizze_134419) & (2 * offset_134440 - 1)) == 0) {\n                // read array element\n                {\n                    x_134437 = ((volatile __local\n                                 float *) red_arr_mem_134421)[sext_i32_i64(local_tid_134417 +\n                                                              offset_134440)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_134438 = x_134436 + x_134437;\n                    \n                    x_134436 = defunc_1_op_res_134438;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_134421)[sext_i32_i64(local_tid_134417)] =\n                        x_134436;\n                }\n            }\n            offset_134440 *= 2;\n        }\n        while (slt32(skip_waves_134441,\n                     squot32(sext_i64_i32(segred_group_sizze_124801) +\n                             wave_sizze_134419 - 1, wave_sizze_134419))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_134440 = skip_waves_134441 * wave_sizze_134419;\n            if (slt32(local_tid_134417 + offset_134440,\n                      sext_i64_i32(segred_group_sizze_124801)) &&\n                ((local_tid_134417 - squot32(local_tid_134417,\n                                             wave_sizze_134419) *\n                  wave_sizze_134419) == 0 && (squot32(local_tid_134417,\n                                                      wave_sizze_134419) & (2 *\n           ",
                   "                                                                 skip_waves_134441 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_134437 = ((__local\n                                 float *) red_arr_mem_134421)[sext_i32_i64(local_tid_134417 +\n                                                              offset_134440)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_134438 = x_134436 + x_134437;\n                    \n                    x_134436 = defunc_1_op_res_134438;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_134421)[sext_i32_i64(local_tid_134417)] =\n                        x_134436;\n                }\n            }\n            skip_waves_134441 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_134417) == (int64_t) 0) {\n                x_acc_134434 = x_134436;\n            }\n        }\n        if (groups_per_segment_134407 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_134417 == 0) {\n                    ((__global float *) mem_131315)[gtid_124567 * t_n_m_114591 +\n                                                    gtid_124568] = x_acc_134434;\n                }\n            }\n        } else {\n            int32_t old_counter_134442;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_134417 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_134412)[sext_i32_i64(virt_group_id_134427)] =\n                        x_acc_134434;\n                    mem_fence_",
                   "global();\n                    old_counter_134442 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_134414)[sext_i32_i64(srem32(flat_segment_id_134428,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_134423)[(int64_t) 0] =\n                        old_counter_134442 == groups_per_segment_134407 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_134443 = ((__local\n                                          bool *) sync_arr_mem_134423)[(int64_t) 0];\n            \n            if (is_last_group_134443) {\n                if (local_tid_134417 == 0) {\n                    old_counter_134442 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_134414)[sext_i32_i64(srem32(flat_segment_id_134428,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_134407));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_134444 =\n                            sdiv_up64(groups_per_segment_134407,\n                                      segred_group_sizze_124801);\n                    \n                    x_124805 = 0.0F;\n                    for (int64_t i_134445 = 0; i_134445 <\n                         read_per_thread_134444; i_134445++) {\n                        int64_t group_res_id_134446 =\n                                sext_i32_i64(local_tid_134417) ",
                   "*\n                                read_per_thread_134444 + i_134445;\n                        int64_t index_of_group_res_134447 =\n                                sext_i32_i64(flat_segment_id_134428) *\n                                groups_per_segment_134407 + group_res_id_134446;\n                        \n                        if (slt64(group_res_id_134446,\n                                  groups_per_segment_134407)) {\n                            x_124806 = ((__global\n                                         float *) segred_tmp_mem_134412)[index_of_group_res_134447];\n                            \n                            float defunc_1_op_res_124807 = x_124805 + x_124806;\n                            \n                            x_124805 = defunc_1_op_res_124807;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_134421)[sext_i32_i64(local_tid_134417)] =\n                    x_124805;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_134448;\n                    int32_t skip_waves_134449 = 1;\n                    float x_134436;\n                    float x_134437;\n                    \n                    offset_134448 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_134417,\n                                  sext_i64_i32(segred_group_sizze_124801))) {\n                            x_134436 = ((__local\n                                         float *) red_arr_mem_134421)[sext_i32_i64(local_tid_134417 +\n                                                                      offset_134448)];\n                        }\n                    }\n                    offset_134448 = 1;\n                    while (slt32(offset_134448, wave_sizze_134419)) {\n                        if (slt32(local_tid_134417 + offset_13444",
                   "8,\n                                  sext_i64_i32(segred_group_sizze_124801)) &&\n                            ((local_tid_134417 - squot32(local_tid_134417,\n                                                         wave_sizze_134419) *\n                              wave_sizze_134419) & (2 * offset_134448 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_134437 = ((volatile __local\n                                             float *) red_arr_mem_134421)[sext_i32_i64(local_tid_134417 +\n                                                                          offset_134448)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_134438 = x_134436 +\n                                      x_134437;\n                                \n                                x_134436 = defunc_1_op_res_134438;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_134421)[sext_i32_i64(local_tid_134417)] =\n                                    x_134436;\n                            }\n                        }\n                        offset_134448 *= 2;\n                    }\n                    while (slt32(skip_waves_134449,\n                                 squot32(sext_i64_i32(segred_group_sizze_124801) +\n                                         wave_sizze_134419 - 1,\n                                         wave_sizze_134419))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_134448 = skip_waves_134449 * wave_sizze_134419;\n                        if (slt32(local_tid_134417 + offset_134448,\n                                  sext_i64_i32(segred_group_sizze_124801)) &&\n ",
                   "                           ((local_tid_134417 - squot32(local_tid_134417,\n                                                         wave_sizze_134419) *\n                              wave_sizze_134419) == 0 &&\n                             (squot32(local_tid_134417, wave_sizze_134419) &\n                              (2 * skip_waves_134449 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_134437 = ((__local\n                                             float *) red_arr_mem_134421)[sext_i32_i64(local_tid_134417 +\n                                                                          offset_134448)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_134438 = x_134436 +\n                                      x_134437;\n                                \n                                x_134436 = defunc_1_op_res_134438;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_134421)[sext_i32_i64(local_tid_134417)] =\n                                    x_134436;\n                            }\n                        }\n                        skip_waves_134449 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_134417 == 0) {\n                            ((__global float *) mem_131315)[gtid_124567 *\n                                                            t_n_m_114591 +\n                                                            gtid_124568] =\n                                x_134436;\n                        }\n                    }\n                }\n            }\n        }\n        barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_F",
                   "ENCE);\n    }\n    \n  error_1:\n    return;\n    #undef segred_group_sizze_124801\n}\n__kernel void mainzisegred_large_125209(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_134722_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134720_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134718_backing_aligned_2,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t t_window_114537,\n                                        int64_t t_jump_114541,\n                                        int64_t t_n_m_114591, int64_t i_114610,\n                                        int64_t num_groups_125662,\n                                        int64_t groups_per_segment_134702,\n                                        int64_t elements_per_thread_134703,\n                                        int64_t virt_num_groups_134704,\n                                        int64_t threads_per_segment_134706,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130606,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130607,\n                                        __global unsigned char *mem_130861,\n                                        __global\n                                        unsigned char *defunc_4_map_res_mem_131267,\n                                        __global unsigned char *mem_131411,\n       ",
                   "                                 __global unsigned char *mem_131415,\n                                        __global unsigned char *mem_131419,\n                                        __global unsigned char *mem_131424,\n                                        __global unsigned char *mem_131428,\n                                        __global\n                                        unsigned char *segred_tmp_mem_134707,\n                                        __global\n                                        unsigned char *segred_tmp_mem_134709,\n                                        __global\n                                        unsigned char *mainzicounter_mem_134711)\n{\n    #define segred_group_sizze_125661 (mainzisegred_group_sizze_125203)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict sync_arr_mem_134722_backing_2 =\n                          (__local volatile\n                           char *) sync_arr_mem_134722_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_134720_backing_1 =\n                          (__local volatile\n                           char *) red_arr_mem_134720_backing_aligned_1;\n    __local volatile char *restrict red_arr_mem_134718_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_134718_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_134713;\n    int32_t local_tid_134714;\n    int64_t group_sizze_134717;\n    int32_t wave_sizze_134716;\n    int32_t group_tid_134715;\n    \n    global_tid_134713 = get_global_id(0);\n    local_tid_134714 = get_local_id(0);\n    group_sizze_134717 = get_local_size(0);\n    wave_sizze_134716 = LOCKSTEP_WIDTH;\n    group_tid_134715 = get_group_id(0);\n    \n    int32_t phys_tid_125209 = global_tid_134713;\n    __local char *red_arr_mem_134718;\n    \n    red_arr_mem_134718 = (__local char *) red_arr_mem_134718_backing_0;\n    \n ",
                   "   __local char *red_arr_mem_134720;\n    \n    red_arr_mem_134720 = (__local char *) red_arr_mem_134720_backing_1;\n    \n    __local char *sync_arr_mem_134722;\n    \n    sync_arr_mem_134722 = (__local char *) sync_arr_mem_134722_backing_2;\n    \n    int32_t phys_group_id_134724;\n    \n    phys_group_id_134724 = get_group_id(0);\n    for (int32_t i_134725 = 0; i_134725 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_134704) - phys_group_id_134724,\n                   sext_i64_i32(num_groups_125662)); i_134725++) {\n        int32_t virt_group_id_134726 = phys_group_id_134724 + i_134725 *\n                sext_i64_i32(num_groups_125662);\n        int32_t flat_segment_id_134727 = squot32(virt_group_id_134726,\n                                                 sext_i64_i32(groups_per_segment_134702));\n        int64_t global_tid_134728 = srem64(sext_i32_i64(virt_group_id_134726) *\n                                           segred_group_sizze_125661 +\n                                           sext_i32_i64(local_tid_134714),\n                                           segred_group_sizze_125661 *\n                                           groups_per_segment_134702);\n        int64_t slice_134729 = t_n_m_114591;\n        int64_t slice_134730 = m_114533 * slice_134729;\n        int64_t gtid_125198 = squot64(sext_i32_i64(flat_segment_id_134727),\n                                      slice_134729);\n        int64_t remnant_134731 = sext_i32_i64(flat_segment_id_134727) -\n                gtid_125198 * slice_134729;\n        int64_t gtid_125199 = remnant_134731;\n        int64_t remnant_134732 = remnant_134731 - gtid_125199;\n        int64_t gtid_125208;\n        float x_acc_134733;\n        float x_acc_134734;\n        int64_t chunk_sizze_134735 = smin64(elements_per_thread_134703,\n                                            sdiv_up64(t_window_114537 -\n                                                      global_tid_134728,\n                                                      threads_per_segment_134",
                   "706));\n        float x_125666;\n        float x_125667;\n        float x_125668;\n        float x_125669;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_134733 = 0.0F;\n            x_acc_134734 = 0.0F;\n        }\n        for (int64_t i_134742 = 0; i_134742 < chunk_sizze_134735; i_134742++) {\n            gtid_125208 = global_tid_134728 + threads_per_segment_134706 *\n                i_134742;\n            // apply map function\n            {\n                int64_t x_125677 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_125198];\n                int64_t x_125682 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130606)[gtid_125198 *\n                                                                             t_n_m_114591 +\n                                                                             gtid_125199];\n                float x_125683 = ((__global\n                                   float *) defunc_3_map_res_mem_130607)[gtid_125198 *\n                                                                         t_n_m_114591 +\n                                                                         gtid_125199];\n                int64_t binop_y_128967 = mul64(t_jump_114541, gtid_125199);\n                int64_t convop_x_128968 = smin64(i_114610, binop_y_128967);\n                float index_primexp_128969 = sitofp_i64_f32(convop_x_128968);\n                float a11_125685 = ((__global float *) mem_131411)[gtid_125198 *\n                                                                   t_n_m_114591 +\n                                                                   gtid_125199];\n                float b11_125686 = ((__global float *) mem_131415)[gtid_125198 *\n                                                                   t_n_m_114591 +\n                                                                   gtid_125199];\n                float c11_125687 = ((__global",
                   " float *) mem_131419)[gtid_125198 *\n                                                                   t_n_m_114591 +\n                                                                   gtid_125199];\n                bool cond_125689 = sle64(x_125677, gtid_125208);\n                float defunc_0_f_res_125690;\n                \n                if (cond_125689) {\n                    defunc_0_f_res_125690 = 0.0F;\n                } else {\n                    int64_t i_125691 = add64(gtid_125208, x_125682);\n                    float x_125692 = ((__global\n                                       float *) mem_130122)[gtid_125198 *\n                                                            n_114534 +\n                                                            i_125691];\n                    float defunc_0_f_res_f_res_125693 = 1.0F + x_125692;\n                    \n                    defunc_0_f_res_125690 = defunc_0_f_res_f_res_125693;\n                }\n                \n                float defunc_0_f_res_125694;\n                \n                if (cond_125689) {\n                    defunc_0_f_res_125694 = 0.0F;\n                } else {\n                    int64_t i_125695 = add64(gtid_125208, x_125682);\n                    float x_125696 = ((__global\n                                       float *) mem_130861)[gtid_125198 *\n                                                            n_114534 +\n                                                            i_125695];\n                    \n                    defunc_0_f_res_125694 = x_125696;\n                }\n                \n                float x_j_125697 = defunc_0_f_res_125690 - index_primexp_128969;\n                float abs_res_125698 = (float) fabs(x_j_125697);\n                float tmp1_125699 = abs_res_125698 / x_125683;\n                float x_125700 = tmp1_125699 * tmp1_125699;\n                float y_125701 = tmp1_125699 * x_125700;\n                float tmp2_125702 = 1.0F - y_125701;\n                float x_125703 = tm",
                   "p2_125702 * tmp2_125702;\n                float tmp3_125704 = tmp2_125702 * x_125703;\n                float tmp4_125705 = defunc_0_f_res_125694 * tmp3_125704;\n                float defunc_1_f_res_125706 = x_j_125697 * tmp4_125705;\n                float defunc_0_f_res_125707;\n                \n                if (cond_125689) {\n                    defunc_0_f_res_125707 = 0.0F;\n                } else {\n                    int64_t i_125708 = add64(gtid_125208, x_125682);\n                    float x_125709 = ((__global\n                                       float *) defunc_4_map_res_mem_131267)[gtid_125198 *\n                                                                             n_114534 +\n                                                                             i_125708];\n                    \n                    defunc_0_f_res_125707 = x_125709;\n                }\n                \n                float x_125710 = a11_125685 * tmp4_125705;\n                float y_125711 = b11_125686 * defunc_1_f_res_125706;\n                float x_125712 = x_125710 + y_125711;\n                float defunc_9_fit_fun_res_125713 = defunc_0_f_res_125707 *\n                      x_125712;\n                float x_125714 = b11_125686 * tmp4_125705;\n                float y_125715 = c11_125687 * defunc_1_f_res_125706;\n                float x_125716 = x_125714 + y_125715;\n                float defunc_9_slope_fun_res_125717 = defunc_0_f_res_125707 *\n                      x_125716;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_125666 = x_acc_134733;\n                    x_125667 = x_acc_134734;\n                }\n                // load new values\n                {\n                    x_125668 = defunc_9_fit_fun_res_125713;\n                    x_125669 = defunc_9_slope_fun_res_125717;\n                }\n                // apply reduction operator\n                {\n                    float de",
                   "func_1_op_res_125670 = x_125666 + x_125668;\n                    float defunc_1_op_res_125671 = x_125667 + x_125669;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_134733 = defunc_1_op_res_125670;\n                        x_acc_134734 = defunc_1_op_res_125671;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_125666 = x_acc_134733;\n            x_125667 = x_acc_134734;\n            ((__local\n              float *) red_arr_mem_134718)[sext_i32_i64(local_tid_134714)] =\n                x_125666;\n            ((__local\n              float *) red_arr_mem_134720)[sext_i32_i64(local_tid_134714)] =\n                x_125667;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_134743;\n        int32_t skip_waves_134744 = 1;\n        float x_134736;\n        float x_134737;\n        float x_134738;\n        float x_134739;\n        \n        offset_134743 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_134714,\n                      sext_i64_i32(segred_group_sizze_125661))) {\n                x_134736 = ((__local\n                             float *) red_arr_mem_134718)[sext_i32_i64(local_tid_134714 +\n                                                          offset_134743)];\n                x_134737 = ((__local\n                             float *) red_arr_mem_134720)[sext_i32_i64(local_tid_134714 +\n                                                          offset_134743)];\n            }\n        }\n        offset_134743 = 1;\n        while (slt32(offset_134743, wave_sizze_134716)) {\n            if (slt32(local_tid_134714 + offset_134743,\n                      sext_i64_i32(segred_group_sizze_125661)) &&\n                ((local_tid_134714 - squot32(local_tid_134714,\n                                             wave_sizze_134716) *\n       ",
                   "           wave_sizze_134716) & (2 * offset_134743 - 1)) == 0) {\n                // read array element\n                {\n                    x_134738 = ((volatile __local\n                                 float *) red_arr_mem_134718)[sext_i32_i64(local_tid_134714 +\n                                                              offset_134743)];\n                    x_134739 = ((volatile __local\n                                 float *) red_arr_mem_134720)[sext_i32_i64(local_tid_134714 +\n                                                              offset_134743)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_134740 = x_134736 + x_134738;\n                    float defunc_1_op_res_134741 = x_134737 + x_134739;\n                    \n                    x_134736 = defunc_1_op_res_134740;\n                    x_134737 = defunc_1_op_res_134741;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_134718)[sext_i32_i64(local_tid_134714)] =\n                        x_134736;\n                    ((volatile __local\n                      float *) red_arr_mem_134720)[sext_i32_i64(local_tid_134714)] =\n                        x_134737;\n                }\n            }\n            offset_134743 *= 2;\n        }\n        while (slt32(skip_waves_134744,\n                     squot32(sext_i64_i32(segred_group_sizze_125661) +\n                             wave_sizze_134716 - 1, wave_sizze_134716))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_134743 = skip_waves_134744 * wave_sizze_134716;\n            if (slt32(local_tid_134714 + offset_134743,\n                      sext_i64_i32(segred_group_sizze_125661)) &&\n                ((local_tid_134714 - squot32(local_tid_134714,\n                                             wave_sizze_134716) *\n                  wave_sizze_134716) == 0 && (squot32(local_",
                   "tid_134714,\n                                                      wave_sizze_134716) & (2 *\n                                                                            skip_waves_134744 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_134738 = ((__local\n                                 float *) red_arr_mem_134718)[sext_i32_i64(local_tid_134714 +\n                                                              offset_134743)];\n                    x_134739 = ((__local\n                                 float *) red_arr_mem_134720)[sext_i32_i64(local_tid_134714 +\n                                                              offset_134743)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_134740 = x_134736 + x_134738;\n                    float defunc_1_op_res_134741 = x_134737 + x_134739;\n                    \n                    x_134736 = defunc_1_op_res_134740;\n                    x_134737 = defunc_1_op_res_134741;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_134718)[sext_i32_i64(local_tid_134714)] =\n                        x_134736;\n                    ((__local\n                      float *) red_arr_mem_134720)[sext_i32_i64(local_tid_134714)] =\n                        x_134737;\n                }\n            }\n            skip_waves_134744 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_134714) == (int64_t) 0) {\n                x_acc_134733 = x_134736;\n                x_acc_134734 = x_134737;\n            }\n        }\n        if (groups_per_segment_134702 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            ",
                   "{\n                if (local_tid_134714 == 0) {\n                    ((__global float *) mem_131424)[gtid_125198 * t_n_m_114591 +\n                                                    gtid_125199] = x_acc_134733;\n                    ((__global float *) mem_131428)[gtid_125198 * t_n_m_114591 +\n                                                    gtid_125199] = x_acc_134734;\n                }\n            }\n        } else {\n            int32_t old_counter_134745;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_134714 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_134707)[sext_i32_i64(virt_group_id_134726)] =\n                        x_acc_134733;\n                    ((__global\n                      float *) segred_tmp_mem_134709)[sext_i32_i64(virt_group_id_134726)] =\n                        x_acc_134734;\n                    mem_fence_global();\n                    old_counter_134745 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_134711)[sext_i32_i64(srem32(flat_segment_id_134727,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_134722)[(int64_t) 0] =\n                        old_counter_134745 == groups_per_segment_134702 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_134746 = ((__local\n                                          bool *) sync_arr_mem_134722)[(int64_t) 0];\n            \n            if (is_last_group_134746) {\n                if (local_tid_134714 == 0) {\n                    old_counter_134745 =\n                        atomic_add_i32_global(&((volatile __gl",
                   "obal\n                                                 int *) mainzicounter_mem_134711)[sext_i32_i64(srem32(flat_segment_id_134727,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_134702));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_134747 =\n                            sdiv_up64(groups_per_segment_134702,\n                                      segred_group_sizze_125661);\n                    \n                    x_125666 = 0.0F;\n                    x_125667 = 0.0F;\n                    for (int64_t i_134748 = 0; i_134748 <\n                         read_per_thread_134747; i_134748++) {\n                        int64_t group_res_id_134749 =\n                                sext_i32_i64(local_tid_134714) *\n                                read_per_thread_134747 + i_134748;\n                        int64_t index_of_group_res_134750 =\n                                sext_i32_i64(flat_segment_id_134727) *\n                                groups_per_segment_134702 + group_res_id_134749;\n                        \n                        if (slt64(group_res_id_134749,\n                                  groups_per_segment_134702)) {\n                            x_125668 = ((__global\n                                         float *) segred_tmp_mem_134707)[index_of_group_res_134750];\n                            x_125669 = ((__global\n                                         float *) segred_tmp_mem_134709)[index_of_group_res_134750];\n                            \n                            float defunc_1_op_res_125670 = x_125666 + x_125668;\n                            float defunc_1_op_res_125671 = x_125667 + x_125669;\n                            \n                            x_125666 = defunc_1_op_res_125670",
                   ";\n                            x_125667 = defunc_1_op_res_125671;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_134718)[sext_i32_i64(local_tid_134714)] =\n                    x_125666;\n                ((__local\n                  float *) red_arr_mem_134720)[sext_i32_i64(local_tid_134714)] =\n                    x_125667;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_134751;\n                    int32_t skip_waves_134752 = 1;\n                    float x_134736;\n                    float x_134737;\n                    float x_134738;\n                    float x_134739;\n                    \n                    offset_134751 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_134714,\n                                  sext_i64_i32(segred_group_sizze_125661))) {\n                            x_134736 = ((__local\n                                         float *) red_arr_mem_134718)[sext_i32_i64(local_tid_134714 +\n                                                                      offset_134751)];\n                            x_134737 = ((__local\n                                         float *) red_arr_mem_134720)[sext_i32_i64(local_tid_134714 +\n                                                                      offset_134751)];\n                        }\n                    }\n                    offset_134751 = 1;\n                    while (slt32(offset_134751, wave_sizze_134716)) {\n                        if (slt32(local_tid_134714 + offset_134751,\n                                  sext_i64_i32(segred_group_sizze_125661)) &&\n                            ((local_tid_134714 - squot32(local_tid_134714,\n                                                         wave_sizze_134716) *\n                              w",
                   "ave_sizze_134716) & (2 * offset_134751 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_134738 = ((volatile __local\n                                             float *) red_arr_mem_134718)[sext_i32_i64(local_tid_134714 +\n                                                                          offset_134751)];\n                                x_134739 = ((volatile __local\n                                             float *) red_arr_mem_134720)[sext_i32_i64(local_tid_134714 +\n                                                                          offset_134751)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_134740 = x_134736 +\n                                      x_134738;\n                                float defunc_1_op_res_134741 = x_134737 +\n                                      x_134739;\n                                \n                                x_134736 = defunc_1_op_res_134740;\n                                x_134737 = defunc_1_op_res_134741;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_134718)[sext_i32_i64(local_tid_134714)] =\n                                    x_134736;\n                                ((volatile __local\n                                  float *) red_arr_mem_134720)[sext_i32_i64(local_tid_134714)] =\n                                    x_134737;\n                            }\n                        }\n                        offset_134751 *= 2;\n                    }\n                    while (slt32(skip_waves_134752,\n                                 squot32(sext_i64_i32(segred_group_sizze_125661) +\n                               ",
                   "          wave_sizze_134716 - 1,\n                                         wave_sizze_134716))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_134751 = skip_waves_134752 * wave_sizze_134716;\n                        if (slt32(local_tid_134714 + offset_134751,\n                                  sext_i64_i32(segred_group_sizze_125661)) &&\n                            ((local_tid_134714 - squot32(local_tid_134714,\n                                                         wave_sizze_134716) *\n                              wave_sizze_134716) == 0 &&\n                             (squot32(local_tid_134714, wave_sizze_134716) &\n                              (2 * skip_waves_134752 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_134738 = ((__local\n                                             float *) red_arr_mem_134718)[sext_i32_i64(local_tid_134714 +\n                                                                          offset_134751)];\n                                x_134739 = ((__local\n                                             float *) red_arr_mem_134720)[sext_i32_i64(local_tid_134714 +\n                                                                          offset_134751)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_134740 = x_134736 +\n                                      x_134738;\n                                float defunc_1_op_res_134741 = x_134737 +\n                                      x_134739;\n                                \n                                x_134736 = defunc_1_op_res_134740;\n                                x_134737 = defunc_1_op_res_134741;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n  ",
                   "                                float *) red_arr_mem_134718)[sext_i32_i64(local_tid_134714)] =\n                                    x_134736;\n                                ((__local\n                                  float *) red_arr_mem_134720)[sext_i32_i64(local_tid_134714)] =\n                                    x_134737;\n                            }\n                        }\n                        skip_waves_134752 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_134714 == 0) {\n                            ((__global float *) mem_131424)[gtid_125198 *\n                                                            t_n_m_114591 +\n                                                            gtid_125199] =\n                                x_134736;\n                            ((__global float *) mem_131428)[gtid_125198 *\n                                                            t_n_m_114591 +\n                                                            gtid_125199] =\n                                x_134737;\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_125661\n}\n__kernel void mainzisegred_large_125298(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_134627_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134625_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134623_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134621_backing_aligned_3,\n      ",
                   "                                  int64_t m_114533, int64_t n_114534,\n                                        int64_t t_window_114537,\n                                        int64_t t_jump_114541,\n                                        int64_t t_n_m_114591, int64_t i_114610,\n                                        int64_t num_groups_125597,\n                                        int64_t groups_per_segment_134603,\n                                        int64_t elements_per_thread_134604,\n                                        int64_t virt_num_groups_134605,\n                                        int64_t threads_per_segment_134607,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130606,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130607,\n                                        __global unsigned char *mem_130861,\n                                        __global unsigned char *mem_131398,\n                                        __global unsigned char *mem_131402,\n                                        __global unsigned char *mem_131406,\n                                        __global\n                                        unsigned char *segred_tmp_mem_134608,\n                                        __global\n                                        unsigned char *segred_tmp_mem_134610,\n                                        __global\n                                        unsigned char *segred_tmp_mem_134612,\n                                        __global\n                                        unsigned char *mainzicounter_mem_134614)\n{\n    #define segred_group_sizze_125596 (mainzisegred_group_sizze_",
                   "125292)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict sync_arr_mem_134627_backing_3 =\n                          (__local volatile\n                           char *) sync_arr_mem_134627_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_134625_backing_2 =\n                          (__local volatile\n                           char *) red_arr_mem_134625_backing_aligned_1;\n    __local volatile char *restrict red_arr_mem_134623_backing_1 =\n                          (__local volatile\n                           char *) red_arr_mem_134623_backing_aligned_2;\n    __local volatile char *restrict red_arr_mem_134621_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_134621_backing_aligned_3;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_134616;\n    int32_t local_tid_134617;\n    int64_t group_sizze_134620;\n    int32_t wave_sizze_134619;\n    int32_t group_tid_134618;\n    \n    global_tid_134616 = get_global_id(0);\n    local_tid_134617 = get_local_id(0);\n    group_sizze_134620 = get_local_size(0);\n    wave_sizze_134619 = LOCKSTEP_WIDTH;\n    group_tid_134618 = get_group_id(0);\n    \n    int32_t phys_tid_125298 = global_tid_134616;\n    __local char *red_arr_mem_134621;\n    \n    red_arr_mem_134621 = (__local char *) red_arr_mem_134621_backing_0;\n    \n    __local char *red_arr_mem_134623;\n    \n    red_arr_mem_134623 = (__local char *) red_arr_mem_134623_backing_1;\n    \n    __local char *red_arr_mem_134625;\n    \n    red_arr_mem_134625 = (__local char *) red_arr_mem_134625_backing_2;\n    \n    __local char *sync_arr_mem_134627;\n    \n    sync_arr_mem_134627 = (__local char *) sync_arr_mem_134627_backing_3;\n    \n    int32_t phys_group_id_134629;\n    \n    phys_group_id_134629 = get_group_id(0);\n    for (int32_t i_134630 = 0; i_134630 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_134605) - phys_group_id_1346",
                   "29,\n                   sext_i64_i32(num_groups_125597)); i_134630++) {\n        int32_t virt_group_id_134631 = phys_group_id_134629 + i_134630 *\n                sext_i64_i32(num_groups_125597);\n        int32_t flat_segment_id_134632 = squot32(virt_group_id_134631,\n                                                 sext_i64_i32(groups_per_segment_134603));\n        int64_t global_tid_134633 = srem64(sext_i32_i64(virt_group_id_134631) *\n                                           segred_group_sizze_125596 +\n                                           sext_i32_i64(local_tid_134617),\n                                           segred_group_sizze_125596 *\n                                           groups_per_segment_134603);\n        int64_t slice_134634 = t_n_m_114591;\n        int64_t slice_134635 = m_114533 * slice_134634;\n        int64_t gtid_125287 = squot64(sext_i32_i64(flat_segment_id_134632),\n                                      slice_134634);\n        int64_t remnant_134636 = sext_i32_i64(flat_segment_id_134632) -\n                gtid_125287 * slice_134634;\n        int64_t gtid_125288 = remnant_134636;\n        int64_t remnant_134637 = remnant_134636 - gtid_125288;\n        int64_t gtid_125297;\n        float x_acc_134638;\n        float x_acc_134639;\n        float x_acc_134640;\n        int64_t chunk_sizze_134641 = smin64(elements_per_thread_134604,\n                                            sdiv_up64(t_window_114537 -\n                                                      global_tid_134633,\n                                                      threads_per_segment_134607));\n        float x_125602;\n        float x_125603;\n        float x_125604;\n        float x_125605;\n        float x_125606;\n        float x_125607;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_134638 = 0.0F;\n            x_acc_134639 = 0.0F;\n            x_acc_134640 = 0.0F;\n        }\n        for (int64_t i_134651 = 0; i_134651 < chunk_sizze_134641; i_134651++) {\n         ",
                   "   gtid_125297 = global_tid_134633 + threads_per_segment_134607 *\n                i_134651;\n            // apply map function\n            {\n                int64_t x_125615 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_125287];\n                int64_t x_125617 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130606)[gtid_125287 *\n                                                                             t_n_m_114591 +\n                                                                             gtid_125288];\n                float x_125618 = ((__global\n                                   float *) defunc_3_map_res_mem_130607)[gtid_125287 *\n                                                                         t_n_m_114591 +\n                                                                         gtid_125288];\n                int64_t binop_y_128960 = mul64(t_jump_114541, gtid_125288);\n                int64_t convop_x_128961 = smin64(i_114610, binop_y_128960);\n                float index_primexp_128962 = sitofp_i64_f32(convop_x_128961);\n                bool cond_125621 = sle64(x_125615, gtid_125297);\n                float defunc_0_f_res_125622;\n                \n                if (cond_125621) {\n                    defunc_0_f_res_125622 = 0.0F;\n                } else {\n                    int64_t i_125623 = add64(gtid_125297, x_125617);\n                    float x_125624 = ((__global\n                                       float *) mem_130122)[gtid_125287 *\n                                                            n_114534 +\n                                                            i_125623];\n                    float defunc_0_f_res_f_res_125625 = 1.0F + x_125624;\n                    \n                    defunc_0_f_res_125622 = defunc_0_f_res_f_res_125625;\n                }\n                \n                float defunc_0_f_res_125626;\n                \n                if (cond_125621) ",
                   "{\n                    defunc_0_f_res_125626 = 0.0F;\n                } else {\n                    int64_t i_125627 = add64(gtid_125297, x_125617);\n                    float x_125628 = ((__global\n                                       float *) mem_130861)[gtid_125287 *\n                                                            n_114534 +\n                                                            i_125627];\n                    \n                    defunc_0_f_res_125626 = x_125628;\n                }\n                \n                float x_j_125629 = defunc_0_f_res_125622 - index_primexp_128962;\n                float abs_res_125630 = (float) fabs(x_j_125629);\n                float tmp1_125631 = abs_res_125630 / x_125618;\n                float x_125632 = tmp1_125631 * tmp1_125631;\n                float y_125633 = tmp1_125631 * x_125632;\n                float tmp2_125634 = 1.0F - y_125633;\n                float x_125635 = tmp2_125634 * tmp2_125634;\n                float tmp3_125636 = tmp2_125634 * x_125635;\n                float w_j_125637 = defunc_0_f_res_125626 * tmp3_125636;\n                float xw_j_125638 = x_j_125629 * w_j_125637;\n                float x2w_j_125639 = x_j_125629 * xw_j_125638;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_125602 = x_acc_134638;\n                    x_125603 = x_acc_134639;\n                    x_125604 = x_acc_134640;\n                }\n                // load new values\n                {\n                    x_125605 = w_j_125637;\n                    x_125606 = xw_j_125638;\n                    x_125607 = x2w_j_125639;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_125608 = x_125602 + x_125605;\n                    float defunc_1_op_res_125609 = x_125603 + x_125606;\n                    float defunc_1_op_res_125610 = x_125604 + x_125607;\n                    ",
                   "\n                    // store in accumulator\n                    {\n                        x_acc_134638 = defunc_1_op_res_125608;\n                        x_acc_134639 = defunc_1_op_res_125609;\n                        x_acc_134640 = defunc_1_op_res_125610;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_125602 = x_acc_134638;\n            x_125603 = x_acc_134639;\n            x_125604 = x_acc_134640;\n            ((__local\n              float *) red_arr_mem_134621)[sext_i32_i64(local_tid_134617)] =\n                x_125602;\n            ((__local\n              float *) red_arr_mem_134623)[sext_i32_i64(local_tid_134617)] =\n                x_125603;\n            ((__local\n              float *) red_arr_mem_134625)[sext_i32_i64(local_tid_134617)] =\n                x_125604;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_134652;\n        int32_t skip_waves_134653 = 1;\n        float x_134642;\n        float x_134643;\n        float x_134644;\n        float x_134645;\n        float x_134646;\n        float x_134647;\n        \n        offset_134652 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_134617,\n                      sext_i64_i32(segred_group_sizze_125596))) {\n                x_134642 = ((__local\n                             float *) red_arr_mem_134621)[sext_i32_i64(local_tid_134617 +\n                                                          offset_134652)];\n                x_134643 = ((__local\n                             float *) red_arr_mem_134623)[sext_i32_i64(local_tid_134617 +\n                                                          offset_134652)];\n                x_134644 = ((__local\n                             float *) red_arr_mem_134625)[sext_i32_i64(local_tid_134617 +\n                                                          offset_134652)];\n            }\n        }\n    ",
                   "    offset_134652 = 1;\n        while (slt32(offset_134652, wave_sizze_134619)) {\n            if (slt32(local_tid_134617 + offset_134652,\n                      sext_i64_i32(segred_group_sizze_125596)) &&\n                ((local_tid_134617 - squot32(local_tid_134617,\n                                             wave_sizze_134619) *\n                  wave_sizze_134619) & (2 * offset_134652 - 1)) == 0) {\n                // read array element\n                {\n                    x_134645 = ((volatile __local\n                                 float *) red_arr_mem_134621)[sext_i32_i64(local_tid_134617 +\n                                                              offset_134652)];\n                    x_134646 = ((volatile __local\n                                 float *) red_arr_mem_134623)[sext_i32_i64(local_tid_134617 +\n                                                              offset_134652)];\n                    x_134647 = ((volatile __local\n                                 float *) red_arr_mem_134625)[sext_i32_i64(local_tid_134617 +\n                                                              offset_134652)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_134648 = x_134642 + x_134645;\n                    float defunc_1_op_res_134649 = x_134643 + x_134646;\n                    float defunc_1_op_res_134650 = x_134644 + x_134647;\n                    \n                    x_134642 = defunc_1_op_res_134648;\n                    x_134643 = defunc_1_op_res_134649;\n                    x_134644 = defunc_1_op_res_134650;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_134621)[sext_i32_i64(local_tid_134617)] =\n                        x_134642;\n                    ((volatile __local\n                      float *) red_arr_mem_134623)[sext_i32_i64(local_tid_134617)] =\n                        x",
                   "_134643;\n                    ((volatile __local\n                      float *) red_arr_mem_134625)[sext_i32_i64(local_tid_134617)] =\n                        x_134644;\n                }\n            }\n            offset_134652 *= 2;\n        }\n        while (slt32(skip_waves_134653,\n                     squot32(sext_i64_i32(segred_group_sizze_125596) +\n                             wave_sizze_134619 - 1, wave_sizze_134619))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_134652 = skip_waves_134653 * wave_sizze_134619;\n            if (slt32(local_tid_134617 + offset_134652,\n                      sext_i64_i32(segred_group_sizze_125596)) &&\n                ((local_tid_134617 - squot32(local_tid_134617,\n                                             wave_sizze_134619) *\n                  wave_sizze_134619) == 0 && (squot32(local_tid_134617,\n                                                      wave_sizze_134619) & (2 *\n                                                                            skip_waves_134653 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_134645 = ((__local\n                                 float *) red_arr_mem_134621)[sext_i32_i64(local_tid_134617 +\n                                                              offset_134652)];\n                    x_134646 = ((__local\n                                 float *) red_arr_mem_134623)[sext_i32_i64(local_tid_134617 +\n                                                              offset_134652)];\n                    x_134647 = ((__local\n                                 float *) red_arr_mem_134625)[sext_i32_i64(local_tid_134617 +\n                                                              offset_134652)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_134648 = x_134642 + x_134645;\n        ",
                   "            float defunc_1_op_res_134649 = x_134643 + x_134646;\n                    float defunc_1_op_res_134650 = x_134644 + x_134647;\n                    \n                    x_134642 = defunc_1_op_res_134648;\n                    x_134643 = defunc_1_op_res_134649;\n                    x_134644 = defunc_1_op_res_134650;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_134621)[sext_i32_i64(local_tid_134617)] =\n                        x_134642;\n                    ((__local\n                      float *) red_arr_mem_134623)[sext_i32_i64(local_tid_134617)] =\n                        x_134643;\n                    ((__local\n                      float *) red_arr_mem_134625)[sext_i32_i64(local_tid_134617)] =\n                        x_134644;\n                }\n            }\n            skip_waves_134653 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_134617) == (int64_t) 0) {\n                x_acc_134638 = x_134642;\n                x_acc_134639 = x_134643;\n                x_acc_134640 = x_134644;\n            }\n        }\n        if (groups_per_segment_134603 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_134617 == 0) {\n                    ((__global float *) mem_131398)[gtid_125287 * t_n_m_114591 +\n                                                    gtid_125288] = x_acc_134638;\n                    ((__global float *) mem_131402)[gtid_125287 * t_n_m_114591 +\n                                                    gtid_125288] = x_acc_134639;\n                    ((__global float *) mem_131406)[gtid_125287 * t_n_m_114591 +\n                                                    gtid_125288] = x_acc_134640;\n                }\n            }\n        } else {\n            int32_t old_counter_134654;\n",
                   "            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_134617 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_134608)[sext_i32_i64(virt_group_id_134631)] =\n                        x_acc_134638;\n                    ((__global\n                      float *) segred_tmp_mem_134610)[sext_i32_i64(virt_group_id_134631)] =\n                        x_acc_134639;\n                    ((__global\n                      float *) segred_tmp_mem_134612)[sext_i32_i64(virt_group_id_134631)] =\n                        x_acc_134640;\n                    mem_fence_global();\n                    old_counter_134654 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_134614)[sext_i32_i64(srem32(flat_segment_id_134632,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_134627)[(int64_t) 0] =\n                        old_counter_134654 == groups_per_segment_134603 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_134655 = ((__local\n                                          bool *) sync_arr_mem_134627)[(int64_t) 0];\n            \n            if (is_last_group_134655) {\n                if (local_tid_134617 == 0) {\n                    old_counter_134654 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_134614)[sext_i32_i64(srem32(flat_segment_id_134632,\n                                                                                                      10240))],\n                                              (int) ((in",
                   "t64_t) 0 -\n                                                     groups_per_segment_134603));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_134656 =\n                            sdiv_up64(groups_per_segment_134603,\n                                      segred_group_sizze_125596);\n                    \n                    x_125602 = 0.0F;\n                    x_125603 = 0.0F;\n                    x_125604 = 0.0F;\n                    for (int64_t i_134657 = 0; i_134657 <\n                         read_per_thread_134656; i_134657++) {\n                        int64_t group_res_id_134658 =\n                                sext_i32_i64(local_tid_134617) *\n                                read_per_thread_134656 + i_134657;\n                        int64_t index_of_group_res_134659 =\n                                sext_i32_i64(flat_segment_id_134632) *\n                                groups_per_segment_134603 + group_res_id_134658;\n                        \n                        if (slt64(group_res_id_134658,\n                                  groups_per_segment_134603)) {\n                            x_125605 = ((__global\n                                         float *) segred_tmp_mem_134608)[index_of_group_res_134659];\n                            x_125606 = ((__global\n                                         float *) segred_tmp_mem_134610)[index_of_group_res_134659];\n                            x_125607 = ((__global\n                                         float *) segred_tmp_mem_134612)[index_of_group_res_134659];\n                            \n                            float defunc_1_op_res_125608 = x_125602 + x_125605;\n                            float defunc_1_op_res_125609 = x_125603 + x_125606;\n                            float defunc_1_op_res_125610 = x_125604 + x_125607;\n                            \n                            x_125602 = defunc_1_op_res_125608;\n                            x",
                   "_125603 = defunc_1_op_res_125609;\n                            x_125604 = defunc_1_op_res_125610;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_134621)[sext_i32_i64(local_tid_134617)] =\n                    x_125602;\n                ((__local\n                  float *) red_arr_mem_134623)[sext_i32_i64(local_tid_134617)] =\n                    x_125603;\n                ((__local\n                  float *) red_arr_mem_134625)[sext_i32_i64(local_tid_134617)] =\n                    x_125604;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_134660;\n                    int32_t skip_waves_134661 = 1;\n                    float x_134642;\n                    float x_134643;\n                    float x_134644;\n                    float x_134645;\n                    float x_134646;\n                    float x_134647;\n                    \n                    offset_134660 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_134617,\n                                  sext_i64_i32(segred_group_sizze_125596))) {\n                            x_134642 = ((__local\n                                         float *) red_arr_mem_134621)[sext_i32_i64(local_tid_134617 +\n                                                                      offset_134660)];\n                            x_134643 = ((__local\n                                         float *) red_arr_mem_134623)[sext_i32_i64(local_tid_134617 +\n                                                                      offset_134660)];\n                            x_134644 = ((__local\n                                         float *) red_arr_mem_134625)[sext_i32_i64(local_tid_134617 +\n                                                                      offset_134660)];\n        ",
                   "                }\n                    }\n                    offset_134660 = 1;\n                    while (slt32(offset_134660, wave_sizze_134619)) {\n                        if (slt32(local_tid_134617 + offset_134660,\n                                  sext_i64_i32(segred_group_sizze_125596)) &&\n                            ((local_tid_134617 - squot32(local_tid_134617,\n                                                         wave_sizze_134619) *\n                              wave_sizze_134619) & (2 * offset_134660 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_134645 = ((volatile __local\n                                             float *) red_arr_mem_134621)[sext_i32_i64(local_tid_134617 +\n                                                                          offset_134660)];\n                                x_134646 = ((volatile __local\n                                             float *) red_arr_mem_134623)[sext_i32_i64(local_tid_134617 +\n                                                                          offset_134660)];\n                                x_134647 = ((volatile __local\n                                             float *) red_arr_mem_134625)[sext_i32_i64(local_tid_134617 +\n                                                                          offset_134660)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_134648 = x_134642 +\n                                      x_134645;\n                                float defunc_1_op_res_134649 = x_134643 +\n                                      x_134646;\n                                float defunc_1_op_res_134650 = x_134644 +\n                                      x_134647;\n                                \n                                x_134642 = defunc_1_op_res_134648;\n",
                   "                                x_134643 = defunc_1_op_res_134649;\n                                x_134644 = defunc_1_op_res_134650;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_134621)[sext_i32_i64(local_tid_134617)] =\n                                    x_134642;\n                                ((volatile __local\n                                  float *) red_arr_mem_134623)[sext_i32_i64(local_tid_134617)] =\n                                    x_134643;\n                                ((volatile __local\n                                  float *) red_arr_mem_134625)[sext_i32_i64(local_tid_134617)] =\n                                    x_134644;\n                            }\n                        }\n                        offset_134660 *= 2;\n                    }\n                    while (slt32(skip_waves_134661,\n                                 squot32(sext_i64_i32(segred_group_sizze_125596) +\n                                         wave_sizze_134619 - 1,\n                                         wave_sizze_134619))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_134660 = skip_waves_134661 * wave_sizze_134619;\n                        if (slt32(local_tid_134617 + offset_134660,\n                                  sext_i64_i32(segred_group_sizze_125596)) &&\n                            ((local_tid_134617 - squot32(local_tid_134617,\n                                                         wave_sizze_134619) *\n                              wave_sizze_134619) == 0 &&\n                             (squot32(local_tid_134617, wave_sizze_134619) &\n                              (2 * skip_waves_134661 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_134645 = ((__local\n               ",
                   "                              float *) red_arr_mem_134621)[sext_i32_i64(local_tid_134617 +\n                                                                          offset_134660)];\n                                x_134646 = ((__local\n                                             float *) red_arr_mem_134623)[sext_i32_i64(local_tid_134617 +\n                                                                          offset_134660)];\n                                x_134647 = ((__local\n                                             float *) red_arr_mem_134625)[sext_i32_i64(local_tid_134617 +\n                                                                          offset_134660)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_134648 = x_134642 +\n                                      x_134645;\n                                float defunc_1_op_res_134649 = x_134643 +\n                                      x_134646;\n                                float defunc_1_op_res_134650 = x_134644 +\n                                      x_134647;\n                                \n                                x_134642 = defunc_1_op_res_134648;\n                                x_134643 = defunc_1_op_res_134649;\n                                x_134644 = defunc_1_op_res_134650;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_134621)[sext_i32_i64(local_tid_134617)] =\n                                    x_134642;\n                                ((__local\n                                  float *) red_arr_mem_134623)[sext_i32_i64(local_tid_134617)] =\n                                    x_134643;\n                                ((__local\n                                  float *) red_arr_mem_134625)[sext_i32_",
                   "i64(local_tid_134617)] =\n                                    x_134644;\n                            }\n                        }\n                        skip_waves_134661 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_134617 == 0) {\n                            ((__global float *) mem_131398)[gtid_125287 *\n                                                            t_n_m_114591 +\n                                                            gtid_125288] =\n                                x_134642;\n                            ((__global float *) mem_131402)[gtid_125287 *\n                                                            t_n_m_114591 +\n                                                            gtid_125288] =\n                                x_134643;\n                            ((__global float *) mem_131406)[gtid_125287 *\n                                                            t_n_m_114591 +\n                                                            gtid_125288] =\n                                x_134644;\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_125596\n}\n__kernel void mainzisegred_large_126142(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_134977_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134975_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134973_backing_aligned_2,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t t_window_114537",
                   ",\n                                        int64_t t_jump_114541,\n                                        int64_t t_n_m_114591, int64_t i_114610,\n                                        int64_t num_groups_126738,\n                                        int64_t groups_per_segment_134957,\n                                        int64_t elements_per_thread_134958,\n                                        int64_t virt_num_groups_134959,\n                                        int64_t threads_per_segment_134961,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130606,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130607,\n                                        __global unsigned char *mem_130861,\n                                        __global\n                                        unsigned char *defunc_4_map_res_mem_131267,\n                                        __global unsigned char *mem_131529,\n                                        __global unsigned char *mem_131533,\n                                        __global unsigned char *mem_131537,\n                                        __global unsigned char *mem_131541,\n                                        __global unsigned char *mem_131545,\n                                        __global unsigned char *mem_131550,\n                                        __global unsigned char *mem_131554,\n                                        __global\n                                        unsigned char *segred_tmp_mem_134962,\n                                        __global\n                                        unsigned char *segred_tmp_mem_134964,\n                   ",
                   "                     __global\n                                        unsigned char *mainzicounter_mem_134966)\n{\n    #define segred_group_sizze_126737 (mainzisegred_group_sizze_126136)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict sync_arr_mem_134977_backing_2 =\n                          (__local volatile\n                           char *) sync_arr_mem_134977_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_134975_backing_1 =\n                          (__local volatile\n                           char *) red_arr_mem_134975_backing_aligned_1;\n    __local volatile char *restrict red_arr_mem_134973_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_134973_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_134968;\n    int32_t local_tid_134969;\n    int64_t group_sizze_134972;\n    int32_t wave_sizze_134971;\n    int32_t group_tid_134970;\n    \n    global_tid_134968 = get_global_id(0);\n    local_tid_134969 = get_local_id(0);\n    group_sizze_134972 = get_local_size(0);\n    wave_sizze_134971 = LOCKSTEP_WIDTH;\n    group_tid_134970 = get_group_id(0);\n    \n    int32_t phys_tid_126142 = global_tid_134968;\n    __local char *red_arr_mem_134973;\n    \n    red_arr_mem_134973 = (__local char *) red_arr_mem_134973_backing_0;\n    \n    __local char *red_arr_mem_134975;\n    \n    red_arr_mem_134975 = (__local char *) red_arr_mem_134975_backing_1;\n    \n    __local char *sync_arr_mem_134977;\n    \n    sync_arr_mem_134977 = (__local char *) sync_arr_mem_134977_backing_2;\n    \n    int32_t phys_group_id_134979;\n    \n    phys_group_id_134979 = get_group_id(0);\n    for (int32_t i_134980 = 0; i_134980 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_134959) - phys_group_id_134979,\n                   sext_i64_i32(num_groups_126738)); i_134980++) {\n        int32_t virt_group_id_134981 = phys_group_id_134",
                   "979 + i_134980 *\n                sext_i64_i32(num_groups_126738);\n        int32_t flat_segment_id_134982 = squot32(virt_group_id_134981,\n                                                 sext_i64_i32(groups_per_segment_134957));\n        int64_t global_tid_134983 = srem64(sext_i32_i64(virt_group_id_134981) *\n                                           segred_group_sizze_126737 +\n                                           sext_i32_i64(local_tid_134969),\n                                           segred_group_sizze_126737 *\n                                           groups_per_segment_134957);\n        int64_t slice_134984 = t_n_m_114591;\n        int64_t slice_134985 = m_114533 * slice_134984;\n        int64_t gtid_126131 = squot64(sext_i32_i64(flat_segment_id_134982),\n                                      slice_134984);\n        int64_t remnant_134986 = sext_i32_i64(flat_segment_id_134982) -\n                gtid_126131 * slice_134984;\n        int64_t gtid_126132 = remnant_134986;\n        int64_t remnant_134987 = remnant_134986 - gtid_126132;\n        int64_t gtid_126141;\n        float x_acc_134988;\n        float x_acc_134989;\n        int64_t chunk_sizze_134990 = smin64(elements_per_thread_134958,\n                                            sdiv_up64(t_window_114537 -\n                                                      global_tid_134983,\n                                                      threads_per_segment_134961));\n        float x_126742;\n        float x_126743;\n        float x_126744;\n        float x_126745;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_134988 = 0.0F;\n            x_acc_134989 = 0.0F;\n        }\n        for (int64_t i_134997 = 0; i_134997 < chunk_sizze_134990; i_134997++) {\n            gtid_126141 = global_tid_134983 + threads_per_segment_134961 *\n                i_134997;\n            // apply map function\n            {\n                int64_t x_126753 = ((__global\n                                     int64_t *) de",
                   "func_3_map_res_mem_130117)[gtid_126131];\n                int64_t x_126760 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130606)[gtid_126131 *\n                                                                             t_n_m_114591 +\n                                                                             gtid_126132];\n                float x_126761 = ((__global\n                                   float *) defunc_3_map_res_mem_130607)[gtid_126131 *\n                                                                         t_n_m_114591 +\n                                                                         gtid_126132];\n                int64_t binop_y_129003 = mul64(t_jump_114541, gtid_126132);\n                int64_t convop_x_129004 = smin64(i_114610, binop_y_129003);\n                float index_primexp_129005 = sitofp_i64_f32(convop_x_129004);\n                float a12_126763 = ((__global float *) mem_131529)[gtid_126131 *\n                                                                   t_n_m_114591 +\n                                                                   gtid_126132];\n                float b12_126764 = ((__global float *) mem_131533)[gtid_126131 *\n                                                                   t_n_m_114591 +\n                                                                   gtid_126132];\n                float c12_126765 = ((__global float *) mem_131537)[gtid_126131 *\n                                                                   t_n_m_114591 +\n                                                                   gtid_126132];\n                float b2_126766 = ((__global float *) mem_131541)[gtid_126131 *\n                                                                  t_n_m_114591 +\n                                                                  gtid_126132];\n                float c2_126767 = ((__global float *) mem_131545)[gtid_126131 *\n                                                  ",
                   "                t_n_m_114591 +\n                                                                  gtid_126132];\n                bool cond_126769 = sle64(x_126753, gtid_126141);\n                float defunc_0_f_res_126770;\n                \n                if (cond_126769) {\n                    defunc_0_f_res_126770 = 0.0F;\n                } else {\n                    int64_t i_126771 = add64(gtid_126141, x_126760);\n                    float x_126772 = ((__global\n                                       float *) mem_130122)[gtid_126131 *\n                                                            n_114534 +\n                                                            i_126771];\n                    float defunc_0_f_res_f_res_126773 = 1.0F + x_126772;\n                    \n                    defunc_0_f_res_126770 = defunc_0_f_res_f_res_126773;\n                }\n                \n                float defunc_0_f_res_126774;\n                \n                if (cond_126769) {\n                    defunc_0_f_res_126774 = 0.0F;\n                } else {\n                    int64_t i_126775 = add64(gtid_126141, x_126760);\n                    float x_126776 = ((__global\n                                       float *) mem_130861)[gtid_126131 *\n                                                            n_114534 +\n                                                            i_126775];\n                    \n                    defunc_0_f_res_126774 = x_126776;\n                }\n                \n                float x_j_126777 = defunc_0_f_res_126770 - index_primexp_129005;\n                float abs_res_126778 = (float) fabs(x_j_126777);\n                float tmp1_126779 = abs_res_126778 / x_126761;\n                float x_126780 = tmp1_126779 * tmp1_126779;\n                float y_126781 = tmp1_126779 * x_126780;\n                float tmp2_126782 = 1.0F - y_126781;\n                float x_126783 = tmp2_126782 * tmp2_126782;\n                float tmp3_126784 = tmp2_126782 * x_126783;\n   ",
                   "             float tmp4_126785 = defunc_0_f_res_126774 * tmp3_126784;\n                float defunc_1_f_res_126786 = x_j_126777 * tmp4_126785;\n                float defunc_1_f_res_126787 = x_j_126777 *\n                      defunc_1_f_res_126786;\n                float defunc_0_f_res_126788;\n                \n                if (cond_126769) {\n                    defunc_0_f_res_126788 = 0.0F;\n                } else {\n                    int64_t i_126789 = add64(gtid_126141, x_126760);\n                    float x_126790 = ((__global\n                                       float *) defunc_4_map_res_mem_131267)[gtid_126131 *\n                                                                             n_114534 +\n                                                                             i_126789];\n                    \n                    defunc_0_f_res_126788 = x_126790;\n                }\n                \n                float x_126791 = a12_126763 * tmp4_126785;\n                float y_126792 = b12_126764 * defunc_1_f_res_126786;\n                float x_126793 = x_126791 + y_126792;\n                float y_126794 = c12_126765 * defunc_1_f_res_126787;\n                float x_126795 = x_126793 + y_126794;\n                float defunc_9_fit_fun_res_126796 = defunc_0_f_res_126788 *\n                      x_126795;\n                float x_126797 = b12_126764 * tmp4_126785;\n                float y_126798 = b2_126766 * defunc_1_f_res_126786;\n                float x_126799 = x_126797 + y_126798;\n                float y_126800 = c2_126767 * defunc_1_f_res_126787;\n                float x_126801 = x_126799 + y_126800;\n                float defunc_9_slope_fun_res_126802 = defunc_0_f_res_126788 *\n                      x_126801;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_126742 = x_acc_134988;\n                    x_126743 = x_acc_134989;\n                }\n                // load",
                   " new values\n                {\n                    x_126744 = defunc_9_fit_fun_res_126796;\n                    x_126745 = defunc_9_slope_fun_res_126802;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_126746 = x_126742 + x_126744;\n                    float defunc_1_op_res_126747 = x_126743 + x_126745;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_134988 = defunc_1_op_res_126746;\n                        x_acc_134989 = defunc_1_op_res_126747;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_126742 = x_acc_134988;\n            x_126743 = x_acc_134989;\n            ((__local\n              float *) red_arr_mem_134973)[sext_i32_i64(local_tid_134969)] =\n                x_126742;\n            ((__local\n              float *) red_arr_mem_134975)[sext_i32_i64(local_tid_134969)] =\n                x_126743;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_134998;\n        int32_t skip_waves_134999 = 1;\n        float x_134991;\n        float x_134992;\n        float x_134993;\n        float x_134994;\n        \n        offset_134998 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_134969,\n                      sext_i64_i32(segred_group_sizze_126737))) {\n                x_134991 = ((__local\n                             float *) red_arr_mem_134973)[sext_i32_i64(local_tid_134969 +\n                                                          offset_134998)];\n                x_134992 = ((__local\n                             float *) red_arr_mem_134975)[sext_i32_i64(local_tid_134969 +\n                                                          offset_134998)];\n            }\n        }\n        offset_134998 = 1;\n        while (slt32(offset_134998, wave_sizze_134971)) ",
                   "{\n            if (slt32(local_tid_134969 + offset_134998,\n                      sext_i64_i32(segred_group_sizze_126737)) &&\n                ((local_tid_134969 - squot32(local_tid_134969,\n                                             wave_sizze_134971) *\n                  wave_sizze_134971) & (2 * offset_134998 - 1)) == 0) {\n                // read array element\n                {\n                    x_134993 = ((volatile __local\n                                 float *) red_arr_mem_134973)[sext_i32_i64(local_tid_134969 +\n                                                              offset_134998)];\n                    x_134994 = ((volatile __local\n                                 float *) red_arr_mem_134975)[sext_i32_i64(local_tid_134969 +\n                                                              offset_134998)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_134995 = x_134991 + x_134993;\n                    float defunc_1_op_res_134996 = x_134992 + x_134994;\n                    \n                    x_134991 = defunc_1_op_res_134995;\n                    x_134992 = defunc_1_op_res_134996;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_134973)[sext_i32_i64(local_tid_134969)] =\n                        x_134991;\n                    ((volatile __local\n                      float *) red_arr_mem_134975)[sext_i32_i64(local_tid_134969)] =\n                        x_134992;\n                }\n            }\n            offset_134998 *= 2;\n        }\n        while (slt32(skip_waves_134999,\n                     squot32(sext_i64_i32(segred_group_sizze_126737) +\n                             wave_sizze_134971 - 1, wave_sizze_134971))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_134998 = skip_waves_134999 * wave_sizze_134971;\n            if (slt32(local_tid_134969 + offset_134",
                   "998,\n                      sext_i64_i32(segred_group_sizze_126737)) &&\n                ((local_tid_134969 - squot32(local_tid_134969,\n                                             wave_sizze_134971) *\n                  wave_sizze_134971) == 0 && (squot32(local_tid_134969,\n                                                      wave_sizze_134971) & (2 *\n                                                                            skip_waves_134999 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_134993 = ((__local\n                                 float *) red_arr_mem_134973)[sext_i32_i64(local_tid_134969 +\n                                                              offset_134998)];\n                    x_134994 = ((__local\n                                 float *) red_arr_mem_134975)[sext_i32_i64(local_tid_134969 +\n                                                              offset_134998)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_134995 = x_134991 + x_134993;\n                    float defunc_1_op_res_134996 = x_134992 + x_134994;\n                    \n                    x_134991 = defunc_1_op_res_134995;\n                    x_134992 = defunc_1_op_res_134996;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_134973)[sext_i32_i64(local_tid_134969)] =\n                        x_134991;\n                    ((__local\n                      float *) red_arr_mem_134975)[sext_i32_i64(local_tid_134969)] =\n                        x_134992;\n                }\n            }\n            skip_waves_134999 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_134969",
                   ") == (int64_t) 0) {\n                x_acc_134988 = x_134991;\n                x_acc_134989 = x_134992;\n            }\n        }\n        if (groups_per_segment_134957 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_134969 == 0) {\n                    ((__global float *) mem_131550)[gtid_126131 * t_n_m_114591 +\n                                                    gtid_126132] = x_acc_134988;\n                    ((__global float *) mem_131554)[gtid_126131 * t_n_m_114591 +\n                                                    gtid_126132] = x_acc_134989;\n                }\n            }\n        } else {\n            int32_t old_counter_135000;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_134969 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_134962)[sext_i32_i64(virt_group_id_134981)] =\n                        x_acc_134988;\n                    ((__global\n                      float *) segred_tmp_mem_134964)[sext_i32_i64(virt_group_id_134981)] =\n                        x_acc_134989;\n                    mem_fence_global();\n                    old_counter_135000 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_134966)[sext_i32_i64(srem32(flat_segment_id_134982,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_134977)[(int64_t) 0] =\n                        old_counter_135000 == groups_per_segment_134957 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_135001 = ((__local\n                          ",
                   "                bool *) sync_arr_mem_134977)[(int64_t) 0];\n            \n            if (is_last_group_135001) {\n                if (local_tid_134969 == 0) {\n                    old_counter_135000 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_134966)[sext_i32_i64(srem32(flat_segment_id_134982,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_134957));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_135002 =\n                            sdiv_up64(groups_per_segment_134957,\n                                      segred_group_sizze_126737);\n                    \n                    x_126742 = 0.0F;\n                    x_126743 = 0.0F;\n                    for (int64_t i_135003 = 0; i_135003 <\n                         read_per_thread_135002; i_135003++) {\n                        int64_t group_res_id_135004 =\n                                sext_i32_i64(local_tid_134969) *\n                                read_per_thread_135002 + i_135003;\n                        int64_t index_of_group_res_135005 =\n                                sext_i32_i64(flat_segment_id_134982) *\n                                groups_per_segment_134957 + group_res_id_135004;\n                        \n                        if (slt64(group_res_id_135004,\n                                  groups_per_segment_134957)) {\n                            x_126744 = ((__global\n                                         float *) segred_tmp_mem_134962)[index_of_group_res_135005];\n                            x_126745 = ((__global\n                                         float *) segred_tmp_mem_134964)[index_of_group_res_135005];\n                   ",
                   "         \n                            float defunc_1_op_res_126746 = x_126742 + x_126744;\n                            float defunc_1_op_res_126747 = x_126743 + x_126745;\n                            \n                            x_126742 = defunc_1_op_res_126746;\n                            x_126743 = defunc_1_op_res_126747;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_134973)[sext_i32_i64(local_tid_134969)] =\n                    x_126742;\n                ((__local\n                  float *) red_arr_mem_134975)[sext_i32_i64(local_tid_134969)] =\n                    x_126743;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_135006;\n                    int32_t skip_waves_135007 = 1;\n                    float x_134991;\n                    float x_134992;\n                    float x_134993;\n                    float x_134994;\n                    \n                    offset_135006 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_134969,\n                                  sext_i64_i32(segred_group_sizze_126737))) {\n                            x_134991 = ((__local\n                                         float *) red_arr_mem_134973)[sext_i32_i64(local_tid_134969 +\n                                                                      offset_135006)];\n                            x_134992 = ((__local\n                                         float *) red_arr_mem_134975)[sext_i32_i64(local_tid_134969 +\n                                                                      offset_135006)];\n                        }\n                    }\n                    offset_135006 = 1;\n                    while (slt32(offset_135006, wave_sizze_134971)) {\n                        if (slt32(local_tid_134969 + offset_135006,\n  ",
                   "                                sext_i64_i32(segred_group_sizze_126737)) &&\n                            ((local_tid_134969 - squot32(local_tid_134969,\n                                                         wave_sizze_134971) *\n                              wave_sizze_134971) & (2 * offset_135006 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_134993 = ((volatile __local\n                                             float *) red_arr_mem_134973)[sext_i32_i64(local_tid_134969 +\n                                                                          offset_135006)];\n                                x_134994 = ((volatile __local\n                                             float *) red_arr_mem_134975)[sext_i32_i64(local_tid_134969 +\n                                                                          offset_135006)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_134995 = x_134991 +\n                                      x_134993;\n                                float defunc_1_op_res_134996 = x_134992 +\n                                      x_134994;\n                                \n                                x_134991 = defunc_1_op_res_134995;\n                                x_134992 = defunc_1_op_res_134996;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_134973)[sext_i32_i64(local_tid_134969)] =\n                                    x_134991;\n                                ((volatile __local\n                                  float *) red_arr_mem_134975)[sext_i32_i64(local_tid_134969)] =\n                                    x_134992;\n                            ",
                   "}\n                        }\n                        offset_135006 *= 2;\n                    }\n                    while (slt32(skip_waves_135007,\n                                 squot32(sext_i64_i32(segred_group_sizze_126737) +\n                                         wave_sizze_134971 - 1,\n                                         wave_sizze_134971))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_135006 = skip_waves_135007 * wave_sizze_134971;\n                        if (slt32(local_tid_134969 + offset_135006,\n                                  sext_i64_i32(segred_group_sizze_126737)) &&\n                            ((local_tid_134969 - squot32(local_tid_134969,\n                                                         wave_sizze_134971) *\n                              wave_sizze_134971) == 0 &&\n                             (squot32(local_tid_134969, wave_sizze_134971) &\n                              (2 * skip_waves_135007 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_134993 = ((__local\n                                             float *) red_arr_mem_134973)[sext_i32_i64(local_tid_134969 +\n                                                                          offset_135006)];\n                                x_134994 = ((__local\n                                             float *) red_arr_mem_134975)[sext_i32_i64(local_tid_134969 +\n                                                                          offset_135006)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_134995 = x_134991 +\n                                      x_134993;\n                                float defunc_1_op_res_134996 = x_134992 +\n                                      x_134994;\n                                \n                                x_1",
                   "34991 = defunc_1_op_res_134995;\n                                x_134992 = defunc_1_op_res_134996;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_134973)[sext_i32_i64(local_tid_134969)] =\n                                    x_134991;\n                                ((__local\n                                  float *) red_arr_mem_134975)[sext_i32_i64(local_tid_134969)] =\n                                    x_134992;\n                            }\n                        }\n                        skip_waves_135007 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_134969 == 0) {\n                            ((__global float *) mem_131550)[gtid_126131 *\n                                                            t_n_m_114591 +\n                                                            gtid_126132] =\n                                x_134991;\n                            ((__global float *) mem_131554)[gtid_126131 *\n                                                            t_n_m_114591 +\n                                                            gtid_126132] =\n                                x_134992;\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_126737\n}\n__kernel void mainzisegred_large_126263(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *sync_arr_mem_134874_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134872_backing_aligned_1,\n                                  ",
                   "      __local volatile\n                                        int64_t *red_arr_mem_134870_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134868_backing_aligned_3,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134866_backing_aligned_4,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134864_backing_aligned_5,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t t_window_114537,\n                                        int64_t t_jump_114541,\n                                        int64_t t_n_m_114591, int64_t i_114610,\n                                        int64_t num_groups_126642,\n                                        int64_t groups_per_segment_134842,\n                                        int64_t elements_per_thread_134843,\n                                        int64_t virt_num_groups_134844,\n                                        int64_t threads_per_segment_134846,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130606,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130607,\n                                        __global unsigned char *mem_130861,\n                                        __global unsigned char *mem_131508,\n                                        __global unsigned char *mem_131512,\n                                        __global unsigned char *mem_131516,\n                             ",
                   "           __global unsigned char *mem_131520,\n                                        __global unsigned char *mem_131524,\n                                        __global\n                                        unsigned char *segred_tmp_mem_134847,\n                                        __global\n                                        unsigned char *segred_tmp_mem_134849,\n                                        __global\n                                        unsigned char *segred_tmp_mem_134851,\n                                        __global\n                                        unsigned char *segred_tmp_mem_134853,\n                                        __global\n                                        unsigned char *segred_tmp_mem_134855,\n                                        __global\n                                        unsigned char *mainzicounter_mem_134857)\n{\n    #define segred_group_sizze_126641 (mainzisegred_group_sizze_126257)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict sync_arr_mem_134874_backing_5 =\n                          (__local volatile\n                           char *) sync_arr_mem_134874_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_134872_backing_4 =\n                          (__local volatile\n                           char *) red_arr_mem_134872_backing_aligned_1;\n    __local volatile char *restrict red_arr_mem_134870_backing_3 =\n                          (__local volatile\n                           char *) red_arr_mem_134870_backing_aligned_2;\n    __local volatile char *restrict red_arr_mem_134868_backing_2 =\n                          (__local volatile\n                           char *) red_arr_mem_134868_backing_aligned_3;\n    __local volatile char *restrict red_arr_mem_134866_backing_1 =\n                          (__local volatile\n                           char *) red_arr_mem_134866_backing_aligned_4;\n    __local volatile ",
                   "char *restrict red_arr_mem_134864_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_134864_backing_aligned_5;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_134859;\n    int32_t local_tid_134860;\n    int64_t group_sizze_134863;\n    int32_t wave_sizze_134862;\n    int32_t group_tid_134861;\n    \n    global_tid_134859 = get_global_id(0);\n    local_tid_134860 = get_local_id(0);\n    group_sizze_134863 = get_local_size(0);\n    wave_sizze_134862 = LOCKSTEP_WIDTH;\n    group_tid_134861 = get_group_id(0);\n    \n    int32_t phys_tid_126263 = global_tid_134859;\n    __local char *red_arr_mem_134864;\n    \n    red_arr_mem_134864 = (__local char *) red_arr_mem_134864_backing_0;\n    \n    __local char *red_arr_mem_134866;\n    \n    red_arr_mem_134866 = (__local char *) red_arr_mem_134866_backing_1;\n    \n    __local char *red_arr_mem_134868;\n    \n    red_arr_mem_134868 = (__local char *) red_arr_mem_134868_backing_2;\n    \n    __local char *red_arr_mem_134870;\n    \n    red_arr_mem_134870 = (__local char *) red_arr_mem_134870_backing_3;\n    \n    __local char *red_arr_mem_134872;\n    \n    red_arr_mem_134872 = (__local char *) red_arr_mem_134872_backing_4;\n    \n    __local char *sync_arr_mem_134874;\n    \n    sync_arr_mem_134874 = (__local char *) sync_arr_mem_134874_backing_5;\n    \n    int32_t phys_group_id_134876;\n    \n    phys_group_id_134876 = get_group_id(0);\n    for (int32_t i_134877 = 0; i_134877 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_134844) - phys_group_id_134876,\n                   sext_i64_i32(num_groups_126642)); i_134877++) {\n        int32_t virt_group_id_134878 = phys_group_id_134876 + i_134877 *\n                sext_i64_i32(num_groups_126642);\n        int32_t flat_segment_id_134879 = squot32(virt_group_id_134878,\n                                                 sext_i64_i32(groups_per_segment_134842));\n        int64_t global_tid_134880 = srem64(sext_i32_i64(virt_group_id_134878) *\n   ",
                   "                                        segred_group_sizze_126641 +\n                                           sext_i32_i64(local_tid_134860),\n                                           segred_group_sizze_126641 *\n                                           groups_per_segment_134842);\n        int64_t slice_134881 = t_n_m_114591;\n        int64_t slice_134882 = m_114533 * slice_134881;\n        int64_t gtid_126252 = squot64(sext_i32_i64(flat_segment_id_134879),\n                                      slice_134881);\n        int64_t remnant_134883 = sext_i32_i64(flat_segment_id_134879) -\n                gtid_126252 * slice_134881;\n        int64_t gtid_126253 = remnant_134883;\n        int64_t remnant_134884 = remnant_134883 - gtid_126253;\n        int64_t gtid_126262;\n        float x_acc_134885;\n        float x_acc_134886;\n        float x_acc_134887;\n        float x_acc_134888;\n        float x_acc_134889;\n        int64_t chunk_sizze_134890 = smin64(elements_per_thread_134843,\n                                            sdiv_up64(t_window_114537 -\n                                                      global_tid_134880,\n                                                      threads_per_segment_134846));\n        float x_126649;\n        float x_126650;\n        float x_126651;\n        float x_126652;\n        float x_126653;\n        float x_126654;\n        float x_126655;\n        float x_126656;\n        float x_126657;\n        float x_126658;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_134885 = 0.0F;\n            x_acc_134886 = 0.0F;\n            x_acc_134887 = 0.0F;\n            x_acc_134888 = 0.0F;\n            x_acc_134889 = 0.0F;\n        }\n        for (int64_t i_134906 = 0; i_134906 < chunk_sizze_134890; i_134906++) {\n            gtid_126262 = global_tid_134880 + threads_per_segment_134846 *\n                i_134906;\n            // apply map function\n            {\n                int64_t x_126668 = ((__global\n                                  ",
                   "   int64_t *) defunc_3_map_res_mem_130117)[gtid_126252];\n                int64_t x_126670 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130606)[gtid_126252 *\n                                                                             t_n_m_114591 +\n                                                                             gtid_126253];\n                float x_126671 = ((__global\n                                   float *) defunc_3_map_res_mem_130607)[gtid_126252 *\n                                                                         t_n_m_114591 +\n                                                                         gtid_126253];\n                int64_t binop_y_128996 = mul64(t_jump_114541, gtid_126253);\n                int64_t convop_x_128997 = smin64(i_114610, binop_y_128996);\n                float index_primexp_128998 = sitofp_i64_f32(convop_x_128997);\n                bool cond_126674 = sle64(x_126668, gtid_126262);\n                float defunc_0_f_res_126675;\n                \n                if (cond_126674) {\n                    defunc_0_f_res_126675 = 0.0F;\n                } else {\n                    int64_t i_126676 = add64(gtid_126262, x_126670);\n                    float x_126677 = ((__global\n                                       float *) mem_130122)[gtid_126252 *\n                                                            n_114534 +\n                                                            i_126676];\n                    float defunc_0_f_res_f_res_126678 = 1.0F + x_126677;\n                    \n                    defunc_0_f_res_126675 = defunc_0_f_res_f_res_126678;\n                }\n                \n                float defunc_0_f_res_126679;\n                \n                if (cond_126674) {\n                    defunc_0_f_res_126679 = 0.0F;\n                } else {\n                    int64_t i_126680 = add64(gtid_126262, x_126670);\n                    float x_126681 = ((__global\n                          ",
                   "             float *) mem_130861)[gtid_126252 *\n                                                            n_114534 +\n                                                            i_126680];\n                    \n                    defunc_0_f_res_126679 = x_126681;\n                }\n                \n                float x_j_126682 = defunc_0_f_res_126675 - index_primexp_128998;\n                float abs_res_126683 = (float) fabs(x_j_126682);\n                float tmp1_126684 = abs_res_126683 / x_126671;\n                float x_126685 = tmp1_126684 * tmp1_126684;\n                float y_126686 = tmp1_126684 * x_126685;\n                float tmp2_126687 = 1.0F - y_126686;\n                float x_126688 = tmp2_126687 * tmp2_126687;\n                float tmp3_126689 = tmp2_126687 * x_126688;\n                float w_j_126690 = defunc_0_f_res_126679 * tmp3_126689;\n                float xw_j_126691 = x_j_126682 * w_j_126690;\n                float x2w_j_126692 = x_j_126682 * xw_j_126691;\n                float x3w_j_126693 = x_j_126682 * x2w_j_126692;\n                float x4w_j_126694 = x_j_126682 * x3w_j_126693;\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_126649 = x_acc_134885;\n                    x_126650 = x_acc_134886;\n                    x_126651 = x_acc_134887;\n                    x_126652 = x_acc_134888;\n                    x_126653 = x_acc_134889;\n                }\n                // load new values\n                {\n                    x_126654 = w_j_126690;\n                    x_126655 = xw_j_126691;\n                    x_126656 = x2w_j_126692;\n                    x_126657 = x3w_j_126693;\n                    x_126658 = x4w_j_126694;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_126659 = x_126649 + x_126654;\n                    float defunc_1_op_res_126660 = x_126650 + x_126655;\n    ",
                   "                float defunc_1_op_res_126661 = x_126651 + x_126656;\n                    float defunc_1_op_res_126662 = x_126652 + x_126657;\n                    float defunc_1_op_res_126663 = x_126653 + x_126658;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_134885 = defunc_1_op_res_126659;\n                        x_acc_134886 = defunc_1_op_res_126660;\n                        x_acc_134887 = defunc_1_op_res_126661;\n                        x_acc_134888 = defunc_1_op_res_126662;\n                        x_acc_134889 = defunc_1_op_res_126663;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_126649 = x_acc_134885;\n            x_126650 = x_acc_134886;\n            x_126651 = x_acc_134887;\n            x_126652 = x_acc_134888;\n            x_126653 = x_acc_134889;\n            ((__local\n              float *) red_arr_mem_134864)[sext_i32_i64(local_tid_134860)] =\n                x_126649;\n            ((__local\n              float *) red_arr_mem_134866)[sext_i32_i64(local_tid_134860)] =\n                x_126650;\n            ((__local\n              float *) red_arr_mem_134868)[sext_i32_i64(local_tid_134860)] =\n                x_126651;\n            ((__local\n              float *) red_arr_mem_134870)[sext_i32_i64(local_tid_134860)] =\n                x_126652;\n            ((__local\n              float *) red_arr_mem_134872)[sext_i32_i64(local_tid_134860)] =\n                x_126653;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_134907;\n        int32_t skip_waves_134908 = 1;\n        float x_134891;\n        float x_134892;\n        float x_134893;\n        float x_134894;\n        float x_134895;\n        float x_134896;\n        float x_134897;\n        float x_134898;\n        float x_134899;\n        float x_134900;\n        \n        offset_134907 = 0;\n        // participating threa",
                   "ds read initial accumulator\n        {\n            if (slt32(local_tid_134860,\n                      sext_i64_i32(segred_group_sizze_126641))) {\n                x_134891 = ((__local\n                             float *) red_arr_mem_134864)[sext_i32_i64(local_tid_134860 +\n                                                          offset_134907)];\n                x_134892 = ((__local\n                             float *) red_arr_mem_134866)[sext_i32_i64(local_tid_134860 +\n                                                          offset_134907)];\n                x_134893 = ((__local\n                             float *) red_arr_mem_134868)[sext_i32_i64(local_tid_134860 +\n                                                          offset_134907)];\n                x_134894 = ((__local\n                             float *) red_arr_mem_134870)[sext_i32_i64(local_tid_134860 +\n                                                          offset_134907)];\n                x_134895 = ((__local\n                             float *) red_arr_mem_134872)[sext_i32_i64(local_tid_134860 +\n                                                          offset_134907)];\n            }\n        }\n        offset_134907 = 1;\n        while (slt32(offset_134907, wave_sizze_134862)) {\n            if (slt32(local_tid_134860 + offset_134907,\n                      sext_i64_i32(segred_group_sizze_126641)) &&\n                ((local_tid_134860 - squot32(local_tid_134860,\n                                             wave_sizze_134862) *\n                  wave_sizze_134862) & (2 * offset_134907 - 1)) == 0) {\n                // read array element\n                {\n                    x_134896 = ((volatile __local\n                                 float *) red_arr_mem_134864)[sext_i32_i64(local_tid_134860 +\n                                                              offset_134907)];\n                    x_134897 = ((volatile __local\n                                 float *) red_arr_mem_134866)[sext_i32_i64(local_tid_",
                   "134860 +\n                                                              offset_134907)];\n                    x_134898 = ((volatile __local\n                                 float *) red_arr_mem_134868)[sext_i32_i64(local_tid_134860 +\n                                                              offset_134907)];\n                    x_134899 = ((volatile __local\n                                 float *) red_arr_mem_134870)[sext_i32_i64(local_tid_134860 +\n                                                              offset_134907)];\n                    x_134900 = ((volatile __local\n                                 float *) red_arr_mem_134872)[sext_i32_i64(local_tid_134860 +\n                                                              offset_134907)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_134901 = x_134891 + x_134896;\n                    float defunc_1_op_res_134902 = x_134892 + x_134897;\n                    float defunc_1_op_res_134903 = x_134893 + x_134898;\n                    float defunc_1_op_res_134904 = x_134894 + x_134899;\n                    float defunc_1_op_res_134905 = x_134895 + x_134900;\n                    \n                    x_134891 = defunc_1_op_res_134901;\n                    x_134892 = defunc_1_op_res_134902;\n                    x_134893 = defunc_1_op_res_134903;\n                    x_134894 = defunc_1_op_res_134904;\n                    x_134895 = defunc_1_op_res_134905;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_134864)[sext_i32_i64(local_tid_134860)] =\n                        x_134891;\n                    ((volatile __local\n                      float *) red_arr_mem_134866)[sext_i32_i64(local_tid_134860)] =\n                        x_134892;\n                    ((volatile __local\n                      float *) red_arr_mem_134868)[sext_i32_i64(local_",
                   "tid_134860)] =\n                        x_134893;\n                    ((volatile __local\n                      float *) red_arr_mem_134870)[sext_i32_i64(local_tid_134860)] =\n                        x_134894;\n                    ((volatile __local\n                      float *) red_arr_mem_134872)[sext_i32_i64(local_tid_134860)] =\n                        x_134895;\n                }\n            }\n            offset_134907 *= 2;\n        }\n        while (slt32(skip_waves_134908,\n                     squot32(sext_i64_i32(segred_group_sizze_126641) +\n                             wave_sizze_134862 - 1, wave_sizze_134862))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_134907 = skip_waves_134908 * wave_sizze_134862;\n            if (slt32(local_tid_134860 + offset_134907,\n                      sext_i64_i32(segred_group_sizze_126641)) &&\n                ((local_tid_134860 - squot32(local_tid_134860,\n                                             wave_sizze_134862) *\n                  wave_sizze_134862) == 0 && (squot32(local_tid_134860,\n                                                      wave_sizze_134862) & (2 *\n                                                                            skip_waves_134908 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_134896 = ((__local\n                                 float *) red_arr_mem_134864)[sext_i32_i64(local_tid_134860 +\n                                                              offset_134907)];\n                    x_134897 = ((__local\n                                 float *) red_arr_mem_134866)[sext_i32_i64(local_tid_134860 +\n                                                              offset_134907)];\n                    x_134898 = ((__local\n                                 float *) red_arr_mem_134868)[sext_i32_i64(local_tid_134860 +\n                                          ",
                   "                    offset_134907)];\n                    x_134899 = ((__local\n                                 float *) red_arr_mem_134870)[sext_i32_i64(local_tid_134860 +\n                                                              offset_134907)];\n                    x_134900 = ((__local\n                                 float *) red_arr_mem_134872)[sext_i32_i64(local_tid_134860 +\n                                                              offset_134907)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_134901 = x_134891 + x_134896;\n                    float defunc_1_op_res_134902 = x_134892 + x_134897;\n                    float defunc_1_op_res_134903 = x_134893 + x_134898;\n                    float defunc_1_op_res_134904 = x_134894 + x_134899;\n                    float defunc_1_op_res_134905 = x_134895 + x_134900;\n                    \n                    x_134891 = defunc_1_op_res_134901;\n                    x_134892 = defunc_1_op_res_134902;\n                    x_134893 = defunc_1_op_res_134903;\n                    x_134894 = defunc_1_op_res_134904;\n                    x_134895 = defunc_1_op_res_134905;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_134864)[sext_i32_i64(local_tid_134860)] =\n                        x_134891;\n                    ((__local\n                      float *) red_arr_mem_134866)[sext_i32_i64(local_tid_134860)] =\n                        x_134892;\n                    ((__local\n                      float *) red_arr_mem_134868)[sext_i32_i64(local_tid_134860)] =\n                        x_134893;\n                    ((__local\n                      float *) red_arr_mem_134870)[sext_i32_i64(local_tid_134860)] =\n                        x_134894;\n                    ((__local\n                      float *) red_arr_mem_134872)[sext_i32_i64(local_tid_134860)] =\n      ",
                   "                  x_134895;\n                }\n            }\n            skip_waves_134908 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_134860) == (int64_t) 0) {\n                x_acc_134885 = x_134891;\n                x_acc_134886 = x_134892;\n                x_acc_134887 = x_134893;\n                x_acc_134888 = x_134894;\n                x_acc_134889 = x_134895;\n            }\n        }\n        if (groups_per_segment_134842 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_134860 == 0) {\n                    ((__global float *) mem_131508)[gtid_126252 * t_n_m_114591 +\n                                                    gtid_126253] = x_acc_134885;\n                    ((__global float *) mem_131512)[gtid_126252 * t_n_m_114591 +\n                                                    gtid_126253] = x_acc_134886;\n                    ((__global float *) mem_131516)[gtid_126252 * t_n_m_114591 +\n                                                    gtid_126253] = x_acc_134887;\n                    ((__global float *) mem_131520)[gtid_126252 * t_n_m_114591 +\n                                                    gtid_126253] = x_acc_134888;\n                    ((__global float *) mem_131524)[gtid_126252 * t_n_m_114591 +\n                                                    gtid_126253] = x_acc_134889;\n                }\n            }\n        } else {\n            int32_t old_counter_134909;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_134860 == 0) {\n                    ((__global\n                      float *) segred_tmp_mem_134847)[sext_i32_i64(virt_group_id_134878)] =\n                        x_acc_134885;\n                    ((__global\n                      float *) segred_tmp_mem_134849)[sext_i32_i64(virt_group_i",
                   "d_134878)] =\n                        x_acc_134886;\n                    ((__global\n                      float *) segred_tmp_mem_134851)[sext_i32_i64(virt_group_id_134878)] =\n                        x_acc_134887;\n                    ((__global\n                      float *) segred_tmp_mem_134853)[sext_i32_i64(virt_group_id_134878)] =\n                        x_acc_134888;\n                    ((__global\n                      float *) segred_tmp_mem_134855)[sext_i32_i64(virt_group_id_134878)] =\n                        x_acc_134889;\n                    mem_fence_global();\n                    old_counter_134909 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_134857)[sext_i32_i64(srem32(flat_segment_id_134879,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_134874)[(int64_t) 0] =\n                        old_counter_134909 == groups_per_segment_134842 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_134910 = ((__local\n                                          bool *) sync_arr_mem_134874)[(int64_t) 0];\n            \n            if (is_last_group_134910) {\n                if (local_tid_134860 == 0) {\n                    old_counter_134909 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_134857)[sext_i32_i64(srem32(flat_segment_id_134879,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_134842));\n ",
                   "               }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_134911 =\n                            sdiv_up64(groups_per_segment_134842,\n                                      segred_group_sizze_126641);\n                    \n                    x_126649 = 0.0F;\n                    x_126650 = 0.0F;\n                    x_126651 = 0.0F;\n                    x_126652 = 0.0F;\n                    x_126653 = 0.0F;\n                    for (int64_t i_134912 = 0; i_134912 <\n                         read_per_thread_134911; i_134912++) {\n                        int64_t group_res_id_134913 =\n                                sext_i32_i64(local_tid_134860) *\n                                read_per_thread_134911 + i_134912;\n                        int64_t index_of_group_res_134914 =\n                                sext_i32_i64(flat_segment_id_134879) *\n                                groups_per_segment_134842 + group_res_id_134913;\n                        \n                        if (slt64(group_res_id_134913,\n                                  groups_per_segment_134842)) {\n                            x_126654 = ((__global\n                                         float *) segred_tmp_mem_134847)[index_of_group_res_134914];\n                            x_126655 = ((__global\n                                         float *) segred_tmp_mem_134849)[index_of_group_res_134914];\n                            x_126656 = ((__global\n                                         float *) segred_tmp_mem_134851)[index_of_group_res_134914];\n                            x_126657 = ((__global\n                                         float *) segred_tmp_mem_134853)[index_of_group_res_134914];\n                            x_126658 = ((__global\n                                         float *) segred_tmp_mem_134855)[index_of_group_res_134914];\n                            \n                            float defunc_1_op_res_126659 = x_126649 + x_126654;",
                   "\n                            float defunc_1_op_res_126660 = x_126650 + x_126655;\n                            float defunc_1_op_res_126661 = x_126651 + x_126656;\n                            float defunc_1_op_res_126662 = x_126652 + x_126657;\n                            float defunc_1_op_res_126663 = x_126653 + x_126658;\n                            \n                            x_126649 = defunc_1_op_res_126659;\n                            x_126650 = defunc_1_op_res_126660;\n                            x_126651 = defunc_1_op_res_126661;\n                            x_126652 = defunc_1_op_res_126662;\n                            x_126653 = defunc_1_op_res_126663;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_134864)[sext_i32_i64(local_tid_134860)] =\n                    x_126649;\n                ((__local\n                  float *) red_arr_mem_134866)[sext_i32_i64(local_tid_134860)] =\n                    x_126650;\n                ((__local\n                  float *) red_arr_mem_134868)[sext_i32_i64(local_tid_134860)] =\n                    x_126651;\n                ((__local\n                  float *) red_arr_mem_134870)[sext_i32_i64(local_tid_134860)] =\n                    x_126652;\n                ((__local\n                  float *) red_arr_mem_134872)[sext_i32_i64(local_tid_134860)] =\n                    x_126653;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_134915;\n                    int32_t skip_waves_134916 = 1;\n                    float x_134891;\n                    float x_134892;\n                    float x_134893;\n                    float x_134894;\n                    float x_134895;\n                    float x_134896;\n                    float x_134897;\n                    float x_134898;\n                    float x_134899;\n                    float x_134900;\n                  ",
                   "  \n                    offset_134915 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_134860,\n                                  sext_i64_i32(segred_group_sizze_126641))) {\n                            x_134891 = ((__local\n                                         float *) red_arr_mem_134864)[sext_i32_i64(local_tid_134860 +\n                                                                      offset_134915)];\n                            x_134892 = ((__local\n                                         float *) red_arr_mem_134866)[sext_i32_i64(local_tid_134860 +\n                                                                      offset_134915)];\n                            x_134893 = ((__local\n                                         float *) red_arr_mem_134868)[sext_i32_i64(local_tid_134860 +\n                                                                      offset_134915)];\n                            x_134894 = ((__local\n                                         float *) red_arr_mem_134870)[sext_i32_i64(local_tid_134860 +\n                                                                      offset_134915)];\n                            x_134895 = ((__local\n                                         float *) red_arr_mem_134872)[sext_i32_i64(local_tid_134860 +\n                                                                      offset_134915)];\n                        }\n                    }\n                    offset_134915 = 1;\n                    while (slt32(offset_134915, wave_sizze_134862)) {\n                        if (slt32(local_tid_134860 + offset_134915,\n                                  sext_i64_i32(segred_group_sizze_126641)) &&\n                            ((local_tid_134860 - squot32(local_tid_134860,\n                                                         wave_sizze_134862) *\n                              wave_sizze_134862) & (2 * offset_134915 - 1)) ==\n           ",
                   "                 0) {\n                            // read array element\n                            {\n                                x_134896 = ((volatile __local\n                                             float *) red_arr_mem_134864)[sext_i32_i64(local_tid_134860 +\n                                                                          offset_134915)];\n                                x_134897 = ((volatile __local\n                                             float *) red_arr_mem_134866)[sext_i32_i64(local_tid_134860 +\n                                                                          offset_134915)];\n                                x_134898 = ((volatile __local\n                                             float *) red_arr_mem_134868)[sext_i32_i64(local_tid_134860 +\n                                                                          offset_134915)];\n                                x_134899 = ((volatile __local\n                                             float *) red_arr_mem_134870)[sext_i32_i64(local_tid_134860 +\n                                                                          offset_134915)];\n                                x_134900 = ((volatile __local\n                                             float *) red_arr_mem_134872)[sext_i32_i64(local_tid_134860 +\n                                                                          offset_134915)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_134901 = x_134891 +\n                                      x_134896;\n                                float defunc_1_op_res_134902 = x_134892 +\n                                      x_134897;\n                                float defunc_1_op_res_134903 = x_134893 +\n                                      x_134898;\n                                float defunc_1_op_res_134904 = x_134894 +\n                                      x_134899",
                   ";\n                                float defunc_1_op_res_134905 = x_134895 +\n                                      x_134900;\n                                \n                                x_134891 = defunc_1_op_res_134901;\n                                x_134892 = defunc_1_op_res_134902;\n                                x_134893 = defunc_1_op_res_134903;\n                                x_134894 = defunc_1_op_res_134904;\n                                x_134895 = defunc_1_op_res_134905;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_134864)[sext_i32_i64(local_tid_134860)] =\n                                    x_134891;\n                                ((volatile __local\n                                  float *) red_arr_mem_134866)[sext_i32_i64(local_tid_134860)] =\n                                    x_134892;\n                                ((volatile __local\n                                  float *) red_arr_mem_134868)[sext_i32_i64(local_tid_134860)] =\n                                    x_134893;\n                                ((volatile __local\n                                  float *) red_arr_mem_134870)[sext_i32_i64(local_tid_134860)] =\n                                    x_134894;\n                                ((volatile __local\n                                  float *) red_arr_mem_134872)[sext_i32_i64(local_tid_134860)] =\n                                    x_134895;\n                            }\n                        }\n                        offset_134915 *= 2;\n                    }\n                    while (slt32(skip_waves_134916,\n                                 squot32(sext_i64_i32(segred_group_sizze_126641) +\n                                         wave_sizze_134862 - 1,\n                                         wave_sizze_134862))) {\n                        barrier(CLK_",
                   "LOCAL_MEM_FENCE);\n                        offset_134915 = skip_waves_134916 * wave_sizze_134862;\n                        if (slt32(local_tid_134860 + offset_134915,\n                                  sext_i64_i32(segred_group_sizze_126641)) &&\n                            ((local_tid_134860 - squot32(local_tid_134860,\n                                                         wave_sizze_134862) *\n                              wave_sizze_134862) == 0 &&\n                             (squot32(local_tid_134860, wave_sizze_134862) &\n                              (2 * skip_waves_134916 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_134896 = ((__local\n                                             float *) red_arr_mem_134864)[sext_i32_i64(local_tid_134860 +\n                                                                          offset_134915)];\n                                x_134897 = ((__local\n                                             float *) red_arr_mem_134866)[sext_i32_i64(local_tid_134860 +\n                                                                          offset_134915)];\n                                x_134898 = ((__local\n                                             float *) red_arr_mem_134868)[sext_i32_i64(local_tid_134860 +\n                                                                          offset_134915)];\n                                x_134899 = ((__local\n                                             float *) red_arr_mem_134870)[sext_i32_i64(local_tid_134860 +\n                                                                          offset_134915)];\n                                x_134900 = ((__local\n                                             float *) red_arr_mem_134872)[sext_i32_i64(local_tid_134860 +\n                                                                          offset_134915)];\n                            }\n                            // apply reduc",
                   "tion operation\n                            {\n                                float defunc_1_op_res_134901 = x_134891 +\n                                      x_134896;\n                                float defunc_1_op_res_134902 = x_134892 +\n                                      x_134897;\n                                float defunc_1_op_res_134903 = x_134893 +\n                                      x_134898;\n                                float defunc_1_op_res_134904 = x_134894 +\n                                      x_134899;\n                                float defunc_1_op_res_134905 = x_134895 +\n                                      x_134900;\n                                \n                                x_134891 = defunc_1_op_res_134901;\n                                x_134892 = defunc_1_op_res_134902;\n                                x_134893 = defunc_1_op_res_134903;\n                                x_134894 = defunc_1_op_res_134904;\n                                x_134895 = defunc_1_op_res_134905;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_134864)[sext_i32_i64(local_tid_134860)] =\n                                    x_134891;\n                                ((__local\n                                  float *) red_arr_mem_134866)[sext_i32_i64(local_tid_134860)] =\n                                    x_134892;\n                                ((__local\n                                  float *) red_arr_mem_134868)[sext_i32_i64(local_tid_134860)] =\n                                    x_134893;\n                                ((__local\n                                  float *) red_arr_mem_134870)[sext_i32_i64(local_tid_134860)] =\n                                    x_134894;\n                                ((__local\n                                  float *) red_arr_mem_134872)[sext_i32_i64(lo",
                   "cal_tid_134860)] =\n                                    x_134895;\n                            }\n                        }\n                        skip_waves_134916 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_134860 == 0) {\n                            ((__global float *) mem_131508)[gtid_126252 *\n                                                            t_n_m_114591 +\n                                                            gtid_126253] =\n                                x_134891;\n                            ((__global float *) mem_131512)[gtid_126252 *\n                                                            t_n_m_114591 +\n                                                            gtid_126253] =\n                                x_134892;\n                            ((__global float *) mem_131516)[gtid_126252 *\n                                                            t_n_m_114591 +\n                                                            gtid_126253] =\n                                x_134893;\n                            ((__global float *) mem_131520)[gtid_126252 *\n                                                            t_n_m_114591 +\n                                                            gtid_126253] =\n                                x_134894;\n                            ((__global float *) mem_131524)[gtid_126252 *\n                                                            t_n_m_114591 +\n                                                            gtid_126253] =\n                                x_134895;\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_126641\n}\n__kernel void mainzisegred_large_128539(__global int *global_failure,\n                                        __loca",
                   "l volatile\n                                        int64_t *sync_arr_mem_135362_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_135360_backing_aligned_1,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t stl_res_114604,\n                                        int64_t j_m_i_115007,\n                                        int64_t num_groups_128548,\n                                        int64_t groups_per_segment_135346,\n                                        int64_t elements_per_thread_135347,\n                                        int64_t virt_num_groups_135348,\n                                        int64_t threads_per_segment_135350,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_131929,\n                                        __global unsigned char *mem_131946,\n                                        __global\n                                        unsigned char *segred_tmp_mem_135351,\n                                        __global\n                                        unsigned char *mainzicounter_mem_135353)\n{\n    #define segred_group_sizze_128547 (mainzisegred_group_sizze_128533)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict sync_arr_mem_135362_backing_1 =\n                          (__local volatile\n                           char *) sync_arr_mem_135362_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_135360_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_135360_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_135355;\n    int32_t local_tid_135356;\n    int64_t group_sizze_135359;\n    int32_t wave_sizze_135358;\n    ",
                   "int32_t group_tid_135357;\n    \n    global_tid_135355 = get_global_id(0);\n    local_tid_135356 = get_local_id(0);\n    group_sizze_135359 = get_local_size(0);\n    wave_sizze_135358 = LOCKSTEP_WIDTH;\n    group_tid_135357 = get_group_id(0);\n    \n    int32_t phys_tid_128539 = global_tid_135355;\n    __local char *red_arr_mem_135360;\n    \n    red_arr_mem_135360 = (__local char *) red_arr_mem_135360_backing_0;\n    \n    __local char *sync_arr_mem_135362;\n    \n    sync_arr_mem_135362 = (__local char *) sync_arr_mem_135362_backing_1;\n    \n    int32_t phys_group_id_135364;\n    \n    phys_group_id_135364 = get_group_id(0);\n    for (int32_t i_135365 = 0; i_135365 <\n         sdiv_up32(sext_i64_i32(virt_num_groups_135348) - phys_group_id_135364,\n                   sext_i64_i32(num_groups_128548)); i_135365++) {\n        int32_t virt_group_id_135366 = phys_group_id_135364 + i_135365 *\n                sext_i64_i32(num_groups_128548);\n        int32_t flat_segment_id_135367 = squot32(virt_group_id_135366,\n                                                 sext_i64_i32(groups_per_segment_135346));\n        int64_t global_tid_135368 = srem64(sext_i32_i64(virt_group_id_135366) *\n                                           segred_group_sizze_128547 +\n                                           sext_i32_i64(local_tid_135356),\n                                           segred_group_sizze_128547 *\n                                           groups_per_segment_135346);\n        int64_t slice_135369 = m_114533;\n        int64_t gtid_128530 = sext_i32_i64(flat_segment_id_135367);\n        int64_t remnant_135370 = sext_i32_i64(flat_segment_id_135367) -\n                gtid_128530;\n        int64_t gtid_128538;\n        float x_acc_135371;\n        int64_t chunk_sizze_135372 = smin64(elements_per_thread_135347,\n                                            sdiv_up64(j_m_i_115007 -\n                                                      global_tid_135368,\n                                                      threads",
                   "_per_segment_135350));\n        float x_128551;\n        float x_128552;\n        \n        // neutral-initialise the accumulators\n        {\n            x_acc_135371 = 0.0F;\n        }\n        for (int64_t i_135376 = 0; i_135376 < chunk_sizze_135372; i_135376++) {\n            gtid_128538 = global_tid_135368 + threads_per_segment_135350 *\n                i_135376;\n            // apply map function\n            {\n                int64_t slice_129027 = stl_res_114604 + gtid_128538;\n                float x_128555 = ((__global\n                                   float *) defunc_3_map_res_mem_131929)[gtid_128530 *\n                                                                         n_114534 +\n                                                                         slice_129027];\n                \n                // save map-out results\n                { }\n                // load accumulator\n                {\n                    x_128551 = x_acc_135371;\n                }\n                // load new values\n                {\n                    x_128552 = x_128555;\n                }\n                // apply reduction operator\n                {\n                    float defunc_1_op_res_128553 = x_128551 + x_128552;\n                    \n                    // store in accumulator\n                    {\n                        x_acc_135371 = defunc_1_op_res_128553;\n                    }\n                }\n            }\n        }\n        // to reduce current chunk, first store our result in memory\n        {\n            x_128551 = x_acc_135371;\n            ((__local\n              float *) red_arr_mem_135360)[sext_i32_i64(local_tid_135356)] =\n                x_128551;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        \n        int32_t offset_135377;\n        int32_t skip_waves_135378 = 1;\n        float x_135373;\n        float x_135374;\n        \n        offset_135377 = 0;\n        // participating threads read initial accumulator\n        {\n            if (slt32(local_tid_135356,\n     ",
                   "                 sext_i64_i32(segred_group_sizze_128547))) {\n                x_135373 = ((__local\n                             float *) red_arr_mem_135360)[sext_i32_i64(local_tid_135356 +\n                                                          offset_135377)];\n            }\n        }\n        offset_135377 = 1;\n        while (slt32(offset_135377, wave_sizze_135358)) {\n            if (slt32(local_tid_135356 + offset_135377,\n                      sext_i64_i32(segred_group_sizze_128547)) &&\n                ((local_tid_135356 - squot32(local_tid_135356,\n                                             wave_sizze_135358) *\n                  wave_sizze_135358) & (2 * offset_135377 - 1)) == 0) {\n                // read array element\n                {\n                    x_135374 = ((volatile __local\n                                 float *) red_arr_mem_135360)[sext_i32_i64(local_tid_135356 +\n                                                              offset_135377)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_135375 = x_135373 + x_135374;\n                    \n                    x_135373 = defunc_1_op_res_135375;\n                }\n                // write result of operation\n                {\n                    ((volatile __local\n                      float *) red_arr_mem_135360)[sext_i32_i64(local_tid_135356)] =\n                        x_135373;\n                }\n            }\n            offset_135377 *= 2;\n        }\n        while (slt32(skip_waves_135378,\n                     squot32(sext_i64_i32(segred_group_sizze_128547) +\n                             wave_sizze_135358 - 1, wave_sizze_135358))) {\n            barrier(CLK_LOCAL_MEM_FENCE);\n            offset_135377 = skip_waves_135378 * wave_sizze_135358;\n            if (slt32(local_tid_135356 + offset_135377,\n                      sext_i64_i32(segred_group_sizze_128547)) &&\n                ((local_tid_135356 - squot32(local_tid_135356,\n    ",
                   "                                         wave_sizze_135358) *\n                  wave_sizze_135358) == 0 && (squot32(local_tid_135356,\n                                                      wave_sizze_135358) & (2 *\n                                                                            skip_waves_135378 -\n                                                                            1)) ==\n                 0)) {\n                // read array element\n                {\n                    x_135374 = ((__local\n                                 float *) red_arr_mem_135360)[sext_i32_i64(local_tid_135356 +\n                                                              offset_135377)];\n                }\n                // apply reduction operation\n                {\n                    float defunc_1_op_res_135375 = x_135373 + x_135374;\n                    \n                    x_135373 = defunc_1_op_res_135375;\n                }\n                // write result of operation\n                {\n                    ((__local\n                      float *) red_arr_mem_135360)[sext_i32_i64(local_tid_135356)] =\n                        x_135373;\n                }\n            }\n            skip_waves_135378 *= 2;\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        // first thread saves the result in accumulator\n        {\n            if (sext_i32_i64(local_tid_135356) == (int64_t) 0) {\n                x_acc_135371 = x_135373;\n            }\n        }\n        if (groups_per_segment_135346 == (int64_t) 1) {\n            // first thread in group saves final result to memory\n            {\n                if (local_tid_135356 == 0) {\n                    ((__global float *) mem_131946)[gtid_128530] = x_acc_135371;\n                }\n            }\n        } else {\n            int32_t old_counter_135379;\n            \n            // first thread in group saves group result to global memory\n            {\n                if (local_tid_135356 == 0) {\n                    ((__global\n                ",
                   "      float *) segred_tmp_mem_135351)[sext_i32_i64(virt_group_id_135366)] =\n                        x_acc_135371;\n                    mem_fence_global();\n                    old_counter_135379 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_135353)[sext_i32_i64(srem32(flat_segment_id_135367,\n                                                                                                      10240))],\n                                              (int) 1);\n                    ((__local bool *) sync_arr_mem_135362)[(int64_t) 0] =\n                        old_counter_135379 == groups_per_segment_135346 -\n                        (int64_t) 1;\n                }\n            }\n            barrier(CLK_GLOBAL_MEM_FENCE | CLK_LOCAL_MEM_FENCE);\n            \n            bool is_last_group_135380 = ((__local\n                                          bool *) sync_arr_mem_135362)[(int64_t) 0];\n            \n            if (is_last_group_135380) {\n                if (local_tid_135356 == 0) {\n                    old_counter_135379 =\n                        atomic_add_i32_global(&((volatile __global\n                                                 int *) mainzicounter_mem_135353)[sext_i32_i64(srem32(flat_segment_id_135367,\n                                                                                                      10240))],\n                                              (int) ((int64_t) 0 -\n                                                     groups_per_segment_135346));\n                }\n                // read in the per-group-results\n                {\n                    int64_t read_per_thread_135381 =\n                            sdiv_up64(groups_per_segment_135346,\n                                      segred_group_sizze_128547);\n                    \n                    x_128551 = 0.0F;\n                    for (int64_t i_135382 = 0; i_135382 <\n                         read_per_th",
                   "read_135381; i_135382++) {\n                        int64_t group_res_id_135383 =\n                                sext_i32_i64(local_tid_135356) *\n                                read_per_thread_135381 + i_135382;\n                        int64_t index_of_group_res_135384 =\n                                sext_i32_i64(flat_segment_id_135367) *\n                                groups_per_segment_135346 + group_res_id_135383;\n                        \n                        if (slt64(group_res_id_135383,\n                                  groups_per_segment_135346)) {\n                            x_128552 = ((__global\n                                         float *) segred_tmp_mem_135351)[index_of_group_res_135384];\n                            \n                            float defunc_1_op_res_128553 = x_128551 + x_128552;\n                            \n                            x_128551 = defunc_1_op_res_128553;\n                        }\n                    }\n                }\n                ((__local\n                  float *) red_arr_mem_135360)[sext_i32_i64(local_tid_135356)] =\n                    x_128551;\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // reduce the per-group results\n                {\n                    int32_t offset_135385;\n                    int32_t skip_waves_135386 = 1;\n                    float x_135373;\n                    float x_135374;\n                    \n                    offset_135385 = 0;\n                    // participating threads read initial accumulator\n                    {\n                        if (slt32(local_tid_135356,\n                                  sext_i64_i32(segred_group_sizze_128547))) {\n                            x_135373 = ((__local\n                                         float *) red_arr_mem_135360)[sext_i32_i64(local_tid_135356 +\n                                                                      offset_135385)];\n                        }\n                    }\n                    offset_135",
                   "385 = 1;\n                    while (slt32(offset_135385, wave_sizze_135358)) {\n                        if (slt32(local_tid_135356 + offset_135385,\n                                  sext_i64_i32(segred_group_sizze_128547)) &&\n                            ((local_tid_135356 - squot32(local_tid_135356,\n                                                         wave_sizze_135358) *\n                              wave_sizze_135358) & (2 * offset_135385 - 1)) ==\n                            0) {\n                            // read array element\n                            {\n                                x_135374 = ((volatile __local\n                                             float *) red_arr_mem_135360)[sext_i32_i64(local_tid_135356 +\n                                                                          offset_135385)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_135375 = x_135373 +\n                                      x_135374;\n                                \n                                x_135373 = defunc_1_op_res_135375;\n                            }\n                            // write result of operation\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_135360)[sext_i32_i64(local_tid_135356)] =\n                                    x_135373;\n                            }\n                        }\n                        offset_135385 *= 2;\n                    }\n                    while (slt32(skip_waves_135386,\n                                 squot32(sext_i64_i32(segred_group_sizze_128547) +\n                                         wave_sizze_135358 - 1,\n                                         wave_sizze_135358))) {\n                        barrier(CLK_LOCAL_MEM_FENCE);\n                        offset_135385 = skip_waves_135386 * wave_sizze_135358;\n   ",
                   "                     if (slt32(local_tid_135356 + offset_135385,\n                                  sext_i64_i32(segred_group_sizze_128547)) &&\n                            ((local_tid_135356 - squot32(local_tid_135356,\n                                                         wave_sizze_135358) *\n                              wave_sizze_135358) == 0 &&\n                             (squot32(local_tid_135356, wave_sizze_135358) &\n                              (2 * skip_waves_135386 - 1)) == 0)) {\n                            // read array element\n                            {\n                                x_135374 = ((__local\n                                             float *) red_arr_mem_135360)[sext_i32_i64(local_tid_135356 +\n                                                                          offset_135385)];\n                            }\n                            // apply reduction operation\n                            {\n                                float defunc_1_op_res_135375 = x_135373 +\n                                      x_135374;\n                                \n                                x_135373 = defunc_1_op_res_135375;\n                            }\n                            // write result of operation\n                            {\n                                ((__local\n                                  float *) red_arr_mem_135360)[sext_i32_i64(local_tid_135356)] =\n                                    x_135373;\n                            }\n                        }\n                        skip_waves_135386 *= 2;\n                    }\n                    // and back to memory with the final result\n                    {\n                        if (local_tid_135356 == 0) {\n                            ((__global float *) mem_131946)[gtid_128530] =\n                                x_135373;\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_128547\n}\n__kernel void mainzisegred_small_117097(__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_132445_backing_aligned_0,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t n_p_114536,\n                                        int64_t css_chunk_len_114580,\n                                        int64_t num_groups_117174,\n                                        int64_t segment_sizze_nonzzero_132438,\n                                        __global unsigned char *Y_mem_130086,\n                                        __global unsigned char *mem_130127,\n                                        __global unsigned char *mem_130191)\n{\n    #define segred_group_sizze_117173 (mainzisegred_group_sizze_117091)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_132445_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_132445_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_132440;\n    int32_t local_tid_132441;\n    int64_t group_sizze_132444;\n    int32_t wave_sizze_132443;\n    int32_t group_tid_132442;\n    \n    global_tid_132440 = get_global_id(0);\n    local_tid_132441 = get_local_id(0);\n    group_sizze_132444 = get_local_size(0);\n    wave_sizze_132443 = LOCKSTEP_WIDTH;\n    group_tid_132442 = get_group_id(0);\n    \n    int32_t phys_ti",
                   "d_117097 = global_tid_132440;\n    __local char *red_arr_mem_132445;\n    \n    red_arr_mem_132445 = (__local char *) red_arr_mem_132445_backing_0;\n    \n    int32_t phys_group_id_132447;\n    \n    phys_group_id_132447 = get_group_id(0);\n    for (int32_t i_132448 = 0; i_132448 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533 * n_p_114536,\n                                          squot64(segred_group_sizze_117173,\n                                                  segment_sizze_nonzzero_132438))) -\n                   phys_group_id_132447, sext_i64_i32(num_groups_117174));\n         i_132448++) {\n        int32_t virt_group_id_132449 = phys_group_id_132447 + i_132448 *\n                sext_i64_i32(num_groups_117174);\n        int64_t slice_132450 = n_p_114536;\n        int64_t slice_132451 = m_114533 * slice_132450;\n        int64_t gtid_117086 = squot64(squot64(sext_i32_i64(local_tid_132441),\n                                              segment_sizze_nonzzero_132438) +\n                                      sext_i32_i64(virt_group_id_132449) *\n                                      squot64(segred_group_sizze_117173,\n                                              segment_sizze_nonzzero_132438),\n                                      slice_132450);\n        int64_t remnant_132452 = squot64(sext_i32_i64(local_tid_132441),\n                                         segment_sizze_nonzzero_132438) +\n                sext_i32_i64(virt_group_id_132449) *\n                squot64(segred_group_sizze_117173,\n                        segment_sizze_nonzzero_132438) - gtid_117086 *\n                slice_132450;\n        int64_t gtid_117087 = remnant_132452;\n        int64_t remnant_132453 = remnant_132452 - gtid_117087;\n        int64_t gtid_117096 = srem64(sext_i32_i64(local_tid_132441),\n                                     css_chunk_len_114580);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, css_chunk_len_114580) && ((slt64(gtid_117086,\n          ",
                   "                                                          m_114533) &&\n                                                              slt64(gtid_117087,\n                                                                    n_p_114536)) &&\n                                                             slt64(sext_i32_i64(local_tid_132441),\n                                                                   css_chunk_len_114580 *\n                                                                   squot64(segred_group_sizze_117173,\n                                                                           segment_sizze_nonzzero_132438)))) {\n                int64_t x_117182 = ((__global\n                                     int64_t *) mem_130127)[gtid_117087 *\n                                                            css_chunk_len_114580 +\n                                                            gtid_117096];\n                bool cond_117183 = sle64((int64_t) 0, x_117182);\n                float defunc_0_f_res_117184;\n                \n                if (cond_117183) {\n                    bool y_117185 = slt64(x_117182, n_114534);\n                    bool bounds_check_117186 = cond_117183 && y_117185;\n                    bool index_certs_117187;\n                    \n                    if (!bounds_check_117186) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          5) == -1) {\n                                global_failure_args[0] = x_117182;\n                                global_failure_args[1] = n_114534;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    float defunc_0_f_res_t_res_117188 = ((__global\n                                                          float *) Y_mem_1",
                   "30086)[gtid_117086 *\n                                                                                 n_114534 +\n                                                                                 x_117182];\n                    \n                    defunc_0_f_res_117184 = defunc_0_f_res_t_res_117188;\n                } else {\n                    defunc_0_f_res_117184 = NAN;\n                }\n                \n                bool isnan_res_117189;\n                \n                isnan_res_117189 = futrts_isnan32(defunc_0_f_res_117184);\n                \n                float defunc_0_f_res_117190;\n                \n                if (isnan_res_117189) {\n                    defunc_0_f_res_117190 = 0.0F;\n                } else {\n                    defunc_0_f_res_117190 = 1.0F;\n                }\n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_132445)[sext_i32_i64(local_tid_132441)] =\n                        defunc_0_f_res_117190;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_132445)[sext_i32_i64(local_tid_132441)] =\n                    0.0F;\n            }\n        }\n        \n      error_0:\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_failure)\n            return;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, css_chunk_len_114580)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_117177;\n                float x_117178;\n                float x_132454;\n                float x_132455;\n                bool ltid_in_bounds_132457 =\n                     slt64(sext_i32_i64(local_tid_132441),\n                           css_chunk_len_114580 *\n                           squot64(segred_group_sizze_117173,\n                                   segment_sizze_nonzzero_132438));\n                int32_t skip_t",
                   "hreads_132458;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_132457) {\n                        x_117178 = ((volatile __local\n                                     float *) red_arr_mem_132445)[sext_i32_i64(local_tid_132441)];\n                        if ((local_tid_132441 - squot32(local_tid_132441, 32) *\n                             32) == 0) {\n                            x_117177 = x_117178;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_132458 = 1;\n                    while (slt32(skip_threads_132458, 32)) {\n                        if (sle32(skip_threads_132458, local_tid_132441 -\n                                  squot32(local_tid_132441, 32) * 32) &&\n                            ltid_in_bounds_132457) {\n                            // read operands\n                            {\n                                x_117177 = ((volatile __local\n                                             float *) red_arr_mem_132445)[sext_i32_i64(local_tid_132441) -\n                                                                          sext_i32_i64(skip_threads_132458)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_132459 =\n                                     slt64(srem64(sext_i32_i64(local_tid_132441),\n                                                  css_chunk_len_114580),\n                                           sext_i32_i64(local_tid_132441) -\n                                           sext_i32_i64(local_tid_132441 -\n                                           skip_threads_132458));\n                                \n                                if (inactive_132459) {\n                                    x_117177 = x_117178;\n                                }\n       ",
                   "                         if (!inactive_132459) {\n                                    float defunc_1_op_res_117179 = x_117177 +\n                                          x_117178;\n                                    \n                                    x_117177 = defunc_1_op_res_117179;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_132443, skip_threads_132458)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_132458, local_tid_132441 -\n                                  squot32(local_tid_132441, 32) * 32) &&\n                            ltid_in_bounds_132457) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_132445)[sext_i32_i64(local_tid_132441)] =\n                                    x_117177;\n                                x_117178 = x_117177;\n                            }\n                        }\n                        if (sle32(wave_sizze_132443, skip_threads_132458)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_132458 *= 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_132441 - squot32(local_tid_132441, 32) *\n                         32) == 31 && ltid_in_bounds_132457) {\n                        ((volatile __local\n                          float *) red_arr_mem_132445)[sext_i32_i64(squot32(local_tid_132441,\n                                                                            32))] =\n                            x_117177;\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_132460;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_132441, 32) == 0 &&\n                            ltid_in_bounds_132457) {\n                            x_132455 = ((volatile __local\n                                         float *) red_arr_mem_132445)[sext_i32_i64(local_tid_132441)];\n                            if ((local_tid_132441 - squot32(local_tid_132441,\n                                                            32) * 32) == 0) {\n                                x_132454 = x_132455;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_132460 = 1;\n                        while (slt32(skip_threads_132460, 32)) {\n                            if (sle32(skip_threads_132460, local_tid_132441 -\n                                      squot32(local_tid_132441, 32) * 32) &&\n                                (squot32(local_tid_132441, 32) == 0 &&\n                                 ltid_in_bounds_132457)) {\n                                // read operands\n                                {\n                                    x_132454 = ((volatile __local\n                                                 float *) red_arr_mem_132445)[sext_i32_i64(local_tid_132441) -\n                                                                              sext_i32_i64(skip_threads_132460)];\n                                }\n                                // perform operation\n                                {\n                                    bool inactive_132461 =\n                                         slt64(srem64(sext_i32_i64(local_tid_132441 *\n                                                      ",
                   "32 + 32 - 1),\n                                                      css_chunk_len_114580),\n                                               sext_i32_i64(local_tid_132441 *\n                                               32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_132441 -\n                                                             skip_threads_132460) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_132461) {\n                                        x_132454 = x_132455;\n                                    }\n                                    if (!inactive_132461) {\n                                        float defunc_1_op_res_132456 =\n                                              x_132454 + x_132455;\n                                        \n                                        x_132454 = defunc_1_op_res_132456;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_132443, skip_threads_132460)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_132460, local_tid_132441 -\n                                      squot32(local_tid_132441, 32) * 32) &&\n                                (squot32(local_tid_132441, 32) == 0 &&\n                                 ltid_in_bounds_132457)) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_132445)[sext_i32_i64(local_tid_132441)] =\n                                        x_132454;\n                                    x_132455 = x_132454;\n                                }\n                            }\n                            if (sle32(wave_sizze_132443, skip_th",
                   "reads_132460)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_132460 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n                    if (!(squot32(local_tid_132441, 32) == 0 ||\n                          !ltid_in_bounds_132457)) {\n                        // read operands\n                        {\n                            x_117178 = x_117177;\n                            x_117177 = ((__local\n                                         float *) red_arr_mem_132445)[sext_i32_i64(squot32(local_tid_132441,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_132462 =\n                                 slt64(srem64(sext_i32_i64(local_tid_132441),\n                                              css_chunk_len_114580),\n                                       sext_i32_i64(local_tid_132441) -\n                                       sext_i32_i64(squot32(local_tid_132441,\n                                                            32) * 32 - 1));\n                            \n                            if (inactive_132462) {\n                                x_117177 = x_117178;\n                            }\n                            if (!inactive_132462) {\n                                float defunc_1_op_res_117179 = x_117177 +\n                                      x_117178;\n                                \n                                x_117177 = defunc_1_op_res_117179;\n                            }\n                        }\n                        // write final result\n             ",
                   "           {\n                            ((__local\n                              float *) red_arr_mem_132445)[sext_i32_i64(local_tid_132441)] =\n                                x_117177;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_132441, 32) == 0) {\n                        ((__local\n                          float *) red_arr_mem_132445)[sext_i32_i64(local_tid_132441)] =\n                            x_117178;\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_132449) *\n                      squot64(segred_group_sizze_117173,\n                              segment_sizze_nonzzero_132438) +\n                      sext_i32_i64(local_tid_132441), m_114533 * n_p_114536) &&\n                slt64(sext_i32_i64(local_tid_132441),\n                      squot64(segred_group_sizze_117173,\n                              segment_sizze_nonzzero_132438))) {\n                ((__global\n                  float *) mem_130191)[squot64(sext_i32_i64(virt_group_id_132449) *\n                                               squot64(segred_group_sizze_117173,\n                                                       segment_sizze_nonzzero_132438) +\n                                               sext_i32_i64(local_tid_132441),\n                                               n_p_114536) * n_p_114536 +\n                                       (sext_i32_i64(virt_group_id_132449) *\n                                        squot64(segred_group_sizze_117173,\n                                                segment_sizze_nonzzero_132438) +\n                                        sext_i32_i64(local_tid_132441) -\n                             ",
                   "           squot64(sext_i32_i64(virt_group_id_132449) *\n                                                squot64(segred_group_sizze_117173,\n                                                        segment_sizze_nonzzero_132438) +\n                                                sext_i32_i64(local_tid_132441),\n                                                n_p_114536) * n_p_114536)] =\n                    ((__local\n                      float *) red_arr_mem_132445)[(sext_i32_i64(local_tid_132441) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_132438 -\n                                                   (int64_t) 1];\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_117173\n}\n__kernel void mainzisegred_small_117941(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_132658_backing_aligned_0,\n                                        int64_t m_114533, int64_t l_jump_114542,\n                                        int64_t l_n_m_114584, int64_t i_114610,\n                                        int64_t min_res_114683,\n                                        int64_t num_groups_118414,\n                                        int64_t segment_sizze_nonzzero_132651,\n                                        __global unsigned char *mem_130375,\n                                        __global unsigned char *mem_130380)\n{\n    #define segred_group_sizze_118413 (mainzisegred_group_sizze_117935)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_132658_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_132658_backing_aligned_0;",
                   "\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_132653;\n    int32_t local_tid_132654;\n    int64_t group_sizze_132657;\n    int32_t wave_sizze_132656;\n    int32_t group_tid_132655;\n    \n    global_tid_132653 = get_global_id(0);\n    local_tid_132654 = get_local_id(0);\n    group_sizze_132657 = get_local_size(0);\n    wave_sizze_132656 = LOCKSTEP_WIDTH;\n    group_tid_132655 = get_group_id(0);\n    \n    int32_t phys_tid_117941 = global_tid_132653;\n    __local char *red_arr_mem_132658;\n    \n    red_arr_mem_132658 = (__local char *) red_arr_mem_132658_backing_0;\n    \n    int32_t phys_group_id_132660;\n    \n    phys_group_id_132660 = get_group_id(0);\n    for (int32_t i_132661 = 0; i_132661 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533 * l_n_m_114584,\n                                          squot64(segred_group_sizze_118413,\n                                                  segment_sizze_nonzzero_132651))) -\n                   phys_group_id_132660, sext_i64_i32(num_groups_118414));\n         i_132661++) {\n        int32_t virt_group_id_132662 = phys_group_id_132660 + i_132661 *\n                sext_i64_i32(num_groups_118414);\n        int64_t slice_132663 = l_n_m_114584;\n        int64_t slice_132664 = m_114533 * slice_132663;\n        int64_t gtid_117930 = squot64(squot64(sext_i32_i64(local_tid_132654),\n                                              segment_sizze_nonzzero_132651) +\n                                      sext_i32_i64(virt_group_id_132662) *\n                                      squot64(segred_group_sizze_118413,\n                                              segment_sizze_nonzzero_132651),\n                                      slice_132663);\n        int64_t remnant_132665 = squot64(sext_i32_i64(local_tid_132654),\n                                         segment_sizze_nonzzero_132651) +\n                sext_i32_i64(virt_group_id_132662) *\n                squot64(segred_group_sizze_118413,\n                        segment_sizze_nonz",
                   "zero_132651) - gtid_117930 *\n                slice_132663;\n        int64_t gtid_117931 = remnant_132665;\n        int64_t remnant_132666 = remnant_132665 - gtid_117931;\n        int64_t gtid_117940 = srem64(sext_i32_i64(local_tid_132654),\n                                     min_res_114683);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, min_res_114683) && ((slt64(gtid_117930,\n                                                              m_114533) &&\n                                                        slt64(gtid_117931,\n                                                              l_n_m_114584)) &&\n                                                       slt64(sext_i32_i64(local_tid_132654),\n                                                             min_res_114683 *\n                                                             squot64(segred_group_sizze_118413,\n                                                                     segment_sizze_nonzzero_132651)))) {\n                int64_t binop_y_128737 = mul64(l_jump_114542, gtid_117931);\n                int64_t binop_y_128738 = smin64(i_114610, binop_y_128737);\n                int64_t index_primexp_128739 = add64((int64_t) 1,\n                                                     binop_y_128738);\n                int64_t x_118424 = ((__global\n                                     int64_t *) mem_130375)[gtid_117930 *\n                                                            (min_res_114683 *\n                                                             l_n_m_114584) +\n                                                            gtid_117931 *\n                                                            min_res_114683 +\n                                                            gtid_117940];\n                int64_t abs_arg_118425 = sub64(x_118424, index_primexp_128739);\n                int64_t abs_res_118426 = abs(abs_arg_118425);\n                \n                // save ",
                   "map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      int64_t *) red_arr_mem_132658)[sext_i32_i64(local_tid_132654)] =\n                        abs_res_118426;\n                }\n            } else {\n                ((__local\n                  int64_t *) red_arr_mem_132658)[sext_i32_i64(local_tid_132654)] =\n                    (int64_t) 0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, min_res_114683)) {\n            // perform segmented scan to imitate reduction\n            {\n                int64_t x_118417;\n                int64_t x_118418;\n                int64_t x_132667;\n                int64_t x_132668;\n                bool ltid_in_bounds_132670 =\n                     slt64(sext_i32_i64(local_tid_132654), min_res_114683 *\n                           squot64(segred_group_sizze_118413,\n                                   segment_sizze_nonzzero_132651));\n                int32_t skip_threads_132671;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_132670) {\n                        x_118418 = ((volatile __local\n                                     int64_t *) red_arr_mem_132658)[sext_i32_i64(local_tid_132654)];\n                        if ((local_tid_132654 - squot32(local_tid_132654, 32) *\n                             32) == 0) {\n                            x_118417 = x_118418;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_132671 = 1;\n                    while (slt32(skip_threads_132671, 32)) {\n                        if (sle32(skip_threads_132671, local_tid_132654 -\n                                  squot32(local_tid_132654, 32) * 32) &&\n                            ltid_in_bounds_132670) {\n                            // rea",
                   "d operands\n                            {\n                                x_118417 = ((volatile __local\n                                             int64_t *) red_arr_mem_132658)[sext_i32_i64(local_tid_132654) -\n                                                                            sext_i32_i64(skip_threads_132671)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_132672 =\n                                     slt64(srem64(sext_i32_i64(local_tid_132654),\n                                                  min_res_114683),\n                                           sext_i32_i64(local_tid_132654) -\n                                           sext_i32_i64(local_tid_132654 -\n                                           skip_threads_132671));\n                                \n                                if (inactive_132672) {\n                                    x_118417 = x_118418;\n                                }\n                                if (!inactive_132672) {\n                                    int64_t defunc_1_op_res_118419 =\n                                            add64(x_118417, x_118418);\n                                    \n                                    x_118417 = defunc_1_op_res_118419;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_132656, skip_threads_132671)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_132671, local_tid_132654 -\n                                  squot32(local_tid_132654, 32) * 32) &&\n                            ltid_in_bounds_132670) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  int64_t *) red_arr_mem_132658)[sext_i32_i64(local_tid",
                   "_132654)] =\n                                    x_118417;\n                                x_118418 = x_118417;\n                            }\n                        }\n                        if (sle32(wave_sizze_132656, skip_threads_132671)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_132671 *= 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_132654 - squot32(local_tid_132654, 32) *\n                         32) == 31 && ltid_in_bounds_132670) {\n                        ((volatile __local\n                          int64_t *) red_arr_mem_132658)[sext_i32_i64(squot32(local_tid_132654,\n                                                                              32))] =\n                            x_118417;\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_132673;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_132654, 32) == 0 &&\n                            ltid_in_bounds_132670) {\n                            x_132668 = ((volatile __local\n                                         int64_t *) red_arr_mem_132658)[sext_i32_i64(local_tid_132654)];\n                            if ((local_tid_132654 - squot32(local_tid_132654,\n                                                            32) * 32) == 0) {\n                                x_132667 = x_132668;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_thread",
                   "s_132673 = 1;\n                        while (slt32(skip_threads_132673, 32)) {\n                            if (sle32(skip_threads_132673, local_tid_132654 -\n                                      squot32(local_tid_132654, 32) * 32) &&\n                                (squot32(local_tid_132654, 32) == 0 &&\n                                 ltid_in_bounds_132670)) {\n                                // read operands\n                                {\n                                    x_132667 = ((volatile __local\n                                                 int64_t *) red_arr_mem_132658)[sext_i32_i64(local_tid_132654) -\n                                                                                sext_i32_i64(skip_threads_132673)];\n                                }\n                                // perform operation\n                                {\n                                    bool inactive_132674 =\n                                         slt64(srem64(sext_i32_i64(local_tid_132654 *\n                                                      32 + 32 - 1),\n                                                      min_res_114683),\n                                               sext_i32_i64(local_tid_132654 *\n                                               32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_132654 -\n                                                             skip_threads_132673) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_132674) {\n                                        x_132667 = x_132668;\n                                    }\n                                    if (!inactive_132674) {\n                                        int64_t defunc_1_op_res_132669 =\n                                                add64(x_132667, x_132668);\n                                        \n                                        x_",
                   "132667 = defunc_1_op_res_132669;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_132656, skip_threads_132673)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_132673, local_tid_132654 -\n                                      squot32(local_tid_132654, 32) * 32) &&\n                                (squot32(local_tid_132654, 32) == 0 &&\n                                 ltid_in_bounds_132670)) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      int64_t *) red_arr_mem_132658)[sext_i32_i64(local_tid_132654)] =\n                                        x_132667;\n                                    x_132668 = x_132667;\n                                }\n                            }\n                            if (sle32(wave_sizze_132656, skip_threads_132673)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_132673 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n                    if (!(squot32(local_tid_132654, 32) == 0 ||\n                          !ltid_in_bounds_132670)) {\n                        // read operands\n                        {\n                            x_118418 = x_118417;\n                            x_118417 = ((__local\n                                         int64_t *) red_arr_mem_132658)[sext_i32_i64(squot32(local_tid_132654,\n                                                                                             32)) -\n                                                                        (int64_t) 1];",
                   "\n                        }\n                        // perform operation\n                        {\n                            bool inactive_132675 =\n                                 slt64(srem64(sext_i32_i64(local_tid_132654),\n                                              min_res_114683),\n                                       sext_i32_i64(local_tid_132654) -\n                                       sext_i32_i64(squot32(local_tid_132654,\n                                                            32) * 32 - 1));\n                            \n                            if (inactive_132675) {\n                                x_118417 = x_118418;\n                            }\n                            if (!inactive_132675) {\n                                int64_t defunc_1_op_res_118419 = add64(x_118417,\n                                                                       x_118418);\n                                \n                                x_118417 = defunc_1_op_res_118419;\n                            }\n                        }\n                        // write final result\n                        {\n                            ((__local\n                              int64_t *) red_arr_mem_132658)[sext_i32_i64(local_tid_132654)] =\n                                x_118417;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_132654, 32) == 0) {\n                        ((__local\n                          int64_t *) red_arr_mem_132658)[sext_i32_i64(local_tid_132654)] =\n                            x_118418;\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_132662) *\n                      squot64(se",
                   "gred_group_sizze_118413,\n                              segment_sizze_nonzzero_132651) +\n                      sext_i32_i64(local_tid_132654), m_114533 *\n                      l_n_m_114584) && slt64(sext_i32_i64(local_tid_132654),\n                                             squot64(segred_group_sizze_118413,\n                                                     segment_sizze_nonzzero_132651))) {\n                ((__global\n                  int64_t *) mem_130380)[squot64(sext_i32_i64(virt_group_id_132662) *\n                                                 squot64(segred_group_sizze_118413,\n                                                         segment_sizze_nonzzero_132651) +\n                                                 sext_i32_i64(local_tid_132654),\n                                                 l_n_m_114584) * l_n_m_114584 +\n                                         (sext_i32_i64(virt_group_id_132662) *\n                                          squot64(segred_group_sizze_118413,\n                                                  segment_sizze_nonzzero_132651) +\n                                          sext_i32_i64(local_tid_132654) -\n                                          squot64(sext_i32_i64(virt_group_id_132662) *\n                                                  squot64(segred_group_sizze_118413,\n                                                          segment_sizze_nonzzero_132651) +\n                                                  sext_i32_i64(local_tid_132654),\n                                                  l_n_m_114584) *\n                                          l_n_m_114584)] = ((__local\n                                                             int64_t *) red_arr_mem_132658)[(sext_i32_i64(local_tid_132654) +\n                                                                                             (int64_t) 1) *\n                                                                                            segment_sizze_nonzzero_132651 -\n  ",
                   "                                                                                          (int64_t) 1];\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_118413\n}\n__kernel void mainzisegred_small_119241(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_132876_backing_aligned_0,\n                                        int64_t m_114533, int64_t t_jump_114541,\n                                        int64_t t_n_m_114591, int64_t i_114610,\n                                        int64_t min_res_114809,\n                                        int64_t num_groups_119714,\n                                        int64_t segment_sizze_nonzzero_132869,\n                                        __global unsigned char *mem_130577,\n                                        __global unsigned char *mem_130582)\n{\n    #define segred_group_sizze_119713 (mainzisegred_group_sizze_119235)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_132876_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_132876_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_132871;\n    int32_t local_tid_132872;\n    int64_t group_sizze_132875;\n    int32_t wave_sizze_132874;\n    int32_t group_tid_132873;\n    \n    global_tid_132871 = get_global_id(0);\n    local_tid_132872 = get_local_id(0);\n    group_sizze_132875 = get_local_size(0);\n    wave_sizze_132874 = LOCKSTEP_WIDTH;\n    group_tid_132873 = get_group_id(0);\n    \n    int32_t phys_tid_119241 = global_tid_132871;\n    __local char *red_arr_mem_132876;\n    \n    red_arr_mem_132876 = (__local char *) red_arr_mem_132876_backing_0;\n    \n    int32_t phy",
                   "s_group_id_132878;\n    \n    phys_group_id_132878 = get_group_id(0);\n    for (int32_t i_132879 = 0; i_132879 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533 * t_n_m_114591,\n                                          squot64(segred_group_sizze_119713,\n                                                  segment_sizze_nonzzero_132869))) -\n                   phys_group_id_132878, sext_i64_i32(num_groups_119714));\n         i_132879++) {\n        int32_t virt_group_id_132880 = phys_group_id_132878 + i_132879 *\n                sext_i64_i32(num_groups_119714);\n        int64_t slice_132881 = t_n_m_114591;\n        int64_t slice_132882 = m_114533 * slice_132881;\n        int64_t gtid_119230 = squot64(squot64(sext_i32_i64(local_tid_132872),\n                                              segment_sizze_nonzzero_132869) +\n                                      sext_i32_i64(virt_group_id_132880) *\n                                      squot64(segred_group_sizze_119713,\n                                              segment_sizze_nonzzero_132869),\n                                      slice_132881);\n        int64_t remnant_132883 = squot64(sext_i32_i64(local_tid_132872),\n                                         segment_sizze_nonzzero_132869) +\n                sext_i32_i64(virt_group_id_132880) *\n                squot64(segred_group_sizze_119713,\n                        segment_sizze_nonzzero_132869) - gtid_119230 *\n                slice_132881;\n        int64_t gtid_119231 = remnant_132883;\n        int64_t remnant_132884 = remnant_132883 - gtid_119231;\n        int64_t gtid_119240 = srem64(sext_i32_i64(local_tid_132872),\n                                     min_res_114809);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, min_res_114809) && ((slt64(gtid_119230,\n                                                              m_114533) &&\n                                                        slt64(gtid_119231,\n                                 ",
                   "                             t_n_m_114591)) &&\n                                                       slt64(sext_i32_i64(local_tid_132872),\n                                                             min_res_114809 *\n                                                             squot64(segred_group_sizze_119713,\n                                                                     segment_sizze_nonzzero_132869)))) {\n                int64_t binop_y_128771 = mul64(t_jump_114541, gtid_119231);\n                int64_t binop_y_128772 = smin64(i_114610, binop_y_128771);\n                int64_t index_primexp_128773 = add64((int64_t) 1,\n                                                     binop_y_128772);\n                int64_t x_119724 = ((__global\n                                     int64_t *) mem_130577)[gtid_119230 *\n                                                            (min_res_114809 *\n                                                             t_n_m_114591) +\n                                                            gtid_119231 *\n                                                            min_res_114809 +\n                                                            gtid_119240];\n                int64_t abs_arg_119725 = sub64(x_119724, index_primexp_128773);\n                int64_t abs_res_119726 = abs(abs_arg_119725);\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      int64_t *) red_arr_mem_132876)[sext_i32_i64(local_tid_132872)] =\n                        abs_res_119726;\n                }\n            } else {\n                ((__local\n                  int64_t *) red_arr_mem_132876)[sext_i32_i64(local_tid_132872)] =\n                    (int64_t) 0;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, min_res_114809)) {\n            // perform segmented scan to imitate reduction\n  ",
                   "          {\n                int64_t x_119717;\n                int64_t x_119718;\n                int64_t x_132885;\n                int64_t x_132886;\n                bool ltid_in_bounds_132888 =\n                     slt64(sext_i32_i64(local_tid_132872), min_res_114809 *\n                           squot64(segred_group_sizze_119713,\n                                   segment_sizze_nonzzero_132869));\n                int32_t skip_threads_132889;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_132888) {\n                        x_119718 = ((volatile __local\n                                     int64_t *) red_arr_mem_132876)[sext_i32_i64(local_tid_132872)];\n                        if ((local_tid_132872 - squot32(local_tid_132872, 32) *\n                             32) == 0) {\n                            x_119717 = x_119718;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_132889 = 1;\n                    while (slt32(skip_threads_132889, 32)) {\n                        if (sle32(skip_threads_132889, local_tid_132872 -\n                                  squot32(local_tid_132872, 32) * 32) &&\n                            ltid_in_bounds_132888) {\n                            // read operands\n                            {\n                                x_119717 = ((volatile __local\n                                             int64_t *) red_arr_mem_132876)[sext_i32_i64(local_tid_132872) -\n                                                                            sext_i32_i64(skip_threads_132889)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_132890 =\n                                     slt64(srem64(sext_i32_i64(local_tid_132872),\n                                         ",
                   "         min_res_114809),\n                                           sext_i32_i64(local_tid_132872) -\n                                           sext_i32_i64(local_tid_132872 -\n                                           skip_threads_132889));\n                                \n                                if (inactive_132890) {\n                                    x_119717 = x_119718;\n                                }\n                                if (!inactive_132890) {\n                                    int64_t defunc_1_op_res_119719 =\n                                            add64(x_119717, x_119718);\n                                    \n                                    x_119717 = defunc_1_op_res_119719;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_132874, skip_threads_132889)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_132889, local_tid_132872 -\n                                  squot32(local_tid_132872, 32) * 32) &&\n                            ltid_in_bounds_132888) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  int64_t *) red_arr_mem_132876)[sext_i32_i64(local_tid_132872)] =\n                                    x_119717;\n                                x_119718 = x_119717;\n                            }\n                        }\n                        if (sle32(wave_sizze_132874, skip_threads_132889)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_132889 *= 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_132872 - squot32(l",
                   "ocal_tid_132872, 32) *\n                         32) == 31 && ltid_in_bounds_132888) {\n                        ((volatile __local\n                          int64_t *) red_arr_mem_132876)[sext_i32_i64(squot32(local_tid_132872,\n                                                                              32))] =\n                            x_119717;\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_132891;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_132872, 32) == 0 &&\n                            ltid_in_bounds_132888) {\n                            x_132886 = ((volatile __local\n                                         int64_t *) red_arr_mem_132876)[sext_i32_i64(local_tid_132872)];\n                            if ((local_tid_132872 - squot32(local_tid_132872,\n                                                            32) * 32) == 0) {\n                                x_132885 = x_132886;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_132891 = 1;\n                        while (slt32(skip_threads_132891, 32)) {\n                            if (sle32(skip_threads_132891, local_tid_132872 -\n                                      squot32(local_tid_132872, 32) * 32) &&\n                                (squot32(local_tid_132872, 32) == 0 &&\n                                 ltid_in_bounds_132888)) {\n                                // read operands\n                                {\n                                    x_132885 = ((volatile __local\n                                                 int64_t *) red_arr_mem_132876)[sext_i32_i64(local",
                   "_tid_132872) -\n                                                                                sext_i32_i64(skip_threads_132891)];\n                                }\n                                // perform operation\n                                {\n                                    bool inactive_132892 =\n                                         slt64(srem64(sext_i32_i64(local_tid_132872 *\n                                                      32 + 32 - 1),\n                                                      min_res_114809),\n                                               sext_i32_i64(local_tid_132872 *\n                                               32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_132872 -\n                                                             skip_threads_132891) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_132892) {\n                                        x_132885 = x_132886;\n                                    }\n                                    if (!inactive_132892) {\n                                        int64_t defunc_1_op_res_132887 =\n                                                add64(x_132885, x_132886);\n                                        \n                                        x_132885 = defunc_1_op_res_132887;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_132874, skip_threads_132891)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_132891, local_tid_132872 -\n                                      squot32(local_tid_132872, 32) * 32) &&\n                                (squot32(local_tid_132872, 32) == 0 &&\n                                 ltid_in_bounds_132888)) {\n                  ",
                   "              // write result\n                                {\n                                    ((volatile __local\n                                      int64_t *) red_arr_mem_132876)[sext_i32_i64(local_tid_132872)] =\n                                        x_132885;\n                                    x_132886 = x_132885;\n                                }\n                            }\n                            if (sle32(wave_sizze_132874, skip_threads_132891)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_132891 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n                    if (!(squot32(local_tid_132872, 32) == 0 ||\n                          !ltid_in_bounds_132888)) {\n                        // read operands\n                        {\n                            x_119718 = x_119717;\n                            x_119717 = ((__local\n                                         int64_t *) red_arr_mem_132876)[sext_i32_i64(squot32(local_tid_132872,\n                                                                                             32)) -\n                                                                        (int64_t) 1];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_132893 =\n                                 slt64(srem64(sext_i32_i64(local_tid_132872),\n                                              min_res_114809),\n                                       sext_i32_i64(local_tid_132872) -\n                                       sext_i32_i64(squot32(local_tid_132872,\n                                                            32) * 32 - 1));\n                            \n                            if (inactive_132893) {\n               ",
                   "                 x_119717 = x_119718;\n                            }\n                            if (!inactive_132893) {\n                                int64_t defunc_1_op_res_119719 = add64(x_119717,\n                                                                       x_119718);\n                                \n                                x_119717 = defunc_1_op_res_119719;\n                            }\n                        }\n                        // write final result\n                        {\n                            ((__local\n                              int64_t *) red_arr_mem_132876)[sext_i32_i64(local_tid_132872)] =\n                                x_119717;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_132872, 32) == 0) {\n                        ((__local\n                          int64_t *) red_arr_mem_132876)[sext_i32_i64(local_tid_132872)] =\n                            x_119718;\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_132880) *\n                      squot64(segred_group_sizze_119713,\n                              segment_sizze_nonzzero_132869) +\n                      sext_i32_i64(local_tid_132872), m_114533 *\n                      t_n_m_114591) && slt64(sext_i32_i64(local_tid_132872),\n                                             squot64(segred_group_sizze_119713,\n                                                     segment_sizze_nonzzero_132869))) {\n                ((__global\n                  int64_t *) mem_130582)[squot64(sext_i32_i64(virt_group_id_132880) *\n                                                 squot64(segred_group_sizze_119713,\n                ",
                   "                                         segment_sizze_nonzzero_132869) +\n                                                 sext_i32_i64(local_tid_132872),\n                                                 t_n_m_114591) * t_n_m_114591 +\n                                         (sext_i32_i64(virt_group_id_132880) *\n                                          squot64(segred_group_sizze_119713,\n                                                  segment_sizze_nonzzero_132869) +\n                                          sext_i32_i64(local_tid_132872) -\n                                          squot64(sext_i32_i64(virt_group_id_132880) *\n                                                  squot64(segred_group_sizze_119713,\n                                                          segment_sizze_nonzzero_132869) +\n                                                  sext_i32_i64(local_tid_132872),\n                                                  t_n_m_114591) *\n                                          t_n_m_114591)] = ((__local\n                                                             int64_t *) red_arr_mem_132876)[(sext_i32_i64(local_tid_132872) +\n                                                                                             (int64_t) 1) *\n                                                                                            segment_sizze_nonzzero_132869 -\n                                                                                            (int64_t) 1];\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_119713\n}\n__kernel void mainzisegred_small_119948(__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_133041_backing_aligned_0,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t n_p_114536,\n                                        int64_t css_chunk_len_114580,\n                                        int64_t num_groups_120023,\n                                        int64_t segment_sizze_nonzzero_133034,\n                                        __global unsigned char *mem_130127,\n                                        __global unsigned char *mem_130672,\n                                        __global unsigned char *mem_130733)\n{\n    #define segred_group_sizze_120022 (mainzisegred_group_sizze_119942)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_133041_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_133041_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_133036;\n    int32_t local_tid_133037;\n    int64_t group_sizze_133040;\n    int32_t wave_sizze_133039;\n    int32_t group_tid_133038;\n    \n    global_tid_133036 = get_global_id(0);\n    local_tid_133037 = get_local_id(0);\n    group_sizze_133040 = get_local_size(0);\n    wave_sizze_133039 = LOCKSTEP_WIDTH;\n    group_tid_133038 = get_group_id(0);\n    \n    int32_t phys_tid_119948 = global_tid_133036;\n    __local char *red_arr_mem_133041;\n    \n    red_arr_mem_133041 = (__local char *) red_arr_mem_133041_backing_0;\n    \n    int32_t phys_group_id_133043;\n    \n    phys_group_id_133043 = get_group_id(0);\n    for (int32_t i_133044 = 0; i_133044 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533 * n_p_114536,\n                                          squot6",
                   "4(segred_group_sizze_120022,\n                                                  segment_sizze_nonzzero_133034))) -\n                   phys_group_id_133043, sext_i64_i32(num_groups_120023));\n         i_133044++) {\n        int32_t virt_group_id_133045 = phys_group_id_133043 + i_133044 *\n                sext_i64_i32(num_groups_120023);\n        int64_t slice_133046 = n_p_114536;\n        int64_t slice_133047 = m_114533 * slice_133046;\n        int64_t gtid_119937 = squot64(squot64(sext_i32_i64(local_tid_133037),\n                                              segment_sizze_nonzzero_133034) +\n                                      sext_i32_i64(virt_group_id_133045) *\n                                      squot64(segred_group_sizze_120022,\n                                              segment_sizze_nonzzero_133034),\n                                      slice_133046);\n        int64_t remnant_133048 = squot64(sext_i32_i64(local_tid_133037),\n                                         segment_sizze_nonzzero_133034) +\n                sext_i32_i64(virt_group_id_133045) *\n                squot64(segred_group_sizze_120022,\n                        segment_sizze_nonzzero_133034) - gtid_119937 *\n                slice_133046;\n        int64_t gtid_119938 = remnant_133048;\n        int64_t remnant_133049 = remnant_133048 - gtid_119938;\n        int64_t gtid_119947 = srem64(sext_i32_i64(local_tid_133037),\n                                     css_chunk_len_114580);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, css_chunk_len_114580) && ((slt64(gtid_119937,\n                                                                    m_114533) &&\n                                                              slt64(gtid_119938,\n                                                                    n_p_114536)) &&\n                                                             slt64(sext_i32_i64(local_tid_133037),\n                                                     ",
                   "              css_chunk_len_114580 *\n                                                                   squot64(segred_group_sizze_120022,\n                                                                           segment_sizze_nonzzero_133034)))) {\n                int64_t x_120031 = ((__global\n                                     int64_t *) mem_130127)[gtid_119938 *\n                                                            css_chunk_len_114580 +\n                                                            gtid_119947];\n                bool cond_120032 = sle64((int64_t) 0, x_120031);\n                float defunc_0_f_res_120033;\n                \n                if (cond_120032) {\n                    bool y_120034 = slt64(x_120031, n_114534);\n                    bool bounds_check_120035 = cond_120032 && y_120034;\n                    bool index_certs_120036;\n                    \n                    if (!bounds_check_120035) {\n                        {\n                            if (atomic_cmpxchg_i32_global(global_failure, -1,\n                                                          59) == -1) {\n                                global_failure_args[0] = x_120031;\n                                global_failure_args[1] = n_114534;\n                                ;\n                            }\n                            local_failure = true;\n                            goto error_0;\n                        }\n                    }\n                    \n                    float defunc_0_f_res_t_res_120037 = ((__global\n                                                          float *) mem_130672)[gtid_119937 *\n                                                                               n_114534 +\n                                                                               x_120031];\n                    \n                    defunc_0_f_res_120033 = defunc_0_f_res_t_res_120037;\n                } else {\n                    defunc_0_f_res_120033 = NAN;\n                }\n  ",
                   "              \n                bool isnan_res_120038;\n                \n                isnan_res_120038 = futrts_isnan32(defunc_0_f_res_120033);\n                \n                float defunc_0_f_res_120039;\n                \n                if (isnan_res_120038) {\n                    defunc_0_f_res_120039 = 0.0F;\n                } else {\n                    defunc_0_f_res_120039 = defunc_0_f_res_120033;\n                }\n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_133041)[sext_i32_i64(local_tid_133037)] =\n                        defunc_0_f_res_120039;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_133041)[sext_i32_i64(local_tid_133037)] =\n                    0.0F;\n            }\n        }\n        \n      error_0:\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (local_failure)\n            return;\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, css_chunk_len_114580)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_120026;\n                float x_120027;\n                float x_133050;\n                float x_133051;\n                bool ltid_in_bounds_133053 =\n                     slt64(sext_i32_i64(local_tid_133037),\n                           css_chunk_len_114580 *\n                           squot64(segred_group_sizze_120022,\n                                   segment_sizze_nonzzero_133034));\n                int32_t skip_threads_133054;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_133053) {\n                        x_120027 = ((volatile __local\n                                     float *) red_arr_mem_133041)[sext_i32_i64(local_tid_133037)];\n                        if ((local_tid_133037 - squot32(local_tid_133037, 32",
                   ") *\n                             32) == 0) {\n                            x_120026 = x_120027;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_133054 = 1;\n                    while (slt32(skip_threads_133054, 32)) {\n                        if (sle32(skip_threads_133054, local_tid_133037 -\n                                  squot32(local_tid_133037, 32) * 32) &&\n                            ltid_in_bounds_133053) {\n                            // read operands\n                            {\n                                x_120026 = ((volatile __local\n                                             float *) red_arr_mem_133041)[sext_i32_i64(local_tid_133037) -\n                                                                          sext_i32_i64(skip_threads_133054)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_133055 =\n                                     slt64(srem64(sext_i32_i64(local_tid_133037),\n                                                  css_chunk_len_114580),\n                                           sext_i32_i64(local_tid_133037) -\n                                           sext_i32_i64(local_tid_133037 -\n                                           skip_threads_133054));\n                                \n                                if (inactive_133055) {\n                                    x_120026 = x_120027;\n                                }\n                                if (!inactive_133055) {\n                                    float defunc_1_op_res_120028 = x_120026 +\n                                          x_120027;\n                                    \n                                    x_120026 = defunc_1_op_res_120028;\n                                }\n                            }\n                        }",
                   "\n                        if (sle32(wave_sizze_133039, skip_threads_133054)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_133054, local_tid_133037 -\n                                  squot32(local_tid_133037, 32) * 32) &&\n                            ltid_in_bounds_133053) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_133041)[sext_i32_i64(local_tid_133037)] =\n                                    x_120026;\n                                x_120027 = x_120026;\n                            }\n                        }\n                        if (sle32(wave_sizze_133039, skip_threads_133054)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_133054 *= 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_133037 - squot32(local_tid_133037, 32) *\n                         32) == 31 && ltid_in_bounds_133053) {\n                        ((volatile __local\n                          float *) red_arr_mem_133041)[sext_i32_i64(squot32(local_tid_133037,\n                                                                            32))] =\n                            x_120026;\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_133056;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_133037, 32) == 0 &&\n                            ltid_in_bounds_133053) {\n       ",
                   "                     x_133051 = ((volatile __local\n                                         float *) red_arr_mem_133041)[sext_i32_i64(local_tid_133037)];\n                            if ((local_tid_133037 - squot32(local_tid_133037,\n                                                            32) * 32) == 0) {\n                                x_133050 = x_133051;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_133056 = 1;\n                        while (slt32(skip_threads_133056, 32)) {\n                            if (sle32(skip_threads_133056, local_tid_133037 -\n                                      squot32(local_tid_133037, 32) * 32) &&\n                                (squot32(local_tid_133037, 32) == 0 &&\n                                 ltid_in_bounds_133053)) {\n                                // read operands\n                                {\n                                    x_133050 = ((volatile __local\n                                                 float *) red_arr_mem_133041)[sext_i32_i64(local_tid_133037) -\n                                                                              sext_i32_i64(skip_threads_133056)];\n                                }\n                                // perform operation\n                                {\n                                    bool inactive_133057 =\n                                         slt64(srem64(sext_i32_i64(local_tid_133037 *\n                                                      32 + 32 - 1),\n                                                      css_chunk_len_114580),\n                                               sext_i32_i64(local_tid_133037 *\n                                               32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_133037 -\n                                                             ski",
                   "p_threads_133056) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_133057) {\n                                        x_133050 = x_133051;\n                                    }\n                                    if (!inactive_133057) {\n                                        float defunc_1_op_res_133052 =\n                                              x_133050 + x_133051;\n                                        \n                                        x_133050 = defunc_1_op_res_133052;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_133039, skip_threads_133056)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_133056, local_tid_133037 -\n                                      squot32(local_tid_133037, 32) * 32) &&\n                                (squot32(local_tid_133037, 32) == 0 &&\n                                 ltid_in_bounds_133053)) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_133041)[sext_i32_i64(local_tid_133037)] =\n                                        x_133050;\n                                    x_133051 = x_133050;\n                                }\n                            }\n                            if (sle32(wave_sizze_133039, skip_threads_133056)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_133056 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n                    if",
                   " (!(squot32(local_tid_133037, 32) == 0 ||\n                          !ltid_in_bounds_133053)) {\n                        // read operands\n                        {\n                            x_120027 = x_120026;\n                            x_120026 = ((__local\n                                         float *) red_arr_mem_133041)[sext_i32_i64(squot32(local_tid_133037,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_133058 =\n                                 slt64(srem64(sext_i32_i64(local_tid_133037),\n                                              css_chunk_len_114580),\n                                       sext_i32_i64(local_tid_133037) -\n                                       sext_i32_i64(squot32(local_tid_133037,\n                                                            32) * 32 - 1));\n                            \n                            if (inactive_133058) {\n                                x_120026 = x_120027;\n                            }\n                            if (!inactive_133058) {\n                                float defunc_1_op_res_120028 = x_120026 +\n                                      x_120027;\n                                \n                                x_120026 = defunc_1_op_res_120028;\n                            }\n                        }\n                        // write final result\n                        {\n                            ((__local\n                              float *) red_arr_mem_133041)[sext_i32_i64(local_tid_133037)] =\n                                x_120026;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n  ",
                   "                  if (squot32(local_tid_133037, 32) == 0) {\n                        ((__local\n                          float *) red_arr_mem_133041)[sext_i32_i64(local_tid_133037)] =\n                            x_120027;\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_133045) *\n                      squot64(segred_group_sizze_120022,\n                              segment_sizze_nonzzero_133034) +\n                      sext_i32_i64(local_tid_133037), m_114533 * n_p_114536) &&\n                slt64(sext_i32_i64(local_tid_133037),\n                      squot64(segred_group_sizze_120022,\n                              segment_sizze_nonzzero_133034))) {\n                ((__global\n                  float *) mem_130733)[squot64(sext_i32_i64(virt_group_id_133045) *\n                                               squot64(segred_group_sizze_120022,\n                                                       segment_sizze_nonzzero_133034) +\n                                               sext_i32_i64(local_tid_133037),\n                                               n_p_114536) * n_p_114536 +\n                                       (sext_i32_i64(virt_group_id_133045) *\n                                        squot64(segred_group_sizze_120022,\n                                                segment_sizze_nonzzero_133034) +\n                                        sext_i32_i64(local_tid_133037) -\n                                        squot64(sext_i32_i64(virt_group_id_133045) *\n                                                squot64(segred_group_sizze_120022,\n                                                        segment_sizze_nonzzero_133034) +\n                                                sext_i32_i64(local_tid_133037),\n                                                n_p_114536) * n_p_11",
                   "4536)] =\n                    ((__local\n                      float *) red_arr_mem_133041)[(sext_i32_i64(local_tid_133037) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_133034 -\n                                                   (int64_t) 1];\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_120022\n}\n__kernel void mainzisegred_small_120463(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133450_backing_aligned_0,\n                                        int64_t m_114533,\n                                        int64_t lifted_single_ma_arg_114976,\n                                        int64_t num_groups_120692,\n                                        int64_t segment_sizze_nonzzero_133443,\n                                        __global unsigned char *mem_130840,\n                                        __global unsigned char *mem_130844)\n{\n    #define segred_group_sizze_120691 (mainzisegred_group_sizze_120457)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_133450_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_133450_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_133445;\n    int32_t local_tid_133446;\n    int64_t group_sizze_133449;\n    int32_t wave_sizze_133448;\n    int32_t group_tid_133447;\n    \n    global_tid_133445 = get_global_id(0);\n    local_tid_133446 = get_local_id(0);\n    group_sizze_133449 = get_local_size(0);\n    wave_sizze_133448 = LOCKSTEP_WIDTH;\n    group_tid_133447 = get_group_id(0);\n    \n    int32_t phys_tid_120463 = global_ti",
                   "d_133445;\n    __local char *red_arr_mem_133450;\n    \n    red_arr_mem_133450 = (__local char *) red_arr_mem_133450_backing_0;\n    \n    int32_t phys_group_id_133452;\n    \n    phys_group_id_133452 = get_group_id(0);\n    for (int32_t i_133453 = 0; i_133453 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533,\n                                          squot64(segred_group_sizze_120691,\n                                                  segment_sizze_nonzzero_133443))) -\n                   phys_group_id_133452, sext_i64_i32(num_groups_120692));\n         i_133453++) {\n        int32_t virt_group_id_133454 = phys_group_id_133452 + i_133453 *\n                sext_i64_i32(num_groups_120692);\n        int64_t slice_133455 = m_114533;\n        int64_t gtid_120454 = squot64(sext_i32_i64(local_tid_133446),\n                                      segment_sizze_nonzzero_133443) +\n                sext_i32_i64(virt_group_id_133454) *\n                squot64(segred_group_sizze_120691,\n                        segment_sizze_nonzzero_133443);\n        int64_t remnant_133456 = squot64(sext_i32_i64(local_tid_133446),\n                                         segment_sizze_nonzzero_133443) +\n                sext_i32_i64(virt_group_id_133454) *\n                squot64(segred_group_sizze_120691,\n                        segment_sizze_nonzzero_133443) - gtid_120454;\n        int64_t gtid_120462 = srem64(sext_i32_i64(local_tid_133446),\n                                     (int64_t) 3);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, (int64_t) 3) && (slt64(gtid_120454,\n                                                          m_114533) &&\n                                                    slt64(sext_i32_i64(local_tid_133446),\n                                                          (int64_t) 3 *\n                                                          squot64(segred_group_sizze_120691,\n                                                                  seg",
                   "ment_sizze_nonzzero_133443)))) {\n                float x_120699 = ((__global float *) mem_130840)[gtid_120454 *\n                                                                 lifted_single_ma_arg_114976 +\n                                                                 gtid_120462];\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_133450)[sext_i32_i64(local_tid_133446)] =\n                        x_120699;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_133450)[sext_i32_i64(local_tid_133446)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, (int64_t) 3)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_120695;\n                float x_120696;\n                float x_133457;\n                float x_133458;\n                bool ltid_in_bounds_133460 =\n                     slt64(sext_i32_i64(local_tid_133446), (int64_t) 3 *\n                           squot64(segred_group_sizze_120691,\n                                   segment_sizze_nonzzero_133443));\n                int32_t skip_threads_133461;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_133460) {\n                        x_120696 = ((volatile __local\n                                     float *) red_arr_mem_133450)[sext_i32_i64(local_tid_133446)];\n                        if ((local_tid_133446 - squot32(local_tid_133446, 32) *\n                             32) == 0) {\n                            x_120695 = x_120696;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_133461 = 1;\n ",
                   "                   while (slt32(skip_threads_133461, 32)) {\n                        if (sle32(skip_threads_133461, local_tid_133446 -\n                                  squot32(local_tid_133446, 32) * 32) &&\n                            ltid_in_bounds_133460) {\n                            // read operands\n                            {\n                                x_120695 = ((volatile __local\n                                             float *) red_arr_mem_133450)[sext_i32_i64(local_tid_133446) -\n                                                                          sext_i32_i64(skip_threads_133461)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_133462 =\n                                     slt64(srem64(sext_i32_i64(local_tid_133446),\n                                                  (int64_t) 3),\n                                           sext_i32_i64(local_tid_133446) -\n                                           sext_i32_i64(local_tid_133446 -\n                                           skip_threads_133461));\n                                \n                                if (inactive_133462) {\n                                    x_120695 = x_120696;\n                                }\n                                if (!inactive_133462) {\n                                    float defunc_1_op_res_120697 = x_120695 +\n                                          x_120696;\n                                    \n                                    x_120695 = defunc_1_op_res_120697;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_133448, skip_threads_133461)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_133461, local_tid_133446 -\n                                  squot32(local_tid_133446, 3",
                   "2) * 32) &&\n                            ltid_in_bounds_133460) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_133450)[sext_i32_i64(local_tid_133446)] =\n                                    x_120695;\n                                x_120696 = x_120695;\n                            }\n                        }\n                        if (sle32(wave_sizze_133448, skip_threads_133461)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_133461 *= 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_133446 - squot32(local_tid_133446, 32) *\n                         32) == 31 && ltid_in_bounds_133460) {\n                        ((volatile __local\n                          float *) red_arr_mem_133450)[sext_i32_i64(squot32(local_tid_133446,\n                                                                            32))] =\n                            x_120695;\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_133463;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_133446, 32) == 0 &&\n                            ltid_in_bounds_133460) {\n                            x_133458 = ((volatile __local\n                                         float *) red_arr_mem_133450)[sext_i32_i64(local_tid_133446)];\n                            if ((local_tid_133446 - squot32(local_tid_133446,\n                                                            32) *",
                   " 32) == 0) {\n                                x_133457 = x_133458;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_133463 = 1;\n                        while (slt32(skip_threads_133463, 32)) {\n                            if (sle32(skip_threads_133463, local_tid_133446 -\n                                      squot32(local_tid_133446, 32) * 32) &&\n                                (squot32(local_tid_133446, 32) == 0 &&\n                                 ltid_in_bounds_133460)) {\n                                // read operands\n                                {\n                                    x_133457 = ((volatile __local\n                                                 float *) red_arr_mem_133450)[sext_i32_i64(local_tid_133446) -\n                                                                              sext_i32_i64(skip_threads_133463)];\n                                }\n                                // perform operation\n                                {\n                                    bool inactive_133464 =\n                                         slt64(srem64(sext_i32_i64(local_tid_133446 *\n                                                      32 + 32 - 1),\n                                                      (int64_t) 3),\n                                               sext_i32_i64(local_tid_133446 *\n                                               32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_133446 -\n                                                             skip_threads_133463) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_133464) {\n                                        x_133457 = x_133458;\n                                    }\n                             ",
                   "       if (!inactive_133464) {\n                                        float defunc_1_op_res_133459 =\n                                              x_133457 + x_133458;\n                                        \n                                        x_133457 = defunc_1_op_res_133459;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_133448, skip_threads_133463)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_133463, local_tid_133446 -\n                                      squot32(local_tid_133446, 32) * 32) &&\n                                (squot32(local_tid_133446, 32) == 0 &&\n                                 ltid_in_bounds_133460)) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_133450)[sext_i32_i64(local_tid_133446)] =\n                                        x_133457;\n                                    x_133458 = x_133457;\n                                }\n                            }\n                            if (sle32(wave_sizze_133448, skip_threads_133463)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_133463 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n                    if (!(squot32(local_tid_133446, 32) == 0 ||\n                          !ltid_in_bounds_133460)) {\n                        // read operands\n                        {\n                            x_120696 = x_120695;\n                            x_120695 = ((__local\n                                         float",
                   " *) red_arr_mem_133450)[sext_i32_i64(squot32(local_tid_133446,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_133465 =\n                                 slt64(srem64(sext_i32_i64(local_tid_133446),\n                                              (int64_t) 3),\n                                       sext_i32_i64(local_tid_133446) -\n                                       sext_i32_i64(squot32(local_tid_133446,\n                                                            32) * 32 - 1));\n                            \n                            if (inactive_133465) {\n                                x_120695 = x_120696;\n                            }\n                            if (!inactive_133465) {\n                                float defunc_1_op_res_120697 = x_120695 +\n                                      x_120696;\n                                \n                                x_120695 = defunc_1_op_res_120697;\n                            }\n                        }\n                        // write final result\n                        {\n                            ((__local\n                              float *) red_arr_mem_133450)[sext_i32_i64(local_tid_133446)] =\n                                x_120695;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_133446, 32) == 0) {\n                        ((__local\n                          float *) red_arr_mem_133450)[sext_i32_i64(local_tid_133446)] =\n                            x_120696;\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_133454) *\n                      squot64(segred_group_sizze_120691,\n                              segment_sizze_nonzzero_133443) +\n                      sext_i32_i64(local_tid_133446), m_114533) &&\n                slt64(sext_i32_i64(local_tid_133446),\n                      squot64(segred_group_sizze_120691,\n                              segment_sizze_nonzzero_133443))) {\n                ((__global\n                  float *) mem_130844)[sext_i32_i64(virt_group_id_133454) *\n                                       squot64(segred_group_sizze_120691,\n                                               segment_sizze_nonzzero_133443) +\n                                       sext_i32_i64(local_tid_133446)] =\n                    ((__local\n                      float *) red_arr_mem_133450)[(sext_i32_i64(local_tid_133446) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_133443 -\n                                                   (int64_t) 1];\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_120691\n}\n__kernel void mainzisegred_small_120526(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133330_backing_aligned_0,\n                                        int64_t m_114533, int64_t n_p_114536,\n                                        int64_t lifted_single_ma_arg_114959,\n                                        int64_t num_groups_120644,\n                                        int64_t segment_sizze_nonzzero_133323,\n                                        __global unsigned char *mem_130831,\n                          ",
                   "              __global unsigned char *mem_130835)\n{\n    #define segred_group_sizze_120643 (mainzisegred_group_sizze_120520)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_133330_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_133330_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_133325;\n    int32_t local_tid_133326;\n    int64_t group_sizze_133329;\n    int32_t wave_sizze_133328;\n    int32_t group_tid_133327;\n    \n    global_tid_133325 = get_global_id(0);\n    local_tid_133326 = get_local_id(0);\n    group_sizze_133329 = get_local_size(0);\n    wave_sizze_133328 = LOCKSTEP_WIDTH;\n    group_tid_133327 = get_group_id(0);\n    \n    int32_t phys_tid_120526 = global_tid_133325;\n    __local char *red_arr_mem_133330;\n    \n    red_arr_mem_133330 = (__local char *) red_arr_mem_133330_backing_0;\n    \n    int32_t phys_group_id_133332;\n    \n    phys_group_id_133332 = get_group_id(0);\n    for (int32_t i_133333 = 0; i_133333 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533,\n                                          squot64(segred_group_sizze_120643,\n                                                  segment_sizze_nonzzero_133323))) -\n                   phys_group_id_133332, sext_i64_i32(num_groups_120644));\n         i_133333++) {\n        int32_t virt_group_id_133334 = phys_group_id_133332 + i_133333 *\n                sext_i64_i32(num_groups_120644);\n        int64_t slice_133335 = m_114533;\n        int64_t gtid_120517 = squot64(sext_i32_i64(local_tid_133326),\n                                      segment_sizze_nonzzero_133323) +\n                sext_i32_i64(virt_group_id_133334) *\n                squot64(segred_group_sizze_120643,\n                        segment_sizze_nonzzero_133323);\n        int64_t remnant_133336 = squot64(sext_i32_i64(local_tid_133326),\n                            ",
                   "             segment_sizze_nonzzero_133323) +\n                sext_i32_i64(virt_group_id_133334) *\n                squot64(segred_group_sizze_120643,\n                        segment_sizze_nonzzero_133323) - gtid_120517;\n        int64_t gtid_120525 = srem64(sext_i32_i64(local_tid_133326),\n                                     n_p_114536);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, n_p_114536) && (slt64(gtid_120517,\n                                                         m_114533) &&\n                                                   slt64(sext_i32_i64(local_tid_133326),\n                                                         n_p_114536 *\n                                                         squot64(segred_group_sizze_120643,\n                                                                 segment_sizze_nonzzero_133323)))) {\n                float x_120651 = ((__global float *) mem_130831)[gtid_120517 *\n                                                                 lifted_single_ma_arg_114959 +\n                                                                 gtid_120525];\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_133330)[sext_i32_i64(local_tid_133326)] =\n                        x_120651;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_133330)[sext_i32_i64(local_tid_133326)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, n_p_114536)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_120647;\n                float x_120648;\n                float x_133337;\n                float x_133338;\n                bool ltid_in_bounds_133340 =\n                     slt64(sext_i32_i6",
                   "4(local_tid_133326), n_p_114536 *\n                           squot64(segred_group_sizze_120643,\n                                   segment_sizze_nonzzero_133323));\n                int32_t skip_threads_133341;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_133340) {\n                        x_120648 = ((volatile __local\n                                     float *) red_arr_mem_133330)[sext_i32_i64(local_tid_133326)];\n                        if ((local_tid_133326 - squot32(local_tid_133326, 32) *\n                             32) == 0) {\n                            x_120647 = x_120648;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_133341 = 1;\n                    while (slt32(skip_threads_133341, 32)) {\n                        if (sle32(skip_threads_133341, local_tid_133326 -\n                                  squot32(local_tid_133326, 32) * 32) &&\n                            ltid_in_bounds_133340) {\n                            // read operands\n                            {\n                                x_120647 = ((volatile __local\n                                             float *) red_arr_mem_133330)[sext_i32_i64(local_tid_133326) -\n                                                                          sext_i32_i64(skip_threads_133341)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_133342 =\n                                     slt64(srem64(sext_i32_i64(local_tid_133326),\n                                                  n_p_114536),\n                                           sext_i32_i64(local_tid_133326) -\n                                           sext_i32_i64(local_tid_133326 -\n                                           skip_threads_133341));\n  ",
                   "                              \n                                if (inactive_133342) {\n                                    x_120647 = x_120648;\n                                }\n                                if (!inactive_133342) {\n                                    float defunc_1_op_res_120649 = x_120647 +\n                                          x_120648;\n                                    \n                                    x_120647 = defunc_1_op_res_120649;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_133328, skip_threads_133341)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_133341, local_tid_133326 -\n                                  squot32(local_tid_133326, 32) * 32) &&\n                            ltid_in_bounds_133340) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_133330)[sext_i32_i64(local_tid_133326)] =\n                                    x_120647;\n                                x_120648 = x_120647;\n                            }\n                        }\n                        if (sle32(wave_sizze_133328, skip_threads_133341)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_133341 *= 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_133326 - squot32(local_tid_133326, 32) *\n                         32) == 31 && ltid_in_bounds_133340) {\n                        ((volatile __local\n                          float *) red_arr_mem_133330)[sext_i32_i64(squot32(local_tid_133326,\n                                  ",
                   "                                          32))] =\n                            x_120647;\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_133343;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_133326, 32) == 0 &&\n                            ltid_in_bounds_133340) {\n                            x_133338 = ((volatile __local\n                                         float *) red_arr_mem_133330)[sext_i32_i64(local_tid_133326)];\n                            if ((local_tid_133326 - squot32(local_tid_133326,\n                                                            32) * 32) == 0) {\n                                x_133337 = x_133338;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_133343 = 1;\n                        while (slt32(skip_threads_133343, 32)) {\n                            if (sle32(skip_threads_133343, local_tid_133326 -\n                                      squot32(local_tid_133326, 32) * 32) &&\n                                (squot32(local_tid_133326, 32) == 0 &&\n                                 ltid_in_bounds_133340)) {\n                                // read operands\n                                {\n                                    x_133337 = ((volatile __local\n                                                 float *) red_arr_mem_133330)[sext_i32_i64(local_tid_133326) -\n                                                                              sext_i32_i64(skip_threads_133343)];\n                                }\n                                // perform operation\n                                {\n               ",
                   "                     bool inactive_133344 =\n                                         slt64(srem64(sext_i32_i64(local_tid_133326 *\n                                                      32 + 32 - 1), n_p_114536),\n                                               sext_i32_i64(local_tid_133326 *\n                                               32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_133326 -\n                                                             skip_threads_133343) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_133344) {\n                                        x_133337 = x_133338;\n                                    }\n                                    if (!inactive_133344) {\n                                        float defunc_1_op_res_133339 =\n                                              x_133337 + x_133338;\n                                        \n                                        x_133337 = defunc_1_op_res_133339;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_133328, skip_threads_133343)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_133343, local_tid_133326 -\n                                      squot32(local_tid_133326, 32) * 32) &&\n                                (squot32(local_tid_133326, 32) == 0 &&\n                                 ltid_in_bounds_133340)) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_133330)[sext_i32_i64(local_tid_133326)] =\n                                        x_133337;\n                                    x_133338 = x_133337;\n        ",
                   "                        }\n                            }\n                            if (sle32(wave_sizze_133328, skip_threads_133343)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_133343 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n                    if (!(squot32(local_tid_133326, 32) == 0 ||\n                          !ltid_in_bounds_133340)) {\n                        // read operands\n                        {\n                            x_120648 = x_120647;\n                            x_120647 = ((__local\n                                         float *) red_arr_mem_133330)[sext_i32_i64(squot32(local_tid_133326,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_133345 =\n                                 slt64(srem64(sext_i32_i64(local_tid_133326),\n                                              n_p_114536),\n                                       sext_i32_i64(local_tid_133326) -\n                                       sext_i32_i64(squot32(local_tid_133326,\n                                                            32) * 32 - 1));\n                            \n                            if (inactive_133345) {\n                                x_120647 = x_120648;\n                            }\n                            if (!inactive_133345) {\n                                float defunc_1_op_res_120649 = x_120647 +\n                                      x_120648;\n                                \n                                x_120647 = defunc_1_op_res_120649;\n     ",
                   "                       }\n                        }\n                        // write final result\n                        {\n                            ((__local\n                              float *) red_arr_mem_133330)[sext_i32_i64(local_tid_133326)] =\n                                x_120647;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_133326, 32) == 0) {\n                        ((__local\n                          float *) red_arr_mem_133330)[sext_i32_i64(local_tid_133326)] =\n                            x_120648;\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_133334) *\n                      squot64(segred_group_sizze_120643,\n                              segment_sizze_nonzzero_133323) +\n                      sext_i32_i64(local_tid_133326), m_114533) &&\n                slt64(sext_i32_i64(local_tid_133326),\n                      squot64(segred_group_sizze_120643,\n                              segment_sizze_nonzzero_133323))) {\n                ((__global\n                  float *) mem_130835)[sext_i32_i64(virt_group_id_133334) *\n                                       squot64(segred_group_sizze_120643,\n                                               segment_sizze_nonzzero_133323) +\n                                       sext_i32_i64(local_tid_133326)] =\n                    ((__local\n                      float *) red_arr_mem_133330)[(sext_i32_i64(local_tid_133326) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_133323 -\n                                                   (int64_t) 1];\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_120643\n}\n__kernel void mainzisegred_small_120587(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133210_backing_aligned_0,\n                                        int64_t m_114533, int64_t n_p_114536,\n                                        int64_t C_len_114582,\n                                        int64_t num_groups_120596,\n                                        int64_t segment_sizze_nonzzero_133203,\n                                        __global unsigned char *mem_130750,\n                                        __global unsigned char *mem_130826)\n{\n    #define segred_group_sizze_120595 (mainzisegred_group_sizze_120581)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_133210_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_133210_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_133205;\n    int32_t local_tid_133206;\n    int64_t group_sizze_133209;\n    int32_t wave_sizze_133208;\n    int32_t group_tid_133207;\n    \n    global_tid_133205 = get_global_id(0);\n    local_tid_133206 = get_local_id(0);\n    group_sizze_133209 = get_local_size(0);\n    wave_sizze_133208 = LOCKSTEP_WIDTH;\n    group_tid_133207 = get_group_id(0);\n    \n    int32_t phys_tid_120587 = global_tid_133205;\n    __local char *red_arr_mem_133210;\n    \n    red_arr_mem_133210 = (__local char *) red_arr_mem_133210_backing_0;\n    \n    int32_t phys_group_id_133212;\n    \n    phys_group_id_133212 = get_group_id(0);\n    for (int32_t i_133213 = 0; i_133213 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533,\n                                       ",
                   "   squot64(segred_group_sizze_120595,\n                                                  segment_sizze_nonzzero_133203))) -\n                   phys_group_id_133212, sext_i64_i32(num_groups_120596));\n         i_133213++) {\n        int32_t virt_group_id_133214 = phys_group_id_133212 + i_133213 *\n                sext_i64_i32(num_groups_120596);\n        int64_t slice_133215 = m_114533;\n        int64_t gtid_120578 = squot64(sext_i32_i64(local_tid_133206),\n                                      segment_sizze_nonzzero_133203) +\n                sext_i32_i64(virt_group_id_133214) *\n                squot64(segred_group_sizze_120595,\n                        segment_sizze_nonzzero_133203);\n        int64_t remnant_133216 = squot64(sext_i32_i64(local_tid_133206),\n                                         segment_sizze_nonzzero_133203) +\n                sext_i32_i64(virt_group_id_133214) *\n                squot64(segred_group_sizze_120595,\n                        segment_sizze_nonzzero_133203) - gtid_120578;\n        int64_t gtid_120586 = srem64(sext_i32_i64(local_tid_133206),\n                                     n_p_114536);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, n_p_114536) && (slt64(gtid_120578,\n                                                         m_114533) &&\n                                                   slt64(sext_i32_i64(local_tid_133206),\n                                                         n_p_114536 *\n                                                         squot64(segred_group_sizze_120595,\n                                                                 segment_sizze_nonzzero_133203)))) {\n                float x_120603 = ((__global float *) mem_130750)[gtid_120578 *\n                                                                 C_len_114582 +\n                                                                 gtid_120586];\n                \n                // save map-out results\n                { }\n      ",
                   "          // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_133210)[sext_i32_i64(local_tid_133206)] =\n                        x_120603;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_133210)[sext_i32_i64(local_tid_133206)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, n_p_114536)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_120599;\n                float x_120600;\n                float x_133217;\n                float x_133218;\n                bool ltid_in_bounds_133220 =\n                     slt64(sext_i32_i64(local_tid_133206), n_p_114536 *\n                           squot64(segred_group_sizze_120595,\n                                   segment_sizze_nonzzero_133203));\n                int32_t skip_threads_133221;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_133220) {\n                        x_120600 = ((volatile __local\n                                     float *) red_arr_mem_133210)[sext_i32_i64(local_tid_133206)];\n                        if ((local_tid_133206 - squot32(local_tid_133206, 32) *\n                             32) == 0) {\n                            x_120599 = x_120600;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_133221 = 1;\n                    while (slt32(skip_threads_133221, 32)) {\n                        if (sle32(skip_threads_133221, local_tid_133206 -\n                                  squot32(local_tid_133206, 32) * 32) &&\n                            ltid_in_bounds_133220) {\n                            // read operands\n                            {\n                                x_12",
                   "0599 = ((volatile __local\n                                             float *) red_arr_mem_133210)[sext_i32_i64(local_tid_133206) -\n                                                                          sext_i32_i64(skip_threads_133221)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_133222 =\n                                     slt64(srem64(sext_i32_i64(local_tid_133206),\n                                                  n_p_114536),\n                                           sext_i32_i64(local_tid_133206) -\n                                           sext_i32_i64(local_tid_133206 -\n                                           skip_threads_133221));\n                                \n                                if (inactive_133222) {\n                                    x_120599 = x_120600;\n                                }\n                                if (!inactive_133222) {\n                                    float defunc_1_op_res_120601 = x_120599 +\n                                          x_120600;\n                                    \n                                    x_120599 = defunc_1_op_res_120601;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_133208, skip_threads_133221)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_133221, local_tid_133206 -\n                                  squot32(local_tid_133206, 32) * 32) &&\n                            ltid_in_bounds_133220) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_133210)[sext_i32_i64(local_tid_133206)] =\n                                    x_120599;\n                                x_12060",
                   "0 = x_120599;\n                            }\n                        }\n                        if (sle32(wave_sizze_133208, skip_threads_133221)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_133221 *= 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_133206 - squot32(local_tid_133206, 32) *\n                         32) == 31 && ltid_in_bounds_133220) {\n                        ((volatile __local\n                          float *) red_arr_mem_133210)[sext_i32_i64(squot32(local_tid_133206,\n                                                                            32))] =\n                            x_120599;\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_133223;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_133206, 32) == 0 &&\n                            ltid_in_bounds_133220) {\n                            x_133218 = ((volatile __local\n                                         float *) red_arr_mem_133210)[sext_i32_i64(local_tid_133206)];\n                            if ((local_tid_133206 - squot32(local_tid_133206,\n                                                            32) * 32) == 0) {\n                                x_133217 = x_133218;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_133223 = 1;\n                        while (slt32(skip_threads_133223, 32)) {\n                        ",
                   "    if (sle32(skip_threads_133223, local_tid_133206 -\n                                      squot32(local_tid_133206, 32) * 32) &&\n                                (squot32(local_tid_133206, 32) == 0 &&\n                                 ltid_in_bounds_133220)) {\n                                // read operands\n                                {\n                                    x_133217 = ((volatile __local\n                                                 float *) red_arr_mem_133210)[sext_i32_i64(local_tid_133206) -\n                                                                              sext_i32_i64(skip_threads_133223)];\n                                }\n                                // perform operation\n                                {\n                                    bool inactive_133224 =\n                                         slt64(srem64(sext_i32_i64(local_tid_133206 *\n                                                      32 + 32 - 1), n_p_114536),\n                                               sext_i32_i64(local_tid_133206 *\n                                               32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_133206 -\n                                                             skip_threads_133223) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_133224) {\n                                        x_133217 = x_133218;\n                                    }\n                                    if (!inactive_133224) {\n                                        float defunc_1_op_res_133219 =\n                                              x_133217 + x_133218;\n                                        \n                                        x_133217 = defunc_1_op_res_133219;\n                                    }\n                                }\n                            }\n                            if (sle32(wa",
                   "ve_sizze_133208, skip_threads_133223)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_133223, local_tid_133206 -\n                                      squot32(local_tid_133206, 32) * 32) &&\n                                (squot32(local_tid_133206, 32) == 0 &&\n                                 ltid_in_bounds_133220)) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_133210)[sext_i32_i64(local_tid_133206)] =\n                                        x_133217;\n                                    x_133218 = x_133217;\n                                }\n                            }\n                            if (sle32(wave_sizze_133208, skip_threads_133223)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_133223 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n                    if (!(squot32(local_tid_133206, 32) == 0 ||\n                          !ltid_in_bounds_133220)) {\n                        // read operands\n                        {\n                            x_120600 = x_120599;\n                            x_120599 = ((__local\n                                         float *) red_arr_mem_133210)[sext_i32_i64(squot32(local_tid_133206,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_133225 =\n                                 s",
                   "lt64(srem64(sext_i32_i64(local_tid_133206),\n                                              n_p_114536),\n                                       sext_i32_i64(local_tid_133206) -\n                                       sext_i32_i64(squot32(local_tid_133206,\n                                                            32) * 32 - 1));\n                            \n                            if (inactive_133225) {\n                                x_120599 = x_120600;\n                            }\n                            if (!inactive_133225) {\n                                float defunc_1_op_res_120601 = x_120599 +\n                                      x_120600;\n                                \n                                x_120599 = defunc_1_op_res_120601;\n                            }\n                        }\n                        // write final result\n                        {\n                            ((__local\n                              float *) red_arr_mem_133210)[sext_i32_i64(local_tid_133206)] =\n                                x_120599;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_133206, 32) == 0) {\n                        ((__local\n                          float *) red_arr_mem_133210)[sext_i32_i64(local_tid_133206)] =\n                            x_120600;\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_133214) *\n                      squot64(segred_group_sizze_120595,\n                              segment_sizze_nonzzero_133203) +\n                      sext_i32_i64(local_tid_133206), m_114533) &&\n                slt64(sext_i32_i64(local_tid_133206),\n                      s",
                   "quot64(segred_group_sizze_120595,\n                              segment_sizze_nonzzero_133203))) {\n                ((__global\n                  float *) mem_130826)[sext_i32_i64(virt_group_id_133214) *\n                                       squot64(segred_group_sizze_120595,\n                                               segment_sizze_nonzzero_133203) +\n                                       sext_i32_i64(local_tid_133206)] =\n                    ((__local\n                      float *) red_arr_mem_133210)[(sext_i32_i64(local_tid_133206) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_133203 -\n                                                   (int64_t) 1];\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_120595\n}\n__kernel void mainzisegred_small_121036(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133690_backing_aligned_0,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t l_window_114538,\n                                        int64_t t_jump_114541,\n                                        int64_t l_n_m_114584, int64_t i_114610,\n                                        int64_t num_groups_121366,\n                                        int64_t segment_sizze_nonzzero_133683,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130404,\n                                        __global\n          ",
                   "                              unsigned char *defunc_3_map_res_mem_130405,\n                                        __global unsigned char *mem_130861,\n                                        __global unsigned char *mem_130865,\n                                        __global unsigned char *mem_130918,\n                                        __global unsigned char *mem_130923)\n{\n    #define segred_group_sizze_121365 (mainzisegred_group_sizze_121030)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_133690_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_133690_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_133685;\n    int32_t local_tid_133686;\n    int64_t group_sizze_133689;\n    int32_t wave_sizze_133688;\n    int32_t group_tid_133687;\n    \n    global_tid_133685 = get_global_id(0);\n    local_tid_133686 = get_local_id(0);\n    group_sizze_133689 = get_local_size(0);\n    wave_sizze_133688 = LOCKSTEP_WIDTH;\n    group_tid_133687 = get_group_id(0);\n    \n    int32_t phys_tid_121036 = global_tid_133685;\n    __local char *red_arr_mem_133690;\n    \n    red_arr_mem_133690 = (__local char *) red_arr_mem_133690_backing_0;\n    \n    int32_t phys_group_id_133692;\n    \n    phys_group_id_133692 = get_group_id(0);\n    for (int32_t i_133693 = 0; i_133693 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533 * l_n_m_114584,\n                                          squot64(segred_group_sizze_121365,\n                                                  segment_sizze_nonzzero_133683))) -\n                   phys_group_id_133692, sext_i64_i32(num_groups_121366));\n         i_133693++) {\n        int32_t virt_group_id_133694 = phys_group_id_133692 + i_133693 *\n                sext_i64_i32(num_groups_121366);\n        int64_t slice_133695 = l_n_m_114584;\n        int64_t slice_133696 = m_114533 * slice_133695;",
                   "\n        int64_t gtid_121025 = squot64(squot64(sext_i32_i64(local_tid_133686),\n                                              segment_sizze_nonzzero_133683) +\n                                      sext_i32_i64(virt_group_id_133694) *\n                                      squot64(segred_group_sizze_121365,\n                                              segment_sizze_nonzzero_133683),\n                                      slice_133695);\n        int64_t remnant_133697 = squot64(sext_i32_i64(local_tid_133686),\n                                         segment_sizze_nonzzero_133683) +\n                sext_i32_i64(virt_group_id_133694) *\n                squot64(segred_group_sizze_121365,\n                        segment_sizze_nonzzero_133683) - gtid_121025 *\n                slice_133695;\n        int64_t gtid_121026 = remnant_133697;\n        int64_t remnant_133698 = remnant_133697 - gtid_121026;\n        int64_t gtid_121035 = srem64(sext_i32_i64(local_tid_133686),\n                                     l_window_114538);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, l_window_114538) && ((slt64(gtid_121025,\n                                                               m_114533) &&\n                                                         slt64(gtid_121026,\n                                                               l_n_m_114584)) &&\n                                                        slt64(sext_i32_i64(local_tid_133686),\n                                                              l_window_114538 *\n                                                              squot64(segred_group_sizze_121365,\n                                                                      segment_sizze_nonzzero_133683)))) {\n                int64_t x_121377 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_121025];\n                int64_t x_121380 = ((__global\n                                     int64_t *)",
                   " defunc_3_map_res_mem_130404)[gtid_121025 *\n                                                                             l_n_m_114584 +\n                                                                             gtid_121026];\n                float x_121381 = ((__global\n                                   float *) defunc_3_map_res_mem_130405)[gtid_121025 *\n                                                                         l_n_m_114584 +\n                                                                         gtid_121026];\n                int64_t binop_y_128820 = mul64(t_jump_114541, gtid_121026);\n                int64_t convop_x_128821 = smin64(i_114610, binop_y_128820);\n                float index_primexp_128822 = sitofp_i64_f32(convop_x_128821);\n                float a0_121383 = ((__global float *) mem_130918)[gtid_121025 *\n                                                                  l_n_m_114584 +\n                                                                  gtid_121026];\n                bool cond_121385 = sle64(x_121377, gtid_121035);\n                float defunc_0_f_res_121386;\n                \n                if (cond_121385) {\n                    defunc_0_f_res_121386 = 0.0F;\n                } else {\n                    int64_t i_121387 = add64(gtid_121035, x_121380);\n                    float x_121388 = ((__global\n                                       float *) mem_130122)[gtid_121025 *\n                                                            n_114534 +\n                                                            i_121387];\n                    float defunc_0_f_res_f_res_121389 = 1.0F + x_121388;\n                    \n                    defunc_0_f_res_121386 = defunc_0_f_res_f_res_121389;\n                }\n                \n                float defunc_0_f_res_121390;\n                \n                if (cond_121385) {\n                    defunc_0_f_res_121390 = 0.0F;\n                } else {\n                    int64_t i_121391 = add64(gtid_12",
                   "1035, x_121380);\n                    float x_121392 = ((__global\n                                       float *) mem_130861)[gtid_121025 *\n                                                            n_114534 +\n                                                            i_121391];\n                    \n                    defunc_0_f_res_121390 = x_121392;\n                }\n                \n                float x_j_121393 = defunc_0_f_res_121386 - index_primexp_128822;\n                float abs_res_121394 = (float) fabs(x_j_121393);\n                float tmp1_121395 = abs_res_121394 / x_121381;\n                float x_121396 = tmp1_121395 * tmp1_121395;\n                float y_121397 = tmp1_121395 * x_121396;\n                float tmp2_121398 = 1.0F - y_121397;\n                float x_121399 = tmp2_121398 * tmp2_121398;\n                float tmp3_121400 = tmp2_121398 * x_121399;\n                float tmp4_121401 = defunc_0_f_res_121390 * tmp3_121400;\n                float defunc_0_f_res_121402;\n                \n                if (cond_121385) {\n                    defunc_0_f_res_121402 = 0.0F;\n                } else {\n                    int64_t i_121403 = add64(gtid_121035, x_121380);\n                    float x_121404 = ((__global\n                                       float *) mem_130865)[gtid_121025 *\n                                                            n_114534 +\n                                                            i_121403];\n                    \n                    defunc_0_f_res_121402 = x_121404;\n                }\n                \n                float x_121405 = a0_121383 * tmp4_121401;\n                float defunc_9_fit_fun_res_121406 = defunc_0_f_res_121402 *\n                      x_121405;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_133690)[sext_i32_i64(local_tid_133686)] =\n",
                   "                        defunc_9_fit_fun_res_121406;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_133690)[sext_i32_i64(local_tid_133686)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, l_window_114538)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_121369;\n                float x_121370;\n                float x_133699;\n                float x_133700;\n                bool ltid_in_bounds_133702 =\n                     slt64(sext_i32_i64(local_tid_133686), l_window_114538 *\n                           squot64(segred_group_sizze_121365,\n                                   segment_sizze_nonzzero_133683));\n                int32_t skip_threads_133703;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_133702) {\n                        x_121370 = ((volatile __local\n                                     float *) red_arr_mem_133690)[sext_i32_i64(local_tid_133686)];\n                        if ((local_tid_133686 - squot32(local_tid_133686, 32) *\n                             32) == 0) {\n                            x_121369 = x_121370;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_133703 = 1;\n                    while (slt32(skip_threads_133703, 32)) {\n                        if (sle32(skip_threads_133703, local_tid_133686 -\n                                  squot32(local_tid_133686, 32) * 32) &&\n                            ltid_in_bounds_133702) {\n                            // read operands\n                            {\n                                x_121369 = ((volatile __local\n                                             float *) red_arr_mem_133690)[sext_i32_i64(local_tid_133686) -\n           ",
                   "                                                               sext_i32_i64(skip_threads_133703)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_133704 =\n                                     slt64(srem64(sext_i32_i64(local_tid_133686),\n                                                  l_window_114538),\n                                           sext_i32_i64(local_tid_133686) -\n                                           sext_i32_i64(local_tid_133686 -\n                                           skip_threads_133703));\n                                \n                                if (inactive_133704) {\n                                    x_121369 = x_121370;\n                                }\n                                if (!inactive_133704) {\n                                    float defunc_1_op_res_121371 = x_121369 +\n                                          x_121370;\n                                    \n                                    x_121369 = defunc_1_op_res_121371;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_133688, skip_threads_133703)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_133703, local_tid_133686 -\n                                  squot32(local_tid_133686, 32) * 32) &&\n                            ltid_in_bounds_133702) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_133690)[sext_i32_i64(local_tid_133686)] =\n                                    x_121369;\n                                x_121370 = x_121369;\n                            }\n                        }\n                        if (sle32(wave_sizze_133688, skip_threads_133",
                   "703)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_133703 *= 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_133686 - squot32(local_tid_133686, 32) *\n                         32) == 31 && ltid_in_bounds_133702) {\n                        ((volatile __local\n                          float *) red_arr_mem_133690)[sext_i32_i64(squot32(local_tid_133686,\n                                                                            32))] =\n                            x_121369;\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_133705;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_133686, 32) == 0 &&\n                            ltid_in_bounds_133702) {\n                            x_133700 = ((volatile __local\n                                         float *) red_arr_mem_133690)[sext_i32_i64(local_tid_133686)];\n                            if ((local_tid_133686 - squot32(local_tid_133686,\n                                                            32) * 32) == 0) {\n                                x_133699 = x_133700;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_133705 = 1;\n                        while (slt32(skip_threads_133705, 32)) {\n                            if (sle32(skip_threads_133705, local_tid_133686 -\n                                      squot32(local_tid_133686, 32) * 32) &&\n        ",
                   "                        (squot32(local_tid_133686, 32) == 0 &&\n                                 ltid_in_bounds_133702)) {\n                                // read operands\n                                {\n                                    x_133699 = ((volatile __local\n                                                 float *) red_arr_mem_133690)[sext_i32_i64(local_tid_133686) -\n                                                                              sext_i32_i64(skip_threads_133705)];\n                                }\n                                // perform operation\n                                {\n                                    bool inactive_133706 =\n                                         slt64(srem64(sext_i32_i64(local_tid_133686 *\n                                                      32 + 32 - 1),\n                                                      l_window_114538),\n                                               sext_i32_i64(local_tid_133686 *\n                                               32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_133686 -\n                                                             skip_threads_133705) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_133706) {\n                                        x_133699 = x_133700;\n                                    }\n                                    if (!inactive_133706) {\n                                        float defunc_1_op_res_133701 =\n                                              x_133699 + x_133700;\n                                        \n                                        x_133699 = defunc_1_op_res_133701;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_133688, skip_threads_133705)) {\n                                barrier",
                   "(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_133705, local_tid_133686 -\n                                      squot32(local_tid_133686, 32) * 32) &&\n                                (squot32(local_tid_133686, 32) == 0 &&\n                                 ltid_in_bounds_133702)) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_133690)[sext_i32_i64(local_tid_133686)] =\n                                        x_133699;\n                                    x_133700 = x_133699;\n                                }\n                            }\n                            if (sle32(wave_sizze_133688, skip_threads_133705)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_133705 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n                    if (!(squot32(local_tid_133686, 32) == 0 ||\n                          !ltid_in_bounds_133702)) {\n                        // read operands\n                        {\n                            x_121370 = x_121369;\n                            x_121369 = ((__local\n                                         float *) red_arr_mem_133690)[sext_i32_i64(squot32(local_tid_133686,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_133707 =\n                                 slt64(srem64(sext_i32_i64(local_tid_133686),\n                                    ",
                   "          l_window_114538),\n                                       sext_i32_i64(local_tid_133686) -\n                                       sext_i32_i64(squot32(local_tid_133686,\n                                                            32) * 32 - 1));\n                            \n                            if (inactive_133707) {\n                                x_121369 = x_121370;\n                            }\n                            if (!inactive_133707) {\n                                float defunc_1_op_res_121371 = x_121369 +\n                                      x_121370;\n                                \n                                x_121369 = defunc_1_op_res_121371;\n                            }\n                        }\n                        // write final result\n                        {\n                            ((__local\n                              float *) red_arr_mem_133690)[sext_i32_i64(local_tid_133686)] =\n                                x_121369;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_133686, 32) == 0) {\n                        ((__local\n                          float *) red_arr_mem_133690)[sext_i32_i64(local_tid_133686)] =\n                            x_121370;\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_133694) *\n                      squot64(segred_group_sizze_121365,\n                              segment_sizze_nonzzero_133683) +\n                      sext_i32_i64(local_tid_133686), m_114533 *\n                      l_n_m_114584) && slt64(sext_i32_i64(local_tid_133686),\n                                             squot64(segred_group_sizze_12136",
                   "5,\n                                                     segment_sizze_nonzzero_133683))) {\n                ((__global\n                  float *) mem_130923)[squot64(sext_i32_i64(virt_group_id_133694) *\n                                               squot64(segred_group_sizze_121365,\n                                                       segment_sizze_nonzzero_133683) +\n                                               sext_i32_i64(local_tid_133686),\n                                               l_n_m_114584) * l_n_m_114584 +\n                                       (sext_i32_i64(virt_group_id_133694) *\n                                        squot64(segred_group_sizze_121365,\n                                                segment_sizze_nonzzero_133683) +\n                                        sext_i32_i64(local_tid_133686) -\n                                        squot64(sext_i32_i64(virt_group_id_133694) *\n                                                squot64(segred_group_sizze_121365,\n                                                        segment_sizze_nonzzero_133683) +\n                                                sext_i32_i64(local_tid_133686),\n                                                l_n_m_114584) * l_n_m_114584)] =\n                    ((__local\n                      float *) red_arr_mem_133690)[(sext_i32_i64(local_tid_133686) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_133683 -\n                                                   (int64_t) 1];\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_121365\n}\n__kernel void mainzisegred_small_121098(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133612_backing_aligned_0,\n       ",
                   "                                 int64_t m_114533, int64_t n_114534,\n                                        int64_t l_window_114538,\n                                        int64_t t_jump_114541,\n                                        int64_t l_n_m_114584, int64_t i_114610,\n                                        int64_t num_groups_121322,\n                                        int64_t segment_sizze_nonzzero_133605,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130404,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130405,\n                                        __global unsigned char *mem_130861,\n                                        __global unsigned char *mem_130913)\n{\n    #define segred_group_sizze_121321 (mainzisegred_group_sizze_121092)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_133612_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_133612_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_133607;\n    int32_t local_tid_133608;\n    int64_t group_sizze_133611;\n    int32_t wave_sizze_133610;\n    int32_t group_tid_133609;\n    \n    global_tid_133607 = get_global_id(0);\n    local_tid_133608 = get_local_id(0);\n    group_sizze_133611 = get_local_size(0);\n    wave_sizze_133610 = LOCKSTEP_WIDTH;\n    group_tid_133609 = get_group_id(0);\n    \n    int32_t phys_tid_121098 = global_tid_133607;\n    __local char *red_arr_mem_133612;\n    \n    red_arr_mem_133612 = (__local char *) red_arr_mem_133612_backing_0;\n    \n  ",
                   "  int32_t phys_group_id_133614;\n    \n    phys_group_id_133614 = get_group_id(0);\n    for (int32_t i_133615 = 0; i_133615 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533 * l_n_m_114584,\n                                          squot64(segred_group_sizze_121321,\n                                                  segment_sizze_nonzzero_133605))) -\n                   phys_group_id_133614, sext_i64_i32(num_groups_121322));\n         i_133615++) {\n        int32_t virt_group_id_133616 = phys_group_id_133614 + i_133615 *\n                sext_i64_i32(num_groups_121322);\n        int64_t slice_133617 = l_n_m_114584;\n        int64_t slice_133618 = m_114533 * slice_133617;\n        int64_t gtid_121087 = squot64(squot64(sext_i32_i64(local_tid_133608),\n                                              segment_sizze_nonzzero_133605) +\n                                      sext_i32_i64(virt_group_id_133616) *\n                                      squot64(segred_group_sizze_121321,\n                                              segment_sizze_nonzzero_133605),\n                                      slice_133617);\n        int64_t remnant_133619 = squot64(sext_i32_i64(local_tid_133608),\n                                         segment_sizze_nonzzero_133605) +\n                sext_i32_i64(virt_group_id_133616) *\n                squot64(segred_group_sizze_121321,\n                        segment_sizze_nonzzero_133605) - gtid_121087 *\n                slice_133617;\n        int64_t gtid_121088 = remnant_133619;\n        int64_t remnant_133620 = remnant_133619 - gtid_121088;\n        int64_t gtid_121097 = srem64(sext_i32_i64(local_tid_133608),\n                                     l_window_114538);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, l_window_114538) && ((slt64(gtid_121087,\n                                                               m_114533) &&\n                                                         slt64(gtid_121088,\n                ",
                   "                                               l_n_m_114584)) &&\n                                                        slt64(sext_i32_i64(local_tid_133608),\n                                                              l_window_114538 *\n                                                              squot64(segred_group_sizze_121321,\n                                                                      segment_sizze_nonzzero_133605)))) {\n                int64_t x_121332 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_121087];\n                int64_t x_121334 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130404)[gtid_121087 *\n                                                                             l_n_m_114584 +\n                                                                             gtid_121088];\n                float x_121335 = ((__global\n                                   float *) defunc_3_map_res_mem_130405)[gtid_121087 *\n                                                                         l_n_m_114584 +\n                                                                         gtid_121088];\n                int64_t binop_y_128813 = mul64(t_jump_114541, gtid_121088);\n                int64_t convop_x_128814 = smin64(i_114610, binop_y_128813);\n                float index_primexp_128815 = sitofp_i64_f32(convop_x_128814);\n                bool cond_121338 = sle64(x_121332, gtid_121097);\n                float defunc_0_f_res_121339;\n                \n                if (cond_121338) {\n                    defunc_0_f_res_121339 = 0.0F;\n                } else {\n                    int64_t i_121340 = add64(gtid_121097, x_121334);\n                    float x_121341 = ((__global\n                                       float *) mem_130122)[gtid_121087 *\n                                                            n_114534 +\n                                                            i_1213",
                   "40];\n                    float defunc_0_f_res_f_res_121342 = 1.0F + x_121341;\n                    \n                    defunc_0_f_res_121339 = defunc_0_f_res_f_res_121342;\n                }\n                \n                float defunc_0_f_res_121343;\n                \n                if (cond_121338) {\n                    defunc_0_f_res_121343 = 0.0F;\n                } else {\n                    int64_t i_121344 = add64(gtid_121097, x_121334);\n                    float x_121345 = ((__global\n                                       float *) mem_130861)[gtid_121087 *\n                                                            n_114534 +\n                                                            i_121344];\n                    \n                    defunc_0_f_res_121343 = x_121345;\n                }\n                \n                float x_j_121346 = defunc_0_f_res_121339 - index_primexp_128815;\n                float abs_res_121347 = (float) fabs(x_j_121346);\n                float tmp1_121348 = abs_res_121347 / x_121335;\n                float x_121349 = tmp1_121348 * tmp1_121348;\n                float y_121350 = tmp1_121348 * x_121349;\n                float tmp2_121351 = 1.0F - y_121350;\n                float x_121352 = tmp2_121351 * tmp2_121351;\n                float tmp3_121353 = tmp2_121351 * x_121352;\n                float w_j_121354 = defunc_0_f_res_121343 * tmp3_121353;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_133612)[sext_i32_i64(local_tid_133608)] =\n                        w_j_121354;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_133612)[sext_i32_i64(local_tid_133608)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, l_window_114538)) {\n            // perform segment",
                   "ed scan to imitate reduction\n            {\n                float x_121325;\n                float x_121326;\n                float x_133621;\n                float x_133622;\n                bool ltid_in_bounds_133624 =\n                     slt64(sext_i32_i64(local_tid_133608), l_window_114538 *\n                           squot64(segred_group_sizze_121321,\n                                   segment_sizze_nonzzero_133605));\n                int32_t skip_threads_133625;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_133624) {\n                        x_121326 = ((volatile __local\n                                     float *) red_arr_mem_133612)[sext_i32_i64(local_tid_133608)];\n                        if ((local_tid_133608 - squot32(local_tid_133608, 32) *\n                             32) == 0) {\n                            x_121325 = x_121326;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_133625 = 1;\n                    while (slt32(skip_threads_133625, 32)) {\n                        if (sle32(skip_threads_133625, local_tid_133608 -\n                                  squot32(local_tid_133608, 32) * 32) &&\n                            ltid_in_bounds_133624) {\n                            // read operands\n                            {\n                                x_121325 = ((volatile __local\n                                             float *) red_arr_mem_133612)[sext_i32_i64(local_tid_133608) -\n                                                                          sext_i32_i64(skip_threads_133625)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_133626 =\n                                     slt64(srem64(sext_i32_i64(local_tid_133608),\n                       ",
                   "                           l_window_114538),\n                                           sext_i32_i64(local_tid_133608) -\n                                           sext_i32_i64(local_tid_133608 -\n                                           skip_threads_133625));\n                                \n                                if (inactive_133626) {\n                                    x_121325 = x_121326;\n                                }\n                                if (!inactive_133626) {\n                                    float defunc_1_op_res_121327 = x_121325 +\n                                          x_121326;\n                                    \n                                    x_121325 = defunc_1_op_res_121327;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_133610, skip_threads_133625)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_133625, local_tid_133608 -\n                                  squot32(local_tid_133608, 32) * 32) &&\n                            ltid_in_bounds_133624) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_133612)[sext_i32_i64(local_tid_133608)] =\n                                    x_121325;\n                                x_121326 = x_121325;\n                            }\n                        }\n                        if (sle32(wave_sizze_133610, skip_threads_133625)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_133625 *= 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_133608 - sq",
                   "uot32(local_tid_133608, 32) *\n                         32) == 31 && ltid_in_bounds_133624) {\n                        ((volatile __local\n                          float *) red_arr_mem_133612)[sext_i32_i64(squot32(local_tid_133608,\n                                                                            32))] =\n                            x_121325;\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_133627;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_133608, 32) == 0 &&\n                            ltid_in_bounds_133624) {\n                            x_133622 = ((volatile __local\n                                         float *) red_arr_mem_133612)[sext_i32_i64(local_tid_133608)];\n                            if ((local_tid_133608 - squot32(local_tid_133608,\n                                                            32) * 32) == 0) {\n                                x_133621 = x_133622;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_133627 = 1;\n                        while (slt32(skip_threads_133627, 32)) {\n                            if (sle32(skip_threads_133627, local_tid_133608 -\n                                      squot32(local_tid_133608, 32) * 32) &&\n                                (squot32(local_tid_133608, 32) == 0 &&\n                                 ltid_in_bounds_133624)) {\n                                // read operands\n                                {\n                                    x_133621 = ((volatile __local\n                                                 float *) red_arr_mem_133612)[sext_i32_i64(local_",
                   "tid_133608) -\n                                                                              sext_i32_i64(skip_threads_133627)];\n                                }\n                                // perform operation\n                                {\n                                    bool inactive_133628 =\n                                         slt64(srem64(sext_i32_i64(local_tid_133608 *\n                                                      32 + 32 - 1),\n                                                      l_window_114538),\n                                               sext_i32_i64(local_tid_133608 *\n                                               32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_133608 -\n                                                             skip_threads_133627) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_133628) {\n                                        x_133621 = x_133622;\n                                    }\n                                    if (!inactive_133628) {\n                                        float defunc_1_op_res_133623 =\n                                              x_133621 + x_133622;\n                                        \n                                        x_133621 = defunc_1_op_res_133623;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_133610, skip_threads_133627)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_133627, local_tid_133608 -\n                                      squot32(local_tid_133608, 32) * 32) &&\n                                (squot32(local_tid_133608, 32) == 0 &&\n                                 ltid_in_bounds_133624)) {\n                              ",
                   "  // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_133612)[sext_i32_i64(local_tid_133608)] =\n                                        x_133621;\n                                    x_133622 = x_133621;\n                                }\n                            }\n                            if (sle32(wave_sizze_133610, skip_threads_133627)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_133627 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n                    if (!(squot32(local_tid_133608, 32) == 0 ||\n                          !ltid_in_bounds_133624)) {\n                        // read operands\n                        {\n                            x_121326 = x_121325;\n                            x_121325 = ((__local\n                                         float *) red_arr_mem_133612)[sext_i32_i64(squot32(local_tid_133608,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_133629 =\n                                 slt64(srem64(sext_i32_i64(local_tid_133608),\n                                              l_window_114538),\n                                       sext_i32_i64(local_tid_133608) -\n                                       sext_i32_i64(squot32(local_tid_133608,\n                                                            32) * 32 - 1));\n                            \n                            if (inactive_133629) {\n                                x_",
                   "121325 = x_121326;\n                            }\n                            if (!inactive_133629) {\n                                float defunc_1_op_res_121327 = x_121325 +\n                                      x_121326;\n                                \n                                x_121325 = defunc_1_op_res_121327;\n                            }\n                        }\n                        // write final result\n                        {\n                            ((__local\n                              float *) red_arr_mem_133612)[sext_i32_i64(local_tid_133608)] =\n                                x_121325;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_133608, 32) == 0) {\n                        ((__local\n                          float *) red_arr_mem_133612)[sext_i32_i64(local_tid_133608)] =\n                            x_121326;\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_133616) *\n                      squot64(segred_group_sizze_121321,\n                              segment_sizze_nonzzero_133605) +\n                      sext_i32_i64(local_tid_133608), m_114533 *\n                      l_n_m_114584) && slt64(sext_i32_i64(local_tid_133608),\n                                             squot64(segred_group_sizze_121321,\n                                                     segment_sizze_nonzzero_133605))) {\n                ((__global\n                  float *) mem_130913)[squot64(sext_i32_i64(virt_group_id_133616) *\n                                               squot64(segred_group_sizze_121321,\n                                                       segment_sizze_nonzzero_133605",
                   ") +\n                                               sext_i32_i64(local_tid_133608),\n                                               l_n_m_114584) * l_n_m_114584 +\n                                       (sext_i32_i64(virt_group_id_133616) *\n                                        squot64(segred_group_sizze_121321,\n                                                segment_sizze_nonzzero_133605) +\n                                        sext_i32_i64(local_tid_133608) -\n                                        squot64(sext_i32_i64(virt_group_id_133616) *\n                                                squot64(segred_group_sizze_121321,\n                                                        segment_sizze_nonzzero_133605) +\n                                                sext_i32_i64(local_tid_133608),\n                                                l_n_m_114584) * l_n_m_114584)] =\n                    ((__local\n                      float *) red_arr_mem_133612)[(sext_i32_i64(local_tid_133608) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_133605 -\n                                                   (int64_t) 1];\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_121321\n}\n__kernel void mainzisegred_small_121729(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133904_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133902_backing_aligned_1,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t l_window_114538,\n                                        int64_t t_jump_114541,\n                           ",
                   "             int64_t l_n_m_114584, int64_t i_114610,\n                                        int64_t num_groups_122182,\n                                        int64_t segment_sizze_nonzzero_133895,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130404,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130405,\n                                        __global unsigned char *mem_130861,\n                                        __global unsigned char *mem_130865,\n                                        __global unsigned char *mem_131009,\n                                        __global unsigned char *mem_131013,\n                                        __global unsigned char *mem_131017,\n                                        __global unsigned char *mem_131022,\n                                        __global unsigned char *mem_131026)\n{\n    #define segred_group_sizze_122181 (mainzisegred_group_sizze_121723)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_133904_backing_1 =\n                          (__local volatile\n                           char *) red_arr_mem_133904_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_133902_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_133902_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_133897;\n    int32_t local_tid_133898;\n    int64_t group_sizze_133901;\n    int32_t wave_sizze_133900;\n    int32_t group_tid_133899;\n    \n    global_tid_133897 = get_global_id(0);\n",
                   "    local_tid_133898 = get_local_id(0);\n    group_sizze_133901 = get_local_size(0);\n    wave_sizze_133900 = LOCKSTEP_WIDTH;\n    group_tid_133899 = get_group_id(0);\n    \n    int32_t phys_tid_121729 = global_tid_133897;\n    __local char *red_arr_mem_133902;\n    \n    red_arr_mem_133902 = (__local char *) red_arr_mem_133902_backing_0;\n    \n    __local char *red_arr_mem_133904;\n    \n    red_arr_mem_133904 = (__local char *) red_arr_mem_133904_backing_1;\n    \n    int32_t phys_group_id_133906;\n    \n    phys_group_id_133906 = get_group_id(0);\n    for (int32_t i_133907 = 0; i_133907 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533 * l_n_m_114584,\n                                          squot64(segred_group_sizze_122181,\n                                                  segment_sizze_nonzzero_133895))) -\n                   phys_group_id_133906, sext_i64_i32(num_groups_122182));\n         i_133907++) {\n        int32_t virt_group_id_133908 = phys_group_id_133906 + i_133907 *\n                sext_i64_i32(num_groups_122182);\n        int64_t slice_133909 = l_n_m_114584;\n        int64_t slice_133910 = m_114533 * slice_133909;\n        int64_t gtid_121718 = squot64(squot64(sext_i32_i64(local_tid_133898),\n                                              segment_sizze_nonzzero_133895) +\n                                      sext_i32_i64(virt_group_id_133908) *\n                                      squot64(segred_group_sizze_122181,\n                                              segment_sizze_nonzzero_133895),\n                                      slice_133909);\n        int64_t remnant_133911 = squot64(sext_i32_i64(local_tid_133898),\n                                         segment_sizze_nonzzero_133895) +\n                sext_i32_i64(virt_group_id_133908) *\n                squot64(segred_group_sizze_122181,\n                        segment_sizze_nonzzero_133895) - gtid_121718 *\n                slice_133909;\n        int64_t gtid_121719 = remnant_133911;\n        int64_t remnant_133912 = ",
                   "remnant_133911 - gtid_121719;\n        int64_t gtid_121728 = srem64(sext_i32_i64(local_tid_133898),\n                                     l_window_114538);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, l_window_114538) && ((slt64(gtid_121718,\n                                                               m_114533) &&\n                                                         slt64(gtid_121719,\n                                                               l_n_m_114584)) &&\n                                                        slt64(sext_i32_i64(local_tid_133898),\n                                                              l_window_114538 *\n                                                              squot64(segred_group_sizze_122181,\n                                                                      segment_sizze_nonzzero_133895)))) {\n                int64_t x_122197 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_121718];\n                int64_t x_122202 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130404)[gtid_121718 *\n                                                                             l_n_m_114584 +\n                                                                             gtid_121719];\n                float x_122203 = ((__global\n                                   float *) defunc_3_map_res_mem_130405)[gtid_121718 *\n                                                                         l_n_m_114584 +\n                                                                         gtid_121719];\n                int64_t binop_y_128852 = mul64(t_jump_114541, gtid_121719);\n                int64_t convop_x_128853 = smin64(i_114610, binop_y_128852);\n                float index_primexp_128854 = sitofp_i64_f32(convop_x_128853);\n                float a11_122205 = ((__global float *) mem_131009)[gtid_121718 *\n                        ",
                   "                                           l_n_m_114584 +\n                                                                   gtid_121719];\n                float b11_122206 = ((__global float *) mem_131013)[gtid_121718 *\n                                                                   l_n_m_114584 +\n                                                                   gtid_121719];\n                float c11_122207 = ((__global float *) mem_131017)[gtid_121718 *\n                                                                   l_n_m_114584 +\n                                                                   gtid_121719];\n                bool cond_122209 = sle64(x_122197, gtid_121728);\n                float defunc_0_f_res_122210;\n                \n                if (cond_122209) {\n                    defunc_0_f_res_122210 = 0.0F;\n                } else {\n                    int64_t i_122211 = add64(gtid_121728, x_122202);\n                    float x_122212 = ((__global\n                                       float *) mem_130122)[gtid_121718 *\n                                                            n_114534 +\n                                                            i_122211];\n                    float defunc_0_f_res_f_res_122213 = 1.0F + x_122212;\n                    \n                    defunc_0_f_res_122210 = defunc_0_f_res_f_res_122213;\n                }\n                \n                float defunc_0_f_res_122214;\n                \n                if (cond_122209) {\n                    defunc_0_f_res_122214 = 0.0F;\n                } else {\n                    int64_t i_122215 = add64(gtid_121728, x_122202);\n                    float x_122216 = ((__global\n                                       float *) mem_130861)[gtid_121718 *\n                                                            n_114534 +\n                                                            i_122215];\n                    \n                    defunc_0_f_res_122214 = x_122216;\n                }\n   ",
                   "             \n                float x_j_122217 = defunc_0_f_res_122210 - index_primexp_128854;\n                float abs_res_122218 = (float) fabs(x_j_122217);\n                float tmp1_122219 = abs_res_122218 / x_122203;\n                float x_122220 = tmp1_122219 * tmp1_122219;\n                float y_122221 = tmp1_122219 * x_122220;\n                float tmp2_122222 = 1.0F - y_122221;\n                float x_122223 = tmp2_122222 * tmp2_122222;\n                float tmp3_122224 = tmp2_122222 * x_122223;\n                float tmp4_122225 = defunc_0_f_res_122214 * tmp3_122224;\n                float defunc_1_f_res_122226 = x_j_122217 * tmp4_122225;\n                float defunc_0_f_res_122227;\n                \n                if (cond_122209) {\n                    defunc_0_f_res_122227 = 0.0F;\n                } else {\n                    int64_t i_122228 = add64(gtid_121728, x_122202);\n                    float x_122229 = ((__global\n                                       float *) mem_130865)[gtid_121718 *\n                                                            n_114534 +\n                                                            i_122228];\n                    \n                    defunc_0_f_res_122227 = x_122229;\n                }\n                \n                float x_122230 = a11_122205 * tmp4_122225;\n                float y_122231 = b11_122206 * defunc_1_f_res_122226;\n                float x_122232 = x_122230 + y_122231;\n                float defunc_9_fit_fun_res_122233 = defunc_0_f_res_122227 *\n                      x_122232;\n                float x_122234 = b11_122206 * tmp4_122225;\n                float y_122235 = c11_122207 * defunc_1_f_res_122226;\n                float x_122236 = x_122234 + y_122235;\n                float defunc_9_slope_fun_res_122237 = defunc_0_f_res_122227 *\n                      x_122236;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n    ",
                   "                ((__local\n                      float *) red_arr_mem_133902)[sext_i32_i64(local_tid_133898)] =\n                        defunc_9_fit_fun_res_122233;\n                    ((__local\n                      float *) red_arr_mem_133904)[sext_i32_i64(local_tid_133898)] =\n                        defunc_9_slope_fun_res_122237;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_133902)[sext_i32_i64(local_tid_133898)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_133904)[sext_i32_i64(local_tid_133898)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, l_window_114538)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_122186;\n                float x_122187;\n                float x_122188;\n                float x_122189;\n                float x_133913;\n                float x_133914;\n                float x_133915;\n                float x_133916;\n                bool ltid_in_bounds_133919 =\n                     slt64(sext_i32_i64(local_tid_133898), l_window_114538 *\n                           squot64(segred_group_sizze_122181,\n                                   segment_sizze_nonzzero_133895));\n                int32_t skip_threads_133920;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_133919) {\n                        x_122188 = ((volatile __local\n                                     float *) red_arr_mem_133902)[sext_i32_i64(local_tid_133898)];\n                        x_122189 = ((volatile __local\n                                     float *) red_arr_mem_133904)[sext_i32_i64(local_tid_133898)];\n                        if ((local_tid_133898 - squot32(local_tid_133898, 32) *\n                             32) == 0) {\n                            x_122186 = x_122188;\n              ",
                   "              x_122187 = x_122189;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_133920 = 1;\n                    while (slt32(skip_threads_133920, 32)) {\n                        if (sle32(skip_threads_133920, local_tid_133898 -\n                                  squot32(local_tid_133898, 32) * 32) &&\n                            ltid_in_bounds_133919) {\n                            // read operands\n                            {\n                                x_122186 = ((volatile __local\n                                             float *) red_arr_mem_133902)[sext_i32_i64(local_tid_133898) -\n                                                                          sext_i32_i64(skip_threads_133920)];\n                                x_122187 = ((volatile __local\n                                             float *) red_arr_mem_133904)[sext_i32_i64(local_tid_133898) -\n                                                                          sext_i32_i64(skip_threads_133920)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_133921 =\n                                     slt64(srem64(sext_i32_i64(local_tid_133898),\n                                                  l_window_114538),\n                                           sext_i32_i64(local_tid_133898) -\n                                           sext_i32_i64(local_tid_133898 -\n                                           skip_threads_133920));\n                                \n                                if (inactive_133921) {\n                                    x_122186 = x_122188;\n                                    x_122187 = x_122189;\n                                }\n                                if (!inactive_133921) {\n                                    float defunc_1_op_r",
                   "es_122190 = x_122186 +\n                                          x_122188;\n                                    float defunc_1_op_res_122191 = x_122187 +\n                                          x_122189;\n                                    \n                                    x_122186 = defunc_1_op_res_122190;\n                                    x_122187 = defunc_1_op_res_122191;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_133900, skip_threads_133920)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_133920, local_tid_133898 -\n                                  squot32(local_tid_133898, 32) * 32) &&\n                            ltid_in_bounds_133919) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_133902)[sext_i32_i64(local_tid_133898)] =\n                                    x_122186;\n                                x_122188 = x_122186;\n                                ((volatile __local\n                                  float *) red_arr_mem_133904)[sext_i32_i64(local_tid_133898)] =\n                                    x_122187;\n                                x_122189 = x_122187;\n                            }\n                        }\n                        if (sle32(wave_sizze_133900, skip_threads_133920)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_133920 *= 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_133898 - squot32(local_tid_133898, 32) *\n                         32) == 31 && ltid_in_bounds_133919) {\n           ",
                   "             ((volatile __local\n                          float *) red_arr_mem_133902)[sext_i32_i64(squot32(local_tid_133898,\n                                                                            32))] =\n                            x_122186;\n                        ((volatile __local\n                          float *) red_arr_mem_133904)[sext_i32_i64(squot32(local_tid_133898,\n                                                                            32))] =\n                            x_122187;\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_133922;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_133898, 32) == 0 &&\n                            ltid_in_bounds_133919) {\n                            x_133915 = ((volatile __local\n                                         float *) red_arr_mem_133902)[sext_i32_i64(local_tid_133898)];\n                            x_133916 = ((volatile __local\n                                         float *) red_arr_mem_133904)[sext_i32_i64(local_tid_133898)];\n                            if ((local_tid_133898 - squot32(local_tid_133898,\n                                                            32) * 32) == 0) {\n                                x_133913 = x_133915;\n                                x_133914 = x_133916;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_133922 = 1;\n                        while (slt32(skip_threads_133922, 32)) {\n                            if (sle32(skip_threads_133922, local_tid_133898 -\n                                      squot32(local_tid_133898, 32) * 32) &&\n       ",
                   "                         (squot32(local_tid_133898, 32) == 0 &&\n                                 ltid_in_bounds_133919)) {\n                                // read operands\n                                {\n                                    x_133913 = ((volatile __local\n                                                 float *) red_arr_mem_133902)[sext_i32_i64(local_tid_133898) -\n                                                                              sext_i32_i64(skip_threads_133922)];\n                                    x_133914 = ((volatile __local\n                                                 float *) red_arr_mem_133904)[sext_i32_i64(local_tid_133898) -\n                                                                              sext_i32_i64(skip_threads_133922)];\n                                }\n                                // perform operation\n                                {\n                                    bool inactive_133923 =\n                                         slt64(srem64(sext_i32_i64(local_tid_133898 *\n                                                      32 + 32 - 1),\n                                                      l_window_114538),\n                                               sext_i32_i64(local_tid_133898 *\n                                               32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_133898 -\n                                                             skip_threads_133922) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_133923) {\n                                        x_133913 = x_133915;\n                                        x_133914 = x_133916;\n                                    }\n                                    if (!inactive_133923) {\n                                        float defunc_1_op_res_133917 =\n                                              x_1339",
                   "13 + x_133915;\n                                        float defunc_1_op_res_133918 =\n                                              x_133914 + x_133916;\n                                        \n                                        x_133913 = defunc_1_op_res_133917;\n                                        x_133914 = defunc_1_op_res_133918;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_133900, skip_threads_133922)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_133922, local_tid_133898 -\n                                      squot32(local_tid_133898, 32) * 32) &&\n                                (squot32(local_tid_133898, 32) == 0 &&\n                                 ltid_in_bounds_133919)) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_133902)[sext_i32_i64(local_tid_133898)] =\n                                        x_133913;\n                                    x_133915 = x_133913;\n                                    ((volatile __local\n                                      float *) red_arr_mem_133904)[sext_i32_i64(local_tid_133898)] =\n                                        x_133914;\n                                    x_133916 = x_133914;\n                                }\n                            }\n                            if (sle32(wave_sizze_133900, skip_threads_133922)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_133922 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n      ",
                   "              if (!(squot32(local_tid_133898, 32) == 0 ||\n                          !ltid_in_bounds_133919)) {\n                        // read operands\n                        {\n                            x_122188 = x_122186;\n                            x_122189 = x_122187;\n                            x_122186 = ((__local\n                                         float *) red_arr_mem_133902)[sext_i32_i64(squot32(local_tid_133898,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                            x_122187 = ((__local\n                                         float *) red_arr_mem_133904)[sext_i32_i64(squot32(local_tid_133898,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_133924 =\n                                 slt64(srem64(sext_i32_i64(local_tid_133898),\n                                              l_window_114538),\n                                       sext_i32_i64(local_tid_133898) -\n                                       sext_i32_i64(squot32(local_tid_133898,\n                                                            32) * 32 - 1));\n                            \n                            if (inactive_133924) {\n                                x_122186 = x_122188;\n                                x_122187 = x_122189;\n                            }\n                            if (!inactive_133924) {\n                                float defunc_1_op_res_122190 = x_122186 +\n                                      x_122188;\n                                float defunc_1_op_res_122191 = x_122187 +\n                                      x_122189;\n                ",
                   "                \n                                x_122186 = defunc_1_op_res_122190;\n                                x_122187 = defunc_1_op_res_122191;\n                            }\n                        }\n                        // write final result\n                        {\n                            ((__local\n                              float *) red_arr_mem_133902)[sext_i32_i64(local_tid_133898)] =\n                                x_122186;\n                            ((__local\n                              float *) red_arr_mem_133904)[sext_i32_i64(local_tid_133898)] =\n                                x_122187;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_133898, 32) == 0) {\n                        ((__local\n                          float *) red_arr_mem_133902)[sext_i32_i64(local_tid_133898)] =\n                            x_122188;\n                        ((__local\n                          float *) red_arr_mem_133904)[sext_i32_i64(local_tid_133898)] =\n                            x_122189;\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_133908) *\n                      squot64(segred_group_sizze_122181,\n                              segment_sizze_nonzzero_133895) +\n                      sext_i32_i64(local_tid_133898), m_114533 *\n                      l_n_m_114584) && slt64(sext_i32_i64(local_tid_133898),\n                                             squot64(segred_group_sizze_122181,\n                                                     segment_sizze_nonzzero_133895))) {\n                ((__global\n                  float *) mem_131022)[squot64(sext_i32_i64(virt_group_id_133908) *\n    ",
                   "                                           squot64(segred_group_sizze_122181,\n                                                       segment_sizze_nonzzero_133895) +\n                                               sext_i32_i64(local_tid_133898),\n                                               l_n_m_114584) * l_n_m_114584 +\n                                       (sext_i32_i64(virt_group_id_133908) *\n                                        squot64(segred_group_sizze_122181,\n                                                segment_sizze_nonzzero_133895) +\n                                        sext_i32_i64(local_tid_133898) -\n                                        squot64(sext_i32_i64(virt_group_id_133908) *\n                                                squot64(segred_group_sizze_122181,\n                                                        segment_sizze_nonzzero_133895) +\n                                                sext_i32_i64(local_tid_133898),\n                                                l_n_m_114584) * l_n_m_114584)] =\n                    ((__local\n                      float *) red_arr_mem_133902)[(sext_i32_i64(local_tid_133898) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_133895 -\n                                                   (int64_t) 1];\n                ((__global\n                  float *) mem_131026)[squot64(sext_i32_i64(virt_group_id_133908) *\n                                               squot64(segred_group_sizze_122181,\n                                                       segment_sizze_nonzzero_133895) +\n                                               sext_i32_i64(local_tid_133898),\n                                               l_n_m_114584) * l_n_m_114584 +\n                                       (sext_i32_i64(virt_group_id_133908) *\n                                        squot64(segred_group_sizze_122181,\n                                 ",
                   "               segment_sizze_nonzzero_133895) +\n                                        sext_i32_i64(local_tid_133898) -\n                                        squot64(sext_i32_i64(virt_group_id_133908) *\n                                                squot64(segred_group_sizze_122181,\n                                                        segment_sizze_nonzzero_133895) +\n                                                sext_i32_i64(local_tid_133898),\n                                                l_n_m_114584) * l_n_m_114584)] =\n                    ((__local\n                      float *) red_arr_mem_133904)[(sext_i32_i64(local_tid_133898) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_133895 -\n                                                   (int64_t) 1];\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_122181\n}\n__kernel void mainzisegred_small_121818(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133802_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133800_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_133798_backing_aligned_2,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t l_window_114538,\n                                        int64_t t_jump_114541,\n                                        int64_t l_n_m_114584, int64_t i_114610,\n                                        int64_t num_groups_122117,\n                                        int64_t segment_sizze_nonzzero_133791,\n   ",
                   "                                     __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130404,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130405,\n                                        __global unsigned char *mem_130861,\n                                        __global unsigned char *mem_130996,\n                                        __global unsigned char *mem_131000,\n                                        __global unsigned char *mem_131004)\n{\n    #define segred_group_sizze_122116 (mainzisegred_group_sizze_121812)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_133802_backing_2 =\n                          (__local volatile\n                           char *) red_arr_mem_133802_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_133800_backing_1 =\n                          (__local volatile\n                           char *) red_arr_mem_133800_backing_aligned_1;\n    __local volatile char *restrict red_arr_mem_133798_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_133798_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_133793;\n    int32_t local_tid_133794;\n    int64_t group_sizze_133797;\n    int32_t wave_sizze_133796;\n    int32_t group_tid_133795;\n    \n    global_tid_133793 = get_global_id(0);\n    local_tid_133794 = get_local_id(0);\n    group_sizze_133797 = get_local_size(0);\n    wave_sizze_133796 = LOCKSTEP_WIDTH;\n    group_tid_133795 = get_group_id(0);\n    \n    int32_t phys_tid_121818 = global_tid_133793;\n    __local char *red_arr_me",
                   "m_133798;\n    \n    red_arr_mem_133798 = (__local char *) red_arr_mem_133798_backing_0;\n    \n    __local char *red_arr_mem_133800;\n    \n    red_arr_mem_133800 = (__local char *) red_arr_mem_133800_backing_1;\n    \n    __local char *red_arr_mem_133802;\n    \n    red_arr_mem_133802 = (__local char *) red_arr_mem_133802_backing_2;\n    \n    int32_t phys_group_id_133804;\n    \n    phys_group_id_133804 = get_group_id(0);\n    for (int32_t i_133805 = 0; i_133805 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533 * l_n_m_114584,\n                                          squot64(segred_group_sizze_122116,\n                                                  segment_sizze_nonzzero_133791))) -\n                   phys_group_id_133804, sext_i64_i32(num_groups_122117));\n         i_133805++) {\n        int32_t virt_group_id_133806 = phys_group_id_133804 + i_133805 *\n                sext_i64_i32(num_groups_122117);\n        int64_t slice_133807 = l_n_m_114584;\n        int64_t slice_133808 = m_114533 * slice_133807;\n        int64_t gtid_121807 = squot64(squot64(sext_i32_i64(local_tid_133794),\n                                              segment_sizze_nonzzero_133791) +\n                                      sext_i32_i64(virt_group_id_133806) *\n                                      squot64(segred_group_sizze_122116,\n                                              segment_sizze_nonzzero_133791),\n                                      slice_133807);\n        int64_t remnant_133809 = squot64(sext_i32_i64(local_tid_133794),\n                                         segment_sizze_nonzzero_133791) +\n                sext_i32_i64(virt_group_id_133806) *\n                squot64(segred_group_sizze_122116,\n                        segment_sizze_nonzzero_133791) - gtid_121807 *\n                slice_133807;\n        int64_t gtid_121808 = remnant_133809;\n        int64_t remnant_133810 = remnant_133809 - gtid_121808;\n        int64_t gtid_121817 = srem64(sext_i32_i64(local_tid_133794),\n                           ",
                   "          l_window_114538);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, l_window_114538) && ((slt64(gtid_121807,\n                                                               m_114533) &&\n                                                         slt64(gtid_121808,\n                                                               l_n_m_114584)) &&\n                                                        slt64(sext_i32_i64(local_tid_133794),\n                                                              l_window_114538 *\n                                                              squot64(segred_group_sizze_122116,\n                                                                      segment_sizze_nonzzero_133791)))) {\n                int64_t x_122135 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_121807];\n                int64_t x_122137 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130404)[gtid_121807 *\n                                                                             l_n_m_114584 +\n                                                                             gtid_121808];\n                float x_122138 = ((__global\n                                   float *) defunc_3_map_res_mem_130405)[gtid_121807 *\n                                                                         l_n_m_114584 +\n                                                                         gtid_121808];\n                int64_t binop_y_128845 = mul64(t_jump_114541, gtid_121808);\n                int64_t convop_x_128846 = smin64(i_114610, binop_y_128845);\n                float index_primexp_128847 = sitofp_i64_f32(convop_x_128846);\n                bool cond_122141 = sle64(x_122135, gtid_121817);\n                float defunc_0_f_res_122142;\n                \n                if (cond_122141) {\n                    defunc_0_f_res_122142 = 0.0F;\n                } e",
                   "lse {\n                    int64_t i_122143 = add64(gtid_121817, x_122137);\n                    float x_122144 = ((__global\n                                       float *) mem_130122)[gtid_121807 *\n                                                            n_114534 +\n                                                            i_122143];\n                    float defunc_0_f_res_f_res_122145 = 1.0F + x_122144;\n                    \n                    defunc_0_f_res_122142 = defunc_0_f_res_f_res_122145;\n                }\n                \n                float defunc_0_f_res_122146;\n                \n                if (cond_122141) {\n                    defunc_0_f_res_122146 = 0.0F;\n                } else {\n                    int64_t i_122147 = add64(gtid_121817, x_122137);\n                    float x_122148 = ((__global\n                                       float *) mem_130861)[gtid_121807 *\n                                                            n_114534 +\n                                                            i_122147];\n                    \n                    defunc_0_f_res_122146 = x_122148;\n                }\n                \n                float x_j_122149 = defunc_0_f_res_122142 - index_primexp_128847;\n                float abs_res_122150 = (float) fabs(x_j_122149);\n                float tmp1_122151 = abs_res_122150 / x_122138;\n                float x_122152 = tmp1_122151 * tmp1_122151;\n                float y_122153 = tmp1_122151 * x_122152;\n                float tmp2_122154 = 1.0F - y_122153;\n                float x_122155 = tmp2_122154 * tmp2_122154;\n                float tmp3_122156 = tmp2_122154 * x_122155;\n                float w_j_122157 = defunc_0_f_res_122146 * tmp3_122156;\n                float xw_j_122158 = x_j_122149 * w_j_122157;\n                float x2w_j_122159 = x_j_122149 * xw_j_122158;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n        ",
                   "            ((__local\n                      float *) red_arr_mem_133798)[sext_i32_i64(local_tid_133794)] =\n                        w_j_122157;\n                    ((__local\n                      float *) red_arr_mem_133800)[sext_i32_i64(local_tid_133794)] =\n                        xw_j_122158;\n                    ((__local\n                      float *) red_arr_mem_133802)[sext_i32_i64(local_tid_133794)] =\n                        x2w_j_122159;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_133798)[sext_i32_i64(local_tid_133794)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_133800)[sext_i32_i64(local_tid_133794)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_133802)[sext_i32_i64(local_tid_133794)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, l_window_114538)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_122122;\n                float x_122123;\n                float x_122124;\n                float x_122125;\n                float x_122126;\n                float x_122127;\n                float x_133811;\n                float x_133812;\n                float x_133813;\n                float x_133814;\n                float x_133815;\n                float x_133816;\n                bool ltid_in_bounds_133820 =\n                     slt64(sext_i32_i64(local_tid_133794), l_window_114538 *\n                           squot64(segred_group_sizze_122116,\n                                   segment_sizze_nonzzero_133791));\n                int32_t skip_threads_133821;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_133820) {\n                        x_122125 = ((volatile __local\n                                     float *) red_arr_mem_133",
                   "798)[sext_i32_i64(local_tid_133794)];\n                        x_122126 = ((volatile __local\n                                     float *) red_arr_mem_133800)[sext_i32_i64(local_tid_133794)];\n                        x_122127 = ((volatile __local\n                                     float *) red_arr_mem_133802)[sext_i32_i64(local_tid_133794)];\n                        if ((local_tid_133794 - squot32(local_tid_133794, 32) *\n                             32) == 0) {\n                            x_122122 = x_122125;\n                            x_122123 = x_122126;\n                            x_122124 = x_122127;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_133821 = 1;\n                    while (slt32(skip_threads_133821, 32)) {\n                        if (sle32(skip_threads_133821, local_tid_133794 -\n                                  squot32(local_tid_133794, 32) * 32) &&\n                            ltid_in_bounds_133820) {\n                            // read operands\n                            {\n                                x_122122 = ((volatile __local\n                                             float *) red_arr_mem_133798)[sext_i32_i64(local_tid_133794) -\n                                                                          sext_i32_i64(skip_threads_133821)];\n                                x_122123 = ((volatile __local\n                                             float *) red_arr_mem_133800)[sext_i32_i64(local_tid_133794) -\n                                                                          sext_i32_i64(skip_threads_133821)];\n                                x_122124 = ((volatile __local\n                                             float *) red_arr_mem_133802)[sext_i32_i64(local_tid_133794) -\n                                                                          sext_i32_i64(skip_threads_133821)];\n                      ",
                   "      }\n                            // perform operation\n                            {\n                                bool inactive_133822 =\n                                     slt64(srem64(sext_i32_i64(local_tid_133794),\n                                                  l_window_114538),\n                                           sext_i32_i64(local_tid_133794) -\n                                           sext_i32_i64(local_tid_133794 -\n                                           skip_threads_133821));\n                                \n                                if (inactive_133822) {\n                                    x_122122 = x_122125;\n                                    x_122123 = x_122126;\n                                    x_122124 = x_122127;\n                                }\n                                if (!inactive_133822) {\n                                    float defunc_1_op_res_122128 = x_122122 +\n                                          x_122125;\n                                    float defunc_1_op_res_122129 = x_122123 +\n                                          x_122126;\n                                    float defunc_1_op_res_122130 = x_122124 +\n                                          x_122127;\n                                    \n                                    x_122122 = defunc_1_op_res_122128;\n                                    x_122123 = defunc_1_op_res_122129;\n                                    x_122124 = defunc_1_op_res_122130;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_133796, skip_threads_133821)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_133821, local_tid_133794 -\n                                  squot32(local_tid_133794, 32) * 32) &&\n                            ltid_in_bounds_133820) {\n                            // write result\n       ",
                   "                     {\n                                ((volatile __local\n                                  float *) red_arr_mem_133798)[sext_i32_i64(local_tid_133794)] =\n                                    x_122122;\n                                x_122125 = x_122122;\n                                ((volatile __local\n                                  float *) red_arr_mem_133800)[sext_i32_i64(local_tid_133794)] =\n                                    x_122123;\n                                x_122126 = x_122123;\n                                ((volatile __local\n                                  float *) red_arr_mem_133802)[sext_i32_i64(local_tid_133794)] =\n                                    x_122124;\n                                x_122127 = x_122124;\n                            }\n                        }\n                        if (sle32(wave_sizze_133796, skip_threads_133821)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_133821 *= 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_133794 - squot32(local_tid_133794, 32) *\n                         32) == 31 && ltid_in_bounds_133820) {\n                        ((volatile __local\n                          float *) red_arr_mem_133798)[sext_i32_i64(squot32(local_tid_133794,\n                                                                            32))] =\n                            x_122122;\n                        ((volatile __local\n                          float *) red_arr_mem_133800)[sext_i32_i64(squot32(local_tid_133794,\n                                                                            32))] =\n                            x_122123;\n                        ((volatile __local\n                          float *) red_arr_mem_133802)[sext_i32_i64(squot32(local_tid_133",
                   "794,\n                                                                            32))] =\n                            x_122124;\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_133823;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_133794, 32) == 0 &&\n                            ltid_in_bounds_133820) {\n                            x_133814 = ((volatile __local\n                                         float *) red_arr_mem_133798)[sext_i32_i64(local_tid_133794)];\n                            x_133815 = ((volatile __local\n                                         float *) red_arr_mem_133800)[sext_i32_i64(local_tid_133794)];\n                            x_133816 = ((volatile __local\n                                         float *) red_arr_mem_133802)[sext_i32_i64(local_tid_133794)];\n                            if ((local_tid_133794 - squot32(local_tid_133794,\n                                                            32) * 32) == 0) {\n                                x_133811 = x_133814;\n                                x_133812 = x_133815;\n                                x_133813 = x_133816;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_133823 = 1;\n                        while (slt32(skip_threads_133823, 32)) {\n                            if (sle32(skip_threads_133823, local_tid_133794 -\n                                      squot32(local_tid_133794, 32) * 32) &&\n                                (squot32(local_tid_133794, 32) == 0 &&\n                                 ltid_in_bounds_133820)) {\n                                // read ope",
                   "rands\n                                {\n                                    x_133811 = ((volatile __local\n                                                 float *) red_arr_mem_133798)[sext_i32_i64(local_tid_133794) -\n                                                                              sext_i32_i64(skip_threads_133823)];\n                                    x_133812 = ((volatile __local\n                                                 float *) red_arr_mem_133800)[sext_i32_i64(local_tid_133794) -\n                                                                              sext_i32_i64(skip_threads_133823)];\n                                    x_133813 = ((volatile __local\n                                                 float *) red_arr_mem_133802)[sext_i32_i64(local_tid_133794) -\n                                                                              sext_i32_i64(skip_threads_133823)];\n                                }\n                                // perform operation\n                                {\n                                    bool inactive_133824 =\n                                         slt64(srem64(sext_i32_i64(local_tid_133794 *\n                                                      32 + 32 - 1),\n                                                      l_window_114538),\n                                               sext_i32_i64(local_tid_133794 *\n                                               32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_133794 -\n                                                             skip_threads_133823) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_133824) {\n                                        x_133811 = x_133814;\n                                        x_133812 = x_133815;\n                                        x_133813 = x_133816;\n                                   ",
                   " }\n                                    if (!inactive_133824) {\n                                        float defunc_1_op_res_133817 =\n                                              x_133811 + x_133814;\n                                        float defunc_1_op_res_133818 =\n                                              x_133812 + x_133815;\n                                        float defunc_1_op_res_133819 =\n                                              x_133813 + x_133816;\n                                        \n                                        x_133811 = defunc_1_op_res_133817;\n                                        x_133812 = defunc_1_op_res_133818;\n                                        x_133813 = defunc_1_op_res_133819;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_133796, skip_threads_133823)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_133823, local_tid_133794 -\n                                      squot32(local_tid_133794, 32) * 32) &&\n                                (squot32(local_tid_133794, 32) == 0 &&\n                                 ltid_in_bounds_133820)) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_133798)[sext_i32_i64(local_tid_133794)] =\n                                        x_133811;\n                                    x_133814 = x_133811;\n                                    ((volatile __local\n                                      float *) red_arr_mem_133800)[sext_i32_i64(local_tid_133794)] =\n                                        x_133812;\n                                    x_133815 = x_133812;\n                                    ((volatile __local\n                                  ",
                   "    float *) red_arr_mem_133802)[sext_i32_i64(local_tid_133794)] =\n                                        x_133813;\n                                    x_133816 = x_133813;\n                                }\n                            }\n                            if (sle32(wave_sizze_133796, skip_threads_133823)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_133823 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n                    if (!(squot32(local_tid_133794, 32) == 0 ||\n                          !ltid_in_bounds_133820)) {\n                        // read operands\n                        {\n                            x_122125 = x_122122;\n                            x_122126 = x_122123;\n                            x_122127 = x_122124;\n                            x_122122 = ((__local\n                                         float *) red_arr_mem_133798)[sext_i32_i64(squot32(local_tid_133794,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                            x_122123 = ((__local\n                                         float *) red_arr_mem_133800)[sext_i32_i64(squot32(local_tid_133794,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                            x_122124 = ((__local\n                                         float *) red_arr_mem_133802)[sext_i32_i64(squot32(local_tid_133794,\n                                                                                           32)) -\n                                                                      (int64_",
                   "t) 1];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_133825 =\n                                 slt64(srem64(sext_i32_i64(local_tid_133794),\n                                              l_window_114538),\n                                       sext_i32_i64(local_tid_133794) -\n                                       sext_i32_i64(squot32(local_tid_133794,\n                                                            32) * 32 - 1));\n                            \n                            if (inactive_133825) {\n                                x_122122 = x_122125;\n                                x_122123 = x_122126;\n                                x_122124 = x_122127;\n                            }\n                            if (!inactive_133825) {\n                                float defunc_1_op_res_122128 = x_122122 +\n                                      x_122125;\n                                float defunc_1_op_res_122129 = x_122123 +\n                                      x_122126;\n                                float defunc_1_op_res_122130 = x_122124 +\n                                      x_122127;\n                                \n                                x_122122 = defunc_1_op_res_122128;\n                                x_122123 = defunc_1_op_res_122129;\n                                x_122124 = defunc_1_op_res_122130;\n                            }\n                        }\n                        // write final result\n                        {\n                            ((__local\n                              float *) red_arr_mem_133798)[sext_i32_i64(local_tid_133794)] =\n                                x_122122;\n                            ((__local\n                              float *) red_arr_mem_133800)[sext_i32_i64(local_tid_133794)] =\n                                x_122123;\n                            ((__local\n                              float *) red_a",
                   "rr_mem_133802)[sext_i32_i64(local_tid_133794)] =\n                                x_122124;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_133794, 32) == 0) {\n                        ((__local\n                          float *) red_arr_mem_133798)[sext_i32_i64(local_tid_133794)] =\n                            x_122125;\n                        ((__local\n                          float *) red_arr_mem_133800)[sext_i32_i64(local_tid_133794)] =\n                            x_122126;\n                        ((__local\n                          float *) red_arr_mem_133802)[sext_i32_i64(local_tid_133794)] =\n                            x_122127;\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_133806) *\n                      squot64(segred_group_sizze_122116,\n                              segment_sizze_nonzzero_133791) +\n                      sext_i32_i64(local_tid_133794), m_114533 *\n                      l_n_m_114584) && slt64(sext_i32_i64(local_tid_133794),\n                                             squot64(segred_group_sizze_122116,\n                                                     segment_sizze_nonzzero_133791))) {\n                ((__global\n                  float *) mem_130996)[squot64(sext_i32_i64(virt_group_id_133806) *\n                                               squot64(segred_group_sizze_122116,\n                                                       segment_sizze_nonzzero_133791) +\n                                               sext_i32_i64(local_tid_133794),\n                                               l_n_m_114584) * l_n_m_114584 +\n                                       (sext_i32_i",
                   "64(virt_group_id_133806) *\n                                        squot64(segred_group_sizze_122116,\n                                                segment_sizze_nonzzero_133791) +\n                                        sext_i32_i64(local_tid_133794) -\n                                        squot64(sext_i32_i64(virt_group_id_133806) *\n                                                squot64(segred_group_sizze_122116,\n                                                        segment_sizze_nonzzero_133791) +\n                                                sext_i32_i64(local_tid_133794),\n                                                l_n_m_114584) * l_n_m_114584)] =\n                    ((__local\n                      float *) red_arr_mem_133798)[(sext_i32_i64(local_tid_133794) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_133791 -\n                                                   (int64_t) 1];\n                ((__global\n                  float *) mem_131000)[squot64(sext_i32_i64(virt_group_id_133806) *\n                                               squot64(segred_group_sizze_122116,\n                                                       segment_sizze_nonzzero_133791) +\n                                               sext_i32_i64(local_tid_133794),\n                                               l_n_m_114584) * l_n_m_114584 +\n                                       (sext_i32_i64(virt_group_id_133806) *\n                                        squot64(segred_group_sizze_122116,\n                                                segment_sizze_nonzzero_133791) +\n                                        sext_i32_i64(local_tid_133794) -\n                                        squot64(sext_i32_i64(virt_group_id_133806) *\n                                                squot64(segred_group_sizze_122116,\n                                                        segment_sizze_nonzzero_13379",
                   "1) +\n                                                sext_i32_i64(local_tid_133794),\n                                                l_n_m_114584) * l_n_m_114584)] =\n                    ((__local\n                      float *) red_arr_mem_133800)[(sext_i32_i64(local_tid_133794) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_133791 -\n                                                   (int64_t) 1];\n                ((__global\n                  float *) mem_131004)[squot64(sext_i32_i64(virt_group_id_133806) *\n                                               squot64(segred_group_sizze_122116,\n                                                       segment_sizze_nonzzero_133791) +\n                                               sext_i32_i64(local_tid_133794),\n                                               l_n_m_114584) * l_n_m_114584 +\n                                       (sext_i32_i64(virt_group_id_133806) *\n                                        squot64(segred_group_sizze_122116,\n                                                segment_sizze_nonzzero_133791) +\n                                        sext_i32_i64(local_tid_133794) -\n                                        squot64(sext_i32_i64(virt_group_id_133806) *\n                                                squot64(segred_group_sizze_122116,\n                                                        segment_sizze_nonzzero_133791) +\n                                                sext_i32_i64(local_tid_133794),\n                                                l_n_m_114584) * l_n_m_114584)] =\n                    ((__local\n                      float *) red_arr_mem_133802)[(sext_i32_i64(local_tid_133794) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_133791 -\n                                                   (int64_t) 1];\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_122116\n}\n__kernel void mainzisegred_small_122662(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134159_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134157_backing_aligned_1,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t l_window_114538,\n                                        int64_t t_jump_114541,\n                                        int64_t l_n_m_114584, int64_t i_114610,\n                                        int64_t num_groups_123258,\n                                        int64_t segment_sizze_nonzzero_134150,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130404,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130405,\n                                        __global unsigned char *mem_130861,\n                                        __global unsigned char *mem_130865,\n                                        __global unsigned char *mem_131127,\n                                        __global unsigned char *mem_131131,\n                                        __global unsigned char *mem_131135,\n                                        __global unsigned char *mem_131139,\n                                        __global unsigned char *mem_131143,\n                     ",
                   "                   __global unsigned char *mem_131148,\n                                        __global unsigned char *mem_131152)\n{\n    #define segred_group_sizze_123257 (mainzisegred_group_sizze_122656)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_134159_backing_1 =\n                          (__local volatile\n                           char *) red_arr_mem_134159_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_134157_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_134157_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_134152;\n    int32_t local_tid_134153;\n    int64_t group_sizze_134156;\n    int32_t wave_sizze_134155;\n    int32_t group_tid_134154;\n    \n    global_tid_134152 = get_global_id(0);\n    local_tid_134153 = get_local_id(0);\n    group_sizze_134156 = get_local_size(0);\n    wave_sizze_134155 = LOCKSTEP_WIDTH;\n    group_tid_134154 = get_group_id(0);\n    \n    int32_t phys_tid_122662 = global_tid_134152;\n    __local char *red_arr_mem_134157;\n    \n    red_arr_mem_134157 = (__local char *) red_arr_mem_134157_backing_0;\n    \n    __local char *red_arr_mem_134159;\n    \n    red_arr_mem_134159 = (__local char *) red_arr_mem_134159_backing_1;\n    \n    int32_t phys_group_id_134161;\n    \n    phys_group_id_134161 = get_group_id(0);\n    for (int32_t i_134162 = 0; i_134162 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533 * l_n_m_114584,\n                                          squot64(segred_group_sizze_123257,\n                                                  segment_sizze_nonzzero_134150))) -\n                   phys_group_id_134161, sext_i64_i32(num_groups_123258));\n         i_134162++) {\n        int32_t virt_group_id_134163 = phys_group_id_134161 + i_134162 *\n                sext_i64_i32(num_groups_123258);\n        int64_t slice_134164 = l_n_m_114584",
                   ";\n        int64_t slice_134165 = m_114533 * slice_134164;\n        int64_t gtid_122651 = squot64(squot64(sext_i32_i64(local_tid_134153),\n                                              segment_sizze_nonzzero_134150) +\n                                      sext_i32_i64(virt_group_id_134163) *\n                                      squot64(segred_group_sizze_123257,\n                                              segment_sizze_nonzzero_134150),\n                                      slice_134164);\n        int64_t remnant_134166 = squot64(sext_i32_i64(local_tid_134153),\n                                         segment_sizze_nonzzero_134150) +\n                sext_i32_i64(virt_group_id_134163) *\n                squot64(segred_group_sizze_123257,\n                        segment_sizze_nonzzero_134150) - gtid_122651 *\n                slice_134164;\n        int64_t gtid_122652 = remnant_134166;\n        int64_t remnant_134167 = remnant_134166 - gtid_122652;\n        int64_t gtid_122661 = srem64(sext_i32_i64(local_tid_134153),\n                                     l_window_114538);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, l_window_114538) && ((slt64(gtid_122651,\n                                                               m_114533) &&\n                                                         slt64(gtid_122652,\n                                                               l_n_m_114584)) &&\n                                                        slt64(sext_i32_i64(local_tid_134153),\n                                                              l_window_114538 *\n                                                              squot64(segred_group_sizze_123257,\n                                                                      segment_sizze_nonzzero_134150)))) {\n                int64_t x_123273 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_122651];\n                int64_t x_123280 = (",
                   "(__global\n                                     int64_t *) defunc_3_map_res_mem_130404)[gtid_122651 *\n                                                                             l_n_m_114584 +\n                                                                             gtid_122652];\n                float x_123281 = ((__global\n                                   float *) defunc_3_map_res_mem_130405)[gtid_122651 *\n                                                                         l_n_m_114584 +\n                                                                         gtid_122652];\n                int64_t binop_y_128888 = mul64(t_jump_114541, gtid_122652);\n                int64_t convop_x_128889 = smin64(i_114610, binop_y_128888);\n                float index_primexp_128890 = sitofp_i64_f32(convop_x_128889);\n                float a12_123283 = ((__global float *) mem_131127)[gtid_122651 *\n                                                                   l_n_m_114584 +\n                                                                   gtid_122652];\n                float b12_123284 = ((__global float *) mem_131131)[gtid_122651 *\n                                                                   l_n_m_114584 +\n                                                                   gtid_122652];\n                float c12_123285 = ((__global float *) mem_131135)[gtid_122651 *\n                                                                   l_n_m_114584 +\n                                                                   gtid_122652];\n                float b2_123286 = ((__global float *) mem_131139)[gtid_122651 *\n                                                                  l_n_m_114584 +\n                                                                  gtid_122652];\n                float c2_123287 = ((__global float *) mem_131143)[gtid_122651 *\n                                                                  l_n_m_114584 +\n                                              ",
                   "                    gtid_122652];\n                bool cond_123289 = sle64(x_123273, gtid_122661);\n                float defunc_0_f_res_123290;\n                \n                if (cond_123289) {\n                    defunc_0_f_res_123290 = 0.0F;\n                } else {\n                    int64_t i_123291 = add64(gtid_122661, x_123280);\n                    float x_123292 = ((__global\n                                       float *) mem_130122)[gtid_122651 *\n                                                            n_114534 +\n                                                            i_123291];\n                    float defunc_0_f_res_f_res_123293 = 1.0F + x_123292;\n                    \n                    defunc_0_f_res_123290 = defunc_0_f_res_f_res_123293;\n                }\n                \n                float defunc_0_f_res_123294;\n                \n                if (cond_123289) {\n                    defunc_0_f_res_123294 = 0.0F;\n                } else {\n                    int64_t i_123295 = add64(gtid_122661, x_123280);\n                    float x_123296 = ((__global\n                                       float *) mem_130861)[gtid_122651 *\n                                                            n_114534 +\n                                                            i_123295];\n                    \n                    defunc_0_f_res_123294 = x_123296;\n                }\n                \n                float x_j_123297 = defunc_0_f_res_123290 - index_primexp_128890;\n                float abs_res_123298 = (float) fabs(x_j_123297);\n                float tmp1_123299 = abs_res_123298 / x_123281;\n                float x_123300 = tmp1_123299 * tmp1_123299;\n                float y_123301 = tmp1_123299 * x_123300;\n                float tmp2_123302 = 1.0F - y_123301;\n                float x_123303 = tmp2_123302 * tmp2_123302;\n                float tmp3_123304 = tmp2_123302 * x_123303;\n                float tmp4_123305 = defunc_0_f_res_123294 * tmp3_123304;\n       ",
                   "         float defunc_1_f_res_123306 = x_j_123297 * tmp4_123305;\n                float defunc_1_f_res_123307 = x_j_123297 *\n                      defunc_1_f_res_123306;\n                float defunc_0_f_res_123308;\n                \n                if (cond_123289) {\n                    defunc_0_f_res_123308 = 0.0F;\n                } else {\n                    int64_t i_123309 = add64(gtid_122661, x_123280);\n                    float x_123310 = ((__global\n                                       float *) mem_130865)[gtid_122651 *\n                                                            n_114534 +\n                                                            i_123309];\n                    \n                    defunc_0_f_res_123308 = x_123310;\n                }\n                \n                float x_123311 = a12_123283 * tmp4_123305;\n                float y_123312 = b12_123284 * defunc_1_f_res_123306;\n                float x_123313 = x_123311 + y_123312;\n                float y_123314 = c12_123285 * defunc_1_f_res_123307;\n                float x_123315 = x_123313 + y_123314;\n                float defunc_9_fit_fun_res_123316 = defunc_0_f_res_123308 *\n                      x_123315;\n                float x_123317 = b12_123284 * tmp4_123305;\n                float y_123318 = b2_123286 * defunc_1_f_res_123306;\n                float x_123319 = x_123317 + y_123318;\n                float y_123320 = c2_123287 * defunc_1_f_res_123307;\n                float x_123321 = x_123319 + y_123320;\n                float defunc_9_slope_fun_res_123322 = defunc_0_f_res_123308 *\n                      x_123321;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_134157)[sext_i32_i64(local_tid_134153)] =\n                        defunc_9_fit_fun_res_123316;\n                    ((__local\n                      float *) red_arr_mem_134159)[",
                   "sext_i32_i64(local_tid_134153)] =\n                        defunc_9_slope_fun_res_123322;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_134157)[sext_i32_i64(local_tid_134153)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_134159)[sext_i32_i64(local_tid_134153)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, l_window_114538)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_123262;\n                float x_123263;\n                float x_123264;\n                float x_123265;\n                float x_134168;\n                float x_134169;\n                float x_134170;\n                float x_134171;\n                bool ltid_in_bounds_134174 =\n                     slt64(sext_i32_i64(local_tid_134153), l_window_114538 *\n                           squot64(segred_group_sizze_123257,\n                                   segment_sizze_nonzzero_134150));\n                int32_t skip_threads_134175;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_134174) {\n                        x_123264 = ((volatile __local\n                                     float *) red_arr_mem_134157)[sext_i32_i64(local_tid_134153)];\n                        x_123265 = ((volatile __local\n                                     float *) red_arr_mem_134159)[sext_i32_i64(local_tid_134153)];\n                        if ((local_tid_134153 - squot32(local_tid_134153, 32) *\n                             32) == 0) {\n                            x_123262 = x_123264;\n                            x_123263 = x_123265;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_134175 = 1;\n                 ",
                   "   while (slt32(skip_threads_134175, 32)) {\n                        if (sle32(skip_threads_134175, local_tid_134153 -\n                                  squot32(local_tid_134153, 32) * 32) &&\n                            ltid_in_bounds_134174) {\n                            // read operands\n                            {\n                                x_123262 = ((volatile __local\n                                             float *) red_arr_mem_134157)[sext_i32_i64(local_tid_134153) -\n                                                                          sext_i32_i64(skip_threads_134175)];\n                                x_123263 = ((volatile __local\n                                             float *) red_arr_mem_134159)[sext_i32_i64(local_tid_134153) -\n                                                                          sext_i32_i64(skip_threads_134175)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_134176 =\n                                     slt64(srem64(sext_i32_i64(local_tid_134153),\n                                                  l_window_114538),\n                                           sext_i32_i64(local_tid_134153) -\n                                           sext_i32_i64(local_tid_134153 -\n                                           skip_threads_134175));\n                                \n                                if (inactive_134176) {\n                                    x_123262 = x_123264;\n                                    x_123263 = x_123265;\n                                }\n                                if (!inactive_134176) {\n                                    float defunc_1_op_res_123266 = x_123262 +\n                                          x_123264;\n                                    float defunc_1_op_res_123267 = x_123263 +\n                                          x_123265;\n                                    \n   ",
                   "                                 x_123262 = defunc_1_op_res_123266;\n                                    x_123263 = defunc_1_op_res_123267;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_134155, skip_threads_134175)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_134175, local_tid_134153 -\n                                  squot32(local_tid_134153, 32) * 32) &&\n                            ltid_in_bounds_134174) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_134157)[sext_i32_i64(local_tid_134153)] =\n                                    x_123262;\n                                x_123264 = x_123262;\n                                ((volatile __local\n                                  float *) red_arr_mem_134159)[sext_i32_i64(local_tid_134153)] =\n                                    x_123263;\n                                x_123265 = x_123263;\n                            }\n                        }\n                        if (sle32(wave_sizze_134155, skip_threads_134175)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_134175 *= 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_134153 - squot32(local_tid_134153, 32) *\n                         32) == 31 && ltid_in_bounds_134174) {\n                        ((volatile __local\n                          float *) red_arr_mem_134157)[sext_i32_i64(squot32(local_tid_134153,\n                                                                            32))] =\n                            x_12326",
                   "2;\n                        ((volatile __local\n                          float *) red_arr_mem_134159)[sext_i32_i64(squot32(local_tid_134153,\n                                                                            32))] =\n                            x_123263;\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_134177;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_134153, 32) == 0 &&\n                            ltid_in_bounds_134174) {\n                            x_134170 = ((volatile __local\n                                         float *) red_arr_mem_134157)[sext_i32_i64(local_tid_134153)];\n                            x_134171 = ((volatile __local\n                                         float *) red_arr_mem_134159)[sext_i32_i64(local_tid_134153)];\n                            if ((local_tid_134153 - squot32(local_tid_134153,\n                                                            32) * 32) == 0) {\n                                x_134168 = x_134170;\n                                x_134169 = x_134171;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_134177 = 1;\n                        while (slt32(skip_threads_134177, 32)) {\n                            if (sle32(skip_threads_134177, local_tid_134153 -\n                                      squot32(local_tid_134153, 32) * 32) &&\n                                (squot32(local_tid_134153, 32) == 0 &&\n                                 ltid_in_bounds_134174)) {\n                                // read operands\n                                {\n                                    x_1",
                   "34168 = ((volatile __local\n                                                 float *) red_arr_mem_134157)[sext_i32_i64(local_tid_134153) -\n                                                                              sext_i32_i64(skip_threads_134177)];\n                                    x_134169 = ((volatile __local\n                                                 float *) red_arr_mem_134159)[sext_i32_i64(local_tid_134153) -\n                                                                              sext_i32_i64(skip_threads_134177)];\n                                }\n                                // perform operation\n                                {\n                                    bool inactive_134178 =\n                                         slt64(srem64(sext_i32_i64(local_tid_134153 *\n                                                      32 + 32 - 1),\n                                                      l_window_114538),\n                                               sext_i32_i64(local_tid_134153 *\n                                               32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_134153 -\n                                                             skip_threads_134177) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_134178) {\n                                        x_134168 = x_134170;\n                                        x_134169 = x_134171;\n                                    }\n                                    if (!inactive_134178) {\n                                        float defunc_1_op_res_134172 =\n                                              x_134168 + x_134170;\n                                        float defunc_1_op_res_134173 =\n                                              x_134169 + x_134171;\n                                        \n                                        x_134168 = ",
                   "defunc_1_op_res_134172;\n                                        x_134169 = defunc_1_op_res_134173;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_134155, skip_threads_134177)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_134177, local_tid_134153 -\n                                      squot32(local_tid_134153, 32) * 32) &&\n                                (squot32(local_tid_134153, 32) == 0 &&\n                                 ltid_in_bounds_134174)) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_134157)[sext_i32_i64(local_tid_134153)] =\n                                        x_134168;\n                                    x_134170 = x_134168;\n                                    ((volatile __local\n                                      float *) red_arr_mem_134159)[sext_i32_i64(local_tid_134153)] =\n                                        x_134169;\n                                    x_134171 = x_134169;\n                                }\n                            }\n                            if (sle32(wave_sizze_134155, skip_threads_134177)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_134177 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n                    if (!(squot32(local_tid_134153, 32) == 0 ||\n                          !ltid_in_bounds_134174)) {\n                        // read operands\n                        {\n                            x_123264 = x_123262;\n                  ",
                   "          x_123265 = x_123263;\n                            x_123262 = ((__local\n                                         float *) red_arr_mem_134157)[sext_i32_i64(squot32(local_tid_134153,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                            x_123263 = ((__local\n                                         float *) red_arr_mem_134159)[sext_i32_i64(squot32(local_tid_134153,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_134179 =\n                                 slt64(srem64(sext_i32_i64(local_tid_134153),\n                                              l_window_114538),\n                                       sext_i32_i64(local_tid_134153) -\n                                       sext_i32_i64(squot32(local_tid_134153,\n                                                            32) * 32 - 1));\n                            \n                            if (inactive_134179) {\n                                x_123262 = x_123264;\n                                x_123263 = x_123265;\n                            }\n                            if (!inactive_134179) {\n                                float defunc_1_op_res_123266 = x_123262 +\n                                      x_123264;\n                                float defunc_1_op_res_123267 = x_123263 +\n                                      x_123265;\n                                \n                                x_123262 = defunc_1_op_res_123266;\n                                x_123263 = defunc_1_op_res_123267;\n                            }\n                        }\n                        // write final",
                   " result\n                        {\n                            ((__local\n                              float *) red_arr_mem_134157)[sext_i32_i64(local_tid_134153)] =\n                                x_123262;\n                            ((__local\n                              float *) red_arr_mem_134159)[sext_i32_i64(local_tid_134153)] =\n                                x_123263;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_134153, 32) == 0) {\n                        ((__local\n                          float *) red_arr_mem_134157)[sext_i32_i64(local_tid_134153)] =\n                            x_123264;\n                        ((__local\n                          float *) red_arr_mem_134159)[sext_i32_i64(local_tid_134153)] =\n                            x_123265;\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_134163) *\n                      squot64(segred_group_sizze_123257,\n                              segment_sizze_nonzzero_134150) +\n                      sext_i32_i64(local_tid_134153), m_114533 *\n                      l_n_m_114584) && slt64(sext_i32_i64(local_tid_134153),\n                                             squot64(segred_group_sizze_123257,\n                                                     segment_sizze_nonzzero_134150))) {\n                ((__global\n                  float *) mem_131148)[squot64(sext_i32_i64(virt_group_id_134163) *\n                                               squot64(segred_group_sizze_123257,\n                                                       segment_sizze_nonzzero_134150) +\n                                               sext_i32_i64(local_tid_134153),\n",
                   "                                               l_n_m_114584) * l_n_m_114584 +\n                                       (sext_i32_i64(virt_group_id_134163) *\n                                        squot64(segred_group_sizze_123257,\n                                                segment_sizze_nonzzero_134150) +\n                                        sext_i32_i64(local_tid_134153) -\n                                        squot64(sext_i32_i64(virt_group_id_134163) *\n                                                squot64(segred_group_sizze_123257,\n                                                        segment_sizze_nonzzero_134150) +\n                                                sext_i32_i64(local_tid_134153),\n                                                l_n_m_114584) * l_n_m_114584)] =\n                    ((__local\n                      float *) red_arr_mem_134157)[(sext_i32_i64(local_tid_134153) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134150 -\n                                                   (int64_t) 1];\n                ((__global\n                  float *) mem_131152)[squot64(sext_i32_i64(virt_group_id_134163) *\n                                               squot64(segred_group_sizze_123257,\n                                                       segment_sizze_nonzzero_134150) +\n                                               sext_i32_i64(local_tid_134153),\n                                               l_n_m_114584) * l_n_m_114584 +\n                                       (sext_i32_i64(virt_group_id_134163) *\n                                        squot64(segred_group_sizze_123257,\n                                                segment_sizze_nonzzero_134150) +\n                                        sext_i32_i64(local_tid_134153) -\n                                        squot64(sext_i32_i64(virt_group_id_134163) *\n                                       ",
                   "         squot64(segred_group_sizze_123257,\n                                                        segment_sizze_nonzzero_134150) +\n                                                sext_i32_i64(local_tid_134153),\n                                                l_n_m_114584) * l_n_m_114584)] =\n                    ((__local\n                      float *) red_arr_mem_134159)[(sext_i32_i64(local_tid_134153) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134150 -\n                                                   (int64_t) 1];\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_123257\n}\n__kernel void mainzisegred_small_122783(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134035_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134033_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134031_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134029_backing_aligned_3,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134027_backing_aligned_4,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t l_window_114538,\n                                        int64_t t_jump_114541,\n                                        int64_t l_n_m_114584, int64_t i_114610,\n                                        int64_t num_groups_123162,\n                                       ",
                   " int64_t segment_sizze_nonzzero_134020,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130404,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130405,\n                                        __global unsigned char *mem_130861,\n                                        __global unsigned char *mem_131106,\n                                        __global unsigned char *mem_131110,\n                                        __global unsigned char *mem_131114,\n                                        __global unsigned char *mem_131118,\n                                        __global unsigned char *mem_131122)\n{\n    #define segred_group_sizze_123161 (mainzisegred_group_sizze_122777)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_134035_backing_4 =\n                          (__local volatile\n                           char *) red_arr_mem_134035_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_134033_backing_3 =\n                          (__local volatile\n                           char *) red_arr_mem_134033_backing_aligned_1;\n    __local volatile char *restrict red_arr_mem_134031_backing_2 =\n                          (__local volatile\n                           char *) red_arr_mem_134031_backing_aligned_2;\n    __local volatile char *restrict red_arr_mem_134029_backing_1 =\n                          (__local volatile\n                           char *) red_arr_mem_134029_backing_aligned_3;\n    __local volatile char *restrict red_arr_mem_134027_backing_0 =\n                          (__local volatile\n             ",
                   "              char *) red_arr_mem_134027_backing_aligned_4;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_134022;\n    int32_t local_tid_134023;\n    int64_t group_sizze_134026;\n    int32_t wave_sizze_134025;\n    int32_t group_tid_134024;\n    \n    global_tid_134022 = get_global_id(0);\n    local_tid_134023 = get_local_id(0);\n    group_sizze_134026 = get_local_size(0);\n    wave_sizze_134025 = LOCKSTEP_WIDTH;\n    group_tid_134024 = get_group_id(0);\n    \n    int32_t phys_tid_122783 = global_tid_134022;\n    __local char *red_arr_mem_134027;\n    \n    red_arr_mem_134027 = (__local char *) red_arr_mem_134027_backing_0;\n    \n    __local char *red_arr_mem_134029;\n    \n    red_arr_mem_134029 = (__local char *) red_arr_mem_134029_backing_1;\n    \n    __local char *red_arr_mem_134031;\n    \n    red_arr_mem_134031 = (__local char *) red_arr_mem_134031_backing_2;\n    \n    __local char *red_arr_mem_134033;\n    \n    red_arr_mem_134033 = (__local char *) red_arr_mem_134033_backing_3;\n    \n    __local char *red_arr_mem_134035;\n    \n    red_arr_mem_134035 = (__local char *) red_arr_mem_134035_backing_4;\n    \n    int32_t phys_group_id_134037;\n    \n    phys_group_id_134037 = get_group_id(0);\n    for (int32_t i_134038 = 0; i_134038 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533 * l_n_m_114584,\n                                          squot64(segred_group_sizze_123161,\n                                                  segment_sizze_nonzzero_134020))) -\n                   phys_group_id_134037, sext_i64_i32(num_groups_123162));\n         i_134038++) {\n        int32_t virt_group_id_134039 = phys_group_id_134037 + i_134038 *\n                sext_i64_i32(num_groups_123162);\n        int64_t slice_134040 = l_n_m_114584;\n        int64_t slice_134041 = m_114533 * slice_134040;\n        int64_t gtid_122772 = squot64(squot64(sext_i32_i64(local_tid_134023),\n                                              segment_sizze_nonzzero_134020) +\n                                 ",
                   "     sext_i32_i64(virt_group_id_134039) *\n                                      squot64(segred_group_sizze_123161,\n                                              segment_sizze_nonzzero_134020),\n                                      slice_134040);\n        int64_t remnant_134042 = squot64(sext_i32_i64(local_tid_134023),\n                                         segment_sizze_nonzzero_134020) +\n                sext_i32_i64(virt_group_id_134039) *\n                squot64(segred_group_sizze_123161,\n                        segment_sizze_nonzzero_134020) - gtid_122772 *\n                slice_134040;\n        int64_t gtid_122773 = remnant_134042;\n        int64_t remnant_134043 = remnant_134042 - gtid_122773;\n        int64_t gtid_122782 = srem64(sext_i32_i64(local_tid_134023),\n                                     l_window_114538);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, l_window_114538) && ((slt64(gtid_122772,\n                                                               m_114533) &&\n                                                         slt64(gtid_122773,\n                                                               l_n_m_114584)) &&\n                                                        slt64(sext_i32_i64(local_tid_134023),\n                                                              l_window_114538 *\n                                                              squot64(segred_group_sizze_123161,\n                                                                      segment_sizze_nonzzero_134020)))) {\n                int64_t x_123188 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_122772];\n                int64_t x_123190 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130404)[gtid_122772 *\n                                                                             l_n_m_114584 +\n                                                       ",
                   "                      gtid_122773];\n                float x_123191 = ((__global\n                                   float *) defunc_3_map_res_mem_130405)[gtid_122772 *\n                                                                         l_n_m_114584 +\n                                                                         gtid_122773];\n                int64_t binop_y_128881 = mul64(t_jump_114541, gtid_122773);\n                int64_t convop_x_128882 = smin64(i_114610, binop_y_128881);\n                float index_primexp_128883 = sitofp_i64_f32(convop_x_128882);\n                bool cond_123194 = sle64(x_123188, gtid_122782);\n                float defunc_0_f_res_123195;\n                \n                if (cond_123194) {\n                    defunc_0_f_res_123195 = 0.0F;\n                } else {\n                    int64_t i_123196 = add64(gtid_122782, x_123190);\n                    float x_123197 = ((__global\n                                       float *) mem_130122)[gtid_122772 *\n                                                            n_114534 +\n                                                            i_123196];\n                    float defunc_0_f_res_f_res_123198 = 1.0F + x_123197;\n                    \n                    defunc_0_f_res_123195 = defunc_0_f_res_f_res_123198;\n                }\n                \n                float defunc_0_f_res_123199;\n                \n                if (cond_123194) {\n                    defunc_0_f_res_123199 = 0.0F;\n                } else {\n                    int64_t i_123200 = add64(gtid_122782, x_123190);\n                    float x_123201 = ((__global\n                                       float *) mem_130861)[gtid_122772 *\n                                                            n_114534 +\n                                                            i_123200];\n                    \n                    defunc_0_f_res_123199 = x_123201;\n                }\n                \n                float x_j_123202 = defunc",
                   "_0_f_res_123195 - index_primexp_128883;\n                float abs_res_123203 = (float) fabs(x_j_123202);\n                float tmp1_123204 = abs_res_123203 / x_123191;\n                float x_123205 = tmp1_123204 * tmp1_123204;\n                float y_123206 = tmp1_123204 * x_123205;\n                float tmp2_123207 = 1.0F - y_123206;\n                float x_123208 = tmp2_123207 * tmp2_123207;\n                float tmp3_123209 = tmp2_123207 * x_123208;\n                float w_j_123210 = defunc_0_f_res_123199 * tmp3_123209;\n                float xw_j_123211 = x_j_123202 * w_j_123210;\n                float x2w_j_123212 = x_j_123202 * xw_j_123211;\n                float x3w_j_123213 = x_j_123202 * x2w_j_123212;\n                float x4w_j_123214 = x_j_123202 * x3w_j_123213;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_134027)[sext_i32_i64(local_tid_134023)] =\n                        w_j_123210;\n                    ((__local\n                      float *) red_arr_mem_134029)[sext_i32_i64(local_tid_134023)] =\n                        xw_j_123211;\n                    ((__local\n                      float *) red_arr_mem_134031)[sext_i32_i64(local_tid_134023)] =\n                        x2w_j_123212;\n                    ((__local\n                      float *) red_arr_mem_134033)[sext_i32_i64(local_tid_134023)] =\n                        x3w_j_123213;\n                    ((__local\n                      float *) red_arr_mem_134035)[sext_i32_i64(local_tid_134023)] =\n                        x4w_j_123214;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_134027)[sext_i32_i64(local_tid_134023)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_134029)[sext_i32_i64(local_tid_134023)] =\n                    0.0F;\n          ",
                   "      ((__local\n                  float *) red_arr_mem_134031)[sext_i32_i64(local_tid_134023)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_134033)[sext_i32_i64(local_tid_134023)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_134035)[sext_i32_i64(local_tid_134023)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, l_window_114538)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_123169;\n                float x_123170;\n                float x_123171;\n                float x_123172;\n                float x_123173;\n                float x_123174;\n                float x_123175;\n                float x_123176;\n                float x_123177;\n                float x_123178;\n                float x_134044;\n                float x_134045;\n                float x_134046;\n                float x_134047;\n                float x_134048;\n                float x_134049;\n                float x_134050;\n                float x_134051;\n                float x_134052;\n                float x_134053;\n                bool ltid_in_bounds_134059 =\n                     slt64(sext_i32_i64(local_tid_134023), l_window_114538 *\n                           squot64(segred_group_sizze_123161,\n                                   segment_sizze_nonzzero_134020));\n                int32_t skip_threads_134060;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_134059) {\n                        x_123174 = ((volatile __local\n                                     float *) red_arr_mem_134027)[sext_i32_i64(local_tid_134023)];\n                        x_123175 = ((volatile __local\n                                     float *) red_arr_mem_134029)[sext_i32_i64(local_tid_134023)];\n                        x_123176 = ((volatile __lo",
                   "cal\n                                     float *) red_arr_mem_134031)[sext_i32_i64(local_tid_134023)];\n                        x_123177 = ((volatile __local\n                                     float *) red_arr_mem_134033)[sext_i32_i64(local_tid_134023)];\n                        x_123178 = ((volatile __local\n                                     float *) red_arr_mem_134035)[sext_i32_i64(local_tid_134023)];\n                        if ((local_tid_134023 - squot32(local_tid_134023, 32) *\n                             32) == 0) {\n                            x_123169 = x_123174;\n                            x_123170 = x_123175;\n                            x_123171 = x_123176;\n                            x_123172 = x_123177;\n                            x_123173 = x_123178;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_134060 = 1;\n                    while (slt32(skip_threads_134060, 32)) {\n                        if (sle32(skip_threads_134060, local_tid_134023 -\n                                  squot32(local_tid_134023, 32) * 32) &&\n                            ltid_in_bounds_134059) {\n                            // read operands\n                            {\n                                x_123169 = ((volatile __local\n                                             float *) red_arr_mem_134027)[sext_i32_i64(local_tid_134023) -\n                                                                          sext_i32_i64(skip_threads_134060)];\n                                x_123170 = ((volatile __local\n                                             float *) red_arr_mem_134029)[sext_i32_i64(local_tid_134023) -\n                                                                          sext_i32_i64(skip_threads_134060)];\n                                x_123171 = ((volatile __local\n                                             float *) red_arr_mem_134031)[se",
                   "xt_i32_i64(local_tid_134023) -\n                                                                          sext_i32_i64(skip_threads_134060)];\n                                x_123172 = ((volatile __local\n                                             float *) red_arr_mem_134033)[sext_i32_i64(local_tid_134023) -\n                                                                          sext_i32_i64(skip_threads_134060)];\n                                x_123173 = ((volatile __local\n                                             float *) red_arr_mem_134035)[sext_i32_i64(local_tid_134023) -\n                                                                          sext_i32_i64(skip_threads_134060)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_134061 =\n                                     slt64(srem64(sext_i32_i64(local_tid_134023),\n                                                  l_window_114538),\n                                           sext_i32_i64(local_tid_134023) -\n                                           sext_i32_i64(local_tid_134023 -\n                                           skip_threads_134060));\n                                \n                                if (inactive_134061) {\n                                    x_123169 = x_123174;\n                                    x_123170 = x_123175;\n                                    x_123171 = x_123176;\n                                    x_123172 = x_123177;\n                                    x_123173 = x_123178;\n                                }\n                                if (!inactive_134061) {\n                                    float defunc_1_op_res_123179 = x_123169 +\n                                          x_123174;\n                                    float defunc_1_op_res_123180 = x_123170 +\n                                          x_123175;\n                                    float defun",
                   "c_1_op_res_123181 = x_123171 +\n                                          x_123176;\n                                    float defunc_1_op_res_123182 = x_123172 +\n                                          x_123177;\n                                    float defunc_1_op_res_123183 = x_123173 +\n                                          x_123178;\n                                    \n                                    x_123169 = defunc_1_op_res_123179;\n                                    x_123170 = defunc_1_op_res_123180;\n                                    x_123171 = defunc_1_op_res_123181;\n                                    x_123172 = defunc_1_op_res_123182;\n                                    x_123173 = defunc_1_op_res_123183;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_134025, skip_threads_134060)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_134060, local_tid_134023 -\n                                  squot32(local_tid_134023, 32) * 32) &&\n                            ltid_in_bounds_134059) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_134027)[sext_i32_i64(local_tid_134023)] =\n                                    x_123169;\n                                x_123174 = x_123169;\n                                ((volatile __local\n                                  float *) red_arr_mem_134029)[sext_i32_i64(local_tid_134023)] =\n                                    x_123170;\n                                x_123175 = x_123170;\n                                ((volatile __local\n                                  float *) red_arr_mem_134031)[sext_i32_i64(local_tid_134023)] =\n                                    x_123171;\n                                x_123176 = x_123171;",
                   "\n                                ((volatile __local\n                                  float *) red_arr_mem_134033)[sext_i32_i64(local_tid_134023)] =\n                                    x_123172;\n                                x_123177 = x_123172;\n                                ((volatile __local\n                                  float *) red_arr_mem_134035)[sext_i32_i64(local_tid_134023)] =\n                                    x_123173;\n                                x_123178 = x_123173;\n                            }\n                        }\n                        if (sle32(wave_sizze_134025, skip_threads_134060)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_134060 *= 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_134023 - squot32(local_tid_134023, 32) *\n                         32) == 31 && ltid_in_bounds_134059) {\n                        ((volatile __local\n                          float *) red_arr_mem_134027)[sext_i32_i64(squot32(local_tid_134023,\n                                                                            32))] =\n                            x_123169;\n                        ((volatile __local\n                          float *) red_arr_mem_134029)[sext_i32_i64(squot32(local_tid_134023,\n                                                                            32))] =\n                            x_123170;\n                        ((volatile __local\n                          float *) red_arr_mem_134031)[sext_i32_i64(squot32(local_tid_134023,\n                                                                            32))] =\n                            x_123171;\n                        ((volatile __local\n                          float *) red_arr_mem_134033)[sext_i32_i64(squot32(local_tid_134023,\n     ",
                   "                                                                       32))] =\n                            x_123172;\n                        ((volatile __local\n                          float *) red_arr_mem_134035)[sext_i32_i64(squot32(local_tid_134023,\n                                                                            32))] =\n                            x_123173;\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_134062;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_134023, 32) == 0 &&\n                            ltid_in_bounds_134059) {\n                            x_134049 = ((volatile __local\n                                         float *) red_arr_mem_134027)[sext_i32_i64(local_tid_134023)];\n                            x_134050 = ((volatile __local\n                                         float *) red_arr_mem_134029)[sext_i32_i64(local_tid_134023)];\n                            x_134051 = ((volatile __local\n                                         float *) red_arr_mem_134031)[sext_i32_i64(local_tid_134023)];\n                            x_134052 = ((volatile __local\n                                         float *) red_arr_mem_134033)[sext_i32_i64(local_tid_134023)];\n                            x_134053 = ((volatile __local\n                                         float *) red_arr_mem_134035)[sext_i32_i64(local_tid_134023)];\n                            if ((local_tid_134023 - squot32(local_tid_134023,\n                                                            32) * 32) == 0) {\n                                x_134044 = x_134049;\n                                x_134045 = x_134050;\n                                x_134046 = x_134051;\n                                x_13404",
                   "7 = x_134052;\n                                x_134048 = x_134053;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_134062 = 1;\n                        while (slt32(skip_threads_134062, 32)) {\n                            if (sle32(skip_threads_134062, local_tid_134023 -\n                                      squot32(local_tid_134023, 32) * 32) &&\n                                (squot32(local_tid_134023, 32) == 0 &&\n                                 ltid_in_bounds_134059)) {\n                                // read operands\n                                {\n                                    x_134044 = ((volatile __local\n                                                 float *) red_arr_mem_134027)[sext_i32_i64(local_tid_134023) -\n                                                                              sext_i32_i64(skip_threads_134062)];\n                                    x_134045 = ((volatile __local\n                                                 float *) red_arr_mem_134029)[sext_i32_i64(local_tid_134023) -\n                                                                              sext_i32_i64(skip_threads_134062)];\n                                    x_134046 = ((volatile __local\n                                                 float *) red_arr_mem_134031)[sext_i32_i64(local_tid_134023) -\n                                                                              sext_i32_i64(skip_threads_134062)];\n                                    x_134047 = ((volatile __local\n                                                 float *) red_arr_mem_134033)[sext_i32_i64(local_tid_134023) -\n                                                                              sext_i32_i64(skip_threads_134062)];\n                                    x_134048 = ((volatile __local\n                                                 floa",
                   "t *) red_arr_mem_134035)[sext_i32_i64(local_tid_134023) -\n                                                                              sext_i32_i64(skip_threads_134062)];\n                                }\n                                // perform operation\n                                {\n                                    bool inactive_134063 =\n                                         slt64(srem64(sext_i32_i64(local_tid_134023 *\n                                                      32 + 32 - 1),\n                                                      l_window_114538),\n                                               sext_i32_i64(local_tid_134023 *\n                                               32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_134023 -\n                                                             skip_threads_134062) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_134063) {\n                                        x_134044 = x_134049;\n                                        x_134045 = x_134050;\n                                        x_134046 = x_134051;\n                                        x_134047 = x_134052;\n                                        x_134048 = x_134053;\n                                    }\n                                    if (!inactive_134063) {\n                                        float defunc_1_op_res_134054 =\n                                              x_134044 + x_134049;\n                                        float defunc_1_op_res_134055 =\n                                              x_134045 + x_134050;\n                                        float defunc_1_op_res_134056 =\n                                              x_134046 + x_134051;\n                                        float defunc_1_op_res_134057 =\n                                              x_134047 + x_134052;\n    ",
                   "                                    float defunc_1_op_res_134058 =\n                                              x_134048 + x_134053;\n                                        \n                                        x_134044 = defunc_1_op_res_134054;\n                                        x_134045 = defunc_1_op_res_134055;\n                                        x_134046 = defunc_1_op_res_134056;\n                                        x_134047 = defunc_1_op_res_134057;\n                                        x_134048 = defunc_1_op_res_134058;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_134025, skip_threads_134062)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_134062, local_tid_134023 -\n                                      squot32(local_tid_134023, 32) * 32) &&\n                                (squot32(local_tid_134023, 32) == 0 &&\n                                 ltid_in_bounds_134059)) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_134027)[sext_i32_i64(local_tid_134023)] =\n                                        x_134044;\n                                    x_134049 = x_134044;\n                                    ((volatile __local\n                                      float *) red_arr_mem_134029)[sext_i32_i64(local_tid_134023)] =\n                                        x_134045;\n                                    x_134050 = x_134045;\n                                    ((volatile __local\n                                      float *) red_arr_mem_134031)[sext_i32_i64(local_tid_134023)] =\n                                        x_134046;\n                                    x_134051 = x_134046;\n                   ",
                   "                 ((volatile __local\n                                      float *) red_arr_mem_134033)[sext_i32_i64(local_tid_134023)] =\n                                        x_134047;\n                                    x_134052 = x_134047;\n                                    ((volatile __local\n                                      float *) red_arr_mem_134035)[sext_i32_i64(local_tid_134023)] =\n                                        x_134048;\n                                    x_134053 = x_134048;\n                                }\n                            }\n                            if (sle32(wave_sizze_134025, skip_threads_134062)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_134062 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n                    if (!(squot32(local_tid_134023, 32) == 0 ||\n                          !ltid_in_bounds_134059)) {\n                        // read operands\n                        {\n                            x_123174 = x_123169;\n                            x_123175 = x_123170;\n                            x_123176 = x_123171;\n                            x_123177 = x_123172;\n                            x_123178 = x_123173;\n                            x_123169 = ((__local\n                                         float *) red_arr_mem_134027)[sext_i32_i64(squot32(local_tid_134023,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                            x_123170 = ((__local\n                                         float *) red_arr_mem_134029)[sext_i32_i64(squot32(local_tid_134023,\n                                                                                    ",
                   "       32)) -\n                                                                      (int64_t) 1];\n                            x_123171 = ((__local\n                                         float *) red_arr_mem_134031)[sext_i32_i64(squot32(local_tid_134023,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                            x_123172 = ((__local\n                                         float *) red_arr_mem_134033)[sext_i32_i64(squot32(local_tid_134023,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                            x_123173 = ((__local\n                                         float *) red_arr_mem_134035)[sext_i32_i64(squot32(local_tid_134023,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_134064 =\n                                 slt64(srem64(sext_i32_i64(local_tid_134023),\n                                              l_window_114538),\n                                       sext_i32_i64(local_tid_134023) -\n                                       sext_i32_i64(squot32(local_tid_134023,\n                                                            32) * 32 - 1));\n                            \n                            if (inactive_134064) {\n                                x_123169 = x_123174;\n                                x_123170 = x_123175;\n                                x_123171 = x_123176;\n                                x_123172 = x_123177;\n                                x_123173 = x_123178;\n                     ",
                   "       }\n                            if (!inactive_134064) {\n                                float defunc_1_op_res_123179 = x_123169 +\n                                      x_123174;\n                                float defunc_1_op_res_123180 = x_123170 +\n                                      x_123175;\n                                float defunc_1_op_res_123181 = x_123171 +\n                                      x_123176;\n                                float defunc_1_op_res_123182 = x_123172 +\n                                      x_123177;\n                                float defunc_1_op_res_123183 = x_123173 +\n                                      x_123178;\n                                \n                                x_123169 = defunc_1_op_res_123179;\n                                x_123170 = defunc_1_op_res_123180;\n                                x_123171 = defunc_1_op_res_123181;\n                                x_123172 = defunc_1_op_res_123182;\n                                x_123173 = defunc_1_op_res_123183;\n                            }\n                        }\n                        // write final result\n                        {\n                            ((__local\n                              float *) red_arr_mem_134027)[sext_i32_i64(local_tid_134023)] =\n                                x_123169;\n                            ((__local\n                              float *) red_arr_mem_134029)[sext_i32_i64(local_tid_134023)] =\n                                x_123170;\n                            ((__local\n                              float *) red_arr_mem_134031)[sext_i32_i64(local_tid_134023)] =\n                                x_123171;\n                            ((__local\n                              float *) red_arr_mem_134033)[sext_i32_i64(local_tid_134023)] =\n                                x_123172;\n                            ((__local\n                              float *) red_arr_mem_134035)[sext_i32_i64(local_tid_134023)] =\n          ",
                   "                      x_123173;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_134023, 32) == 0) {\n                        ((__local\n                          float *) red_arr_mem_134027)[sext_i32_i64(local_tid_134023)] =\n                            x_123174;\n                        ((__local\n                          float *) red_arr_mem_134029)[sext_i32_i64(local_tid_134023)] =\n                            x_123175;\n                        ((__local\n                          float *) red_arr_mem_134031)[sext_i32_i64(local_tid_134023)] =\n                            x_123176;\n                        ((__local\n                          float *) red_arr_mem_134033)[sext_i32_i64(local_tid_134023)] =\n                            x_123177;\n                        ((__local\n                          float *) red_arr_mem_134035)[sext_i32_i64(local_tid_134023)] =\n                            x_123178;\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_134039) *\n                      squot64(segred_group_sizze_123161,\n                              segment_sizze_nonzzero_134020) +\n                      sext_i32_i64(local_tid_134023), m_114533 *\n                      l_n_m_114584) && slt64(sext_i32_i64(local_tid_134023),\n                                             squot64(segred_group_sizze_123161,\n                                                     segment_sizze_nonzzero_134020))) {\n                ((__global\n                  float *) mem_131106)[squot64(sext_i32_i64(virt_group_id_134039) *\n                                               squot64(segred_group_sizze_123161,\n                                ",
                   "                       segment_sizze_nonzzero_134020) +\n                                               sext_i32_i64(local_tid_134023),\n                                               l_n_m_114584) * l_n_m_114584 +\n                                       (sext_i32_i64(virt_group_id_134039) *\n                                        squot64(segred_group_sizze_123161,\n                                                segment_sizze_nonzzero_134020) +\n                                        sext_i32_i64(local_tid_134023) -\n                                        squot64(sext_i32_i64(virt_group_id_134039) *\n                                                squot64(segred_group_sizze_123161,\n                                                        segment_sizze_nonzzero_134020) +\n                                                sext_i32_i64(local_tid_134023),\n                                                l_n_m_114584) * l_n_m_114584)] =\n                    ((__local\n                      float *) red_arr_mem_134027)[(sext_i32_i64(local_tid_134023) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134020 -\n                                                   (int64_t) 1];\n                ((__global\n                  float *) mem_131110)[squot64(sext_i32_i64(virt_group_id_134039) *\n                                               squot64(segred_group_sizze_123161,\n                                                       segment_sizze_nonzzero_134020) +\n                                               sext_i32_i64(local_tid_134023),\n                                               l_n_m_114584) * l_n_m_114584 +\n                                       (sext_i32_i64(virt_group_id_134039) *\n                                        squot64(segred_group_sizze_123161,\n                                                segment_sizze_nonzzero_134020) +\n                                        sext_i32_i64(local_tid",
                   "_134023) -\n                                        squot64(sext_i32_i64(virt_group_id_134039) *\n                                                squot64(segred_group_sizze_123161,\n                                                        segment_sizze_nonzzero_134020) +\n                                                sext_i32_i64(local_tid_134023),\n                                                l_n_m_114584) * l_n_m_114584)] =\n                    ((__local\n                      float *) red_arr_mem_134029)[(sext_i32_i64(local_tid_134023) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134020 -\n                                                   (int64_t) 1];\n                ((__global\n                  float *) mem_131114)[squot64(sext_i32_i64(virt_group_id_134039) *\n                                               squot64(segred_group_sizze_123161,\n                                                       segment_sizze_nonzzero_134020) +\n                                               sext_i32_i64(local_tid_134023),\n                                               l_n_m_114584) * l_n_m_114584 +\n                                       (sext_i32_i64(virt_group_id_134039) *\n                                        squot64(segred_group_sizze_123161,\n                                                segment_sizze_nonzzero_134020) +\n                                        sext_i32_i64(local_tid_134023) -\n                                        squot64(sext_i32_i64(virt_group_id_134039) *\n                                                squot64(segred_group_sizze_123161,\n                                                        segment_sizze_nonzzero_134020) +\n                                                sext_i32_i64(local_tid_134023),\n                                                l_n_m_114584) * l_n_m_114584)] =\n                    ((__local\n                      float *) red_arr_mem_134031",
                   ")[(sext_i32_i64(local_tid_134023) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134020 -\n                                                   (int64_t) 1];\n                ((__global\n                  float *) mem_131118)[squot64(sext_i32_i64(virt_group_id_134039) *\n                                               squot64(segred_group_sizze_123161,\n                                                       segment_sizze_nonzzero_134020) +\n                                               sext_i32_i64(local_tid_134023),\n                                               l_n_m_114584) * l_n_m_114584 +\n                                       (sext_i32_i64(virt_group_id_134039) *\n                                        squot64(segred_group_sizze_123161,\n                                                segment_sizze_nonzzero_134020) +\n                                        sext_i32_i64(local_tid_134023) -\n                                        squot64(sext_i32_i64(virt_group_id_134039) *\n                                                squot64(segred_group_sizze_123161,\n                                                        segment_sizze_nonzzero_134020) +\n                                                sext_i32_i64(local_tid_134023),\n                                                l_n_m_114584) * l_n_m_114584)] =\n                    ((__local\n                      float *) red_arr_mem_134033)[(sext_i32_i64(local_tid_134023) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134020 -\n                                                   (int64_t) 1];\n                ((__global\n                  float *) mem_131122)[squot64(sext_i32_i64(virt_group_id_134039) *\n                                               squot64(segred_group_sizze_123161,\n                                                       segment_s",
                   "izze_nonzzero_134020) +\n                                               sext_i32_i64(local_tid_134023),\n                                               l_n_m_114584) * l_n_m_114584 +\n                                       (sext_i32_i64(virt_group_id_134039) *\n                                        squot64(segred_group_sizze_123161,\n                                                segment_sizze_nonzzero_134020) +\n                                        sext_i32_i64(local_tid_134023) -\n                                        squot64(sext_i32_i64(virt_group_id_134039) *\n                                                squot64(segred_group_sizze_123161,\n                                                        segment_sizze_nonzzero_134020) +\n                                                sext_i32_i64(local_tid_134023),\n                                                l_n_m_114584) * l_n_m_114584)] =\n                    ((__local\n                      float *) red_arr_mem_134035)[(sext_i32_i64(local_tid_134023) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134020 -\n                                                   (int64_t) 1];\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_123161\n}\n__kernel void mainzisegred_small_124516(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134467_backing_aligned_0,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t t_window_114537,\n                                        int64_t t_jump_114541,\n                                        int64_t t_n_m_114591, int64_t i_114610,\n                                        int64_t num_groups_124846,\n    ",
                   "                                    int64_t segment_sizze_nonzzero_134460,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130606,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130607,\n                                        __global unsigned char *mem_130861,\n                                        __global\n                                        unsigned char *defunc_4_map_res_mem_131267,\n                                        __global unsigned char *mem_131320,\n                                        __global unsigned char *mem_131325)\n{\n    #define segred_group_sizze_124845 (mainzisegred_group_sizze_124510)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_134467_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_134467_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_134462;\n    int32_t local_tid_134463;\n    int64_t group_sizze_134466;\n    int32_t wave_sizze_134465;\n    int32_t group_tid_134464;\n    \n    global_tid_134462 = get_global_id(0);\n    local_tid_134463 = get_local_id(0);\n    group_sizze_134466 = get_local_size(0);\n    wave_sizze_134465 = LOCKSTEP_WIDTH;\n    group_tid_134464 = get_group_id(0);\n    \n    int32_t phys_tid_124516 = global_tid_134462;\n    __local char *red_arr_mem_134467;\n    \n    red_arr_mem_134467 = (__local char *) red_arr_mem_134467_backing_0;\n    \n    int32_t phys_group_id_134469;\n    \n    phys_group_id_134469 = get_group_id(0);\n    for (int32_t i_134470 = 0; i_134470 <\n         sdiv_up",
                   "32(sext_i64_i32(sdiv_up64(m_114533 * t_n_m_114591,\n                                          squot64(segred_group_sizze_124845,\n                                                  segment_sizze_nonzzero_134460))) -\n                   phys_group_id_134469, sext_i64_i32(num_groups_124846));\n         i_134470++) {\n        int32_t virt_group_id_134471 = phys_group_id_134469 + i_134470 *\n                sext_i64_i32(num_groups_124846);\n        int64_t slice_134472 = t_n_m_114591;\n        int64_t slice_134473 = m_114533 * slice_134472;\n        int64_t gtid_124505 = squot64(squot64(sext_i32_i64(local_tid_134463),\n                                              segment_sizze_nonzzero_134460) +\n                                      sext_i32_i64(virt_group_id_134471) *\n                                      squot64(segred_group_sizze_124845,\n                                              segment_sizze_nonzzero_134460),\n                                      slice_134472);\n        int64_t remnant_134474 = squot64(sext_i32_i64(local_tid_134463),\n                                         segment_sizze_nonzzero_134460) +\n                sext_i32_i64(virt_group_id_134471) *\n                squot64(segred_group_sizze_124845,\n                        segment_sizze_nonzzero_134460) - gtid_124505 *\n                slice_134472;\n        int64_t gtid_124506 = remnant_134474;\n        int64_t remnant_134475 = remnant_134474 - gtid_124506;\n        int64_t gtid_124515 = srem64(sext_i32_i64(local_tid_134463),\n                                     t_window_114537);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, t_window_114537) && ((slt64(gtid_124505,\n                                                               m_114533) &&\n                                                         slt64(gtid_124506,\n                                                               t_n_m_114591)) &&\n                                                        slt64(sext_i32_i64",
                   "(local_tid_134463),\n                                                              t_window_114537 *\n                                                              squot64(segred_group_sizze_124845,\n                                                                      segment_sizze_nonzzero_134460)))) {\n                int64_t x_124857 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_124505];\n                int64_t x_124860 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130606)[gtid_124505 *\n                                                                             t_n_m_114591 +\n                                                                             gtid_124506];\n                float x_124861 = ((__global\n                                   float *) defunc_3_map_res_mem_130607)[gtid_124505 *\n                                                                         t_n_m_114591 +\n                                                                         gtid_124506];\n                int64_t binop_y_128935 = mul64(t_jump_114541, gtid_124506);\n                int64_t convop_x_128936 = smin64(i_114610, binop_y_128935);\n                float index_primexp_128937 = sitofp_i64_f32(convop_x_128936);\n                float a0_124863 = ((__global float *) mem_131320)[gtid_124505 *\n                                                                  t_n_m_114591 +\n                                                                  gtid_124506];\n                bool cond_124865 = sle64(x_124857, gtid_124515);\n                float defunc_0_f_res_124866;\n                \n                if (cond_124865) {\n                    defunc_0_f_res_124866 = 0.0F;\n                } else {\n                    int64_t i_124867 = add64(gtid_124515, x_124860);\n                    float x_124868 = ((__global\n                                       float *) mem_130122)[gtid_124505 *\n                                   ",
                   "                         n_114534 +\n                                                            i_124867];\n                    float defunc_0_f_res_f_res_124869 = 1.0F + x_124868;\n                    \n                    defunc_0_f_res_124866 = defunc_0_f_res_f_res_124869;\n                }\n                \n                float defunc_0_f_res_124870;\n                \n                if (cond_124865) {\n                    defunc_0_f_res_124870 = 0.0F;\n                } else {\n                    int64_t i_124871 = add64(gtid_124515, x_124860);\n                    float x_124872 = ((__global\n                                       float *) mem_130861)[gtid_124505 *\n                                                            n_114534 +\n                                                            i_124871];\n                    \n                    defunc_0_f_res_124870 = x_124872;\n                }\n                \n                float x_j_124873 = defunc_0_f_res_124866 - index_primexp_128937;\n                float abs_res_124874 = (float) fabs(x_j_124873);\n                float tmp1_124875 = abs_res_124874 / x_124861;\n                float x_124876 = tmp1_124875 * tmp1_124875;\n                float y_124877 = tmp1_124875 * x_124876;\n                float tmp2_124878 = 1.0F - y_124877;\n                float x_124879 = tmp2_124878 * tmp2_124878;\n                float tmp3_124880 = tmp2_124878 * x_124879;\n                float tmp4_124881 = defunc_0_f_res_124870 * tmp3_124880;\n                float defunc_0_f_res_124882;\n                \n                if (cond_124865) {\n                    defunc_0_f_res_124882 = 0.0F;\n                } else {\n                    int64_t i_124883 = add64(gtid_124515, x_124860);\n                    float x_124884 = ((__global\n                                       float *) defunc_4_map_res_mem_131267)[gtid_124505 *\n                                                                             n_114534 +\n                                    ",
                   "                                         i_124883];\n                    \n                    defunc_0_f_res_124882 = x_124884;\n                }\n                \n                float x_124885 = a0_124863 * tmp4_124881;\n                float defunc_9_fit_fun_res_124886 = defunc_0_f_res_124882 *\n                      x_124885;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_134467)[sext_i32_i64(local_tid_134463)] =\n                        defunc_9_fit_fun_res_124886;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_134467)[sext_i32_i64(local_tid_134463)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, t_window_114537)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_124849;\n                float x_124850;\n                float x_134476;\n                float x_134477;\n                bool ltid_in_bounds_134479 =\n                     slt64(sext_i32_i64(local_tid_134463), t_window_114537 *\n                           squot64(segred_group_sizze_124845,\n                                   segment_sizze_nonzzero_134460));\n                int32_t skip_threads_134480;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_134479) {\n                        x_124850 = ((volatile __local\n                                     float *) red_arr_mem_134467)[sext_i32_i64(local_tid_134463)];\n                        if ((local_tid_134463 - squot32(local_tid_134463, 32) *\n                             32) == 0) {\n                            x_124849 = x_124850;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers nee",
                   "ded)\n                {\n                    skip_threads_134480 = 1;\n                    while (slt32(skip_threads_134480, 32)) {\n                        if (sle32(skip_threads_134480, local_tid_134463 -\n                                  squot32(local_tid_134463, 32) * 32) &&\n                            ltid_in_bounds_134479) {\n                            // read operands\n                            {\n                                x_124849 = ((volatile __local\n                                             float *) red_arr_mem_134467)[sext_i32_i64(local_tid_134463) -\n                                                                          sext_i32_i64(skip_threads_134480)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_134481 =\n                                     slt64(srem64(sext_i32_i64(local_tid_134463),\n                                                  t_window_114537),\n                                           sext_i32_i64(local_tid_134463) -\n                                           sext_i32_i64(local_tid_134463 -\n                                           skip_threads_134480));\n                                \n                                if (inactive_134481) {\n                                    x_124849 = x_124850;\n                                }\n                                if (!inactive_134481) {\n                                    float defunc_1_op_res_124851 = x_124849 +\n                                          x_124850;\n                                    \n                                    x_124849 = defunc_1_op_res_124851;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_134465, skip_threads_134480)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_134480, local_t",
                   "id_134463 -\n                                  squot32(local_tid_134463, 32) * 32) &&\n                            ltid_in_bounds_134479) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_134467)[sext_i32_i64(local_tid_134463)] =\n                                    x_124849;\n                                x_124850 = x_124849;\n                            }\n                        }\n                        if (sle32(wave_sizze_134465, skip_threads_134480)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_134480 *= 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_134463 - squot32(local_tid_134463, 32) *\n                         32) == 31 && ltid_in_bounds_134479) {\n                        ((volatile __local\n                          float *) red_arr_mem_134467)[sext_i32_i64(squot32(local_tid_134463,\n                                                                            32))] =\n                            x_124849;\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_134482;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_134463, 32) == 0 &&\n                            ltid_in_bounds_134479) {\n                            x_134477 = ((volatile __local\n                                         float *) red_arr_mem_134467)[sext_i32_i64(local_tid_134463)];\n                            if ((local_tid_134463 - squot32(local_tid_",
                   "134463,\n                                                            32) * 32) == 0) {\n                                x_134476 = x_134477;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_134482 = 1;\n                        while (slt32(skip_threads_134482, 32)) {\n                            if (sle32(skip_threads_134482, local_tid_134463 -\n                                      squot32(local_tid_134463, 32) * 32) &&\n                                (squot32(local_tid_134463, 32) == 0 &&\n                                 ltid_in_bounds_134479)) {\n                                // read operands\n                                {\n                                    x_134476 = ((volatile __local\n                                                 float *) red_arr_mem_134467)[sext_i32_i64(local_tid_134463) -\n                                                                              sext_i32_i64(skip_threads_134482)];\n                                }\n                                // perform operation\n                                {\n                                    bool inactive_134483 =\n                                         slt64(srem64(sext_i32_i64(local_tid_134463 *\n                                                      32 + 32 - 1),\n                                                      t_window_114537),\n                                               sext_i32_i64(local_tid_134463 *\n                                               32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_134463 -\n                                                             skip_threads_134482) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_134483) {\n                                        x_134476 = ",
                   "x_134477;\n                                    }\n                                    if (!inactive_134483) {\n                                        float defunc_1_op_res_134478 =\n                                              x_134476 + x_134477;\n                                        \n                                        x_134476 = defunc_1_op_res_134478;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_134465, skip_threads_134482)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_134482, local_tid_134463 -\n                                      squot32(local_tid_134463, 32) * 32) &&\n                                (squot32(local_tid_134463, 32) == 0 &&\n                                 ltid_in_bounds_134479)) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_134467)[sext_i32_i64(local_tid_134463)] =\n                                        x_134476;\n                                    x_134477 = x_134476;\n                                }\n                            }\n                            if (sle32(wave_sizze_134465, skip_threads_134482)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_134482 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n                    if (!(squot32(local_tid_134463, 32) == 0 ||\n                          !ltid_in_bounds_134479)) {\n                        // read operands\n                        {\n                            x_124850 = x_124849;\n                  ",
                   "          x_124849 = ((__local\n                                         float *) red_arr_mem_134467)[sext_i32_i64(squot32(local_tid_134463,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_134484 =\n                                 slt64(srem64(sext_i32_i64(local_tid_134463),\n                                              t_window_114537),\n                                       sext_i32_i64(local_tid_134463) -\n                                       sext_i32_i64(squot32(local_tid_134463,\n                                                            32) * 32 - 1));\n                            \n                            if (inactive_134484) {\n                                x_124849 = x_124850;\n                            }\n                            if (!inactive_134484) {\n                                float defunc_1_op_res_124851 = x_124849 +\n                                      x_124850;\n                                \n                                x_124849 = defunc_1_op_res_124851;\n                            }\n                        }\n                        // write final result\n                        {\n                            ((__local\n                              float *) red_arr_mem_134467)[sext_i32_i64(local_tid_134463)] =\n                                x_124849;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_134463, 32) == 0) {\n                        ((__local\n                          float *) red_arr_mem_134467)[sext_i32_i64(local_tid_134463)] =\n                            x_124850;\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_134471) *\n                      squot64(segred_group_sizze_124845,\n                              segment_sizze_nonzzero_134460) +\n                      sext_i32_i64(local_tid_134463), m_114533 *\n                      t_n_m_114591) && slt64(sext_i32_i64(local_tid_134463),\n                                             squot64(segred_group_sizze_124845,\n                                                     segment_sizze_nonzzero_134460))) {\n                ((__global\n                  float *) mem_131325)[squot64(sext_i32_i64(virt_group_id_134471) *\n                                               squot64(segred_group_sizze_124845,\n                                                       segment_sizze_nonzzero_134460) +\n                                               sext_i32_i64(local_tid_134463),\n                                               t_n_m_114591) * t_n_m_114591 +\n                                       (sext_i32_i64(virt_group_id_134471) *\n                                        squot64(segred_group_sizze_124845,\n                                                segment_sizze_nonzzero_134460) +\n                                        sext_i32_i64(local_tid_134463) -\n                                        squot64(sext_i32_i64(virt_group_id_134471) *\n                                                squot64(segred_group_sizze_124845,\n                                                        segment_sizze_nonzzero_134460) +\n                                                sext_i32_i64(local_tid_134463),\n                                                t_n_m_114591) * t_n_m_114591)] =\n                    ((__local\n                      float *) red_arr_mem_134467)[(sext_i32_i64(local_tid_134463) +\n                                                ",
                   "    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134460 -\n                                                   (int64_t) 1];\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_124845\n}\n__kernel void mainzisegred_small_124578(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134389_backing_aligned_0,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t t_window_114537,\n                                        int64_t t_jump_114541,\n                                        int64_t t_n_m_114591, int64_t i_114610,\n                                        int64_t num_groups_124802,\n                                        int64_t segment_sizze_nonzzero_134382,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130606,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130607,\n                                        __global unsigned char *mem_130861,\n                                        __global unsigned char *mem_131315)\n{\n    #define segred_group_sizze_124801 (mainzisegred_group_sizze_124572)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_134389_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_134389_backing_aligned_0;\n    \n    if (",
                   "*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_134384;\n    int32_t local_tid_134385;\n    int64_t group_sizze_134388;\n    int32_t wave_sizze_134387;\n    int32_t group_tid_134386;\n    \n    global_tid_134384 = get_global_id(0);\n    local_tid_134385 = get_local_id(0);\n    group_sizze_134388 = get_local_size(0);\n    wave_sizze_134387 = LOCKSTEP_WIDTH;\n    group_tid_134386 = get_group_id(0);\n    \n    int32_t phys_tid_124578 = global_tid_134384;\n    __local char *red_arr_mem_134389;\n    \n    red_arr_mem_134389 = (__local char *) red_arr_mem_134389_backing_0;\n    \n    int32_t phys_group_id_134391;\n    \n    phys_group_id_134391 = get_group_id(0);\n    for (int32_t i_134392 = 0; i_134392 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533 * t_n_m_114591,\n                                          squot64(segred_group_sizze_124801,\n                                                  segment_sizze_nonzzero_134382))) -\n                   phys_group_id_134391, sext_i64_i32(num_groups_124802));\n         i_134392++) {\n        int32_t virt_group_id_134393 = phys_group_id_134391 + i_134392 *\n                sext_i64_i32(num_groups_124802);\n        int64_t slice_134394 = t_n_m_114591;\n        int64_t slice_134395 = m_114533 * slice_134394;\n        int64_t gtid_124567 = squot64(squot64(sext_i32_i64(local_tid_134385),\n                                              segment_sizze_nonzzero_134382) +\n                                      sext_i32_i64(virt_group_id_134393) *\n                                      squot64(segred_group_sizze_124801,\n                                              segment_sizze_nonzzero_134382),\n                                      slice_134394);\n        int64_t remnant_134396 = squot64(sext_i32_i64(local_tid_134385),\n                                         segment_sizze_nonzzero_134382) +\n                sext_i32_i64(virt_group_id_134393) *\n                squot64(segred_group_sizze_124801,\n                        segment_sizze_nonzzero_134382) -",
                   " gtid_124567 *\n                slice_134394;\n        int64_t gtid_124568 = remnant_134396;\n        int64_t remnant_134397 = remnant_134396 - gtid_124568;\n        int64_t gtid_124577 = srem64(sext_i32_i64(local_tid_134385),\n                                     t_window_114537);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, t_window_114537) && ((slt64(gtid_124567,\n                                                               m_114533) &&\n                                                         slt64(gtid_124568,\n                                                               t_n_m_114591)) &&\n                                                        slt64(sext_i32_i64(local_tid_134385),\n                                                              t_window_114537 *\n                                                              squot64(segred_group_sizze_124801,\n                                                                      segment_sizze_nonzzero_134382)))) {\n                int64_t x_124812 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_124567];\n                int64_t x_124814 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130606)[gtid_124567 *\n                                                                             t_n_m_114591 +\n                                                                             gtid_124568];\n                float x_124815 = ((__global\n                                   float *) defunc_3_map_res_mem_130607)[gtid_124567 *\n                                                                         t_n_m_114591 +\n                                                                         gtid_124568];\n                int64_t binop_y_128928 = mul64(t_jump_114541, gtid_124568);\n                int64_t convop_x_128929 = smin64(i_114610, binop_y_128928);\n                float index_primexp_128930 = sitofp_i64_f32",
                   "(convop_x_128929);\n                bool cond_124818 = sle64(x_124812, gtid_124577);\n                float defunc_0_f_res_124819;\n                \n                if (cond_124818) {\n                    defunc_0_f_res_124819 = 0.0F;\n                } else {\n                    int64_t i_124820 = add64(gtid_124577, x_124814);\n                    float x_124821 = ((__global\n                                       float *) mem_130122)[gtid_124567 *\n                                                            n_114534 +\n                                                            i_124820];\n                    float defunc_0_f_res_f_res_124822 = 1.0F + x_124821;\n                    \n                    defunc_0_f_res_124819 = defunc_0_f_res_f_res_124822;\n                }\n                \n                float defunc_0_f_res_124823;\n                \n                if (cond_124818) {\n                    defunc_0_f_res_124823 = 0.0F;\n                } else {\n                    int64_t i_124824 = add64(gtid_124577, x_124814);\n                    float x_124825 = ((__global\n                                       float *) mem_130861)[gtid_124567 *\n                                                            n_114534 +\n                                                            i_124824];\n                    \n                    defunc_0_f_res_124823 = x_124825;\n                }\n                \n                float x_j_124826 = defunc_0_f_res_124819 - index_primexp_128930;\n                float abs_res_124827 = (float) fabs(x_j_124826);\n                float tmp1_124828 = abs_res_124827 / x_124815;\n                float x_124829 = tmp1_124828 * tmp1_124828;\n                float y_124830 = tmp1_124828 * x_124829;\n                float tmp2_124831 = 1.0F - y_124830;\n                float x_124832 = tmp2_124831 * tmp2_124831;\n                float tmp3_124833 = tmp2_124831 * x_124832;\n                float w_j_124834 = defunc_0_f_res_124823 * tmp3_124833;\n                \n      ",
                   "          // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_134389)[sext_i32_i64(local_tid_134385)] =\n                        w_j_124834;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_134389)[sext_i32_i64(local_tid_134385)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, t_window_114537)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_124805;\n                float x_124806;\n                float x_134398;\n                float x_134399;\n                bool ltid_in_bounds_134401 =\n                     slt64(sext_i32_i64(local_tid_134385), t_window_114537 *\n                           squot64(segred_group_sizze_124801,\n                                   segment_sizze_nonzzero_134382));\n                int32_t skip_threads_134402;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_134401) {\n                        x_124806 = ((volatile __local\n                                     float *) red_arr_mem_134389)[sext_i32_i64(local_tid_134385)];\n                        if ((local_tid_134385 - squot32(local_tid_134385, 32) *\n                             32) == 0) {\n                            x_124805 = x_124806;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_134402 = 1;\n                    while (slt32(skip_threads_134402, 32)) {\n                        if (sle32(skip_threads_134402, local_tid_134385 -\n                                  squot32(local_tid_134385, 32) * 32) &&\n                            ltid_in_bounds_134401) {\n                            // read ope",
                   "rands\n                            {\n                                x_124805 = ((volatile __local\n                                             float *) red_arr_mem_134389)[sext_i32_i64(local_tid_134385) -\n                                                                          sext_i32_i64(skip_threads_134402)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_134403 =\n                                     slt64(srem64(sext_i32_i64(local_tid_134385),\n                                                  t_window_114537),\n                                           sext_i32_i64(local_tid_134385) -\n                                           sext_i32_i64(local_tid_134385 -\n                                           skip_threads_134402));\n                                \n                                if (inactive_134403) {\n                                    x_124805 = x_124806;\n                                }\n                                if (!inactive_134403) {\n                                    float defunc_1_op_res_124807 = x_124805 +\n                                          x_124806;\n                                    \n                                    x_124805 = defunc_1_op_res_124807;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_134387, skip_threads_134402)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_134402, local_tid_134385 -\n                                  squot32(local_tid_134385, 32) * 32) &&\n                            ltid_in_bounds_134401) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_134389)[sext_i32_i64(local_tid_134385)] =\n        ",
                   "                            x_124805;\n                                x_124806 = x_124805;\n                            }\n                        }\n                        if (sle32(wave_sizze_134387, skip_threads_134402)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_134402 *= 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_134385 - squot32(local_tid_134385, 32) *\n                         32) == 31 && ltid_in_bounds_134401) {\n                        ((volatile __local\n                          float *) red_arr_mem_134389)[sext_i32_i64(squot32(local_tid_134385,\n                                                                            32))] =\n                            x_124805;\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_134404;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_134385, 32) == 0 &&\n                            ltid_in_bounds_134401) {\n                            x_134399 = ((volatile __local\n                                         float *) red_arr_mem_134389)[sext_i32_i64(local_tid_134385)];\n                            if ((local_tid_134385 - squot32(local_tid_134385,\n                                                            32) * 32) == 0) {\n                                x_134398 = x_134399;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_134404 = 1;\n            ",
                   "            while (slt32(skip_threads_134404, 32)) {\n                            if (sle32(skip_threads_134404, local_tid_134385 -\n                                      squot32(local_tid_134385, 32) * 32) &&\n                                (squot32(local_tid_134385, 32) == 0 &&\n                                 ltid_in_bounds_134401)) {\n                                // read operands\n                                {\n                                    x_134398 = ((volatile __local\n                                                 float *) red_arr_mem_134389)[sext_i32_i64(local_tid_134385) -\n                                                                              sext_i32_i64(skip_threads_134404)];\n                                }\n                                // perform operation\n                                {\n                                    bool inactive_134405 =\n                                         slt64(srem64(sext_i32_i64(local_tid_134385 *\n                                                      32 + 32 - 1),\n                                                      t_window_114537),\n                                               sext_i32_i64(local_tid_134385 *\n                                               32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_134385 -\n                                                             skip_threads_134404) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_134405) {\n                                        x_134398 = x_134399;\n                                    }\n                                    if (!inactive_134405) {\n                                        float defunc_1_op_res_134400 =\n                                              x_134398 + x_134399;\n                                        \n                                        x_134398 = defunc_1_op_res_134400;\n      ",
                   "                              }\n                                }\n                            }\n                            if (sle32(wave_sizze_134387, skip_threads_134404)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_134404, local_tid_134385 -\n                                      squot32(local_tid_134385, 32) * 32) &&\n                                (squot32(local_tid_134385, 32) == 0 &&\n                                 ltid_in_bounds_134401)) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_134389)[sext_i32_i64(local_tid_134385)] =\n                                        x_134398;\n                                    x_134399 = x_134398;\n                                }\n                            }\n                            if (sle32(wave_sizze_134387, skip_threads_134404)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_134404 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n                    if (!(squot32(local_tid_134385, 32) == 0 ||\n                          !ltid_in_bounds_134401)) {\n                        // read operands\n                        {\n                            x_124806 = x_124805;\n                            x_124805 = ((__local\n                                         float *) red_arr_mem_134389)[sext_i32_i64(squot32(local_tid_134385,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                        }\n                    ",
                   "    // perform operation\n                        {\n                            bool inactive_134406 =\n                                 slt64(srem64(sext_i32_i64(local_tid_134385),\n                                              t_window_114537),\n                                       sext_i32_i64(local_tid_134385) -\n                                       sext_i32_i64(squot32(local_tid_134385,\n                                                            32) * 32 - 1));\n                            \n                            if (inactive_134406) {\n                                x_124805 = x_124806;\n                            }\n                            if (!inactive_134406) {\n                                float defunc_1_op_res_124807 = x_124805 +\n                                      x_124806;\n                                \n                                x_124805 = defunc_1_op_res_124807;\n                            }\n                        }\n                        // write final result\n                        {\n                            ((__local\n                              float *) red_arr_mem_134389)[sext_i32_i64(local_tid_134385)] =\n                                x_124805;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_134385, 32) == 0) {\n                        ((__local\n                          float *) red_arr_mem_134389)[sext_i32_i64(local_tid_134385)] =\n                            x_124806;\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_134393) *\n                      squot64(segred_group_sizze_124801,\n                              segment_sizze_nonzzero_134382) +\n   ",
                   "                   sext_i32_i64(local_tid_134385), m_114533 *\n                      t_n_m_114591) && slt64(sext_i32_i64(local_tid_134385),\n                                             squot64(segred_group_sizze_124801,\n                                                     segment_sizze_nonzzero_134382))) {\n                ((__global\n                  float *) mem_131315)[squot64(sext_i32_i64(virt_group_id_134393) *\n                                               squot64(segred_group_sizze_124801,\n                                                       segment_sizze_nonzzero_134382) +\n                                               sext_i32_i64(local_tid_134385),\n                                               t_n_m_114591) * t_n_m_114591 +\n                                       (sext_i32_i64(virt_group_id_134393) *\n                                        squot64(segred_group_sizze_124801,\n                                                segment_sizze_nonzzero_134382) +\n                                        sext_i32_i64(local_tid_134385) -\n                                        squot64(sext_i32_i64(virt_group_id_134393) *\n                                                squot64(segred_group_sizze_124801,\n                                                        segment_sizze_nonzzero_134382) +\n                                                sext_i32_i64(local_tid_134385),\n                                                t_n_m_114591) * t_n_m_114591)] =\n                    ((__local\n                      float *) red_arr_mem_134389)[(sext_i32_i64(local_tid_134385) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134382 -\n                                                   (int64_t) 1];\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_124801\n}\n__ker",
                   "nel void mainzisegred_small_125209(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134681_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134679_backing_aligned_1,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t t_window_114537,\n                                        int64_t t_jump_114541,\n                                        int64_t t_n_m_114591, int64_t i_114610,\n                                        int64_t num_groups_125662,\n                                        int64_t segment_sizze_nonzzero_134672,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130606,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130607,\n                                        __global unsigned char *mem_130861,\n                                        __global\n                                        unsigned char *defunc_4_map_res_mem_131267,\n                                        __global unsigned char *mem_131411,\n                                        __global unsigned char *mem_131415,\n                                        __global unsigned char *mem_131419,\n                                        __global unsigned char *mem_131424,\n                                        __global unsigned char *mem_131428)\n{\n    #define segred_group_sizze_125661 (mainzisegred_group_sizze_125203)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int ",
                   "block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_134681_backing_1 =\n                          (__local volatile\n                           char *) red_arr_mem_134681_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_134679_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_134679_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_134674;\n    int32_t local_tid_134675;\n    int64_t group_sizze_134678;\n    int32_t wave_sizze_134677;\n    int32_t group_tid_134676;\n    \n    global_tid_134674 = get_global_id(0);\n    local_tid_134675 = get_local_id(0);\n    group_sizze_134678 = get_local_size(0);\n    wave_sizze_134677 = LOCKSTEP_WIDTH;\n    group_tid_134676 = get_group_id(0);\n    \n    int32_t phys_tid_125209 = global_tid_134674;\n    __local char *red_arr_mem_134679;\n    \n    red_arr_mem_134679 = (__local char *) red_arr_mem_134679_backing_0;\n    \n    __local char *red_arr_mem_134681;\n    \n    red_arr_mem_134681 = (__local char *) red_arr_mem_134681_backing_1;\n    \n    int32_t phys_group_id_134683;\n    \n    phys_group_id_134683 = get_group_id(0);\n    for (int32_t i_134684 = 0; i_134684 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533 * t_n_m_114591,\n                                          squot64(segred_group_sizze_125661,\n                                                  segment_sizze_nonzzero_134672))) -\n                   phys_group_id_134683, sext_i64_i32(num_groups_125662));\n         i_134684++) {\n        int32_t virt_group_id_134685 = phys_group_id_134683 + i_134684 *\n                sext_i64_i32(num_groups_125662);\n        int64_t slice_134686 = t_n_m_114591;\n        int64_t slice_134687 = m_114533 * slice_134686;\n        int64_t gtid_125198 = squot64(squot64(sext_i32_i64(local_tid_134675),\n                                              segment_sizze_nonzzero_134672) +\n                                      sext_i32_i64(virt_group_id_1346",
                   "85) *\n                                      squot64(segred_group_sizze_125661,\n                                              segment_sizze_nonzzero_134672),\n                                      slice_134686);\n        int64_t remnant_134688 = squot64(sext_i32_i64(local_tid_134675),\n                                         segment_sizze_nonzzero_134672) +\n                sext_i32_i64(virt_group_id_134685) *\n                squot64(segred_group_sizze_125661,\n                        segment_sizze_nonzzero_134672) - gtid_125198 *\n                slice_134686;\n        int64_t gtid_125199 = remnant_134688;\n        int64_t remnant_134689 = remnant_134688 - gtid_125199;\n        int64_t gtid_125208 = srem64(sext_i32_i64(local_tid_134675),\n                                     t_window_114537);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, t_window_114537) && ((slt64(gtid_125198,\n                                                               m_114533) &&\n                                                         slt64(gtid_125199,\n                                                               t_n_m_114591)) &&\n                                                        slt64(sext_i32_i64(local_tid_134675),\n                                                              t_window_114537 *\n                                                              squot64(segred_group_sizze_125661,\n                                                                      segment_sizze_nonzzero_134672)))) {\n                int64_t x_125677 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_125198];\n                int64_t x_125682 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130606)[gtid_125198 *\n                                                                             t_n_m_114591 +\n                                                                             gtid_125199];\n",
                   "                float x_125683 = ((__global\n                                   float *) defunc_3_map_res_mem_130607)[gtid_125198 *\n                                                                         t_n_m_114591 +\n                                                                         gtid_125199];\n                int64_t binop_y_128967 = mul64(t_jump_114541, gtid_125199);\n                int64_t convop_x_128968 = smin64(i_114610, binop_y_128967);\n                float index_primexp_128969 = sitofp_i64_f32(convop_x_128968);\n                float a11_125685 = ((__global float *) mem_131411)[gtid_125198 *\n                                                                   t_n_m_114591 +\n                                                                   gtid_125199];\n                float b11_125686 = ((__global float *) mem_131415)[gtid_125198 *\n                                                                   t_n_m_114591 +\n                                                                   gtid_125199];\n                float c11_125687 = ((__global float *) mem_131419)[gtid_125198 *\n                                                                   t_n_m_114591 +\n                                                                   gtid_125199];\n                bool cond_125689 = sle64(x_125677, gtid_125208);\n                float defunc_0_f_res_125690;\n                \n                if (cond_125689) {\n                    defunc_0_f_res_125690 = 0.0F;\n                } else {\n                    int64_t i_125691 = add64(gtid_125208, x_125682);\n                    float x_125692 = ((__global\n                                       float *) mem_130122)[gtid_125198 *\n                                                            n_114534 +\n                                                            i_125691];\n                    float defunc_0_f_res_f_res_125693 = 1.0F + x_125692;\n                    \n                    defunc_0_f_res_125690 = defunc_0_f_res_f_res_125",
                   "693;\n                }\n                \n                float defunc_0_f_res_125694;\n                \n                if (cond_125689) {\n                    defunc_0_f_res_125694 = 0.0F;\n                } else {\n                    int64_t i_125695 = add64(gtid_125208, x_125682);\n                    float x_125696 = ((__global\n                                       float *) mem_130861)[gtid_125198 *\n                                                            n_114534 +\n                                                            i_125695];\n                    \n                    defunc_0_f_res_125694 = x_125696;\n                }\n                \n                float x_j_125697 = defunc_0_f_res_125690 - index_primexp_128969;\n                float abs_res_125698 = (float) fabs(x_j_125697);\n                float tmp1_125699 = abs_res_125698 / x_125683;\n                float x_125700 = tmp1_125699 * tmp1_125699;\n                float y_125701 = tmp1_125699 * x_125700;\n                float tmp2_125702 = 1.0F - y_125701;\n                float x_125703 = tmp2_125702 * tmp2_125702;\n                float tmp3_125704 = tmp2_125702 * x_125703;\n                float tmp4_125705 = defunc_0_f_res_125694 * tmp3_125704;\n                float defunc_1_f_res_125706 = x_j_125697 * tmp4_125705;\n                float defunc_0_f_res_125707;\n                \n                if (cond_125689) {\n                    defunc_0_f_res_125707 = 0.0F;\n                } else {\n                    int64_t i_125708 = add64(gtid_125208, x_125682);\n                    float x_125709 = ((__global\n                                       float *) defunc_4_map_res_mem_131267)[gtid_125198 *\n                                                                             n_114534 +\n                                                                             i_125708];\n                    \n                    defunc_0_f_res_125707 = x_125709;\n                }\n                \n                float x_125710 = a1",
                   "1_125685 * tmp4_125705;\n                float y_125711 = b11_125686 * defunc_1_f_res_125706;\n                float x_125712 = x_125710 + y_125711;\n                float defunc_9_fit_fun_res_125713 = defunc_0_f_res_125707 *\n                      x_125712;\n                float x_125714 = b11_125686 * tmp4_125705;\n                float y_125715 = c11_125687 * defunc_1_f_res_125706;\n                float x_125716 = x_125714 + y_125715;\n                float defunc_9_slope_fun_res_125717 = defunc_0_f_res_125707 *\n                      x_125716;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_134679)[sext_i32_i64(local_tid_134675)] =\n                        defunc_9_fit_fun_res_125713;\n                    ((__local\n                      float *) red_arr_mem_134681)[sext_i32_i64(local_tid_134675)] =\n                        defunc_9_slope_fun_res_125717;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_134679)[sext_i32_i64(local_tid_134675)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_134681)[sext_i32_i64(local_tid_134675)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, t_window_114537)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_125666;\n                float x_125667;\n                float x_125668;\n                float x_125669;\n                float x_134690;\n                float x_134691;\n                float x_134692;\n                float x_134693;\n                bool ltid_in_bounds_134696 =\n                     slt64(sext_i32_i64(local_tid_134675), t_window_114537 *\n                           squot64(segred_group_sizze_125661,\n                                   segment_",
                   "sizze_nonzzero_134672));\n                int32_t skip_threads_134697;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_134696) {\n                        x_125668 = ((volatile __local\n                                     float *) red_arr_mem_134679)[sext_i32_i64(local_tid_134675)];\n                        x_125669 = ((volatile __local\n                                     float *) red_arr_mem_134681)[sext_i32_i64(local_tid_134675)];\n                        if ((local_tid_134675 - squot32(local_tid_134675, 32) *\n                             32) == 0) {\n                            x_125666 = x_125668;\n                            x_125667 = x_125669;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_134697 = 1;\n                    while (slt32(skip_threads_134697, 32)) {\n                        if (sle32(skip_threads_134697, local_tid_134675 -\n                                  squot32(local_tid_134675, 32) * 32) &&\n                            ltid_in_bounds_134696) {\n                            // read operands\n                            {\n                                x_125666 = ((volatile __local\n                                             float *) red_arr_mem_134679)[sext_i32_i64(local_tid_134675) -\n                                                                          sext_i32_i64(skip_threads_134697)];\n                                x_125667 = ((volatile __local\n                                             float *) red_arr_mem_134681)[sext_i32_i64(local_tid_134675) -\n                                                                          sext_i32_i64(skip_threads_134697)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_134698 =\n                      ",
                   "               slt64(srem64(sext_i32_i64(local_tid_134675),\n                                                  t_window_114537),\n                                           sext_i32_i64(local_tid_134675) -\n                                           sext_i32_i64(local_tid_134675 -\n                                           skip_threads_134697));\n                                \n                                if (inactive_134698) {\n                                    x_125666 = x_125668;\n                                    x_125667 = x_125669;\n                                }\n                                if (!inactive_134698) {\n                                    float defunc_1_op_res_125670 = x_125666 +\n                                          x_125668;\n                                    float defunc_1_op_res_125671 = x_125667 +\n                                          x_125669;\n                                    \n                                    x_125666 = defunc_1_op_res_125670;\n                                    x_125667 = defunc_1_op_res_125671;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_134677, skip_threads_134697)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_134697, local_tid_134675 -\n                                  squot32(local_tid_134675, 32) * 32) &&\n                            ltid_in_bounds_134696) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_134679)[sext_i32_i64(local_tid_134675)] =\n                                    x_125666;\n                                x_125668 = x_125666;\n                                ((volatile __local\n                                  float *) red_arr_mem_134681)[sext_i32_i64(local_tid_134675)] =\n    ",
                   "                                x_125667;\n                                x_125669 = x_125667;\n                            }\n                        }\n                        if (sle32(wave_sizze_134677, skip_threads_134697)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_134697 *= 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_134675 - squot32(local_tid_134675, 32) *\n                         32) == 31 && ltid_in_bounds_134696) {\n                        ((volatile __local\n                          float *) red_arr_mem_134679)[sext_i32_i64(squot32(local_tid_134675,\n                                                                            32))] =\n                            x_125666;\n                        ((volatile __local\n                          float *) red_arr_mem_134681)[sext_i32_i64(squot32(local_tid_134675,\n                                                                            32))] =\n                            x_125667;\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_134699;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_134675, 32) == 0 &&\n                            ltid_in_bounds_134696) {\n                            x_134692 = ((volatile __local\n                                         float *) red_arr_mem_134679)[sext_i32_i64(local_tid_134675)];\n                            x_134693 = ((volatile __local\n                                         float *) red_arr_mem_134681)[sext_i32_i64(local_tid_134675)];\n              ",
                   "              if ((local_tid_134675 - squot32(local_tid_134675,\n                                                            32) * 32) == 0) {\n                                x_134690 = x_134692;\n                                x_134691 = x_134693;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_134699 = 1;\n                        while (slt32(skip_threads_134699, 32)) {\n                            if (sle32(skip_threads_134699, local_tid_134675 -\n                                      squot32(local_tid_134675, 32) * 32) &&\n                                (squot32(local_tid_134675, 32) == 0 &&\n                                 ltid_in_bounds_134696)) {\n                                // read operands\n                                {\n                                    x_134690 = ((volatile __local\n                                                 float *) red_arr_mem_134679)[sext_i32_i64(local_tid_134675) -\n                                                                              sext_i32_i64(skip_threads_134699)];\n                                    x_134691 = ((volatile __local\n                                                 float *) red_arr_mem_134681)[sext_i32_i64(local_tid_134675) -\n                                                                              sext_i32_i64(skip_threads_134699)];\n                                }\n                                // perform operation\n                                {\n                                    bool inactive_134700 =\n                                         slt64(srem64(sext_i32_i64(local_tid_134675 *\n                                                      32 + 32 - 1),\n                                                      t_window_114537),\n                                               sext_i32_i64(local_tid_134675 *\n                                   ",
                   "            32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_134675 -\n                                                             skip_threads_134699) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_134700) {\n                                        x_134690 = x_134692;\n                                        x_134691 = x_134693;\n                                    }\n                                    if (!inactive_134700) {\n                                        float defunc_1_op_res_134694 =\n                                              x_134690 + x_134692;\n                                        float defunc_1_op_res_134695 =\n                                              x_134691 + x_134693;\n                                        \n                                        x_134690 = defunc_1_op_res_134694;\n                                        x_134691 = defunc_1_op_res_134695;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_134677, skip_threads_134699)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_134699, local_tid_134675 -\n                                      squot32(local_tid_134675, 32) * 32) &&\n                                (squot32(local_tid_134675, 32) == 0 &&\n                                 ltid_in_bounds_134696)) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_134679)[sext_i32_i64(local_tid_134675)] =\n                                        x_134690;\n                                    x_134692 = x_134690;\n                                    ((volatile __local\n    ",
                   "                                  float *) red_arr_mem_134681)[sext_i32_i64(local_tid_134675)] =\n                                        x_134691;\n                                    x_134693 = x_134691;\n                                }\n                            }\n                            if (sle32(wave_sizze_134677, skip_threads_134699)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_134699 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n                    if (!(squot32(local_tid_134675, 32) == 0 ||\n                          !ltid_in_bounds_134696)) {\n                        // read operands\n                        {\n                            x_125668 = x_125666;\n                            x_125669 = x_125667;\n                            x_125666 = ((__local\n                                         float *) red_arr_mem_134679)[sext_i32_i64(squot32(local_tid_134675,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                            x_125667 = ((__local\n                                         float *) red_arr_mem_134681)[sext_i32_i64(squot32(local_tid_134675,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_134701 =\n                                 slt64(srem64(sext_i32_i64(local_tid_134675),\n                                              t_window_114537),\n                                       sext_i32_i64(local_tid_",
                   "134675) -\n                                       sext_i32_i64(squot32(local_tid_134675,\n                                                            32) * 32 - 1));\n                            \n                            if (inactive_134701) {\n                                x_125666 = x_125668;\n                                x_125667 = x_125669;\n                            }\n                            if (!inactive_134701) {\n                                float defunc_1_op_res_125670 = x_125666 +\n                                      x_125668;\n                                float defunc_1_op_res_125671 = x_125667 +\n                                      x_125669;\n                                \n                                x_125666 = defunc_1_op_res_125670;\n                                x_125667 = defunc_1_op_res_125671;\n                            }\n                        }\n                        // write final result\n                        {\n                            ((__local\n                              float *) red_arr_mem_134679)[sext_i32_i64(local_tid_134675)] =\n                                x_125666;\n                            ((__local\n                              float *) red_arr_mem_134681)[sext_i32_i64(local_tid_134675)] =\n                                x_125667;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_134675, 32) == 0) {\n                        ((__local\n                          float *) red_arr_mem_134679)[sext_i32_i64(local_tid_134675)] =\n                            x_125668;\n                        ((__local\n                          float *) red_arr_mem_134681)[sext_i32_i64(local_tid_134675)] =\n                            x_125669;\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_134685) *\n                      squot64(segred_group_sizze_125661,\n                              segment_sizze_nonzzero_134672) +\n                      sext_i32_i64(local_tid_134675), m_114533 *\n                      t_n_m_114591) && slt64(sext_i32_i64(local_tid_134675),\n                                             squot64(segred_group_sizze_125661,\n                                                     segment_sizze_nonzzero_134672))) {\n                ((__global\n                  float *) mem_131424)[squot64(sext_i32_i64(virt_group_id_134685) *\n                                               squot64(segred_group_sizze_125661,\n                                                       segment_sizze_nonzzero_134672) +\n                                               sext_i32_i64(local_tid_134675),\n                                               t_n_m_114591) * t_n_m_114591 +\n                                       (sext_i32_i64(virt_group_id_134685) *\n                                        squot64(segred_group_sizze_125661,\n                                                segment_sizze_nonzzero_134672) +\n                                        sext_i32_i64(local_tid_134675) -\n                                        squot64(sext_i32_i64(virt_group_id_134685) *\n                                                squot64(segred_group_sizze_125661,\n                                                        segment_sizze_nonzzero_134672) +\n                                                sext_i32_i64(local_tid_134675),\n                                                t_n_m_114591) * t_n_m_114591)] =\n                    ((__local\n                      float *) red_arr_mem_134679)[(sext_i32_i64(local_tid_134675) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_13467",
                   "2 -\n                                                   (int64_t) 1];\n                ((__global\n                  float *) mem_131428)[squot64(sext_i32_i64(virt_group_id_134685) *\n                                               squot64(segred_group_sizze_125661,\n                                                       segment_sizze_nonzzero_134672) +\n                                               sext_i32_i64(local_tid_134675),\n                                               t_n_m_114591) * t_n_m_114591 +\n                                       (sext_i32_i64(virt_group_id_134685) *\n                                        squot64(segred_group_sizze_125661,\n                                                segment_sizze_nonzzero_134672) +\n                                        sext_i32_i64(local_tid_134675) -\n                                        squot64(sext_i32_i64(virt_group_id_134685) *\n                                                squot64(segred_group_sizze_125661,\n                                                        segment_sizze_nonzzero_134672) +\n                                                sext_i32_i64(local_tid_134675),\n                                                t_n_m_114591) * t_n_m_114591)] =\n                    ((__local\n                      float *) red_arr_mem_134681)[(sext_i32_i64(local_tid_134675) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134672 -\n                                                   (int64_t) 1];\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_125661\n}\n__kernel void mainzisegred_small_125298(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134579_backing_aligned_0,\n                             ",
                   "           __local volatile\n                                        int64_t *red_arr_mem_134577_backing_aligned_1,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134575_backing_aligned_2,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t t_window_114537,\n                                        int64_t t_jump_114541,\n                                        int64_t t_n_m_114591, int64_t i_114610,\n                                        int64_t num_groups_125597,\n                                        int64_t segment_sizze_nonzzero_134568,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130606,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130607,\n                                        __global unsigned char *mem_130861,\n                                        __global unsigned char *mem_131398,\n                                        __global unsigned char *mem_131402,\n                                        __global unsigned char *mem_131406)\n{\n    #define segred_group_sizze_125596 (mainzisegred_group_sizze_125292)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_134579_backing_2 =\n                          (__local volatile\n                           char *) red_arr_mem_134579_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_134577_backing_1 =\n                          (__local volatile\n                           char *) red_arr_mem_134577_backing_aligne",
                   "d_1;\n    __local volatile char *restrict red_arr_mem_134575_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_134575_backing_aligned_2;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_134570;\n    int32_t local_tid_134571;\n    int64_t group_sizze_134574;\n    int32_t wave_sizze_134573;\n    int32_t group_tid_134572;\n    \n    global_tid_134570 = get_global_id(0);\n    local_tid_134571 = get_local_id(0);\n    group_sizze_134574 = get_local_size(0);\n    wave_sizze_134573 = LOCKSTEP_WIDTH;\n    group_tid_134572 = get_group_id(0);\n    \n    int32_t phys_tid_125298 = global_tid_134570;\n    __local char *red_arr_mem_134575;\n    \n    red_arr_mem_134575 = (__local char *) red_arr_mem_134575_backing_0;\n    \n    __local char *red_arr_mem_134577;\n    \n    red_arr_mem_134577 = (__local char *) red_arr_mem_134577_backing_1;\n    \n    __local char *red_arr_mem_134579;\n    \n    red_arr_mem_134579 = (__local char *) red_arr_mem_134579_backing_2;\n    \n    int32_t phys_group_id_134581;\n    \n    phys_group_id_134581 = get_group_id(0);\n    for (int32_t i_134582 = 0; i_134582 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533 * t_n_m_114591,\n                                          squot64(segred_group_sizze_125596,\n                                                  segment_sizze_nonzzero_134568))) -\n                   phys_group_id_134581, sext_i64_i32(num_groups_125597));\n         i_134582++) {\n        int32_t virt_group_id_134583 = phys_group_id_134581 + i_134582 *\n                sext_i64_i32(num_groups_125597);\n        int64_t slice_134584 = t_n_m_114591;\n        int64_t slice_134585 = m_114533 * slice_134584;\n        int64_t gtid_125287 = squot64(squot64(sext_i32_i64(local_tid_134571),\n                                              segment_sizze_nonzzero_134568) +\n                                      sext_i32_i64(virt_group_id_134583) *\n                                      squot64(segred_group_sizze_1255",
                   "96,\n                                              segment_sizze_nonzzero_134568),\n                                      slice_134584);\n        int64_t remnant_134586 = squot64(sext_i32_i64(local_tid_134571),\n                                         segment_sizze_nonzzero_134568) +\n                sext_i32_i64(virt_group_id_134583) *\n                squot64(segred_group_sizze_125596,\n                        segment_sizze_nonzzero_134568) - gtid_125287 *\n                slice_134584;\n        int64_t gtid_125288 = remnant_134586;\n        int64_t remnant_134587 = remnant_134586 - gtid_125288;\n        int64_t gtid_125297 = srem64(sext_i32_i64(local_tid_134571),\n                                     t_window_114537);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, t_window_114537) && ((slt64(gtid_125287,\n                                                               m_114533) &&\n                                                         slt64(gtid_125288,\n                                                               t_n_m_114591)) &&\n                                                        slt64(sext_i32_i64(local_tid_134571),\n                                                              t_window_114537 *\n                                                              squot64(segred_group_sizze_125596,\n                                                                      segment_sizze_nonzzero_134568)))) {\n                int64_t x_125615 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_125287];\n                int64_t x_125617 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130606)[gtid_125287 *\n                                                                             t_n_m_114591 +\n                                                                             gtid_125288];\n                float x_125618 = ((__global\n                               ",
                   "    float *) defunc_3_map_res_mem_130607)[gtid_125287 *\n                                                                         t_n_m_114591 +\n                                                                         gtid_125288];\n                int64_t binop_y_128960 = mul64(t_jump_114541, gtid_125288);\n                int64_t convop_x_128961 = smin64(i_114610, binop_y_128960);\n                float index_primexp_128962 = sitofp_i64_f32(convop_x_128961);\n                bool cond_125621 = sle64(x_125615, gtid_125297);\n                float defunc_0_f_res_125622;\n                \n                if (cond_125621) {\n                    defunc_0_f_res_125622 = 0.0F;\n                } else {\n                    int64_t i_125623 = add64(gtid_125297, x_125617);\n                    float x_125624 = ((__global\n                                       float *) mem_130122)[gtid_125287 *\n                                                            n_114534 +\n                                                            i_125623];\n                    float defunc_0_f_res_f_res_125625 = 1.0F + x_125624;\n                    \n                    defunc_0_f_res_125622 = defunc_0_f_res_f_res_125625;\n                }\n                \n                float defunc_0_f_res_125626;\n                \n                if (cond_125621) {\n                    defunc_0_f_res_125626 = 0.0F;\n                } else {\n                    int64_t i_125627 = add64(gtid_125297, x_125617);\n                    float x_125628 = ((__global\n                                       float *) mem_130861)[gtid_125287 *\n                                                            n_114534 +\n                                                            i_125627];\n                    \n                    defunc_0_f_res_125626 = x_125628;\n                }\n                \n                float x_j_125629 = defunc_0_f_res_125622 - index_primexp_128962;\n                float abs_res_125630 = (float) fabs(x_j_125629);\n      ",
                   "          float tmp1_125631 = abs_res_125630 / x_125618;\n                float x_125632 = tmp1_125631 * tmp1_125631;\n                float y_125633 = tmp1_125631 * x_125632;\n                float tmp2_125634 = 1.0F - y_125633;\n                float x_125635 = tmp2_125634 * tmp2_125634;\n                float tmp3_125636 = tmp2_125634 * x_125635;\n                float w_j_125637 = defunc_0_f_res_125626 * tmp3_125636;\n                float xw_j_125638 = x_j_125629 * w_j_125637;\n                float x2w_j_125639 = x_j_125629 * xw_j_125638;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_134575)[sext_i32_i64(local_tid_134571)] =\n                        w_j_125637;\n                    ((__local\n                      float *) red_arr_mem_134577)[sext_i32_i64(local_tid_134571)] =\n                        xw_j_125638;\n                    ((__local\n                      float *) red_arr_mem_134579)[sext_i32_i64(local_tid_134571)] =\n                        x2w_j_125639;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_134575)[sext_i32_i64(local_tid_134571)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_134577)[sext_i32_i64(local_tid_134571)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_134579)[sext_i32_i64(local_tid_134571)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, t_window_114537)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_125602;\n                float x_125603;\n                float x_125604;\n                float x_125605;\n                float x_125606;\n                float x_125607;\n                float x_134588;\n            ",
                   "    float x_134589;\n                float x_134590;\n                float x_134591;\n                float x_134592;\n                float x_134593;\n                bool ltid_in_bounds_134597 =\n                     slt64(sext_i32_i64(local_tid_134571), t_window_114537 *\n                           squot64(segred_group_sizze_125596,\n                                   segment_sizze_nonzzero_134568));\n                int32_t skip_threads_134598;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_134597) {\n                        x_125605 = ((volatile __local\n                                     float *) red_arr_mem_134575)[sext_i32_i64(local_tid_134571)];\n                        x_125606 = ((volatile __local\n                                     float *) red_arr_mem_134577)[sext_i32_i64(local_tid_134571)];\n                        x_125607 = ((volatile __local\n                                     float *) red_arr_mem_134579)[sext_i32_i64(local_tid_134571)];\n                        if ((local_tid_134571 - squot32(local_tid_134571, 32) *\n                             32) == 0) {\n                            x_125602 = x_125605;\n                            x_125603 = x_125606;\n                            x_125604 = x_125607;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_134598 = 1;\n                    while (slt32(skip_threads_134598, 32)) {\n                        if (sle32(skip_threads_134598, local_tid_134571 -\n                                  squot32(local_tid_134571, 32) * 32) &&\n                            ltid_in_bounds_134597) {\n                            // read operands\n                            {\n                                x_125602 = ((volatile __local\n                                             float *) red_arr_mem_134575)[sext_i32_i64(local_tid_134571) ",
                   "-\n                                                                          sext_i32_i64(skip_threads_134598)];\n                                x_125603 = ((volatile __local\n                                             float *) red_arr_mem_134577)[sext_i32_i64(local_tid_134571) -\n                                                                          sext_i32_i64(skip_threads_134598)];\n                                x_125604 = ((volatile __local\n                                             float *) red_arr_mem_134579)[sext_i32_i64(local_tid_134571) -\n                                                                          sext_i32_i64(skip_threads_134598)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_134599 =\n                                     slt64(srem64(sext_i32_i64(local_tid_134571),\n                                                  t_window_114537),\n                                           sext_i32_i64(local_tid_134571) -\n                                           sext_i32_i64(local_tid_134571 -\n                                           skip_threads_134598));\n                                \n                                if (inactive_134599) {\n                                    x_125602 = x_125605;\n                                    x_125603 = x_125606;\n                                    x_125604 = x_125607;\n                                }\n                                if (!inactive_134599) {\n                                    float defunc_1_op_res_125608 = x_125602 +\n                                          x_125605;\n                                    float defunc_1_op_res_125609 = x_125603 +\n                                          x_125606;\n                                    float defunc_1_op_res_125610 = x_125604 +\n                                          x_125607;\n                                    \n                       ",
                   "             x_125602 = defunc_1_op_res_125608;\n                                    x_125603 = defunc_1_op_res_125609;\n                                    x_125604 = defunc_1_op_res_125610;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_134573, skip_threads_134598)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_134598, local_tid_134571 -\n                                  squot32(local_tid_134571, 32) * 32) &&\n                            ltid_in_bounds_134597) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_134575)[sext_i32_i64(local_tid_134571)] =\n                                    x_125602;\n                                x_125605 = x_125602;\n                                ((volatile __local\n                                  float *) red_arr_mem_134577)[sext_i32_i64(local_tid_134571)] =\n                                    x_125603;\n                                x_125606 = x_125603;\n                                ((volatile __local\n                                  float *) red_arr_mem_134579)[sext_i32_i64(local_tid_134571)] =\n                                    x_125604;\n                                x_125607 = x_125604;\n                            }\n                        }\n                        if (sle32(wave_sizze_134573, skip_threads_134598)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_134598 *= 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_134571 - squot32(local_tid_134571, 32) *\n                     ",
                   "    32) == 31 && ltid_in_bounds_134597) {\n                        ((volatile __local\n                          float *) red_arr_mem_134575)[sext_i32_i64(squot32(local_tid_134571,\n                                                                            32))] =\n                            x_125602;\n                        ((volatile __local\n                          float *) red_arr_mem_134577)[sext_i32_i64(squot32(local_tid_134571,\n                                                                            32))] =\n                            x_125603;\n                        ((volatile __local\n                          float *) red_arr_mem_134579)[sext_i32_i64(squot32(local_tid_134571,\n                                                                            32))] =\n                            x_125604;\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_134600;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_134571, 32) == 0 &&\n                            ltid_in_bounds_134597) {\n                            x_134591 = ((volatile __local\n                                         float *) red_arr_mem_134575)[sext_i32_i64(local_tid_134571)];\n                            x_134592 = ((volatile __local\n                                         float *) red_arr_mem_134577)[sext_i32_i64(local_tid_134571)];\n                            x_134593 = ((volatile __local\n                                         float *) red_arr_mem_134579)[sext_i32_i64(local_tid_134571)];\n                            if ((local_tid_134571 - squot32(local_tid_134571,\n                                                            32) * 32) == 0) {\n                                x_134588 = x_134591;\n                        ",
                   "        x_134589 = x_134592;\n                                x_134590 = x_134593;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_134600 = 1;\n                        while (slt32(skip_threads_134600, 32)) {\n                            if (sle32(skip_threads_134600, local_tid_134571 -\n                                      squot32(local_tid_134571, 32) * 32) &&\n                                (squot32(local_tid_134571, 32) == 0 &&\n                                 ltid_in_bounds_134597)) {\n                                // read operands\n                                {\n                                    x_134588 = ((volatile __local\n                                                 float *) red_arr_mem_134575)[sext_i32_i64(local_tid_134571) -\n                                                                              sext_i32_i64(skip_threads_134600)];\n                                    x_134589 = ((volatile __local\n                                                 float *) red_arr_mem_134577)[sext_i32_i64(local_tid_134571) -\n                                                                              sext_i32_i64(skip_threads_134600)];\n                                    x_134590 = ((volatile __local\n                                                 float *) red_arr_mem_134579)[sext_i32_i64(local_tid_134571) -\n                                                                              sext_i32_i64(skip_threads_134600)];\n                                }\n                                // perform operation\n                                {\n                                    bool inactive_134601 =\n                                         slt64(srem64(sext_i32_i64(local_tid_134571 *\n                                                      32 + 32 - 1),\n                                                      t_windo",
                   "w_114537),\n                                               sext_i32_i64(local_tid_134571 *\n                                               32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_134571 -\n                                                             skip_threads_134600) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_134601) {\n                                        x_134588 = x_134591;\n                                        x_134589 = x_134592;\n                                        x_134590 = x_134593;\n                                    }\n                                    if (!inactive_134601) {\n                                        float defunc_1_op_res_134594 =\n                                              x_134588 + x_134591;\n                                        float defunc_1_op_res_134595 =\n                                              x_134589 + x_134592;\n                                        float defunc_1_op_res_134596 =\n                                              x_134590 + x_134593;\n                                        \n                                        x_134588 = defunc_1_op_res_134594;\n                                        x_134589 = defunc_1_op_res_134595;\n                                        x_134590 = defunc_1_op_res_134596;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_134573, skip_threads_134600)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_134600, local_tid_134571 -\n                                      squot32(local_tid_134571, 32) * 32) &&\n                                (squot32(local_tid_134571, 32) == 0 &&\n                                 ltid_in_bounds_134597)) {\n     ",
                   "                           // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_134575)[sext_i32_i64(local_tid_134571)] =\n                                        x_134588;\n                                    x_134591 = x_134588;\n                                    ((volatile __local\n                                      float *) red_arr_mem_134577)[sext_i32_i64(local_tid_134571)] =\n                                        x_134589;\n                                    x_134592 = x_134589;\n                                    ((volatile __local\n                                      float *) red_arr_mem_134579)[sext_i32_i64(local_tid_134571)] =\n                                        x_134590;\n                                    x_134593 = x_134590;\n                                }\n                            }\n                            if (sle32(wave_sizze_134573, skip_threads_134600)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_134600 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n                    if (!(squot32(local_tid_134571, 32) == 0 ||\n                          !ltid_in_bounds_134597)) {\n                        // read operands\n                        {\n                            x_125605 = x_125602;\n                            x_125606 = x_125603;\n                            x_125607 = x_125604;\n                            x_125602 = ((__local\n                                         float *) red_arr_mem_134575)[sext_i32_i64(squot32(local_tid_134571,\n                                                                                           32)) -\n                                                                 ",
                   "     (int64_t) 1];\n                            x_125603 = ((__local\n                                         float *) red_arr_mem_134577)[sext_i32_i64(squot32(local_tid_134571,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                            x_125604 = ((__local\n                                         float *) red_arr_mem_134579)[sext_i32_i64(squot32(local_tid_134571,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_134602 =\n                                 slt64(srem64(sext_i32_i64(local_tid_134571),\n                                              t_window_114537),\n                                       sext_i32_i64(local_tid_134571) -\n                                       sext_i32_i64(squot32(local_tid_134571,\n                                                            32) * 32 - 1));\n                            \n                            if (inactive_134602) {\n                                x_125602 = x_125605;\n                                x_125603 = x_125606;\n                                x_125604 = x_125607;\n                            }\n                            if (!inactive_134602) {\n                                float defunc_1_op_res_125608 = x_125602 +\n                                      x_125605;\n                                float defunc_1_op_res_125609 = x_125603 +\n                                      x_125606;\n                                float defunc_1_op_res_125610 = x_125604 +\n                                      x_125607;\n                                \n                                x_125602 = defunc_1_op_res_125608",
                   ";\n                                x_125603 = defunc_1_op_res_125609;\n                                x_125604 = defunc_1_op_res_125610;\n                            }\n                        }\n                        // write final result\n                        {\n                            ((__local\n                              float *) red_arr_mem_134575)[sext_i32_i64(local_tid_134571)] =\n                                x_125602;\n                            ((__local\n                              float *) red_arr_mem_134577)[sext_i32_i64(local_tid_134571)] =\n                                x_125603;\n                            ((__local\n                              float *) red_arr_mem_134579)[sext_i32_i64(local_tid_134571)] =\n                                x_125604;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_134571, 32) == 0) {\n                        ((__local\n                          float *) red_arr_mem_134575)[sext_i32_i64(local_tid_134571)] =\n                            x_125605;\n                        ((__local\n                          float *) red_arr_mem_134577)[sext_i32_i64(local_tid_134571)] =\n                            x_125606;\n                        ((__local\n                          float *) red_arr_mem_134579)[sext_i32_i64(local_tid_134571)] =\n                            x_125607;\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_134583) *\n                      squot64(segred_group_sizze_125596,\n                              segment_sizze_nonzzero_134568) +\n                      sext_i32_i64(local_tid_134571), m_114533 *\n                      t_n_m_114591) && sl",
                   "t64(sext_i32_i64(local_tid_134571),\n                                             squot64(segred_group_sizze_125596,\n                                                     segment_sizze_nonzzero_134568))) {\n                ((__global\n                  float *) mem_131398)[squot64(sext_i32_i64(virt_group_id_134583) *\n                                               squot64(segred_group_sizze_125596,\n                                                       segment_sizze_nonzzero_134568) +\n                                               sext_i32_i64(local_tid_134571),\n                                               t_n_m_114591) * t_n_m_114591 +\n                                       (sext_i32_i64(virt_group_id_134583) *\n                                        squot64(segred_group_sizze_125596,\n                                                segment_sizze_nonzzero_134568) +\n                                        sext_i32_i64(local_tid_134571) -\n                                        squot64(sext_i32_i64(virt_group_id_134583) *\n                                                squot64(segred_group_sizze_125596,\n                                                        segment_sizze_nonzzero_134568) +\n                                                sext_i32_i64(local_tid_134571),\n                                                t_n_m_114591) * t_n_m_114591)] =\n                    ((__local\n                      float *) red_arr_mem_134575)[(sext_i32_i64(local_tid_134571) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134568 -\n                                                   (int64_t) 1];\n                ((__global\n                  float *) mem_131402)[squot64(sext_i32_i64(virt_group_id_134583) *\n                                               squot64(segred_group_sizze_125596,\n                                                       segment_sizze_nonzzero_134568) +\n                       ",
                   "                        sext_i32_i64(local_tid_134571),\n                                               t_n_m_114591) * t_n_m_114591 +\n                                       (sext_i32_i64(virt_group_id_134583) *\n                                        squot64(segred_group_sizze_125596,\n                                                segment_sizze_nonzzero_134568) +\n                                        sext_i32_i64(local_tid_134571) -\n                                        squot64(sext_i32_i64(virt_group_id_134583) *\n                                                squot64(segred_group_sizze_125596,\n                                                        segment_sizze_nonzzero_134568) +\n                                                sext_i32_i64(local_tid_134571),\n                                                t_n_m_114591) * t_n_m_114591)] =\n                    ((__local\n                      float *) red_arr_mem_134577)[(sext_i32_i64(local_tid_134571) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134568 -\n                                                   (int64_t) 1];\n                ((__global\n                  float *) mem_131406)[squot64(sext_i32_i64(virt_group_id_134583) *\n                                               squot64(segred_group_sizze_125596,\n                                                       segment_sizze_nonzzero_134568) +\n                                               sext_i32_i64(local_tid_134571),\n                                               t_n_m_114591) * t_n_m_114591 +\n                                       (sext_i32_i64(virt_group_id_134583) *\n                                        squot64(segred_group_sizze_125596,\n                                                segment_sizze_nonzzero_134568) +\n                                        sext_i32_i64(local_tid_134571) -\n                                        squot64(sext_i32_i64(virt_gr",
                   "oup_id_134583) *\n                                                squot64(segred_group_sizze_125596,\n                                                        segment_sizze_nonzzero_134568) +\n                                                sext_i32_i64(local_tid_134571),\n                                                t_n_m_114591) * t_n_m_114591)] =\n                    ((__local\n                      float *) red_arr_mem_134579)[(sext_i32_i64(local_tid_134571) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134568 -\n                                                   (int64_t) 1];\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_125596\n}\n__kernel void mainzisegred_small_126142(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134936_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134934_backing_aligned_1,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t t_window_114537,\n                                        int64_t t_jump_114541,\n                                        int64_t t_n_m_114591, int64_t i_114610,\n                                        int64_t num_groups_126738,\n                                        int64_t segment_sizze_nonzzero_134927,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_13",
                   "0606,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130607,\n                                        __global unsigned char *mem_130861,\n                                        __global\n                                        unsigned char *defunc_4_map_res_mem_131267,\n                                        __global unsigned char *mem_131529,\n                                        __global unsigned char *mem_131533,\n                                        __global unsigned char *mem_131537,\n                                        __global unsigned char *mem_131541,\n                                        __global unsigned char *mem_131545,\n                                        __global unsigned char *mem_131550,\n                                        __global unsigned char *mem_131554)\n{\n    #define segred_group_sizze_126737 (mainzisegred_group_sizze_126136)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_134936_backing_1 =\n                          (__local volatile\n                           char *) red_arr_mem_134936_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_134934_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_134934_backing_aligned_1;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_134929;\n    int32_t local_tid_134930;\n    int64_t group_sizze_134933;\n    int32_t wave_sizze_134932;\n    int32_t group_tid_134931;\n    \n    global_tid_134929 = get_global_id(0);\n    local_tid_134930 = get_local_id(0);\n    group_sizze_134933 = get_local_size(0);\n    wave_sizze_134932 = LOCKSTEP_WIDTH;\n    group_tid_134931 = get_group_id(0);\n    \n    int32_t phys_tid_126142 = global_tid_134929;\n    __local char *red_arr_mem_134934;\n    \n    red_arr_mem_134934 = (__local char *) red_arr_mem_134934_back",
                   "ing_0;\n    \n    __local char *red_arr_mem_134936;\n    \n    red_arr_mem_134936 = (__local char *) red_arr_mem_134936_backing_1;\n    \n    int32_t phys_group_id_134938;\n    \n    phys_group_id_134938 = get_group_id(0);\n    for (int32_t i_134939 = 0; i_134939 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533 * t_n_m_114591,\n                                          squot64(segred_group_sizze_126737,\n                                                  segment_sizze_nonzzero_134927))) -\n                   phys_group_id_134938, sext_i64_i32(num_groups_126738));\n         i_134939++) {\n        int32_t virt_group_id_134940 = phys_group_id_134938 + i_134939 *\n                sext_i64_i32(num_groups_126738);\n        int64_t slice_134941 = t_n_m_114591;\n        int64_t slice_134942 = m_114533 * slice_134941;\n        int64_t gtid_126131 = squot64(squot64(sext_i32_i64(local_tid_134930),\n                                              segment_sizze_nonzzero_134927) +\n                                      sext_i32_i64(virt_group_id_134940) *\n                                      squot64(segred_group_sizze_126737,\n                                              segment_sizze_nonzzero_134927),\n                                      slice_134941);\n        int64_t remnant_134943 = squot64(sext_i32_i64(local_tid_134930),\n                                         segment_sizze_nonzzero_134927) +\n                sext_i32_i64(virt_group_id_134940) *\n                squot64(segred_group_sizze_126737,\n                        segment_sizze_nonzzero_134927) - gtid_126131 *\n                slice_134941;\n        int64_t gtid_126132 = remnant_134943;\n        int64_t remnant_134944 = remnant_134943 - gtid_126132;\n        int64_t gtid_126141 = srem64(sext_i32_i64(local_tid_134930),\n                                     t_window_114537);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, t_window_114537) && ((slt64(gtid_126131,\n                                  ",
                   "                             m_114533) &&\n                                                         slt64(gtid_126132,\n                                                               t_n_m_114591)) &&\n                                                        slt64(sext_i32_i64(local_tid_134930),\n                                                              t_window_114537 *\n                                                              squot64(segred_group_sizze_126737,\n                                                                      segment_sizze_nonzzero_134927)))) {\n                int64_t x_126753 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_126131];\n                int64_t x_126760 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130606)[gtid_126131 *\n                                                                             t_n_m_114591 +\n                                                                             gtid_126132];\n                float x_126761 = ((__global\n                                   float *) defunc_3_map_res_mem_130607)[gtid_126131 *\n                                                                         t_n_m_114591 +\n                                                                         gtid_126132];\n                int64_t binop_y_129003 = mul64(t_jump_114541, gtid_126132);\n                int64_t convop_x_129004 = smin64(i_114610, binop_y_129003);\n                float index_primexp_129005 = sitofp_i64_f32(convop_x_129004);\n                float a12_126763 = ((__global float *) mem_131529)[gtid_126131 *\n                                                                   t_n_m_114591 +\n                                                                   gtid_126132];\n                float b12_126764 = ((__global float *) mem_131533)[gtid_126131 *\n                                                                   t_n_m_114591 +\n                        ",
                   "                                           gtid_126132];\n                float c12_126765 = ((__global float *) mem_131537)[gtid_126131 *\n                                                                   t_n_m_114591 +\n                                                                   gtid_126132];\n                float b2_126766 = ((__global float *) mem_131541)[gtid_126131 *\n                                                                  t_n_m_114591 +\n                                                                  gtid_126132];\n                float c2_126767 = ((__global float *) mem_131545)[gtid_126131 *\n                                                                  t_n_m_114591 +\n                                                                  gtid_126132];\n                bool cond_126769 = sle64(x_126753, gtid_126141);\n                float defunc_0_f_res_126770;\n                \n                if (cond_126769) {\n                    defunc_0_f_res_126770 = 0.0F;\n                } else {\n                    int64_t i_126771 = add64(gtid_126141, x_126760);\n                    float x_126772 = ((__global\n                                       float *) mem_130122)[gtid_126131 *\n                                                            n_114534 +\n                                                            i_126771];\n                    float defunc_0_f_res_f_res_126773 = 1.0F + x_126772;\n                    \n                    defunc_0_f_res_126770 = defunc_0_f_res_f_res_126773;\n                }\n                \n                float defunc_0_f_res_126774;\n                \n                if (cond_126769) {\n                    defunc_0_f_res_126774 = 0.0F;\n                } else {\n                    int64_t i_126775 = add64(gtid_126141, x_126760);\n                    float x_126776 = ((__global\n                                       float *) mem_130861)[gtid_126131 *\n                                                            n_114534 +\n           ",
                   "                                                 i_126775];\n                    \n                    defunc_0_f_res_126774 = x_126776;\n                }\n                \n                float x_j_126777 = defunc_0_f_res_126770 - index_primexp_129005;\n                float abs_res_126778 = (float) fabs(x_j_126777);\n                float tmp1_126779 = abs_res_126778 / x_126761;\n                float x_126780 = tmp1_126779 * tmp1_126779;\n                float y_126781 = tmp1_126779 * x_126780;\n                float tmp2_126782 = 1.0F - y_126781;\n                float x_126783 = tmp2_126782 * tmp2_126782;\n                float tmp3_126784 = tmp2_126782 * x_126783;\n                float tmp4_126785 = defunc_0_f_res_126774 * tmp3_126784;\n                float defunc_1_f_res_126786 = x_j_126777 * tmp4_126785;\n                float defunc_1_f_res_126787 = x_j_126777 *\n                      defunc_1_f_res_126786;\n                float defunc_0_f_res_126788;\n                \n                if (cond_126769) {\n                    defunc_0_f_res_126788 = 0.0F;\n                } else {\n                    int64_t i_126789 = add64(gtid_126141, x_126760);\n                    float x_126790 = ((__global\n                                       float *) defunc_4_map_res_mem_131267)[gtid_126131 *\n                                                                             n_114534 +\n                                                                             i_126789];\n                    \n                    defunc_0_f_res_126788 = x_126790;\n                }\n                \n                float x_126791 = a12_126763 * tmp4_126785;\n                float y_126792 = b12_126764 * defunc_1_f_res_126786;\n                float x_126793 = x_126791 + y_126792;\n                float y_126794 = c12_126765 * defunc_1_f_res_126787;\n                float x_126795 = x_126793 + y_126794;\n                float defunc_9_fit_fun_res_126796 = defunc_0_f_res_126788 *\n                      x_126795;\n   ",
                   "             float x_126797 = b12_126764 * tmp4_126785;\n                float y_126798 = b2_126766 * defunc_1_f_res_126786;\n                float x_126799 = x_126797 + y_126798;\n                float y_126800 = c2_126767 * defunc_1_f_res_126787;\n                float x_126801 = x_126799 + y_126800;\n                float defunc_9_slope_fun_res_126802 = defunc_0_f_res_126788 *\n                      x_126801;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_134934)[sext_i32_i64(local_tid_134930)] =\n                        defunc_9_fit_fun_res_126796;\n                    ((__local\n                      float *) red_arr_mem_134936)[sext_i32_i64(local_tid_134930)] =\n                        defunc_9_slope_fun_res_126802;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_134934)[sext_i32_i64(local_tid_134930)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_134936)[sext_i32_i64(local_tid_134930)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, t_window_114537)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_126742;\n                float x_126743;\n                float x_126744;\n                float x_126745;\n                float x_134945;\n                float x_134946;\n                float x_134947;\n                float x_134948;\n                bool ltid_in_bounds_134951 =\n                     slt64(sext_i32_i64(local_tid_134930), t_window_114537 *\n                           squot64(segred_group_sizze_126737,\n                                   segment_sizze_nonzzero_134927));\n                int32_t skip_threads_134952;\n                \n                // read input for in-block scan\n  ",
                   "              {\n                    if (ltid_in_bounds_134951) {\n                        x_126744 = ((volatile __local\n                                     float *) red_arr_mem_134934)[sext_i32_i64(local_tid_134930)];\n                        x_126745 = ((volatile __local\n                                     float *) red_arr_mem_134936)[sext_i32_i64(local_tid_134930)];\n                        if ((local_tid_134930 - squot32(local_tid_134930, 32) *\n                             32) == 0) {\n                            x_126742 = x_126744;\n                            x_126743 = x_126745;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_134952 = 1;\n                    while (slt32(skip_threads_134952, 32)) {\n                        if (sle32(skip_threads_134952, local_tid_134930 -\n                                  squot32(local_tid_134930, 32) * 32) &&\n                            ltid_in_bounds_134951) {\n                            // read operands\n                            {\n                                x_126742 = ((volatile __local\n                                             float *) red_arr_mem_134934)[sext_i32_i64(local_tid_134930) -\n                                                                          sext_i32_i64(skip_threads_134952)];\n                                x_126743 = ((volatile __local\n                                             float *) red_arr_mem_134936)[sext_i32_i64(local_tid_134930) -\n                                                                          sext_i32_i64(skip_threads_134952)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_134953 =\n                                     slt64(srem64(sext_i32_i64(local_tid_134930),\n                                                  t_window_114537),\n         ",
                   "                                  sext_i32_i64(local_tid_134930) -\n                                           sext_i32_i64(local_tid_134930 -\n                                           skip_threads_134952));\n                                \n                                if (inactive_134953) {\n                                    x_126742 = x_126744;\n                                    x_126743 = x_126745;\n                                }\n                                if (!inactive_134953) {\n                                    float defunc_1_op_res_126746 = x_126742 +\n                                          x_126744;\n                                    float defunc_1_op_res_126747 = x_126743 +\n                                          x_126745;\n                                    \n                                    x_126742 = defunc_1_op_res_126746;\n                                    x_126743 = defunc_1_op_res_126747;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_134932, skip_threads_134952)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_134952, local_tid_134930 -\n                                  squot32(local_tid_134930, 32) * 32) &&\n                            ltid_in_bounds_134951) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_134934)[sext_i32_i64(local_tid_134930)] =\n                                    x_126742;\n                                x_126744 = x_126742;\n                                ((volatile __local\n                                  float *) red_arr_mem_134936)[sext_i32_i64(local_tid_134930)] =\n                                    x_126743;\n                                x_126745 = x_126743;\n                            }\n            ",
                   "            }\n                        if (sle32(wave_sizze_134932, skip_threads_134952)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_134952 *= 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_134930 - squot32(local_tid_134930, 32) *\n                         32) == 31 && ltid_in_bounds_134951) {\n                        ((volatile __local\n                          float *) red_arr_mem_134934)[sext_i32_i64(squot32(local_tid_134930,\n                                                                            32))] =\n                            x_126742;\n                        ((volatile __local\n                          float *) red_arr_mem_134936)[sext_i32_i64(squot32(local_tid_134930,\n                                                                            32))] =\n                            x_126743;\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_134954;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_134930, 32) == 0 &&\n                            ltid_in_bounds_134951) {\n                            x_134947 = ((volatile __local\n                                         float *) red_arr_mem_134934)[sext_i32_i64(local_tid_134930)];\n                            x_134948 = ((volatile __local\n                                         float *) red_arr_mem_134936)[sext_i32_i64(local_tid_134930)];\n                            if ((local_tid_134930 - squot32(local_tid_134930,\n                                                            32) * 32) == ",
                   "0) {\n                                x_134945 = x_134947;\n                                x_134946 = x_134948;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_134954 = 1;\n                        while (slt32(skip_threads_134954, 32)) {\n                            if (sle32(skip_threads_134954, local_tid_134930 -\n                                      squot32(local_tid_134930, 32) * 32) &&\n                                (squot32(local_tid_134930, 32) == 0 &&\n                                 ltid_in_bounds_134951)) {\n                                // read operands\n                                {\n                                    x_134945 = ((volatile __local\n                                                 float *) red_arr_mem_134934)[sext_i32_i64(local_tid_134930) -\n                                                                              sext_i32_i64(skip_threads_134954)];\n                                    x_134946 = ((volatile __local\n                                                 float *) red_arr_mem_134936)[sext_i32_i64(local_tid_134930) -\n                                                                              sext_i32_i64(skip_threads_134954)];\n                                }\n                                // perform operation\n                                {\n                                    bool inactive_134955 =\n                                         slt64(srem64(sext_i32_i64(local_tid_134930 *\n                                                      32 + 32 - 1),\n                                                      t_window_114537),\n                                               sext_i32_i64(local_tid_134930 *\n                                               32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_134930 -\n                              ",
                   "                               skip_threads_134954) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_134955) {\n                                        x_134945 = x_134947;\n                                        x_134946 = x_134948;\n                                    }\n                                    if (!inactive_134955) {\n                                        float defunc_1_op_res_134949 =\n                                              x_134945 + x_134947;\n                                        float defunc_1_op_res_134950 =\n                                              x_134946 + x_134948;\n                                        \n                                        x_134945 = defunc_1_op_res_134949;\n                                        x_134946 = defunc_1_op_res_134950;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_134932, skip_threads_134954)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_134954, local_tid_134930 -\n                                      squot32(local_tid_134930, 32) * 32) &&\n                                (squot32(local_tid_134930, 32) == 0 &&\n                                 ltid_in_bounds_134951)) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_134934)[sext_i32_i64(local_tid_134930)] =\n                                        x_134945;\n                                    x_134947 = x_134945;\n                                    ((volatile __local\n                                      float *) red_arr_mem_134936)[sext_i32_i64(local_tid_134930)] =\n                                        ",
                   "x_134946;\n                                    x_134948 = x_134946;\n                                }\n                            }\n                            if (sle32(wave_sizze_134932, skip_threads_134954)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_134954 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n                    if (!(squot32(local_tid_134930, 32) == 0 ||\n                          !ltid_in_bounds_134951)) {\n                        // read operands\n                        {\n                            x_126744 = x_126742;\n                            x_126745 = x_126743;\n                            x_126742 = ((__local\n                                         float *) red_arr_mem_134934)[sext_i32_i64(squot32(local_tid_134930,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                            x_126743 = ((__local\n                                         float *) red_arr_mem_134936)[sext_i32_i64(squot32(local_tid_134930,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_134956 =\n                                 slt64(srem64(sext_i32_i64(local_tid_134930),\n                                              t_window_114537),\n                                       sext_i32_i64(local_tid_134930) -\n                                       sext_i32_i64(squot32(local_tid_134930,\n                                                 ",
                   "           32) * 32 - 1));\n                            \n                            if (inactive_134956) {\n                                x_126742 = x_126744;\n                                x_126743 = x_126745;\n                            }\n                            if (!inactive_134956) {\n                                float defunc_1_op_res_126746 = x_126742 +\n                                      x_126744;\n                                float defunc_1_op_res_126747 = x_126743 +\n                                      x_126745;\n                                \n                                x_126742 = defunc_1_op_res_126746;\n                                x_126743 = defunc_1_op_res_126747;\n                            }\n                        }\n                        // write final result\n                        {\n                            ((__local\n                              float *) red_arr_mem_134934)[sext_i32_i64(local_tid_134930)] =\n                                x_126742;\n                            ((__local\n                              float *) red_arr_mem_134936)[sext_i32_i64(local_tid_134930)] =\n                                x_126743;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_134930, 32) == 0) {\n                        ((__local\n                          float *) red_arr_mem_134934)[sext_i32_i64(local_tid_134930)] =\n                            x_126744;\n                        ((__local\n                          float *) red_arr_mem_134936)[sext_i32_i64(local_tid_134930)] =\n                            x_126745;\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_",
                   "134940) *\n                      squot64(segred_group_sizze_126737,\n                              segment_sizze_nonzzero_134927) +\n                      sext_i32_i64(local_tid_134930), m_114533 *\n                      t_n_m_114591) && slt64(sext_i32_i64(local_tid_134930),\n                                             squot64(segred_group_sizze_126737,\n                                                     segment_sizze_nonzzero_134927))) {\n                ((__global\n                  float *) mem_131550)[squot64(sext_i32_i64(virt_group_id_134940) *\n                                               squot64(segred_group_sizze_126737,\n                                                       segment_sizze_nonzzero_134927) +\n                                               sext_i32_i64(local_tid_134930),\n                                               t_n_m_114591) * t_n_m_114591 +\n                                       (sext_i32_i64(virt_group_id_134940) *\n                                        squot64(segred_group_sizze_126737,\n                                                segment_sizze_nonzzero_134927) +\n                                        sext_i32_i64(local_tid_134930) -\n                                        squot64(sext_i32_i64(virt_group_id_134940) *\n                                                squot64(segred_group_sizze_126737,\n                                                        segment_sizze_nonzzero_134927) +\n                                                sext_i32_i64(local_tid_134930),\n                                                t_n_m_114591) * t_n_m_114591)] =\n                    ((__local\n                      float *) red_arr_mem_134934)[(sext_i32_i64(local_tid_134930) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134927 -\n                                                   (int64_t) 1];\n                ((__global\n                  float *) mem_131554)[sq",
                   "uot64(sext_i32_i64(virt_group_id_134940) *\n                                               squot64(segred_group_sizze_126737,\n                                                       segment_sizze_nonzzero_134927) +\n                                               sext_i32_i64(local_tid_134930),\n                                               t_n_m_114591) * t_n_m_114591 +\n                                       (sext_i32_i64(virt_group_id_134940) *\n                                        squot64(segred_group_sizze_126737,\n                                                segment_sizze_nonzzero_134927) +\n                                        sext_i32_i64(local_tid_134930) -\n                                        squot64(sext_i32_i64(virt_group_id_134940) *\n                                                squot64(segred_group_sizze_126737,\n                                                        segment_sizze_nonzzero_134927) +\n                                                sext_i32_i64(local_tid_134930),\n                                                t_n_m_114591) * t_n_m_114591)] =\n                    ((__local\n                      float *) red_arr_mem_134936)[(sext_i32_i64(local_tid_134930) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134927 -\n                                                   (int64_t) 1];\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_126737\n}\n__kernel void mainzisegred_small_126263(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134812_backing_aligned_0,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134810_backing_aligned_1,\n                      ",
                   "                  __local volatile\n                                        int64_t *red_arr_mem_134808_backing_aligned_2,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134806_backing_aligned_3,\n                                        __local volatile\n                                        int64_t *red_arr_mem_134804_backing_aligned_4,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t t_window_114537,\n                                        int64_t t_jump_114541,\n                                        int64_t t_n_m_114591, int64_t i_114610,\n                                        int64_t num_groups_126642,\n                                        int64_t segment_sizze_nonzzero_134797,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130117,\n                                        __global unsigned char *mem_130122,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130606,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_130607,\n                                        __global unsigned char *mem_130861,\n                                        __global unsigned char *mem_131508,\n                                        __global unsigned char *mem_131512,\n                                        __global unsigned char *mem_131516,\n                                        __global unsigned char *mem_131520,\n                                        __global unsigned char *mem_131524)\n{\n    #define segred_group_sizze_126641 (mainzisegred_group_sizze_126257)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_134812_backi",
                   "ng_4 =\n                          (__local volatile\n                           char *) red_arr_mem_134812_backing_aligned_0;\n    __local volatile char *restrict red_arr_mem_134810_backing_3 =\n                          (__local volatile\n                           char *) red_arr_mem_134810_backing_aligned_1;\n    __local volatile char *restrict red_arr_mem_134808_backing_2 =\n                          (__local volatile\n                           char *) red_arr_mem_134808_backing_aligned_2;\n    __local volatile char *restrict red_arr_mem_134806_backing_1 =\n                          (__local volatile\n                           char *) red_arr_mem_134806_backing_aligned_3;\n    __local volatile char *restrict red_arr_mem_134804_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_134804_backing_aligned_4;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_134799;\n    int32_t local_tid_134800;\n    int64_t group_sizze_134803;\n    int32_t wave_sizze_134802;\n    int32_t group_tid_134801;\n    \n    global_tid_134799 = get_global_id(0);\n    local_tid_134800 = get_local_id(0);\n    group_sizze_134803 = get_local_size(0);\n    wave_sizze_134802 = LOCKSTEP_WIDTH;\n    group_tid_134801 = get_group_id(0);\n    \n    int32_t phys_tid_126263 = global_tid_134799;\n    __local char *red_arr_mem_134804;\n    \n    red_arr_mem_134804 = (__local char *) red_arr_mem_134804_backing_0;\n    \n    __local char *red_arr_mem_134806;\n    \n    red_arr_mem_134806 = (__local char *) red_arr_mem_134806_backing_1;\n    \n    __local char *red_arr_mem_134808;\n    \n    red_arr_mem_134808 = (__local char *) red_arr_mem_134808_backing_2;\n    \n    __local char *red_arr_mem_134810;\n    \n    red_arr_mem_134810 = (__local char *) red_arr_mem_134810_backing_3;\n    \n    __local char *red_arr_mem_134812;\n    \n    red_arr_mem_134812 = (__local char *) red_arr_mem_134812_backing_4;\n    \n    int32_t phys_group_id_134814;\n    \n    phys_group_id_134814 =",
                   " get_group_id(0);\n    for (int32_t i_134815 = 0; i_134815 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533 * t_n_m_114591,\n                                          squot64(segred_group_sizze_126641,\n                                                  segment_sizze_nonzzero_134797))) -\n                   phys_group_id_134814, sext_i64_i32(num_groups_126642));\n         i_134815++) {\n        int32_t virt_group_id_134816 = phys_group_id_134814 + i_134815 *\n                sext_i64_i32(num_groups_126642);\n        int64_t slice_134817 = t_n_m_114591;\n        int64_t slice_134818 = m_114533 * slice_134817;\n        int64_t gtid_126252 = squot64(squot64(sext_i32_i64(local_tid_134800),\n                                              segment_sizze_nonzzero_134797) +\n                                      sext_i32_i64(virt_group_id_134816) *\n                                      squot64(segred_group_sizze_126641,\n                                              segment_sizze_nonzzero_134797),\n                                      slice_134817);\n        int64_t remnant_134819 = squot64(sext_i32_i64(local_tid_134800),\n                                         segment_sizze_nonzzero_134797) +\n                sext_i32_i64(virt_group_id_134816) *\n                squot64(segred_group_sizze_126641,\n                        segment_sizze_nonzzero_134797) - gtid_126252 *\n                slice_134817;\n        int64_t gtid_126253 = remnant_134819;\n        int64_t remnant_134820 = remnant_134819 - gtid_126253;\n        int64_t gtid_126262 = srem64(sext_i32_i64(local_tid_134800),\n                                     t_window_114537);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, t_window_114537) && ((slt64(gtid_126252,\n                                                               m_114533) &&\n                                                         slt64(gtid_126253,\n                                                               t_n_m_114591)) &",
                   "&\n                                                        slt64(sext_i32_i64(local_tid_134800),\n                                                              t_window_114537 *\n                                                              squot64(segred_group_sizze_126641,\n                                                                      segment_sizze_nonzzero_134797)))) {\n                int64_t x_126668 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130117)[gtid_126252];\n                int64_t x_126670 = ((__global\n                                     int64_t *) defunc_3_map_res_mem_130606)[gtid_126252 *\n                                                                             t_n_m_114591 +\n                                                                             gtid_126253];\n                float x_126671 = ((__global\n                                   float *) defunc_3_map_res_mem_130607)[gtid_126252 *\n                                                                         t_n_m_114591 +\n                                                                         gtid_126253];\n                int64_t binop_y_128996 = mul64(t_jump_114541, gtid_126253);\n                int64_t convop_x_128997 = smin64(i_114610, binop_y_128996);\n                float index_primexp_128998 = sitofp_i64_f32(convop_x_128997);\n                bool cond_126674 = sle64(x_126668, gtid_126262);\n                float defunc_0_f_res_126675;\n                \n                if (cond_126674) {\n                    defunc_0_f_res_126675 = 0.0F;\n                } else {\n                    int64_t i_126676 = add64(gtid_126262, x_126670);\n                    float x_126677 = ((__global\n                                       float *) mem_130122)[gtid_126252 *\n                                                            n_114534 +\n                                                            i_126676];\n                    float defunc_0_f_res_f_res_126678 = 1.",
                   "0F + x_126677;\n                    \n                    defunc_0_f_res_126675 = defunc_0_f_res_f_res_126678;\n                }\n                \n                float defunc_0_f_res_126679;\n                \n                if (cond_126674) {\n                    defunc_0_f_res_126679 = 0.0F;\n                } else {\n                    int64_t i_126680 = add64(gtid_126262, x_126670);\n                    float x_126681 = ((__global\n                                       float *) mem_130861)[gtid_126252 *\n                                                            n_114534 +\n                                                            i_126680];\n                    \n                    defunc_0_f_res_126679 = x_126681;\n                }\n                \n                float x_j_126682 = defunc_0_f_res_126675 - index_primexp_128998;\n                float abs_res_126683 = (float) fabs(x_j_126682);\n                float tmp1_126684 = abs_res_126683 / x_126671;\n                float x_126685 = tmp1_126684 * tmp1_126684;\n                float y_126686 = tmp1_126684 * x_126685;\n                float tmp2_126687 = 1.0F - y_126686;\n                float x_126688 = tmp2_126687 * tmp2_126687;\n                float tmp3_126689 = tmp2_126687 * x_126688;\n                float w_j_126690 = defunc_0_f_res_126679 * tmp3_126689;\n                float xw_j_126691 = x_j_126682 * w_j_126690;\n                float x2w_j_126692 = x_j_126682 * xw_j_126691;\n                float x3w_j_126693 = x_j_126682 * x2w_j_126692;\n                float x4w_j_126694 = x_j_126682 * x3w_j_126693;\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_134804)[sext_i32_i64(local_tid_134800)] =\n                        w_j_126690;\n                    ((__local\n                      float *) red_arr_mem_134806)[sext_i32_i64(local_tid_134800)] =\n           ",
                   "             xw_j_126691;\n                    ((__local\n                      float *) red_arr_mem_134808)[sext_i32_i64(local_tid_134800)] =\n                        x2w_j_126692;\n                    ((__local\n                      float *) red_arr_mem_134810)[sext_i32_i64(local_tid_134800)] =\n                        x3w_j_126693;\n                    ((__local\n                      float *) red_arr_mem_134812)[sext_i32_i64(local_tid_134800)] =\n                        x4w_j_126694;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_134804)[sext_i32_i64(local_tid_134800)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_134806)[sext_i32_i64(local_tid_134800)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_134808)[sext_i32_i64(local_tid_134800)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_134810)[sext_i32_i64(local_tid_134800)] =\n                    0.0F;\n                ((__local\n                  float *) red_arr_mem_134812)[sext_i32_i64(local_tid_134800)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, t_window_114537)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_126649;\n                float x_126650;\n                float x_126651;\n                float x_126652;\n                float x_126653;\n                float x_126654;\n                float x_126655;\n                float x_126656;\n                float x_126657;\n                float x_126658;\n                float x_134821;\n                float x_134822;\n                float x_134823;\n                float x_134824;\n                float x_134825;\n                float x_134826;\n                float x_134827;\n                float x_134828;\n                float x_134829;\n                f",
                   "loat x_134830;\n                bool ltid_in_bounds_134836 =\n                     slt64(sext_i32_i64(local_tid_134800), t_window_114537 *\n                           squot64(segred_group_sizze_126641,\n                                   segment_sizze_nonzzero_134797));\n                int32_t skip_threads_134837;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_134836) {\n                        x_126654 = ((volatile __local\n                                     float *) red_arr_mem_134804)[sext_i32_i64(local_tid_134800)];\n                        x_126655 = ((volatile __local\n                                     float *) red_arr_mem_134806)[sext_i32_i64(local_tid_134800)];\n                        x_126656 = ((volatile __local\n                                     float *) red_arr_mem_134808)[sext_i32_i64(local_tid_134800)];\n                        x_126657 = ((volatile __local\n                                     float *) red_arr_mem_134810)[sext_i32_i64(local_tid_134800)];\n                        x_126658 = ((volatile __local\n                                     float *) red_arr_mem_134812)[sext_i32_i64(local_tid_134800)];\n                        if ((local_tid_134800 - squot32(local_tid_134800, 32) *\n                             32) == 0) {\n                            x_126649 = x_126654;\n                            x_126650 = x_126655;\n                            x_126651 = x_126656;\n                            x_126652 = x_126657;\n                            x_126653 = x_126658;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_134837 = 1;\n                    while (slt32(skip_threads_134837, 32)) {\n                        if (sle32(skip_threads_134837, local_tid_134800 -\n                                  squot32(local_tid_134800, 32) * 32) &&\n                        ",
                   "    ltid_in_bounds_134836) {\n                            // read operands\n                            {\n                                x_126649 = ((volatile __local\n                                             float *) red_arr_mem_134804)[sext_i32_i64(local_tid_134800) -\n                                                                          sext_i32_i64(skip_threads_134837)];\n                                x_126650 = ((volatile __local\n                                             float *) red_arr_mem_134806)[sext_i32_i64(local_tid_134800) -\n                                                                          sext_i32_i64(skip_threads_134837)];\n                                x_126651 = ((volatile __local\n                                             float *) red_arr_mem_134808)[sext_i32_i64(local_tid_134800) -\n                                                                          sext_i32_i64(skip_threads_134837)];\n                                x_126652 = ((volatile __local\n                                             float *) red_arr_mem_134810)[sext_i32_i64(local_tid_134800) -\n                                                                          sext_i32_i64(skip_threads_134837)];\n                                x_126653 = ((volatile __local\n                                             float *) red_arr_mem_134812)[sext_i32_i64(local_tid_134800) -\n                                                                          sext_i32_i64(skip_threads_134837)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_134838 =\n                                     slt64(srem64(sext_i32_i64(local_tid_134800),\n                                                  t_window_114537),\n                                           sext_i32_i64(local_tid_134800) -\n                                           sext_i32_i64(local_tid_134800 -\n                                    ",
                   "       skip_threads_134837));\n                                \n                                if (inactive_134838) {\n                                    x_126649 = x_126654;\n                                    x_126650 = x_126655;\n                                    x_126651 = x_126656;\n                                    x_126652 = x_126657;\n                                    x_126653 = x_126658;\n                                }\n                                if (!inactive_134838) {\n                                    float defunc_1_op_res_126659 = x_126649 +\n                                          x_126654;\n                                    float defunc_1_op_res_126660 = x_126650 +\n                                          x_126655;\n                                    float defunc_1_op_res_126661 = x_126651 +\n                                          x_126656;\n                                    float defunc_1_op_res_126662 = x_126652 +\n                                          x_126657;\n                                    float defunc_1_op_res_126663 = x_126653 +\n                                          x_126658;\n                                    \n                                    x_126649 = defunc_1_op_res_126659;\n                                    x_126650 = defunc_1_op_res_126660;\n                                    x_126651 = defunc_1_op_res_126661;\n                                    x_126652 = defunc_1_op_res_126662;\n                                    x_126653 = defunc_1_op_res_126663;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_134802, skip_threads_134837)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_134837, local_tid_134800 -\n                                  squot32(local_tid_134800, 32) * 32) &&\n                            ltid_in_bounds_134836) {\n              ",
                   "              // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_134804)[sext_i32_i64(local_tid_134800)] =\n                                    x_126649;\n                                x_126654 = x_126649;\n                                ((volatile __local\n                                  float *) red_arr_mem_134806)[sext_i32_i64(local_tid_134800)] =\n                                    x_126650;\n                                x_126655 = x_126650;\n                                ((volatile __local\n                                  float *) red_arr_mem_134808)[sext_i32_i64(local_tid_134800)] =\n                                    x_126651;\n                                x_126656 = x_126651;\n                                ((volatile __local\n                                  float *) red_arr_mem_134810)[sext_i32_i64(local_tid_134800)] =\n                                    x_126652;\n                                x_126657 = x_126652;\n                                ((volatile __local\n                                  float *) red_arr_mem_134812)[sext_i32_i64(local_tid_134800)] =\n                                    x_126653;\n                                x_126658 = x_126653;\n                            }\n                        }\n                        if (sle32(wave_sizze_134802, skip_threads_134837)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_134837 *= 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_134800 - squot32(local_tid_134800, 32) *\n                         32) == 31 && ltid_in_bounds_134836) {\n                        ((volatile __local\n                          float *) red_arr_mem_134804)[sext_i32_i64(squot32(",
                   "local_tid_134800,\n                                                                            32))] =\n                            x_126649;\n                        ((volatile __local\n                          float *) red_arr_mem_134806)[sext_i32_i64(squot32(local_tid_134800,\n                                                                            32))] =\n                            x_126650;\n                        ((volatile __local\n                          float *) red_arr_mem_134808)[sext_i32_i64(squot32(local_tid_134800,\n                                                                            32))] =\n                            x_126651;\n                        ((volatile __local\n                          float *) red_arr_mem_134810)[sext_i32_i64(squot32(local_tid_134800,\n                                                                            32))] =\n                            x_126652;\n                        ((volatile __local\n                          float *) red_arr_mem_134812)[sext_i32_i64(squot32(local_tid_134800,\n                                                                            32))] =\n                            x_126653;\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_134839;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_134800, 32) == 0 &&\n                            ltid_in_bounds_134836) {\n                            x_134826 = ((volatile __local\n                                         float *) red_arr_mem_134804)[sext_i32_i64(local_tid_134800)];\n                            x_134827 = ((volatile __local\n                                         float *) red_arr_mem_134806)[sext_i32_i64(local_tid_134800)];\n                            x_134828 ",
                   "= ((volatile __local\n                                         float *) red_arr_mem_134808)[sext_i32_i64(local_tid_134800)];\n                            x_134829 = ((volatile __local\n                                         float *) red_arr_mem_134810)[sext_i32_i64(local_tid_134800)];\n                            x_134830 = ((volatile __local\n                                         float *) red_arr_mem_134812)[sext_i32_i64(local_tid_134800)];\n                            if ((local_tid_134800 - squot32(local_tid_134800,\n                                                            32) * 32) == 0) {\n                                x_134821 = x_134826;\n                                x_134822 = x_134827;\n                                x_134823 = x_134828;\n                                x_134824 = x_134829;\n                                x_134825 = x_134830;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_134839 = 1;\n                        while (slt32(skip_threads_134839, 32)) {\n                            if (sle32(skip_threads_134839, local_tid_134800 -\n                                      squot32(local_tid_134800, 32) * 32) &&\n                                (squot32(local_tid_134800, 32) == 0 &&\n                                 ltid_in_bounds_134836)) {\n                                // read operands\n                                {\n                                    x_134821 = ((volatile __local\n                                                 float *) red_arr_mem_134804)[sext_i32_i64(local_tid_134800) -\n                                                                              sext_i32_i64(skip_threads_134839)];\n                                    x_134822 = ((volatile __local\n                                                 float *) red_arr_mem_134806)[sext_i32_i64(local_tid_134800) -\n               ",
                   "                                                               sext_i32_i64(skip_threads_134839)];\n                                    x_134823 = ((volatile __local\n                                                 float *) red_arr_mem_134808)[sext_i32_i64(local_tid_134800) -\n                                                                              sext_i32_i64(skip_threads_134839)];\n                                    x_134824 = ((volatile __local\n                                                 float *) red_arr_mem_134810)[sext_i32_i64(local_tid_134800) -\n                                                                              sext_i32_i64(skip_threads_134839)];\n                                    x_134825 = ((volatile __local\n                                                 float *) red_arr_mem_134812)[sext_i32_i64(local_tid_134800) -\n                                                                              sext_i32_i64(skip_threads_134839)];\n                                }\n                                // perform operation\n                                {\n                                    bool inactive_134840 =\n                                         slt64(srem64(sext_i32_i64(local_tid_134800 *\n                                                      32 + 32 - 1),\n                                                      t_window_114537),\n                                               sext_i32_i64(local_tid_134800 *\n                                               32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_134800 -\n                                                             skip_threads_134839) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_134840) {\n                                        x_134821 = x_134826;\n                                        x_134822 = x_134827;\n                                     ",
                   "   x_134823 = x_134828;\n                                        x_134824 = x_134829;\n                                        x_134825 = x_134830;\n                                    }\n                                    if (!inactive_134840) {\n                                        float defunc_1_op_res_134831 =\n                                              x_134821 + x_134826;\n                                        float defunc_1_op_res_134832 =\n                                              x_134822 + x_134827;\n                                        float defunc_1_op_res_134833 =\n                                              x_134823 + x_134828;\n                                        float defunc_1_op_res_134834 =\n                                              x_134824 + x_134829;\n                                        float defunc_1_op_res_134835 =\n                                              x_134825 + x_134830;\n                                        \n                                        x_134821 = defunc_1_op_res_134831;\n                                        x_134822 = defunc_1_op_res_134832;\n                                        x_134823 = defunc_1_op_res_134833;\n                                        x_134824 = defunc_1_op_res_134834;\n                                        x_134825 = defunc_1_op_res_134835;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_134802, skip_threads_134839)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_134839, local_tid_134800 -\n                                      squot32(local_tid_134800, 32) * 32) &&\n                                (squot32(local_tid_134800, 32) == 0 &&\n                                 ltid_in_bounds_134836)) {\n                                // write result\n                                {\n        ",
                   "                            ((volatile __local\n                                      float *) red_arr_mem_134804)[sext_i32_i64(local_tid_134800)] =\n                                        x_134821;\n                                    x_134826 = x_134821;\n                                    ((volatile __local\n                                      float *) red_arr_mem_134806)[sext_i32_i64(local_tid_134800)] =\n                                        x_134822;\n                                    x_134827 = x_134822;\n                                    ((volatile __local\n                                      float *) red_arr_mem_134808)[sext_i32_i64(local_tid_134800)] =\n                                        x_134823;\n                                    x_134828 = x_134823;\n                                    ((volatile __local\n                                      float *) red_arr_mem_134810)[sext_i32_i64(local_tid_134800)] =\n                                        x_134824;\n                                    x_134829 = x_134824;\n                                    ((volatile __local\n                                      float *) red_arr_mem_134812)[sext_i32_i64(local_tid_134800)] =\n                                        x_134825;\n                                    x_134830 = x_134825;\n                                }\n                            }\n                            if (sle32(wave_sizze_134802, skip_threads_134839)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_134839 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n                    if (!(squot32(local_tid_134800, 32) == 0 ||\n                          !ltid_in_bounds_134836)) {\n                        // read operands\n                        {\n                           ",
                   " x_126654 = x_126649;\n                            x_126655 = x_126650;\n                            x_126656 = x_126651;\n                            x_126657 = x_126652;\n                            x_126658 = x_126653;\n                            x_126649 = ((__local\n                                         float *) red_arr_mem_134804)[sext_i32_i64(squot32(local_tid_134800,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                            x_126650 = ((__local\n                                         float *) red_arr_mem_134806)[sext_i32_i64(squot32(local_tid_134800,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                            x_126651 = ((__local\n                                         float *) red_arr_mem_134808)[sext_i32_i64(squot32(local_tid_134800,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                            x_126652 = ((__local\n                                         float *) red_arr_mem_134810)[sext_i32_i64(squot32(local_tid_134800,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                            x_126653 = ((__local\n                                         float *) red_arr_mem_134812)[sext_i32_i64(squot32(local_tid_134800,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                        }\n                        // perform operation\n           ",
                   "             {\n                            bool inactive_134841 =\n                                 slt64(srem64(sext_i32_i64(local_tid_134800),\n                                              t_window_114537),\n                                       sext_i32_i64(local_tid_134800) -\n                                       sext_i32_i64(squot32(local_tid_134800,\n                                                            32) * 32 - 1));\n                            \n                            if (inactive_134841) {\n                                x_126649 = x_126654;\n                                x_126650 = x_126655;\n                                x_126651 = x_126656;\n                                x_126652 = x_126657;\n                                x_126653 = x_126658;\n                            }\n                            if (!inactive_134841) {\n                                float defunc_1_op_res_126659 = x_126649 +\n                                      x_126654;\n                                float defunc_1_op_res_126660 = x_126650 +\n                                      x_126655;\n                                float defunc_1_op_res_126661 = x_126651 +\n                                      x_126656;\n                                float defunc_1_op_res_126662 = x_126652 +\n                                      x_126657;\n                                float defunc_1_op_res_126663 = x_126653 +\n                                      x_126658;\n                                \n                                x_126649 = defunc_1_op_res_126659;\n                                x_126650 = defunc_1_op_res_126660;\n                                x_126651 = defunc_1_op_res_126661;\n                                x_126652 = defunc_1_op_res_126662;\n                                x_126653 = defunc_1_op_res_126663;\n                            }\n                        }\n                        // write final result\n                        {\n                            ((__l",
                   "ocal\n                              float *) red_arr_mem_134804)[sext_i32_i64(local_tid_134800)] =\n                                x_126649;\n                            ((__local\n                              float *) red_arr_mem_134806)[sext_i32_i64(local_tid_134800)] =\n                                x_126650;\n                            ((__local\n                              float *) red_arr_mem_134808)[sext_i32_i64(local_tid_134800)] =\n                                x_126651;\n                            ((__local\n                              float *) red_arr_mem_134810)[sext_i32_i64(local_tid_134800)] =\n                                x_126652;\n                            ((__local\n                              float *) red_arr_mem_134812)[sext_i32_i64(local_tid_134800)] =\n                                x_126653;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_134800, 32) == 0) {\n                        ((__local\n                          float *) red_arr_mem_134804)[sext_i32_i64(local_tid_134800)] =\n                            x_126654;\n                        ((__local\n                          float *) red_arr_mem_134806)[sext_i32_i64(local_tid_134800)] =\n                            x_126655;\n                        ((__local\n                          float *) red_arr_mem_134808)[sext_i32_i64(local_tid_134800)] =\n                            x_126656;\n                        ((__local\n                          float *) red_arr_mem_134810)[sext_i32_i64(local_tid_134800)] =\n                            x_126657;\n                        ((__local\n                          float *) red_arr_mem_134812)[sext_i32_i64(local_tid_134800)] =\n                            x_126658;\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_134816) *\n                      squot64(segred_group_sizze_126641,\n                              segment_sizze_nonzzero_134797) +\n                      sext_i32_i64(local_tid_134800), m_114533 *\n                      t_n_m_114591) && slt64(sext_i32_i64(local_tid_134800),\n                                             squot64(segred_group_sizze_126641,\n                                                     segment_sizze_nonzzero_134797))) {\n                ((__global\n                  float *) mem_131508)[squot64(sext_i32_i64(virt_group_id_134816) *\n                                               squot64(segred_group_sizze_126641,\n                                                       segment_sizze_nonzzero_134797) +\n                                               sext_i32_i64(local_tid_134800),\n                                               t_n_m_114591) * t_n_m_114591 +\n                                       (sext_i32_i64(virt_group_id_134816) *\n                                        squot64(segred_group_sizze_126641,\n                                                segment_sizze_nonzzero_134797) +\n                                        sext_i32_i64(local_tid_134800) -\n                                        squot64(sext_i32_i64(virt_group_id_134816) *\n                                                squot64(segred_group_sizze_126641,\n                                                        segment_sizze_nonzzero_134797) +\n                                                sext_i32_i64(local_tid_134800),\n                                                t_n_m_114591) * t_n_m_114591)] =\n                    ((__local\n                      float *) red_arr_mem_134804)[(sext_i32_i64(local_tid_134800) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134797 ",
                   "-\n                                                   (int64_t) 1];\n                ((__global\n                  float *) mem_131512)[squot64(sext_i32_i64(virt_group_id_134816) *\n                                               squot64(segred_group_sizze_126641,\n                                                       segment_sizze_nonzzero_134797) +\n                                               sext_i32_i64(local_tid_134800),\n                                               t_n_m_114591) * t_n_m_114591 +\n                                       (sext_i32_i64(virt_group_id_134816) *\n                                        squot64(segred_group_sizze_126641,\n                                                segment_sizze_nonzzero_134797) +\n                                        sext_i32_i64(local_tid_134800) -\n                                        squot64(sext_i32_i64(virt_group_id_134816) *\n                                                squot64(segred_group_sizze_126641,\n                                                        segment_sizze_nonzzero_134797) +\n                                                sext_i32_i64(local_tid_134800),\n                                                t_n_m_114591) * t_n_m_114591)] =\n                    ((__local\n                      float *) red_arr_mem_134806)[(sext_i32_i64(local_tid_134800) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134797 -\n                                                   (int64_t) 1];\n                ((__global\n                  float *) mem_131516)[squot64(sext_i32_i64(virt_group_id_134816) *\n                                               squot64(segred_group_sizze_126641,\n                                                       segment_sizze_nonzzero_134797) +\n                                               sext_i32_i64(local_tid_134800),\n                                               t_n_m_114591) * t_n_m_114591 +\n   ",
                   "                                    (sext_i32_i64(virt_group_id_134816) *\n                                        squot64(segred_group_sizze_126641,\n                                                segment_sizze_nonzzero_134797) +\n                                        sext_i32_i64(local_tid_134800) -\n                                        squot64(sext_i32_i64(virt_group_id_134816) *\n                                                squot64(segred_group_sizze_126641,\n                                                        segment_sizze_nonzzero_134797) +\n                                                sext_i32_i64(local_tid_134800),\n                                                t_n_m_114591) * t_n_m_114591)] =\n                    ((__local\n                      float *) red_arr_mem_134808)[(sext_i32_i64(local_tid_134800) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134797 -\n                                                   (int64_t) 1];\n                ((__global\n                  float *) mem_131520)[squot64(sext_i32_i64(virt_group_id_134816) *\n                                               squot64(segred_group_sizze_126641,\n                                                       segment_sizze_nonzzero_134797) +\n                                               sext_i32_i64(local_tid_134800),\n                                               t_n_m_114591) * t_n_m_114591 +\n                                       (sext_i32_i64(virt_group_id_134816) *\n                                        squot64(segred_group_sizze_126641,\n                                                segment_sizze_nonzzero_134797) +\n                                        sext_i32_i64(local_tid_134800) -\n                                        squot64(sext_i32_i64(virt_group_id_134816) *\n                                                squot64(segred_group_sizze_126641,\n                                     ",
                   "                   segment_sizze_nonzzero_134797) +\n                                                sext_i32_i64(local_tid_134800),\n                                                t_n_m_114591) * t_n_m_114591)] =\n                    ((__local\n                      float *) red_arr_mem_134810)[(sext_i32_i64(local_tid_134800) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134797 -\n                                                   (int64_t) 1];\n                ((__global\n                  float *) mem_131524)[squot64(sext_i32_i64(virt_group_id_134816) *\n                                               squot64(segred_group_sizze_126641,\n                                                       segment_sizze_nonzzero_134797) +\n                                               sext_i32_i64(local_tid_134800),\n                                               t_n_m_114591) * t_n_m_114591 +\n                                       (sext_i32_i64(virt_group_id_134816) *\n                                        squot64(segred_group_sizze_126641,\n                                                segment_sizze_nonzzero_134797) +\n                                        sext_i32_i64(local_tid_134800) -\n                                        squot64(sext_i32_i64(virt_group_id_134816) *\n                                                squot64(segred_group_sizze_126641,\n                                                        segment_sizze_nonzzero_134797) +\n                                                sext_i32_i64(local_tid_134800),\n                                                t_n_m_114591) * t_n_m_114591)] =\n                    ((__local\n                      float *) red_arr_mem_134812)[(sext_i32_i64(local_tid_134800) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_134797 -\n                              ",
                   "                     (int64_t) 1];\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_126641\n}\n__kernel void mainzisegred_small_128539(__global int *global_failure,\n                                        __local volatile\n                                        int64_t *red_arr_mem_135330_backing_aligned_0,\n                                        int64_t m_114533, int64_t n_114534,\n                                        int64_t stl_res_114604,\n                                        int64_t j_m_i_115007,\n                                        int64_t num_groups_128548,\n                                        int64_t segment_sizze_nonzzero_135323,\n                                        __global\n                                        unsigned char *defunc_3_map_res_mem_131929,\n                                        __global unsigned char *mem_131946)\n{\n    #define segred_group_sizze_128547 (mainzisegred_group_sizze_128533)\n    \n    const int block_dim0 = 0;\n    const int block_dim1 = 1;\n    const int block_dim2 = 2;\n    __local volatile char *restrict red_arr_mem_135330_backing_0 =\n                          (__local volatile\n                           char *) red_arr_mem_135330_backing_aligned_0;\n    \n    if (*global_failure >= 0)\n        return;\n    \n    int32_t global_tid_135325;\n    int32_t local_tid_135326;\n    int64_t group_sizze_135329;\n    int32_t wave_sizze_135328;\n    int32_t group_tid_135327;\n    \n    global_tid_135325 = get_global_id(0);\n    local_tid_135326 = get_local_id(0);\n    group_sizze_135329 = get_local_size(0);\n    wave_sizze_135328 = LOCKSTEP_WIDTH;\n    group_tid_135327 = get_group_id(0);\n    \n    int32_t phys_tid_128539 = global_tid_135325;\n    __local char *red_arr_mem_135330;\n    \n    red_arr_mem_135330 = (__local char *) red_arr_mem_135330_backing_0;\n    \n    int32_t phys_group_id_135332;\n    \n    phys_gr",
                   "oup_id_135332 = get_group_id(0);\n    for (int32_t i_135333 = 0; i_135333 <\n         sdiv_up32(sext_i64_i32(sdiv_up64(m_114533,\n                                          squot64(segred_group_sizze_128547,\n                                                  segment_sizze_nonzzero_135323))) -\n                   phys_group_id_135332, sext_i64_i32(num_groups_128548));\n         i_135333++) {\n        int32_t virt_group_id_135334 = phys_group_id_135332 + i_135333 *\n                sext_i64_i32(num_groups_128548);\n        int64_t slice_135335 = m_114533;\n        int64_t gtid_128530 = squot64(sext_i32_i64(local_tid_135326),\n                                      segment_sizze_nonzzero_135323) +\n                sext_i32_i64(virt_group_id_135334) *\n                squot64(segred_group_sizze_128547,\n                        segment_sizze_nonzzero_135323);\n        int64_t remnant_135336 = squot64(sext_i32_i64(local_tid_135326),\n                                         segment_sizze_nonzzero_135323) +\n                sext_i32_i64(virt_group_id_135334) *\n                squot64(segred_group_sizze_128547,\n                        segment_sizze_nonzzero_135323) - gtid_128530;\n        int64_t gtid_128538 = srem64(sext_i32_i64(local_tid_135326),\n                                     j_m_i_115007);\n        \n        // apply map function if in bounds\n        {\n            if (slt64((int64_t) 0, j_m_i_115007) && (slt64(gtid_128530,\n                                                           m_114533) &&\n                                                     slt64(sext_i32_i64(local_tid_135326),\n                                                           j_m_i_115007 *\n                                                           squot64(segred_group_sizze_128547,\n                                                                   segment_sizze_nonzzero_135323)))) {\n                int64_t slice_129027 = stl_res_114604 + gtid_128538;\n                float x_128555 = ((__global\n                          ",
                   "         float *) defunc_3_map_res_mem_131929)[gtid_128530 *\n                                                                         n_114534 +\n                                                                         slice_129027];\n                \n                // save map-out results\n                { }\n                // save results to be reduced\n                {\n                    ((__local\n                      float *) red_arr_mem_135330)[sext_i32_i64(local_tid_135326)] =\n                        x_128555;\n                }\n            } else {\n                ((__local\n                  float *) red_arr_mem_135330)[sext_i32_i64(local_tid_135326)] =\n                    0.0F;\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FENCE);\n        if (slt64((int64_t) 0, j_m_i_115007)) {\n            // perform segmented scan to imitate reduction\n            {\n                float x_128551;\n                float x_128552;\n                float x_135337;\n                float x_135338;\n                bool ltid_in_bounds_135340 =\n                     slt64(sext_i32_i64(local_tid_135326), j_m_i_115007 *\n                           squot64(segred_group_sizze_128547,\n                                   segment_sizze_nonzzero_135323));\n                int32_t skip_threads_135341;\n                \n                // read input for in-block scan\n                {\n                    if (ltid_in_bounds_135340) {\n                        x_128552 = ((volatile __local\n                                     float *) red_arr_mem_135330)[sext_i32_i64(local_tid_135326)];\n                        if ((local_tid_135326 - squot32(local_tid_135326, 32) *\n                             32) == 0) {\n                            x_128551 = x_128552;\n                        }\n                    }\n                }\n                // in-block scan (hopefully no barriers needed)\n                {\n                    skip_threads_135341 = 1;\n                    while (slt32(skip_threads_135341",
                   ", 32)) {\n                        if (sle32(skip_threads_135341, local_tid_135326 -\n                                  squot32(local_tid_135326, 32) * 32) &&\n                            ltid_in_bounds_135340) {\n                            // read operands\n                            {\n                                x_128551 = ((volatile __local\n                                             float *) red_arr_mem_135330)[sext_i32_i64(local_tid_135326) -\n                                                                          sext_i32_i64(skip_threads_135341)];\n                            }\n                            // perform operation\n                            {\n                                bool inactive_135342 =\n                                     slt64(srem64(sext_i32_i64(local_tid_135326),\n                                                  j_m_i_115007),\n                                           sext_i32_i64(local_tid_135326) -\n                                           sext_i32_i64(local_tid_135326 -\n                                           skip_threads_135341));\n                                \n                                if (inactive_135342) {\n                                    x_128551 = x_128552;\n                                }\n                                if (!inactive_135342) {\n                                    float defunc_1_op_res_128553 = x_128551 +\n                                          x_128552;\n                                    \n                                    x_128551 = defunc_1_op_res_128553;\n                                }\n                            }\n                        }\n                        if (sle32(wave_sizze_135328, skip_threads_135341)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        if (sle32(skip_threads_135341, local_tid_135326 -\n                                  squot32(local_tid_135326, 32) * 32) &&\n                            ltid_in_bo",
                   "unds_135340) {\n                            // write result\n                            {\n                                ((volatile __local\n                                  float *) red_arr_mem_135330)[sext_i32_i64(local_tid_135326)] =\n                                    x_128551;\n                                x_128552 = x_128551;\n                            }\n                        }\n                        if (sle32(wave_sizze_135328, skip_threads_135341)) {\n                            barrier(CLK_LOCAL_MEM_FENCE);\n                        }\n                        skip_threads_135341 *= 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_135326 - squot32(local_tid_135326, 32) *\n                         32) == 31 && ltid_in_bounds_135340) {\n                        ((volatile __local\n                          float *) red_arr_mem_135330)[sext_i32_i64(squot32(local_tid_135326,\n                                                                            32))] =\n                            x_128551;\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_135343;\n                    \n                    // read input for in-block scan\n                    {\n                        if (squot32(local_tid_135326, 32) == 0 &&\n                            ltid_in_bounds_135340) {\n                            x_135338 = ((volatile __local\n                                         float *) red_arr_mem_135330)[sext_i32_i64(local_tid_135326)];\n                            if ((local_tid_135326 - squot32(local_tid_135326,\n                                                            32) * 32) == 0) {\n                                x_135",
                   "337 = x_135338;\n                            }\n                        }\n                    }\n                    // in-block scan (hopefully no barriers needed)\n                    {\n                        skip_threads_135343 = 1;\n                        while (slt32(skip_threads_135343, 32)) {\n                            if (sle32(skip_threads_135343, local_tid_135326 -\n                                      squot32(local_tid_135326, 32) * 32) &&\n                                (squot32(local_tid_135326, 32) == 0 &&\n                                 ltid_in_bounds_135340)) {\n                                // read operands\n                                {\n                                    x_135337 = ((volatile __local\n                                                 float *) red_arr_mem_135330)[sext_i32_i64(local_tid_135326) -\n                                                                              sext_i32_i64(skip_threads_135343)];\n                                }\n                                // perform operation\n                                {\n                                    bool inactive_135344 =\n                                         slt64(srem64(sext_i32_i64(local_tid_135326 *\n                                                      32 + 32 - 1),\n                                                      j_m_i_115007),\n                                               sext_i32_i64(local_tid_135326 *\n                                               32 + 32 - 1) -\n                                               sext_i32_i64((local_tid_135326 -\n                                                             skip_threads_135343) *\n                                               32 + 32 - 1));\n                                    \n                                    if (inactive_135344) {\n                                        x_135337 = x_135338;\n                                    }\n                                    if (!inactive_135344) {\n                  ",
                   "                      float defunc_1_op_res_135339 =\n                                              x_135337 + x_135338;\n                                        \n                                        x_135337 = defunc_1_op_res_135339;\n                                    }\n                                }\n                            }\n                            if (sle32(wave_sizze_135328, skip_threads_135343)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            if (sle32(skip_threads_135343, local_tid_135326 -\n                                      squot32(local_tid_135326, 32) * 32) &&\n                                (squot32(local_tid_135326, 32) == 0 &&\n                                 ltid_in_bounds_135340)) {\n                                // write result\n                                {\n                                    ((volatile __local\n                                      float *) red_arr_mem_135330)[sext_i32_i64(local_tid_135326)] =\n                                        x_135337;\n                                    x_135338 = x_135337;\n                                }\n                            }\n                            if (sle32(wave_sizze_135328, skip_threads_135343)) {\n                                barrier(CLK_LOCAL_MEM_FENCE);\n                            }\n                            skip_threads_135343 *= 2;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // carry-in for every block except the first\n                {\n                    if (!(squot32(local_tid_135326, 32) == 0 ||\n                          !ltid_in_bounds_135340)) {\n                        // read operands\n                        {\n                            x_128552 = x_128551;\n                            x_128551 = ((__local\n                                         float *) red_arr_mem_135330)[sext_i32_i64(squot32(loca",
                   "l_tid_135326,\n                                                                                           32)) -\n                                                                      (int64_t) 1];\n                        }\n                        // perform operation\n                        {\n                            bool inactive_135345 =\n                                 slt64(srem64(sext_i32_i64(local_tid_135326),\n                                              j_m_i_115007),\n                                       sext_i32_i64(local_tid_135326) -\n                                       sext_i32_i64(squot32(local_tid_135326,\n                                                            32) * 32 - 1));\n                            \n                            if (inactive_135345) {\n                                x_128551 = x_128552;\n                            }\n                            if (!inactive_135345) {\n                                float defunc_1_op_res_128553 = x_128551 +\n                                      x_128552;\n                                \n                                x_128551 = defunc_1_op_res_128553;\n                            }\n                        }\n                        // write final result\n                        {\n                            ((__local\n                              float *) red_arr_mem_135330)[sext_i32_i64(local_tid_135326)] =\n                                x_128551;\n                        }\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n                // restore correct values for first block\n                {\n                    if (squot32(local_tid_135326, 32) == 0) {\n                        ((__local\n                          float *) red_arr_mem_135330)[sext_i32_i64(local_tid_135326)] =\n                            x_128552;\n                    }\n                }\n                barrier(CLK_LOCAL_MEM_FENCE);\n            }\n        }\n        barrier(CLK_LOCAL_MEM_FE",
                   "NCE);\n        // save final values of segments\n        {\n            if (slt64(sext_i32_i64(virt_group_id_135334) *\n                      squot64(segred_group_sizze_128547,\n                              segment_sizze_nonzzero_135323) +\n                      sext_i32_i64(local_tid_135326), m_114533) &&\n                slt64(sext_i32_i64(local_tid_135326),\n                      squot64(segred_group_sizze_128547,\n                              segment_sizze_nonzzero_135323))) {\n                ((__global\n                  float *) mem_131946)[sext_i32_i64(virt_group_id_135334) *\n                                       squot64(segred_group_sizze_128547,\n                                               segment_sizze_nonzzero_135323) +\n                                       sext_i32_i64(local_tid_135326)] =\n                    ((__local\n                      float *) red_arr_mem_135330)[(sext_i32_i64(local_tid_135326) +\n                                                    (int64_t) 1) *\n                                                   segment_sizze_nonzzero_135323 -\n                                                   (int64_t) 1];\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_128547\n}\n",
                   NULL};
static const char *size_names[] = {"builtin#replicate_f32.group_size_132961",
                                   "builtin#replicate_i64.group_size_132372",
                                   "main.group_size_132363",
                                   "main.group_size_132601",
                                   "main.group_size_132606",
                                   "main.group_size_132819",
                                   "main.group_size_132824",
                                   "main.segmap_group_size_116798",
                                   "main.segmap_group_size_116916",
                                   "main.segmap_group_size_116953",
                                   "main.segmap_group_size_116994",
                                   "main.segmap_group_size_117079",
                                   "main.segmap_group_size_117352",
                                   "main.segmap_group_size_117736",
                                   "main.segmap_group_size_117862",
                                   "main.segmap_group_size_117963",
                                   "main.segmap_group_size_117978",
                                   "main.segmap_group_size_118169",
                                   "main.segmap_group_size_118191",
                                   "main.segmap_group_size_118652",
                                   "main.segmap_group_size_119036",
                                   "main.segmap_group_size_119162",
                                   "main.segmap_group_size_119263",
                                   "main.segmap_group_size_119278",
                                   "main.segmap_group_size_119469",
                                   "main.segmap_group_size_119491",
                                   "main.segmap_group_size_119815",
                                   "main.segmap_group_size_119847",
                                   "main.segmap_group_size_119931",
                                   "main.segmap_group_size_120063",
                                   "main.segmap_group_size_120135",
                                   "main.segmap_group_size_120745",
                                   "main.segmap_group_size_120813",
                                   "main.segmap_group_size_120954",
                                   "main.segmap_group_size_121082",
                                   "main.segmap_group_size_121414",
                                   "main.segmap_group_size_121614",
                                   "main.segmap_group_size_121793",
                                   "main.segmap_group_size_122247",
                                   "main.segmap_group_size_122511",
                                   "main.segmap_group_size_122739",
                                   "main.segmap_group_size_123941",
                                   "main.segmap_group_size_124119",
                                   "main.segmap_group_size_124205",
                                   "main.segmap_group_size_124242",
                                   "main.segmap_group_size_124293",
                                   "main.segmap_group_size_124434",
                                   "main.segmap_group_size_124562",
                                   "main.segmap_group_size_124894",
                                   "main.segmap_group_size_125094",
                                   "main.segmap_group_size_125273",
                                   "main.segmap_group_size_125727",
                                   "main.segmap_group_size_125991",
                                   "main.segmap_group_size_126219",
                                   "main.segmap_group_size_127421",
                                   "main.segmap_group_size_127599",
                                   "main.segmap_group_size_127654",
                                   "main.segmap_group_size_127710",
                                   "main.segmap_group_size_128094",
                                   "main.segmap_group_size_128492",
                                   "main.segmap_group_size_128523",
                                   "main.segmap_group_size_128582",
                                   "main.segmap_group_size_128673",
                                   "main.segmap_num_groups_116996",
                                   "main.segmap_num_groups_117354",
                                   "main.segmap_num_groups_118654",
                                   "main.segmap_num_groups_119849",
                                   "main.segmap_num_groups_120137",
                                   "main.segmap_num_groups_120815",
                                   "main.segmap_num_groups_121416",
                                   "main.segmap_num_groups_122249",
                                   "main.segmap_num_groups_124295",
                                   "main.segmap_num_groups_124896",
                                   "main.segmap_num_groups_125729",
                                   "main.segmap_num_groups_127712",
                                   "main.segred_group_size_117091",
                                   "main.segred_group_size_117935",
                                   "main.segred_group_size_119235",
                                   "main.segred_group_size_119942",
                                   "main.segred_group_size_120457",
                                   "main.segred_group_size_120520",
                                   "main.segred_group_size_120581",
                                   "main.segred_group_size_121030",
                                   "main.segred_group_size_121092",
                                   "main.segred_group_size_121723",
                                   "main.segred_group_size_121812",
                                   "main.segred_group_size_122656",
                                   "main.segred_group_size_122777",
                                   "main.segred_group_size_124510",
                                   "main.segred_group_size_124572",
                                   "main.segred_group_size_125203",
                                   "main.segred_group_size_125292",
                                   "main.segred_group_size_126136",
                                   "main.segred_group_size_126257",
                                   "main.segred_group_size_128533",
                                   "main.segred_num_groups_117093",
                                   "main.segred_num_groups_117937",
                                   "main.segred_num_groups_119237",
                                   "main.segred_num_groups_119944",
                                   "main.segred_num_groups_120459",
                                   "main.segred_num_groups_120522",
                                   "main.segred_num_groups_120583",
                                   "main.segred_num_groups_121032",
                                   "main.segred_num_groups_121094",
                                   "main.segred_num_groups_121725",
                                   "main.segred_num_groups_121814",
                                   "main.segred_num_groups_122658",
                                   "main.segred_num_groups_122779",
                                   "main.segred_num_groups_124512",
                                   "main.segred_num_groups_124574",
                                   "main.segred_num_groups_125205",
                                   "main.segred_num_groups_125294",
                                   "main.segred_num_groups_126138",
                                   "main.segred_num_groups_126259",
                                   "main.segred_num_groups_128535",
                                   "main.segscan_group_size_116843",
                                   "main.segscan_group_size_120422",
                                   "main.segscan_group_size_120485",
                                   "main.segscan_group_size_120547",
                                   "main.segscan_group_size_128137",
                                   "main.segscan_num_groups_116845",
                                   "main.segscan_num_groups_120424",
                                   "main.segscan_num_groups_120487",
                                   "main.segscan_num_groups_120549",
                                   "main.segscan_num_groups_128139",
                                   "main.suff_intra_par_0",
                                   "main.suff_intra_par_12",
                                   "main.suff_intra_par_19",
                                   "main.suff_intra_par_27",
                                   "main.suff_intra_par_28",
                                   "main.suff_intra_par_4",
                                   "main.suff_intra_par_7",
                                   "main.suff_outer_par_1",
                                   "main.suff_outer_par_10",
                                   "main.suff_outer_par_11",
                                   "main.suff_outer_par_13",
                                   "main.suff_outer_par_14",
                                   "main.suff_outer_par_15",
                                   "main.suff_outer_par_16",
                                   "main.suff_outer_par_17",
                                   "main.suff_outer_par_18",
                                   "main.suff_outer_par_2",
                                   "main.suff_outer_par_20",
                                   "main.suff_outer_par_21",
                                   "main.suff_outer_par_22",
                                   "main.suff_outer_par_23",
                                   "main.suff_outer_par_24",
                                   "main.suff_outer_par_25",
                                   "main.suff_outer_par_26",
                                   "main.suff_outer_par_29",
                                   "main.suff_outer_par_3",
                                   "main.suff_outer_par_5",
                                   "main.suff_outer_par_6",
                                   "main.suff_outer_par_8",
                                   "main.suff_outer_par_9",
                                   "main.tile_size_129243",
                                   "main.tile_size_129541"};
static const char *size_vars[] = {"builtinzhreplicate_f32zigroup_sizze_132961",
                                  "builtinzhreplicate_i64zigroup_sizze_132372",
                                  "mainzigroup_sizze_132363",
                                  "mainzigroup_sizze_132601",
                                  "mainzigroup_sizze_132606",
                                  "mainzigroup_sizze_132819",
                                  "mainzigroup_sizze_132824",
                                  "mainzisegmap_group_sizze_116798",
                                  "mainzisegmap_group_sizze_116916",
                                  "mainzisegmap_group_sizze_116953",
                                  "mainzisegmap_group_sizze_116994",
                                  "mainzisegmap_group_sizze_117079",
                                  "mainzisegmap_group_sizze_117352",
                                  "mainzisegmap_group_sizze_117736",
                                  "mainzisegmap_group_sizze_117862",
                                  "mainzisegmap_group_sizze_117963",
                                  "mainzisegmap_group_sizze_117978",
                                  "mainzisegmap_group_sizze_118169",
                                  "mainzisegmap_group_sizze_118191",
                                  "mainzisegmap_group_sizze_118652",
                                  "mainzisegmap_group_sizze_119036",
                                  "mainzisegmap_group_sizze_119162",
                                  "mainzisegmap_group_sizze_119263",
                                  "mainzisegmap_group_sizze_119278",
                                  "mainzisegmap_group_sizze_119469",
                                  "mainzisegmap_group_sizze_119491",
                                  "mainzisegmap_group_sizze_119815",
                                  "mainzisegmap_group_sizze_119847",
                                  "mainzisegmap_group_sizze_119931",
                                  "mainzisegmap_group_sizze_120063",
                                  "mainzisegmap_group_sizze_120135",
                                  "mainzisegmap_group_sizze_120745",
                                  "mainzisegmap_group_sizze_120813",
                                  "mainzisegmap_group_sizze_120954",
                                  "mainzisegmap_group_sizze_121082",
                                  "mainzisegmap_group_sizze_121414",
                                  "mainzisegmap_group_sizze_121614",
                                  "mainzisegmap_group_sizze_121793",
                                  "mainzisegmap_group_sizze_122247",
                                  "mainzisegmap_group_sizze_122511",
                                  "mainzisegmap_group_sizze_122739",
                                  "mainzisegmap_group_sizze_123941",
                                  "mainzisegmap_group_sizze_124119",
                                  "mainzisegmap_group_sizze_124205",
                                  "mainzisegmap_group_sizze_124242",
                                  "mainzisegmap_group_sizze_124293",
                                  "mainzisegmap_group_sizze_124434",
                                  "mainzisegmap_group_sizze_124562",
                                  "mainzisegmap_group_sizze_124894",
                                  "mainzisegmap_group_sizze_125094",
                                  "mainzisegmap_group_sizze_125273",
                                  "mainzisegmap_group_sizze_125727",
                                  "mainzisegmap_group_sizze_125991",
                                  "mainzisegmap_group_sizze_126219",
                                  "mainzisegmap_group_sizze_127421",
                                  "mainzisegmap_group_sizze_127599",
                                  "mainzisegmap_group_sizze_127654",
                                  "mainzisegmap_group_sizze_127710",
                                  "mainzisegmap_group_sizze_128094",
                                  "mainzisegmap_group_sizze_128492",
                                  "mainzisegmap_group_sizze_128523",
                                  "mainzisegmap_group_sizze_128582",
                                  "mainzisegmap_group_sizze_128673",
                                  "mainzisegmap_num_groups_116996",
                                  "mainzisegmap_num_groups_117354",
                                  "mainzisegmap_num_groups_118654",
                                  "mainzisegmap_num_groups_119849",
                                  "mainzisegmap_num_groups_120137",
                                  "mainzisegmap_num_groups_120815",
                                  "mainzisegmap_num_groups_121416",
                                  "mainzisegmap_num_groups_122249",
                                  "mainzisegmap_num_groups_124295",
                                  "mainzisegmap_num_groups_124896",
                                  "mainzisegmap_num_groups_125729",
                                  "mainzisegmap_num_groups_127712",
                                  "mainzisegred_group_sizze_117091",
                                  "mainzisegred_group_sizze_117935",
                                  "mainzisegred_group_sizze_119235",
                                  "mainzisegred_group_sizze_119942",
                                  "mainzisegred_group_sizze_120457",
                                  "mainzisegred_group_sizze_120520",
                                  "mainzisegred_group_sizze_120581",
                                  "mainzisegred_group_sizze_121030",
                                  "mainzisegred_group_sizze_121092",
                                  "mainzisegred_group_sizze_121723",
                                  "mainzisegred_group_sizze_121812",
                                  "mainzisegred_group_sizze_122656",
                                  "mainzisegred_group_sizze_122777",
                                  "mainzisegred_group_sizze_124510",
                                  "mainzisegred_group_sizze_124572",
                                  "mainzisegred_group_sizze_125203",
                                  "mainzisegred_group_sizze_125292",
                                  "mainzisegred_group_sizze_126136",
                                  "mainzisegred_group_sizze_126257",
                                  "mainzisegred_group_sizze_128533",
                                  "mainzisegred_num_groups_117093",
                                  "mainzisegred_num_groups_117937",
                                  "mainzisegred_num_groups_119237",
                                  "mainzisegred_num_groups_119944",
                                  "mainzisegred_num_groups_120459",
                                  "mainzisegred_num_groups_120522",
                                  "mainzisegred_num_groups_120583",
                                  "mainzisegred_num_groups_121032",
                                  "mainzisegred_num_groups_121094",
                                  "mainzisegred_num_groups_121725",
                                  "mainzisegred_num_groups_121814",
                                  "mainzisegred_num_groups_122658",
                                  "mainzisegred_num_groups_122779",
                                  "mainzisegred_num_groups_124512",
                                  "mainzisegred_num_groups_124574",
                                  "mainzisegred_num_groups_125205",
                                  "mainzisegred_num_groups_125294",
                                  "mainzisegred_num_groups_126138",
                                  "mainzisegred_num_groups_126259",
                                  "mainzisegred_num_groups_128535",
                                  "mainzisegscan_group_sizze_116843",
                                  "mainzisegscan_group_sizze_120422",
                                  "mainzisegscan_group_sizze_120485",
                                  "mainzisegscan_group_sizze_120547",
                                  "mainzisegscan_group_sizze_128137",
                                  "mainzisegscan_num_groups_116845",
                                  "mainzisegscan_num_groups_120424",
                                  "mainzisegscan_num_groups_120487",
                                  "mainzisegscan_num_groups_120549",
                                  "mainzisegscan_num_groups_128139",
                                  "mainzisuff_intra_par_0",
                                  "mainzisuff_intra_par_12",
                                  "mainzisuff_intra_par_19",
                                  "mainzisuff_intra_par_27",
                                  "mainzisuff_intra_par_28",
                                  "mainzisuff_intra_par_4",
                                  "mainzisuff_intra_par_7",
                                  "mainzisuff_outer_par_1",
                                  "mainzisuff_outer_par_10",
                                  "mainzisuff_outer_par_11",
                                  "mainzisuff_outer_par_13",
                                  "mainzisuff_outer_par_14",
                                  "mainzisuff_outer_par_15",
                                  "mainzisuff_outer_par_16",
                                  "mainzisuff_outer_par_17",
                                  "mainzisuff_outer_par_18",
                                  "mainzisuff_outer_par_2",
                                  "mainzisuff_outer_par_20",
                                  "mainzisuff_outer_par_21",
                                  "mainzisuff_outer_par_22",
                                  "mainzisuff_outer_par_23",
                                  "mainzisuff_outer_par_24",
                                  "mainzisuff_outer_par_25",
                                  "mainzisuff_outer_par_26",
                                  "mainzisuff_outer_par_29",
                                  "mainzisuff_outer_par_3",
                                  "mainzisuff_outer_par_5",
                                  "mainzisuff_outer_par_6",
                                  "mainzisuff_outer_par_8",
                                  "mainzisuff_outer_par_9",
                                  "mainzitile_sizze_129243",
                                  "mainzitile_sizze_129541"};
static const char *size_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",
                                     "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",
                                     "num_groups", "num_groups", "num_groups",
                                     "num_groups", "num_groups", "num_groups",
                                     "num_groups", "num_groups", "num_groups",
                                     "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", "num_groups",
                                     "num_groups", "num_groups", "num_groups",
                                     "num_groups", "num_groups", "num_groups",
                                     "num_groups", "num_groups", "num_groups",
                                     "num_groups", "num_groups", "num_groups",
                                     "num_groups", "num_groups", "num_groups",
                                     "num_groups", "group_size", "group_size",
                                     "group_size", "group_size", "group_size",
                                     "num_groups", "num_groups", "num_groups",
                                     "num_groups", "num_groups",
                                     "threshold(32,)",
                                     "threshold(32, !main.suff_outer_par_11)",
                                     "threshold(32,)",
                                     "threshold(32, !main.suff_outer_par_26)",
                                     "threshold(32, !main.suff_outer_par_26 !main.suff_intra_par_27)",
                                     "threshold(32, !main.suff_outer_par_3)",
                                     "threshold(32, !main.suff_outer_par_6)",
                                     "threshold(def,)",
                                     "threshold(def, !main.suff_outer_par_9)",
                                     "threshold(def,)", "threshold(def,)",
                                     "threshold(def, !main.suff_outer_par_13)",
                                     "threshold(def,)",
                                     "threshold(def, !main.suff_outer_par_15)",
                                     "threshold(def,)",
                                     "threshold(def, !main.suff_outer_par_17)",
                                     "threshold(def, !main.suff_outer_par_1)",
                                     "threshold(def,)",
                                     "threshold(def, !main.suff_outer_par_20)",
                                     "threshold(def,)",
                                     "threshold(def, !main.suff_outer_par_22)",
                                     "threshold(def,)",
                                     "threshold(def, !main.suff_outer_par_24)",
                                     "threshold(def,)", "threshold(def,)",
                                     "threshold(def,)",
                                     "threshold(def, !main.suff_outer_par_3 !main.suff_intra_par_4)",
                                     "threshold(def,)",
                                     "threshold(def, !main.suff_outer_par_6 !main.suff_intra_par_7)",
                                     "threshold(def,)", "tile_size",
                                     "tile_size"};
struct sizes {
    int64_t builtinzhreplicate_f32zigroup_sizze_132961;
    int64_t builtinzhreplicate_i64zigroup_sizze_132372;
    int64_t mainzigroup_sizze_132363;
    int64_t mainzigroup_sizze_132601;
    int64_t mainzigroup_sizze_132606;
    int64_t mainzigroup_sizze_132819;
    int64_t mainzigroup_sizze_132824;
    int64_t mainzisegmap_group_sizze_116798;
    int64_t mainzisegmap_group_sizze_116916;
    int64_t mainzisegmap_group_sizze_116953;
    int64_t mainzisegmap_group_sizze_116994;
    int64_t mainzisegmap_group_sizze_117079;
    int64_t mainzisegmap_group_sizze_117352;
    int64_t mainzisegmap_group_sizze_117736;
    int64_t mainzisegmap_group_sizze_117862;
    int64_t mainzisegmap_group_sizze_117963;
    int64_t mainzisegmap_group_sizze_117978;
    int64_t mainzisegmap_group_sizze_118169;
    int64_t mainzisegmap_group_sizze_118191;
    int64_t mainzisegmap_group_sizze_118652;
    int64_t mainzisegmap_group_sizze_119036;
    int64_t mainzisegmap_group_sizze_119162;
    int64_t mainzisegmap_group_sizze_119263;
    int64_t mainzisegmap_group_sizze_119278;
    int64_t mainzisegmap_group_sizze_119469;
    int64_t mainzisegmap_group_sizze_119491;
    int64_t mainzisegmap_group_sizze_119815;
    int64_t mainzisegmap_group_sizze_119847;
    int64_t mainzisegmap_group_sizze_119931;
    int64_t mainzisegmap_group_sizze_120063;
    int64_t mainzisegmap_group_sizze_120135;
    int64_t mainzisegmap_group_sizze_120745;
    int64_t mainzisegmap_group_sizze_120813;
    int64_t mainzisegmap_group_sizze_120954;
    int64_t mainzisegmap_group_sizze_121082;
    int64_t mainzisegmap_group_sizze_121414;
    int64_t mainzisegmap_group_sizze_121614;
    int64_t mainzisegmap_group_sizze_121793;
    int64_t mainzisegmap_group_sizze_122247;
    int64_t mainzisegmap_group_sizze_122511;
    int64_t mainzisegmap_group_sizze_122739;
    int64_t mainzisegmap_group_sizze_123941;
    int64_t mainzisegmap_group_sizze_124119;
    int64_t mainzisegmap_group_sizze_124205;
    int64_t mainzisegmap_group_sizze_124242;
    int64_t mainzisegmap_group_sizze_124293;
    int64_t mainzisegmap_group_sizze_124434;
    int64_t mainzisegmap_group_sizze_124562;
    int64_t mainzisegmap_group_sizze_124894;
    int64_t mainzisegmap_group_sizze_125094;
    int64_t mainzisegmap_group_sizze_125273;
    int64_t mainzisegmap_group_sizze_125727;
    int64_t mainzisegmap_group_sizze_125991;
    int64_t mainzisegmap_group_sizze_126219;
    int64_t mainzisegmap_group_sizze_127421;
    int64_t mainzisegmap_group_sizze_127599;
    int64_t mainzisegmap_group_sizze_127654;
    int64_t mainzisegmap_group_sizze_127710;
    int64_t mainzisegmap_group_sizze_128094;
    int64_t mainzisegmap_group_sizze_128492;
    int64_t mainzisegmap_group_sizze_128523;
    int64_t mainzisegmap_group_sizze_128582;
    int64_t mainzisegmap_group_sizze_128673;
    int64_t mainzisegmap_num_groups_116996;
    int64_t mainzisegmap_num_groups_117354;
    int64_t mainzisegmap_num_groups_118654;
    int64_t mainzisegmap_num_groups_119849;
    int64_t mainzisegmap_num_groups_120137;
    int64_t mainzisegmap_num_groups_120815;
    int64_t mainzisegmap_num_groups_121416;
    int64_t mainzisegmap_num_groups_122249;
    int64_t mainzisegmap_num_groups_124295;
    int64_t mainzisegmap_num_groups_124896;
    int64_t mainzisegmap_num_groups_125729;
    int64_t mainzisegmap_num_groups_127712;
    int64_t mainzisegred_group_sizze_117091;
    int64_t mainzisegred_group_sizze_117935;
    int64_t mainzisegred_group_sizze_119235;
    int64_t mainzisegred_group_sizze_119942;
    int64_t mainzisegred_group_sizze_120457;
    int64_t mainzisegred_group_sizze_120520;
    int64_t mainzisegred_group_sizze_120581;
    int64_t mainzisegred_group_sizze_121030;
    int64_t mainzisegred_group_sizze_121092;
    int64_t mainzisegred_group_sizze_121723;
    int64_t mainzisegred_group_sizze_121812;
    int64_t mainzisegred_group_sizze_122656;
    int64_t mainzisegred_group_sizze_122777;
    int64_t mainzisegred_group_sizze_124510;
    int64_t mainzisegred_group_sizze_124572;
    int64_t mainzisegred_group_sizze_125203;
    int64_t mainzisegred_group_sizze_125292;
    int64_t mainzisegred_group_sizze_126136;
    int64_t mainzisegred_group_sizze_126257;
    int64_t mainzisegred_group_sizze_128533;
    int64_t mainzisegred_num_groups_117093;
    int64_t mainzisegred_num_groups_117937;
    int64_t mainzisegred_num_groups_119237;
    int64_t mainzisegred_num_groups_119944;
    int64_t mainzisegred_num_groups_120459;
    int64_t mainzisegred_num_groups_120522;
    int64_t mainzisegred_num_groups_120583;
    int64_t mainzisegred_num_groups_121032;
    int64_t mainzisegred_num_groups_121094;
    int64_t mainzisegred_num_groups_121725;
    int64_t mainzisegred_num_groups_121814;
    int64_t mainzisegred_num_groups_122658;
    int64_t mainzisegred_num_groups_122779;
    int64_t mainzisegred_num_groups_124512;
    int64_t mainzisegred_num_groups_124574;
    int64_t mainzisegred_num_groups_125205;
    int64_t mainzisegred_num_groups_125294;
    int64_t mainzisegred_num_groups_126138;
    int64_t mainzisegred_num_groups_126259;
    int64_t mainzisegred_num_groups_128535;
    int64_t mainzisegscan_group_sizze_116843;
    int64_t mainzisegscan_group_sizze_120422;
    int64_t mainzisegscan_group_sizze_120485;
    int64_t mainzisegscan_group_sizze_120547;
    int64_t mainzisegscan_group_sizze_128137;
    int64_t mainzisegscan_num_groups_116845;
    int64_t mainzisegscan_num_groups_120424;
    int64_t mainzisegscan_num_groups_120487;
    int64_t mainzisegscan_num_groups_120549;
    int64_t mainzisegscan_num_groups_128139;
    int64_t mainzisuff_intra_par_0;
    int64_t mainzisuff_intra_par_12;
    int64_t mainzisuff_intra_par_19;
    int64_t mainzisuff_intra_par_27;
    int64_t mainzisuff_intra_par_28;
    int64_t mainzisuff_intra_par_4;
    int64_t mainzisuff_intra_par_7;
    int64_t mainzisuff_outer_par_1;
    int64_t mainzisuff_outer_par_10;
    int64_t mainzisuff_outer_par_11;
    int64_t mainzisuff_outer_par_13;
    int64_t mainzisuff_outer_par_14;
    int64_t mainzisuff_outer_par_15;
    int64_t mainzisuff_outer_par_16;
    int64_t mainzisuff_outer_par_17;
    int64_t mainzisuff_outer_par_18;
    int64_t mainzisuff_outer_par_2;
    int64_t mainzisuff_outer_par_20;
    int64_t mainzisuff_outer_par_21;
    int64_t mainzisuff_outer_par_22;
    int64_t mainzisuff_outer_par_23;
    int64_t mainzisuff_outer_par_24;
    int64_t mainzisuff_outer_par_25;
    int64_t mainzisuff_outer_par_26;
    int64_t mainzisuff_outer_par_29;
    int64_t mainzisuff_outer_par_3;
    int64_t mainzisuff_outer_par_5;
    int64_t mainzisuff_outer_par_6;
    int64_t mainzisuff_outer_par_8;
    int64_t mainzisuff_outer_par_9;
    int64_t mainzitile_sizze_129243;
    int64_t mainzitile_sizze_129541;
};
struct futhark_context_config {
    struct opencl_config opencl;
    int64_t sizes[157];
    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->num_build_opts = 0;
    cfg->build_opts = (const char **) malloc(sizeof(const char *));
    cfg->build_opts[0] = NULL;
    cfg->sizes[0] = 0;
    cfg->sizes[1] = 0;
    cfg->sizes[2] = 0;
    cfg->sizes[3] = 0;
    cfg->sizes[4] = 0;
    cfg->sizes[5] = 0;
    cfg->sizes[6] = 0;
    cfg->sizes[7] = 0;
    cfg->sizes[8] = 0;
    cfg->sizes[9] = 0;
    cfg->sizes[10] = 0;
    cfg->sizes[11] = 0;
    cfg->sizes[12] = 0;
    cfg->sizes[13] = 0;
    cfg->sizes[14] = 0;
    cfg->sizes[15] = 0;
    cfg->sizes[16] = 0;
    cfg->sizes[17] = 0;
    cfg->sizes[18] = 0;
    cfg->sizes[19] = 0;
    cfg->sizes[20] = 0;
    cfg->sizes[21] = 0;
    cfg->sizes[22] = 0;
    cfg->sizes[23] = 0;
    cfg->sizes[24] = 0;
    cfg->sizes[25] = 0;
    cfg->sizes[26] = 0;
    cfg->sizes[27] = 0;
    cfg->sizes[28] = 0;
    cfg->sizes[29] = 0;
    cfg->sizes[30] = 0;
    cfg->sizes[31] = 0;
    cfg->sizes[32] = 0;
    cfg->sizes[33] = 0;
    cfg->sizes[34] = 0;
    cfg->sizes[35] = 0;
    cfg->sizes[36] = 0;
    cfg->sizes[37] = 0;
    cfg->sizes[38] = 0;
    cfg->sizes[39] = 0;
    cfg->sizes[40] = 0;
    cfg->sizes[41] = 0;
    cfg->sizes[42] = 0;
    cfg->sizes[43] = 0;
    cfg->sizes[44] = 0;
    cfg->sizes[45] = 0;
    cfg->sizes[46] = 0;
    cfg->sizes[47] = 0;
    cfg->sizes[48] = 0;
    cfg->sizes[49] = 0;
    cfg->sizes[50] = 0;
    cfg->sizes[51] = 0;
    cfg->sizes[52] = 0;
    cfg->sizes[53] = 0;
    cfg->sizes[54] = 0;
    cfg->sizes[55] = 0;
    cfg->sizes[56] = 0;
    cfg->sizes[57] = 0;
    cfg->sizes[58] = 0;
    cfg->sizes[59] = 0;
    cfg->sizes[60] = 0;
    cfg->sizes[61] = 0;
    cfg->sizes[62] = 0;
    cfg->sizes[63] = 0;
    cfg->sizes[64] = 0;
    cfg->sizes[65] = 0;
    cfg->sizes[66] = 0;
    cfg->sizes[67] = 0;
    cfg->sizes[68] = 0;
    cfg->sizes[69] = 0;
    cfg->sizes[70] = 0;
    cfg->sizes[71] = 0;
    cfg->sizes[72] = 0;
    cfg->sizes[73] = 0;
    cfg->sizes[74] = 0;
    cfg->sizes[75] = 0;
    cfg->sizes[76] = 0;
    cfg->sizes[77] = 0;
    cfg->sizes[78] = 0;
    cfg->sizes[79] = 0;
    cfg->sizes[80] = 0;
    cfg->sizes[81] = 0;
    cfg->sizes[82] = 0;
    cfg->sizes[83] = 0;
    cfg->sizes[84] = 0;
    cfg->sizes[85] = 0;
    cfg->sizes[86] = 0;
    cfg->sizes[87] = 0;
    cfg->sizes[88] = 0;
    cfg->sizes[89] = 0;
    cfg->sizes[90] = 0;
    cfg->sizes[91] = 0;
    cfg->sizes[92] = 0;
    cfg->sizes[93] = 0;
    cfg->sizes[94] = 0;
    cfg->sizes[95] = 0;
    cfg->sizes[96] = 0;
    cfg->sizes[97] = 0;
    cfg->sizes[98] = 0;
    cfg->sizes[99] = 0;
    cfg->sizes[100] = 0;
    cfg->sizes[101] = 0;
    cfg->sizes[102] = 0;
    cfg->sizes[103] = 0;
    cfg->sizes[104] = 0;
    cfg->sizes[105] = 0;
    cfg->sizes[106] = 0;
    cfg->sizes[107] = 0;
    cfg->sizes[108] = 0;
    cfg->sizes[109] = 0;
    cfg->sizes[110] = 0;
    cfg->sizes[111] = 0;
    cfg->sizes[112] = 0;
    cfg->sizes[113] = 0;
    cfg->sizes[114] = 0;
    cfg->sizes[115] = 0;
    cfg->sizes[116] = 0;
    cfg->sizes[117] = 0;
    cfg->sizes[118] = 0;
    cfg->sizes[119] = 0;
    cfg->sizes[120] = 0;
    cfg->sizes[121] = 0;
    cfg->sizes[122] = 0;
    cfg->sizes[123] = 0;
    cfg->sizes[124] = 0;
    cfg->sizes[125] = 32;
    cfg->sizes[126] = 32;
    cfg->sizes[127] = 32;
    cfg->sizes[128] = 32;
    cfg->sizes[129] = 32;
    cfg->sizes[130] = 32;
    cfg->sizes[131] = 32;
    cfg->sizes[132] = 0;
    cfg->sizes[133] = 0;
    cfg->sizes[134] = 0;
    cfg->sizes[135] = 0;
    cfg->sizes[136] = 0;
    cfg->sizes[137] = 0;
    cfg->sizes[138] = 0;
    cfg->sizes[139] = 0;
    cfg->sizes[140] = 0;
    cfg->sizes[141] = 0;
    cfg->sizes[142] = 0;
    cfg->sizes[143] = 0;
    cfg->sizes[144] = 0;
    cfg->sizes[145] = 0;
    cfg->sizes[146] = 0;
    cfg->sizes[147] = 0;
    cfg->sizes[148] = 0;
    cfg->sizes[149] = 0;
    cfg->sizes[150] = 0;
    cfg->sizes[151] = 0;
    cfg->sizes[152] = 0;
    cfg->sizes[153] = 0;
    cfg->sizes[154] = 0;
    cfg->sizes[155] = 0;
    cfg->sizes[156] = 0;
    opencl_config_init(&cfg->opencl, 157, size_names, size_vars, cfg->sizes,
                       size_classes);
    return cfg;
}
void futhark_context_config_free(struct futhark_context_config *cfg)
{
    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_size(struct futhark_context_config *cfg, const
                                    char *size_name, size_t size_value)
{
    for (int i = 0; i < 157; i++) {
        if (strcmp(size_name, size_names[i]) == 0) {
            cfg->sizes[i] = size_value;
            return 0;
        }
    }
    if (strcmp(size_name, "default_group_size") == 0) {
        cfg->opencl.default_group_size = size_value;
        return 0;
    }
    if (strcmp(size_name, "default_num_groups") == 0) {
        cfg->opencl.default_num_groups = size_value;
        return 0;
    }
    if (strcmp(size_name, "default_threshold") == 0) {
        cfg->opencl.default_threshold = size_value;
        return 0;
    }
    if (strcmp(size_name, "default_tile_size") == 0) {
        cfg->opencl.default_tile_size = size_value;
        return 0;
    }
    if (strcmp(size_name, "default_reg_tile_size") == 0) {
        cfg->opencl.default_reg_tile_size = size_value;
        return 0;
    }
    return 1;
}
struct futhark_context {
    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_132470;
    struct memblock_device mainzicounter_mem_132683;
    struct memblock_device mainzicounter_mem_132901;
    struct memblock_device mainzicounter_mem_133066;
    struct memblock_device mainzicounter_mem_133233;
    struct memblock_device mainzicounter_mem_133353;
    struct memblock_device mainzicounter_mem_133473;
    struct memblock_device mainzicounter_mem_133637;
    struct memblock_device mainzicounter_mem_133715;
    struct memblock_device mainzicounter_mem_133837;
    struct memblock_device mainzicounter_mem_133934;
    struct memblock_device mainzicounter_mem_134080;
    struct memblock_device mainzicounter_mem_134189;
    struct memblock_device mainzicounter_mem_134414;
    struct memblock_device mainzicounter_mem_134492;
    struct memblock_device mainzicounter_mem_134614;
    struct memblock_device mainzicounter_mem_134711;
    struct memblock_device mainzicounter_mem_134857;
    struct memblock_device mainzicounter_mem_134966;
    struct memblock_device mainzicounter_mem_135353;
    int total_runs;
    long total_runtime;
    cl_kernel builtinzhreplicate_f32zireplicate_132958;
    cl_kernel builtinzhreplicate_i64zireplicate_132369;
    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 gpu_map_transpose_i64;
    cl_kernel gpu_map_transpose_i64_low_height;
    cl_kernel gpu_map_transpose_i64_low_width;
    cl_kernel gpu_map_transpose_i64_small;
    cl_kernel mainzicopy_132360;
    cl_kernel mainzicopy_132598;
    cl_kernel mainzicopy_132603;
    cl_kernel mainzicopy_132816;
    cl_kernel mainzicopy_132821;
    cl_kernel mainziscan_stage1_116849;
    cl_kernel mainziscan_stage1_120428;
    cl_kernel mainziscan_stage1_120491;
    cl_kernel mainziscan_stage1_120553;
    cl_kernel mainziscan_stage1_128143;
    cl_kernel mainziscan_stage2_116849;
    cl_kernel mainziscan_stage2_120428;
    cl_kernel mainziscan_stage2_120491;
    cl_kernel mainziscan_stage2_120553;
    cl_kernel mainziscan_stage2_128143;
    cl_kernel mainziscan_stage3_116849;
    cl_kernel mainziscan_stage3_120428;
    cl_kernel mainziscan_stage3_120491;
    cl_kernel mainziscan_stage3_120553;
    cl_kernel mainziscan_stage3_128143;
    cl_kernel mainzisegmap_116795;
    cl_kernel mainzisegmap_116913;
    cl_kernel mainzisegmap_116950;
    cl_kernel mainzisegmap_116992;
    cl_kernel mainzisegmap_117076;
    cl_kernel mainzisegmap_117350;
    cl_kernel mainzisegmap_117733;
    cl_kernel mainzisegmap_117859;
    cl_kernel mainzisegmap_117959;
    cl_kernel mainzisegmap_117975;
    cl_kernel mainzisegmap_118167;
    cl_kernel mainzisegmap_118188;
    cl_kernel mainzisegmap_118650;
    cl_kernel mainzisegmap_119033;
    cl_kernel mainzisegmap_119159;
    cl_kernel mainzisegmap_119259;
    cl_kernel mainzisegmap_119275;
    cl_kernel mainzisegmap_119467;
    cl_kernel mainzisegmap_119488;
    cl_kernel mainzisegmap_119812;
    cl_kernel mainzisegmap_119845;
    cl_kernel mainzisegmap_119928;
    cl_kernel mainzisegmap_120060;
    cl_kernel mainzisegmap_120133;
    cl_kernel mainzisegmap_120742;
    cl_kernel mainzisegmap_120811;
    cl_kernel mainzisegmap_120951;
    cl_kernel mainzisegmap_121079;
    cl_kernel mainzisegmap_121412;
    cl_kernel mainzisegmap_121611;
    cl_kernel mainzisegmap_121790;
    cl_kernel mainzisegmap_122245;
    cl_kernel mainzisegmap_122508;
    cl_kernel mainzisegmap_122736;
    cl_kernel mainzisegmap_123938;
    cl_kernel mainzisegmap_124116;
    cl_kernel mainzisegmap_124202;
    cl_kernel mainzisegmap_124239;
    cl_kernel mainzisegmap_124291;
    cl_kernel mainzisegmap_124431;
    cl_kernel mainzisegmap_124559;
    cl_kernel mainzisegmap_124892;
    cl_kernel mainzisegmap_125091;
    cl_kernel mainzisegmap_125270;
    cl_kernel mainzisegmap_125725;
    cl_kernel mainzisegmap_125988;
    cl_kernel mainzisegmap_126216;
    cl_kernel mainzisegmap_127418;
    cl_kernel mainzisegmap_127596;
    cl_kernel mainzisegmap_127651;
    cl_kernel mainzisegmap_127708;
    cl_kernel mainzisegmap_128091;
    cl_kernel mainzisegmap_128490;
    cl_kernel mainzisegmap_128521;
    cl_kernel mainzisegmap_128579;
    cl_kernel mainzisegmap_128670;
    cl_kernel mainzisegmap_intragroup_116763;
    cl_kernel mainzisegmap_intragroup_117346;
    cl_kernel mainzisegmap_intragroup_118646;
    cl_kernel mainzisegmap_intragroup_120129;
    cl_kernel mainzisegmap_intragroup_123347;
    cl_kernel mainzisegmap_intragroup_123476;
    cl_kernel mainzisegmap_intragroup_123686;
    cl_kernel mainzisegmap_intragroup_124166;
    cl_kernel mainzisegmap_intragroup_126827;
    cl_kernel mainzisegmap_intragroup_126956;
    cl_kernel mainzisegmap_intragroup_127166;
    cl_kernel mainzisegmap_intragroup_127704;
    cl_kernel mainzisegmap_intragroup_127994;
    cl_kernel mainzisegmap_intragroup_129249;
    cl_kernel mainzisegmap_intragroup_129547;
    cl_kernel mainzisegred_large_117097;
    cl_kernel mainzisegred_large_117941;
    cl_kernel mainzisegred_large_119241;
    cl_kernel mainzisegred_large_119948;
    cl_kernel mainzisegred_large_120463;
    cl_kernel mainzisegred_large_120526;
    cl_kernel mainzisegred_large_120587;
    cl_kernel mainzisegred_large_121036;
    cl_kernel mainzisegred_large_121098;
    cl_kernel mainzisegred_large_121729;
    cl_kernel mainzisegred_large_121818;
    cl_kernel mainzisegred_large_122662;
    cl_kernel mainzisegred_large_122783;
    cl_kernel mainzisegred_large_124516;
    cl_kernel mainzisegred_large_124578;
    cl_kernel mainzisegred_large_125209;
    cl_kernel mainzisegred_large_125298;
    cl_kernel mainzisegred_large_126142;
    cl_kernel mainzisegred_large_126263;
    cl_kernel mainzisegred_large_128539;
    cl_kernel mainzisegred_small_117097;
    cl_kernel mainzisegred_small_117941;
    cl_kernel mainzisegred_small_119241;
    cl_kernel mainzisegred_small_119948;
    cl_kernel mainzisegred_small_120463;
    cl_kernel mainzisegred_small_120526;
    cl_kernel mainzisegred_small_120587;
    cl_kernel mainzisegred_small_121036;
    cl_kernel mainzisegred_small_121098;
    cl_kernel mainzisegred_small_121729;
    cl_kernel mainzisegred_small_121818;
    cl_kernel mainzisegred_small_122662;
    cl_kernel mainzisegred_small_122783;
    cl_kernel mainzisegred_small_124516;
    cl_kernel mainzisegred_small_124578;
    cl_kernel mainzisegred_small_125209;
    cl_kernel mainzisegred_small_125298;
    cl_kernel mainzisegred_small_126142;
    cl_kernel mainzisegred_small_126263;
    cl_kernel mainzisegred_small_128539;
    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_132958_total_runtime;
    int builtinzhreplicate_f32zireplicate_132958_runs;
    int64_t builtinzhreplicate_i64zireplicate_132369_total_runtime;
    int builtinzhreplicate_i64zireplicate_132369_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 gpu_map_transpose_i64_total_runtime;
    int gpu_map_transpose_i64_runs;
    int64_t gpu_map_transpose_i64_low_height_total_runtime;
    int gpu_map_transpose_i64_low_height_runs;
    int64_t gpu_map_transpose_i64_low_width_total_runtime;
    int gpu_map_transpose_i64_low_width_runs;
    int64_t gpu_map_transpose_i64_small_total_runtime;
    int gpu_map_transpose_i64_small_runs;
    int64_t mainzicopy_132360_total_runtime;
    int mainzicopy_132360_runs;
    int64_t mainzicopy_132598_total_runtime;
    int mainzicopy_132598_runs;
    int64_t mainzicopy_132603_total_runtime;
    int mainzicopy_132603_runs;
    int64_t mainzicopy_132816_total_runtime;
    int mainzicopy_132816_runs;
    int64_t mainzicopy_132821_total_runtime;
    int mainzicopy_132821_runs;
    int64_t mainziscan_stage1_116849_total_runtime;
    int mainziscan_stage1_116849_runs;
    int64_t mainziscan_stage1_120428_total_runtime;
    int mainziscan_stage1_120428_runs;
    int64_t mainziscan_stage1_120491_total_runtime;
    int mainziscan_stage1_120491_runs;
    int64_t mainziscan_stage1_120553_total_runtime;
    int mainziscan_stage1_120553_runs;
    int64_t mainziscan_stage1_128143_total_runtime;
    int mainziscan_stage1_128143_runs;
    int64_t mainziscan_stage2_116849_total_runtime;
    int mainziscan_stage2_116849_runs;
    int64_t mainziscan_stage2_120428_total_runtime;
    int mainziscan_stage2_120428_runs;
    int64_t mainziscan_stage2_120491_total_runtime;
    int mainziscan_stage2_120491_runs;
    int64_t mainziscan_stage2_120553_total_runtime;
    int mainziscan_stage2_120553_runs;
    int64_t mainziscan_stage2_128143_total_runtime;
    int mainziscan_stage2_128143_runs;
    int64_t mainziscan_stage3_116849_total_runtime;
    int mainziscan_stage3_116849_runs;
    int64_t mainziscan_stage3_120428_total_runtime;
    int mainziscan_stage3_120428_runs;
    int64_t mainziscan_stage3_120491_total_runtime;
    int mainziscan_stage3_120491_runs;
    int64_t mainziscan_stage3_120553_total_runtime;
    int mainziscan_stage3_120553_runs;
    int64_t mainziscan_stage3_128143_total_runtime;
    int mainziscan_stage3_128143_runs;
    int64_t mainzisegmap_116795_total_runtime;
    int mainzisegmap_116795_runs;
    int64_t mainzisegmap_116913_total_runtime;
    int mainzisegmap_116913_runs;
    int64_t mainzisegmap_116950_total_runtime;
    int mainzisegmap_116950_runs;
    int64_t mainzisegmap_116992_total_runtime;
    int mainzisegmap_116992_runs;
    int64_t mainzisegmap_117076_total_runtime;
    int mainzisegmap_117076_runs;
    int64_t mainzisegmap_117350_total_runtime;
    int mainzisegmap_117350_runs;
    int64_t mainzisegmap_117733_total_runtime;
    int mainzisegmap_117733_runs;
    int64_t mainzisegmap_117859_total_runtime;
    int mainzisegmap_117859_runs;
    int64_t mainzisegmap_117959_total_runtime;
    int mainzisegmap_117959_runs;
    int64_t mainzisegmap_117975_total_runtime;
    int mainzisegmap_117975_runs;
    int64_t mainzisegmap_118167_total_runtime;
    int mainzisegmap_118167_runs;
    int64_t mainzisegmap_118188_total_runtime;
    int mainzisegmap_118188_runs;
    int64_t mainzisegmap_118650_total_runtime;
    int mainzisegmap_118650_runs;
    int64_t mainzisegmap_119033_total_runtime;
    int mainzisegmap_119033_runs;
    int64_t mainzisegmap_119159_total_runtime;
    int mainzisegmap_119159_runs;
    int64_t mainzisegmap_119259_total_runtime;
    int mainzisegmap_119259_runs;
    int64_t mainzisegmap_119275_total_runtime;
    int mainzisegmap_119275_runs;
    int64_t mainzisegmap_119467_total_runtime;
    int mainzisegmap_119467_runs;
    int64_t mainzisegmap_119488_total_runtime;
    int mainzisegmap_119488_runs;
    int64_t mainzisegmap_119812_total_runtime;
    int mainzisegmap_119812_runs;
    int64_t mainzisegmap_119845_total_runtime;
    int mainzisegmap_119845_runs;
    int64_t mainzisegmap_119928_total_runtime;
    int mainzisegmap_119928_runs;
    int64_t mainzisegmap_120060_total_runtime;
    int mainzisegmap_120060_runs;
    int64_t mainzisegmap_120133_total_runtime;
    int mainzisegmap_120133_runs;
    int64_t mainzisegmap_120742_total_runtime;
    int mainzisegmap_120742_runs;
    int64_t mainzisegmap_120811_total_runtime;
    int mainzisegmap_120811_runs;
    int64_t mainzisegmap_120951_total_runtime;
    int mainzisegmap_120951_runs;
    int64_t mainzisegmap_121079_total_runtime;
    int mainzisegmap_121079_runs;
    int64_t mainzisegmap_121412_total_runtime;
    int mainzisegmap_121412_runs;
    int64_t mainzisegmap_121611_total_runtime;
    int mainzisegmap_121611_runs;
    int64_t mainzisegmap_121790_total_runtime;
    int mainzisegmap_121790_runs;
    int64_t mainzisegmap_122245_total_runtime;
    int mainzisegmap_122245_runs;
    int64_t mainzisegmap_122508_total_runtime;
    int mainzisegmap_122508_runs;
    int64_t mainzisegmap_122736_total_runtime;
    int mainzisegmap_122736_runs;
    int64_t mainzisegmap_123938_total_runtime;
    int mainzisegmap_123938_runs;
    int64_t mainzisegmap_124116_total_runtime;
    int mainzisegmap_124116_runs;
    int64_t mainzisegmap_124202_total_runtime;
    int mainzisegmap_124202_runs;
    int64_t mainzisegmap_124239_total_runtime;
    int mainzisegmap_124239_runs;
    int64_t mainzisegmap_124291_total_runtime;
    int mainzisegmap_124291_runs;
    int64_t mainzisegmap_124431_total_runtime;
    int mainzisegmap_124431_runs;
    int64_t mainzisegmap_124559_total_runtime;
    int mainzisegmap_124559_runs;
    int64_t mainzisegmap_124892_total_runtime;
    int mainzisegmap_124892_runs;
    int64_t mainzisegmap_125091_total_runtime;
    int mainzisegmap_125091_runs;
    int64_t mainzisegmap_125270_total_runtime;
    int mainzisegmap_125270_runs;
    int64_t mainzisegmap_125725_total_runtime;
    int mainzisegmap_125725_runs;
    int64_t mainzisegmap_125988_total_runtime;
    int mainzisegmap_125988_runs;
    int64_t mainzisegmap_126216_total_runtime;
    int mainzisegmap_126216_runs;
    int64_t mainzisegmap_127418_total_runtime;
    int mainzisegmap_127418_runs;
    int64_t mainzisegmap_127596_total_runtime;
    int mainzisegmap_127596_runs;
    int64_t mainzisegmap_127651_total_runtime;
    int mainzisegmap_127651_runs;
    int64_t mainzisegmap_127708_total_runtime;
    int mainzisegmap_127708_runs;
    int64_t mainzisegmap_128091_total_runtime;
    int mainzisegmap_128091_runs;
    int64_t mainzisegmap_128490_total_runtime;
    int mainzisegmap_128490_runs;
    int64_t mainzisegmap_128521_total_runtime;
    int mainzisegmap_128521_runs;
    int64_t mainzisegmap_128579_total_runtime;
    int mainzisegmap_128579_runs;
    int64_t mainzisegmap_128670_total_runtime;
    int mainzisegmap_128670_runs;
    int64_t mainzisegmap_intragroup_116763_total_runtime;
    int mainzisegmap_intragroup_116763_runs;
    int64_t mainzisegmap_intragroup_117346_total_runtime;
    int mainzisegmap_intragroup_117346_runs;
    int64_t mainzisegmap_intragroup_118646_total_runtime;
    int mainzisegmap_intragroup_118646_runs;
    int64_t mainzisegmap_intragroup_120129_total_runtime;
    int mainzisegmap_intragroup_120129_runs;
    int64_t mainzisegmap_intragroup_123347_total_runtime;
    int mainzisegmap_intragroup_123347_runs;
    int64_t mainzisegmap_intragroup_123476_total_runtime;
    int mainzisegmap_intragroup_123476_runs;
    int64_t mainzisegmap_intragroup_123686_total_runtime;
    int mainzisegmap_intragroup_123686_runs;
    int64_t mainzisegmap_intragroup_124166_total_runtime;
    int mainzisegmap_intragroup_124166_runs;
    int64_t mainzisegmap_intragroup_126827_total_runtime;
    int mainzisegmap_intragroup_126827_runs;
    int64_t mainzisegmap_intragroup_126956_total_runtime;
    int mainzisegmap_intragroup_126956_runs;
    int64_t mainzisegmap_intragroup_127166_total_runtime;
    int mainzisegmap_intragroup_127166_runs;
    int64_t mainzisegmap_intragroup_127704_total_runtime;
    int mainzisegmap_intragroup_127704_runs;
    int64_t mainzisegmap_intragroup_127994_total_runtime;
    int mainzisegmap_intragroup_127994_runs;
    int64_t mainzisegmap_intragroup_129249_total_runtime;
    int mainzisegmap_intragroup_129249_runs;
    int64_t mainzisegmap_intragroup_129547_total_runtime;
    int mainzisegmap_intragroup_129547_runs;
    int64_t mainzisegred_large_117097_total_runtime;
    int mainzisegred_large_117097_runs;
    int64_t mainzisegred_large_117941_total_runtime;
    int mainzisegred_large_117941_runs;
    int64_t mainzisegred_large_119241_total_runtime;
    int mainzisegred_large_119241_runs;
    int64_t mainzisegred_large_119948_total_runtime;
    int mainzisegred_large_119948_runs;
    int64_t mainzisegred_large_120463_total_runtime;
    int mainzisegred_large_120463_runs;
    int64_t mainzisegred_large_120526_total_runtime;
    int mainzisegred_large_120526_runs;
    int64_t mainzisegred_large_120587_total_runtime;
    int mainzisegred_large_120587_runs;
    int64_t mainzisegred_large_121036_total_runtime;
    int mainzisegred_large_121036_runs;
    int64_t mainzisegred_large_121098_total_runtime;
    int mainzisegred_large_121098_runs;
    int64_t mainzisegred_large_121729_total_runtime;
    int mainzisegred_large_121729_runs;
    int64_t mainzisegred_large_121818_total_runtime;
    int mainzisegred_large_121818_runs;
    int64_t mainzisegred_large_122662_total_runtime;
    int mainzisegred_large_122662_runs;
    int64_t mainzisegred_large_122783_total_runtime;
    int mainzisegred_large_122783_runs;
    int64_t mainzisegred_large_124516_total_runtime;
    int mainzisegred_large_124516_runs;
    int64_t mainzisegred_large_124578_total_runtime;
    int mainzisegred_large_124578_runs;
    int64_t mainzisegred_large_125209_total_runtime;
    int mainzisegred_large_125209_runs;
    int64_t mainzisegred_large_125298_total_runtime;
    int mainzisegred_large_125298_runs;
    int64_t mainzisegred_large_126142_total_runtime;
    int mainzisegred_large_126142_runs;
    int64_t mainzisegred_large_126263_total_runtime;
    int mainzisegred_large_126263_runs;
    int64_t mainzisegred_large_128539_total_runtime;
    int mainzisegred_large_128539_runs;
    int64_t mainzisegred_small_117097_total_runtime;
    int mainzisegred_small_117097_runs;
    int64_t mainzisegred_small_117941_total_runtime;
    int mainzisegred_small_117941_runs;
    int64_t mainzisegred_small_119241_total_runtime;
    int mainzisegred_small_119241_runs;
    int64_t mainzisegred_small_119948_total_runtime;
    int mainzisegred_small_119948_runs;
    int64_t mainzisegred_small_120463_total_runtime;
    int mainzisegred_small_120463_runs;
    int64_t mainzisegred_small_120526_total_runtime;
    int mainzisegred_small_120526_runs;
    int64_t mainzisegred_small_120587_total_runtime;
    int mainzisegred_small_120587_runs;
    int64_t mainzisegred_small_121036_total_runtime;
    int mainzisegred_small_121036_runs;
    int64_t mainzisegred_small_121098_total_runtime;
    int mainzisegred_small_121098_runs;
    int64_t mainzisegred_small_121729_total_runtime;
    int mainzisegred_small_121729_runs;
    int64_t mainzisegred_small_121818_total_runtime;
    int mainzisegred_small_121818_runs;
    int64_t mainzisegred_small_122662_total_runtime;
    int mainzisegred_small_122662_runs;
    int64_t mainzisegred_small_122783_total_runtime;
    int mainzisegred_small_122783_runs;
    int64_t mainzisegred_small_124516_total_runtime;
    int mainzisegred_small_124516_runs;
    int64_t mainzisegred_small_124578_total_runtime;
    int mainzisegred_small_124578_runs;
    int64_t mainzisegred_small_125209_total_runtime;
    int mainzisegred_small_125209_runs;
    int64_t mainzisegred_small_125298_total_runtime;
    int mainzisegred_small_125298_runs;
    int64_t mainzisegred_small_126142_total_runtime;
    int mainzisegred_small_126142_runs;
    int64_t mainzisegred_small_126263_total_runtime;
    int mainzisegred_small_126263_runs;
    int64_t mainzisegred_small_128539_total_runtime;
    int mainzisegred_small_128539_runs;
    cl_mem global_failure;
    cl_mem global_failure_args;
    struct opencl_context opencl;
    struct sizes sizes;
    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_132958_total_runtime = 0;
    ctx->builtinzhreplicate_f32zireplicate_132958_runs = 0;
    ctx->builtinzhreplicate_i64zireplicate_132369_total_runtime = 0;
    ctx->builtinzhreplicate_i64zireplicate_132369_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->gpu_map_transpose_i64_total_runtime = 0;
    ctx->gpu_map_transpose_i64_runs = 0;
    ctx->gpu_map_transpose_i64_low_height_total_runtime = 0;
    ctx->gpu_map_transpose_i64_low_height_runs = 0;
    ctx->gpu_map_transpose_i64_low_width_total_runtime = 0;
    ctx->gpu_map_transpose_i64_low_width_runs = 0;
    ctx->gpu_map_transpose_i64_small_total_runtime = 0;
    ctx->gpu_map_transpose_i64_small_runs = 0;
    ctx->mainzicopy_132360_total_runtime = 0;
    ctx->mainzicopy_132360_runs = 0;
    ctx->mainzicopy_132598_total_runtime = 0;
    ctx->mainzicopy_132598_runs = 0;
    ctx->mainzicopy_132603_total_runtime = 0;
    ctx->mainzicopy_132603_runs = 0;
    ctx->mainzicopy_132816_total_runtime = 0;
    ctx->mainzicopy_132816_runs = 0;
    ctx->mainzicopy_132821_total_runtime = 0;
    ctx->mainzicopy_132821_runs = 0;
    ctx->mainziscan_stage1_116849_total_runtime = 0;
    ctx->mainziscan_stage1_116849_runs = 0;
    ctx->mainziscan_stage1_120428_total_runtime = 0;
    ctx->mainziscan_stage1_120428_runs = 0;
    ctx->mainziscan_stage1_120491_total_runtime = 0;
    ctx->mainziscan_stage1_120491_runs = 0;
    ctx->mainziscan_stage1_120553_total_runtime = 0;
    ctx->mainziscan_stage1_120553_runs = 0;
    ctx->mainziscan_stage1_128143_total_runtime = 0;
    ctx->mainziscan_stage1_128143_runs = 0;
    ctx->mainziscan_stage2_116849_total_runtime = 0;
    ctx->mainziscan_stage2_116849_runs = 0;
    ctx->mainziscan_stage2_120428_total_runtime = 0;
    ctx->mainziscan_stage2_120428_runs = 0;
    ctx->mainziscan_stage2_120491_total_runtime = 0;
    ctx->mainziscan_stage2_120491_runs = 0;
    ctx->mainziscan_stage2_120553_total_runtime = 0;
    ctx->mainziscan_stage2_120553_runs = 0;
    ctx->mainziscan_stage2_128143_total_runtime = 0;
    ctx->mainziscan_stage2_128143_runs = 0;
    ctx->mainziscan_stage3_116849_total_runtime = 0;
    ctx->mainziscan_stage3_116849_runs = 0;
    ctx->mainziscan_stage3_120428_total_runtime = 0;
    ctx->mainziscan_stage3_120428_runs = 0;
    ctx->mainziscan_stage3_120491_total_runtime = 0;
    ctx->mainziscan_stage3_120491_runs = 0;
    ctx->mainziscan_stage3_120553_total_runtime = 0;
    ctx->mainziscan_stage3_120553_runs = 0;
    ctx->mainziscan_stage3_128143_total_runtime = 0;
    ctx->mainziscan_stage3_128143_runs = 0;
    ctx->mainzisegmap_116795_total_runtime = 0;
    ctx->mainzisegmap_116795_runs = 0;
    ctx->mainzisegmap_116913_total_runtime = 0;
    ctx->mainzisegmap_116913_runs = 0;
    ctx->mainzisegmap_116950_total_runtime = 0;
    ctx->mainzisegmap_116950_runs = 0;
    ctx->mainzisegmap_116992_total_runtime = 0;
    ctx->mainzisegmap_116992_runs = 0;
    ctx->mainzisegmap_117076_total_runtime = 0;
    ctx->mainzisegmap_117076_runs = 0;
    ctx->mainzisegmap_117350_total_runtime = 0;
    ctx->mainzisegmap_117350_runs = 0;
    ctx->mainzisegmap_117733_total_runtime = 0;
    ctx->mainzisegmap_117733_runs = 0;
    ctx->mainzisegmap_117859_total_runtime = 0;
    ctx->mainzisegmap_117859_runs = 0;
    ctx->mainzisegmap_117959_total_runtime = 0;
    ctx->mainzisegmap_117959_runs = 0;
    ctx->mainzisegmap_117975_total_runtime = 0;
    ctx->mainzisegmap_117975_runs = 0;
    ctx->mainzisegmap_118167_total_runtime = 0;
    ctx->mainzisegmap_118167_runs = 0;
    ctx->mainzisegmap_118188_total_runtime = 0;
    ctx->mainzisegmap_118188_runs = 0;
    ctx->mainzisegmap_118650_total_runtime = 0;
    ctx->mainzisegmap_118650_runs = 0;
    ctx->mainzisegmap_119033_total_runtime = 0;
    ctx->mainzisegmap_119033_runs = 0;
    ctx->mainzisegmap_119159_total_runtime = 0;
    ctx->mainzisegmap_119159_runs = 0;
    ctx->mainzisegmap_119259_total_runtime = 0;
    ctx->mainzisegmap_119259_runs = 0;
    ctx->mainzisegmap_119275_total_runtime = 0;
    ctx->mainzisegmap_119275_runs = 0;
    ctx->mainzisegmap_119467_total_runtime = 0;
    ctx->mainzisegmap_119467_runs = 0;
    ctx->mainzisegmap_119488_total_runtime = 0;
    ctx->mainzisegmap_119488_runs = 0;
    ctx->mainzisegmap_119812_total_runtime = 0;
    ctx->mainzisegmap_119812_runs = 0;
    ctx->mainzisegmap_119845_total_runtime = 0;
    ctx->mainzisegmap_119845_runs = 0;
    ctx->mainzisegmap_119928_total_runtime = 0;
    ctx->mainzisegmap_119928_runs = 0;
    ctx->mainzisegmap_120060_total_runtime = 0;
    ctx->mainzisegmap_120060_runs = 0;
    ctx->mainzisegmap_120133_total_runtime = 0;
    ctx->mainzisegmap_120133_runs = 0;
    ctx->mainzisegmap_120742_total_runtime = 0;
    ctx->mainzisegmap_120742_runs = 0;
    ctx->mainzisegmap_120811_total_runtime = 0;
    ctx->mainzisegmap_120811_runs = 0;
    ctx->mainzisegmap_120951_total_runtime = 0;
    ctx->mainzisegmap_120951_runs = 0;
    ctx->mainzisegmap_121079_total_runtime = 0;
    ctx->mainzisegmap_121079_runs = 0;
    ctx->mainzisegmap_121412_total_runtime = 0;
    ctx->mainzisegmap_121412_runs = 0;
    ctx->mainzisegmap_121611_total_runtime = 0;
    ctx->mainzisegmap_121611_runs = 0;
    ctx->mainzisegmap_121790_total_runtime = 0;
    ctx->mainzisegmap_121790_runs = 0;
    ctx->mainzisegmap_122245_total_runtime = 0;
    ctx->mainzisegmap_122245_runs = 0;
    ctx->mainzisegmap_122508_total_runtime = 0;
    ctx->mainzisegmap_122508_runs = 0;
    ctx->mainzisegmap_122736_total_runtime = 0;
    ctx->mainzisegmap_122736_runs = 0;
    ctx->mainzisegmap_123938_total_runtime = 0;
    ctx->mainzisegmap_123938_runs = 0;
    ctx->mainzisegmap_124116_total_runtime = 0;
    ctx->mainzisegmap_124116_runs = 0;
    ctx->mainzisegmap_124202_total_runtime = 0;
    ctx->mainzisegmap_124202_runs = 0;
    ctx->mainzisegmap_124239_total_runtime = 0;
    ctx->mainzisegmap_124239_runs = 0;
    ctx->mainzisegmap_124291_total_runtime = 0;
    ctx->mainzisegmap_124291_runs = 0;
    ctx->mainzisegmap_124431_total_runtime = 0;
    ctx->mainzisegmap_124431_runs = 0;
    ctx->mainzisegmap_124559_total_runtime = 0;
    ctx->mainzisegmap_124559_runs = 0;
    ctx->mainzisegmap_124892_total_runtime = 0;
    ctx->mainzisegmap_124892_runs = 0;
    ctx->mainzisegmap_125091_total_runtime = 0;
    ctx->mainzisegmap_125091_runs = 0;
    ctx->mainzisegmap_125270_total_runtime = 0;
    ctx->mainzisegmap_125270_runs = 0;
    ctx->mainzisegmap_125725_total_runtime = 0;
    ctx->mainzisegmap_125725_runs = 0;
    ctx->mainzisegmap_125988_total_runtime = 0;
    ctx->mainzisegmap_125988_runs = 0;
    ctx->mainzisegmap_126216_total_runtime = 0;
    ctx->mainzisegmap_126216_runs = 0;
    ctx->mainzisegmap_127418_total_runtime = 0;
    ctx->mainzisegmap_127418_runs = 0;
    ctx->mainzisegmap_127596_total_runtime = 0;
    ctx->mainzisegmap_127596_runs = 0;
    ctx->mainzisegmap_127651_total_runtime = 0;
    ctx->mainzisegmap_127651_runs = 0;
    ctx->mainzisegmap_127708_total_runtime = 0;
    ctx->mainzisegmap_127708_runs = 0;
    ctx->mainzisegmap_128091_total_runtime = 0;
    ctx->mainzisegmap_128091_runs = 0;
    ctx->mainzisegmap_128490_total_runtime = 0;
    ctx->mainzisegmap_128490_runs = 0;
    ctx->mainzisegmap_128521_total_runtime = 0;
    ctx->mainzisegmap_128521_runs = 0;
    ctx->mainzisegmap_128579_total_runtime = 0;
    ctx->mainzisegmap_128579_runs = 0;
    ctx->mainzisegmap_128670_total_runtime = 0;
    ctx->mainzisegmap_128670_runs = 0;
    ctx->mainzisegmap_intragroup_116763_total_runtime = 0;
    ctx->mainzisegmap_intragroup_116763_runs = 0;
    ctx->mainzisegmap_intragroup_117346_total_runtime = 0;
    ctx->mainzisegmap_intragroup_117346_runs = 0;
    ctx->mainzisegmap_intragroup_118646_total_runtime = 0;
    ctx->mainzisegmap_intragroup_118646_runs = 0;
    ctx->mainzisegmap_intragroup_120129_total_runtime = 0;
    ctx->mainzisegmap_intragroup_120129_runs = 0;
    ctx->mainzisegmap_intragroup_123347_total_runtime = 0;
    ctx->mainzisegmap_intragroup_123347_runs = 0;
    ctx->mainzisegmap_intragroup_123476_total_runtime = 0;
    ctx->mainzisegmap_intragroup_123476_runs = 0;
    ctx->mainzisegmap_intragroup_123686_total_runtime = 0;
    ctx->mainzisegmap_intragroup_123686_runs = 0;
    ctx->mainzisegmap_intragroup_124166_total_runtime = 0;
    ctx->mainzisegmap_intragroup_124166_runs = 0;
    ctx->mainzisegmap_intragroup_126827_total_runtime = 0;
    ctx->mainzisegmap_intragroup_126827_runs = 0;
    ctx->mainzisegmap_intragroup_126956_total_runtime = 0;
    ctx->mainzisegmap_intragroup_126956_runs = 0;
    ctx->mainzisegmap_intragroup_127166_total_runtime = 0;
    ctx->mainzisegmap_intragroup_127166_runs = 0;
    ctx->mainzisegmap_intragroup_127704_total_runtime = 0;
    ctx->mainzisegmap_intragroup_127704_runs = 0;
    ctx->mainzisegmap_intragroup_127994_total_runtime = 0;
    ctx->mainzisegmap_intragroup_127994_runs = 0;
    ctx->mainzisegmap_intragroup_129249_total_runtime = 0;
    ctx->mainzisegmap_intragroup_129249_runs = 0;
    ctx->mainzisegmap_intragroup_129547_total_runtime = 0;
    ctx->mainzisegmap_intragroup_129547_runs = 0;
    ctx->mainzisegred_large_117097_total_runtime = 0;
    ctx->mainzisegred_large_117097_runs = 0;
    ctx->mainzisegred_large_117941_total_runtime = 0;
    ctx->mainzisegred_large_117941_runs = 0;
    ctx->mainzisegred_large_119241_total_runtime = 0;
    ctx->mainzisegred_large_119241_runs = 0;
    ctx->mainzisegred_large_119948_total_runtime = 0;
    ctx->mainzisegred_large_119948_runs = 0;
    ctx->mainzisegred_large_120463_total_runtime = 0;
    ctx->mainzisegred_large_120463_runs = 0;
    ctx->mainzisegred_large_120526_total_runtime = 0;
    ctx->mainzisegred_large_120526_runs = 0;
    ctx->mainzisegred_large_120587_total_runtime = 0;
    ctx->mainzisegred_large_120587_runs = 0;
    ctx->mainzisegred_large_121036_total_runtime = 0;
    ctx->mainzisegred_large_121036_runs = 0;
    ctx->mainzisegred_large_121098_total_runtime = 0;
    ctx->mainzisegred_large_121098_runs = 0;
    ctx->mainzisegred_large_121729_total_runtime = 0;
    ctx->mainzisegred_large_121729_runs = 0;
    ctx->mainzisegred_large_121818_total_runtime = 0;
    ctx->mainzisegred_large_121818_runs = 0;
    ctx->mainzisegred_large_122662_total_runtime = 0;
    ctx->mainzisegred_large_122662_runs = 0;
    ctx->mainzisegred_large_122783_total_runtime = 0;
    ctx->mainzisegred_large_122783_runs = 0;
    ctx->mainzisegred_large_124516_total_runtime = 0;
    ctx->mainzisegred_large_124516_runs = 0;
    ctx->mainzisegred_large_124578_total_runtime = 0;
    ctx->mainzisegred_large_124578_runs = 0;
    ctx->mainzisegred_large_125209_total_runtime = 0;
    ctx->mainzisegred_large_125209_runs = 0;
    ctx->mainzisegred_large_125298_total_runtime = 0;
    ctx->mainzisegred_large_125298_runs = 0;
    ctx->mainzisegred_large_126142_total_runtime = 0;
    ctx->mainzisegred_large_126142_runs = 0;
    ctx->mainzisegred_large_126263_total_runtime = 0;
    ctx->mainzisegred_large_126263_runs = 0;
    ctx->mainzisegred_large_128539_total_runtime = 0;
    ctx->mainzisegred_large_128539_runs = 0;
    ctx->mainzisegred_small_117097_total_runtime = 0;
    ctx->mainzisegred_small_117097_runs = 0;
    ctx->mainzisegred_small_117941_total_runtime = 0;
    ctx->mainzisegred_small_117941_runs = 0;
    ctx->mainzisegred_small_119241_total_runtime = 0;
    ctx->mainzisegred_small_119241_runs = 0;
    ctx->mainzisegred_small_119948_total_runtime = 0;
    ctx->mainzisegred_small_119948_runs = 0;
    ctx->mainzisegred_small_120463_total_runtime = 0;
    ctx->mainzisegred_small_120463_runs = 0;
    ctx->mainzisegred_small_120526_total_runtime = 0;
    ctx->mainzisegred_small_120526_runs = 0;
    ctx->mainzisegred_small_120587_total_runtime = 0;
    ctx->mainzisegred_small_120587_runs = 0;
    ctx->mainzisegred_small_121036_total_runtime = 0;
    ctx->mainzisegred_small_121036_runs = 0;
    ctx->mainzisegred_small_121098_total_runtime = 0;
    ctx->mainzisegred_small_121098_runs = 0;
    ctx->mainzisegred_small_121729_total_runtime = 0;
    ctx->mainzisegred_small_121729_runs = 0;
    ctx->mainzisegred_small_121818_total_runtime = 0;
    ctx->mainzisegred_small_121818_runs = 0;
    ctx->mainzisegred_small_122662_total_runtime = 0;
    ctx->mainzisegred_small_122662_runs = 0;
    ctx->mainzisegred_small_122783_total_runtime = 0;
    ctx->mainzisegred_small_122783_runs = 0;
    ctx->mainzisegred_small_124516_total_runtime = 0;
    ctx->mainzisegred_small_124516_runs = 0;
    ctx->mainzisegred_small_124578_total_runtime = 0;
    ctx->mainzisegred_small_124578_runs = 0;
    ctx->mainzisegred_small_125209_total_runtime = 0;
    ctx->mainzisegred_small_125209_runs = 0;
    ctx->mainzisegred_small_125298_total_runtime = 0;
    ctx->mainzisegred_small_125298_runs = 0;
    ctx->mainzisegred_small_126142_total_runtime = 0;
    ctx->mainzisegred_small_126142_runs = 0;
    ctx->mainzisegred_small_126263_total_runtime = 0;
    ctx->mainzisegred_small_126263_runs = 0;
    ctx->mainzisegred_small_128539_total_runtime = 0;
    ctx->mainzisegred_small_128539_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) * (3 + 1), NULL,
                                              &error);
    OPENCL_SUCCEED_OR_RETURN(error);
    {
        ctx->builtinzhreplicate_f32zireplicate_132958 = clCreateKernel(prog,
                                                                       "builtinzhreplicate_f32zireplicate_132958",
                                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "builtin#replicate_f32.replicate_132958");
    }
    {
        ctx->builtinzhreplicate_i64zireplicate_132369 = clCreateKernel(prog,
                                                                       "builtinzhreplicate_i64zireplicate_132369",
                                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "builtin#replicate_i64.replicate_132369");
    }
    {
        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->gpu_map_transpose_i64 = clCreateKernel(prog,
                                                    "gpu_map_transpose_i64",
                                                    &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "gpu_map_transpose_i64");
    }
    {
        ctx->gpu_map_transpose_i64_low_height = clCreateKernel(prog,
                                                               "gpu_map_transpose_i64_low_height",
                                                               &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "gpu_map_transpose_i64_low_height");
    }
    {
        ctx->gpu_map_transpose_i64_low_width = clCreateKernel(prog,
                                                              "gpu_map_transpose_i64_low_width",
                                                              &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "gpu_map_transpose_i64_low_width");
    }
    {
        ctx->gpu_map_transpose_i64_small = clCreateKernel(prog,
                                                          "gpu_map_transpose_i64_small",
                                                          &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "gpu_map_transpose_i64_small");
    }
    {
        ctx->mainzicopy_132360 = clCreateKernel(prog, "mainzicopy_132360",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_132360");
    }
    {
        ctx->mainzicopy_132598 = clCreateKernel(prog, "mainzicopy_132598",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_132598");
    }
    {
        ctx->mainzicopy_132603 = clCreateKernel(prog, "mainzicopy_132603",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_132603");
    }
    {
        ctx->mainzicopy_132816 = clCreateKernel(prog, "mainzicopy_132816",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_132816");
    }
    {
        ctx->mainzicopy_132821 = clCreateKernel(prog, "mainzicopy_132821",
                                                &error);
        OPENCL_SUCCEED_FATAL(error);
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.copy_132821");
    }
    {
        ctx->mainziscan_stage1_116849 = clCreateKernel(prog,
                                                       "mainziscan_stage1_116849",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_116849, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage1_116849");
    }
    {
        ctx->mainziscan_stage1_120428 = clCreateKernel(prog,
                                                       "mainziscan_stage1_120428",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_120428, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_120428, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage1_120428");
    }
    {
        ctx->mainziscan_stage1_120491 = clCreateKernel(prog,
                                                       "mainziscan_stage1_120491",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_120491, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_120491, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage1_120491");
    }
    {
        ctx->mainziscan_stage1_120553 = clCreateKernel(prog,
                                                       "mainziscan_stage1_120553",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_120553, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_120553, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage1_120553");
    }
    {
        ctx->mainziscan_stage1_128143 = clCreateKernel(prog,
                                                       "mainziscan_stage1_128143",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage1_128143, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage1_128143");
    }
    {
        ctx->mainziscan_stage2_116849 = clCreateKernel(prog,
                                                       "mainziscan_stage2_116849",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_116849, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage2_116849");
    }
    {
        ctx->mainziscan_stage2_120428 = clCreateKernel(prog,
                                                       "mainziscan_stage2_120428",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_120428, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage2_120428");
    }
    {
        ctx->mainziscan_stage2_120491 = clCreateKernel(prog,
                                                       "mainziscan_stage2_120491",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_120491, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage2_120491");
    }
    {
        ctx->mainziscan_stage2_120553 = clCreateKernel(prog,
                                                       "mainziscan_stage2_120553",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_120553, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage2_120553");
    }
    {
        ctx->mainziscan_stage2_128143 = clCreateKernel(prog,
                                                       "mainziscan_stage2_128143",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage2_128143, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage2_128143");
    }
    {
        ctx->mainziscan_stage3_116849 = clCreateKernel(prog,
                                                       "mainziscan_stage3_116849",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_116849, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage3_116849");
    }
    {
        ctx->mainziscan_stage3_120428 = clCreateKernel(prog,
                                                       "mainziscan_stage3_120428",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_120428, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage3_120428");
    }
    {
        ctx->mainziscan_stage3_120491 = clCreateKernel(prog,
                                                       "mainziscan_stage3_120491",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_120491, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage3_120491");
    }
    {
        ctx->mainziscan_stage3_120553 = clCreateKernel(prog,
                                                       "mainziscan_stage3_120553",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_120553, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage3_120553");
    }
    {
        ctx->mainziscan_stage3_128143 = clCreateKernel(prog,
                                                       "mainziscan_stage3_128143",
                                                       &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainziscan_stage3_128143, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.scan_stage3_128143");
    }
    {
        ctx->mainzisegmap_116795 = clCreateKernel(prog, "mainzisegmap_116795",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_116795, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_116795");
    }
    {
        ctx->mainzisegmap_116913 = clCreateKernel(prog, "mainzisegmap_116913",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_116913, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_116913");
    }
    {
        ctx->mainzisegmap_116950 = clCreateKernel(prog, "mainzisegmap_116950",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_116950, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_116950");
    }
    {
        ctx->mainzisegmap_116992 = clCreateKernel(prog, "mainzisegmap_116992",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_116992, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_116992, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_116992");
    }
    {
        ctx->mainzisegmap_117076 = clCreateKernel(prog, "mainzisegmap_117076",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_117076, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_117076, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_117076");
    }
    {
        ctx->mainzisegmap_117350 = clCreateKernel(prog, "mainzisegmap_117350",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_117350, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_117350, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_117350");
    }
    {
        ctx->mainzisegmap_117733 = clCreateKernel(prog, "mainzisegmap_117733",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_117733, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_117733, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_117733");
    }
    {
        ctx->mainzisegmap_117859 = clCreateKernel(prog, "mainzisegmap_117859",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_117859, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_117859, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_117859");
    }
    {
        ctx->mainzisegmap_117959 = clCreateKernel(prog, "mainzisegmap_117959",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_117959, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_117959");
    }
    {
        ctx->mainzisegmap_117975 = clCreateKernel(prog, "mainzisegmap_117975",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_117975, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_117975, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_117975");
    }
    {
        ctx->mainzisegmap_118167 = clCreateKernel(prog, "mainzisegmap_118167",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_118167, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_118167");
    }
    {
        ctx->mainzisegmap_118188 = clCreateKernel(prog, "mainzisegmap_118188",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_118188, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_118188");
    }
    {
        ctx->mainzisegmap_118650 = clCreateKernel(prog, "mainzisegmap_118650",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_118650, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_118650, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_118650");
    }
    {
        ctx->mainzisegmap_119033 = clCreateKernel(prog, "mainzisegmap_119033",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_119033, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_119033, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_119033");
    }
    {
        ctx->mainzisegmap_119159 = clCreateKernel(prog, "mainzisegmap_119159",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_119159, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_119159, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_119159");
    }
    {
        ctx->mainzisegmap_119259 = clCreateKernel(prog, "mainzisegmap_119259",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_119259, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_119259");
    }
    {
        ctx->mainzisegmap_119275 = clCreateKernel(prog, "mainzisegmap_119275",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_119275, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_119275, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_119275");
    }
    {
        ctx->mainzisegmap_119467 = clCreateKernel(prog, "mainzisegmap_119467",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_119467, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_119467");
    }
    {
        ctx->mainzisegmap_119488 = clCreateKernel(prog, "mainzisegmap_119488",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_119488, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_119488");
    }
    {
        ctx->mainzisegmap_119812 = clCreateKernel(prog, "mainzisegmap_119812",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_119812, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_119812");
    }
    {
        ctx->mainzisegmap_119845 = clCreateKernel(prog, "mainzisegmap_119845",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_119845, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_119845, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_119845");
    }
    {
        ctx->mainzisegmap_119928 = clCreateKernel(prog, "mainzisegmap_119928",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_119928, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_119928");
    }
    {
        ctx->mainzisegmap_120060 = clCreateKernel(prog, "mainzisegmap_120060",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_120060, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_120060, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_120060");
    }
    {
        ctx->mainzisegmap_120133 = clCreateKernel(prog, "mainzisegmap_120133",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_120133, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_120133, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_120133");
    }
    {
        ctx->mainzisegmap_120742 = clCreateKernel(prog, "mainzisegmap_120742",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_120742, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_120742, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_120742");
    }
    {
        ctx->mainzisegmap_120811 = clCreateKernel(prog, "mainzisegmap_120811",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_120811, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_120811");
    }
    {
        ctx->mainzisegmap_120951 = clCreateKernel(prog, "mainzisegmap_120951",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_120951, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_120951");
    }
    {
        ctx->mainzisegmap_121079 = clCreateKernel(prog, "mainzisegmap_121079",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_121079, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_121079");
    }
    {
        ctx->mainzisegmap_121412 = clCreateKernel(prog, "mainzisegmap_121412",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_121412, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_121412");
    }
    {
        ctx->mainzisegmap_121611 = clCreateKernel(prog, "mainzisegmap_121611",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_121611, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_121611");
    }
    {
        ctx->mainzisegmap_121790 = clCreateKernel(prog, "mainzisegmap_121790",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_121790, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_121790");
    }
    {
        ctx->mainzisegmap_122245 = clCreateKernel(prog, "mainzisegmap_122245",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_122245, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_122245");
    }
    {
        ctx->mainzisegmap_122508 = clCreateKernel(prog, "mainzisegmap_122508",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_122508, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_122508");
    }
    {
        ctx->mainzisegmap_122736 = clCreateKernel(prog, "mainzisegmap_122736",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_122736, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_122736");
    }
    {
        ctx->mainzisegmap_123938 = clCreateKernel(prog, "mainzisegmap_123938",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_123938, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_123938, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_123938");
    }
    {
        ctx->mainzisegmap_124116 = clCreateKernel(prog, "mainzisegmap_124116",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_124116, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_124116");
    }
    {
        ctx->mainzisegmap_124202 = clCreateKernel(prog, "mainzisegmap_124202",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_124202, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_124202, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_124202");
    }
    {
        ctx->mainzisegmap_124239 = clCreateKernel(prog, "mainzisegmap_124239",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_124239, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_124239");
    }
    {
        ctx->mainzisegmap_124291 = clCreateKernel(prog, "mainzisegmap_124291",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_124291, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_124291");
    }
    {
        ctx->mainzisegmap_124431 = clCreateKernel(prog, "mainzisegmap_124431",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_124431, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_124431");
    }
    {
        ctx->mainzisegmap_124559 = clCreateKernel(prog, "mainzisegmap_124559",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_124559, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_124559");
    }
    {
        ctx->mainzisegmap_124892 = clCreateKernel(prog, "mainzisegmap_124892",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_124892, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_124892");
    }
    {
        ctx->mainzisegmap_125091 = clCreateKernel(prog, "mainzisegmap_125091",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_125091, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_125091");
    }
    {
        ctx->mainzisegmap_125270 = clCreateKernel(prog, "mainzisegmap_125270",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_125270, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_125270");
    }
    {
        ctx->mainzisegmap_125725 = clCreateKernel(prog, "mainzisegmap_125725",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_125725, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_125725");
    }
    {
        ctx->mainzisegmap_125988 = clCreateKernel(prog, "mainzisegmap_125988",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_125988, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_125988");
    }
    {
        ctx->mainzisegmap_126216 = clCreateKernel(prog, "mainzisegmap_126216",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_126216, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_126216");
    }
    {
        ctx->mainzisegmap_127418 = clCreateKernel(prog, "mainzisegmap_127418",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_127418, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_127418, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_127418");
    }
    {
        ctx->mainzisegmap_127596 = clCreateKernel(prog, "mainzisegmap_127596",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_127596, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_127596");
    }
    {
        ctx->mainzisegmap_127651 = clCreateKernel(prog, "mainzisegmap_127651",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_127651, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_127651, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_127651");
    }
    {
        ctx->mainzisegmap_127708 = clCreateKernel(prog, "mainzisegmap_127708",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_127708, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_127708");
    }
    {
        ctx->mainzisegmap_128091 = clCreateKernel(prog, "mainzisegmap_128091",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_128091, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_128091");
    }
    {
        ctx->mainzisegmap_128490 = clCreateKernel(prog, "mainzisegmap_128490",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_128490, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_128490");
    }
    {
        ctx->mainzisegmap_128521 = clCreateKernel(prog, "mainzisegmap_128521",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_128521, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_128521");
    }
    {
        ctx->mainzisegmap_128579 = clCreateKernel(prog, "mainzisegmap_128579",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_128579, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_128579");
    }
    {
        ctx->mainzisegmap_128670 = clCreateKernel(prog, "mainzisegmap_128670",
                                                  &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_128670, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n", "main.segmap_128670");
    }
    {
        ctx->mainzisegmap_intragroup_116763 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_116763",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_116763,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_116763");
    }
    {
        ctx->mainzisegmap_intragroup_117346 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_117346",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_117346");
    }
    {
        ctx->mainzisegmap_intragroup_118646 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_118646",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_118646");
    }
    {
        ctx->mainzisegmap_intragroup_120129 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_120129",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_120129,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_120129,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_120129");
    }
    {
        ctx->mainzisegmap_intragroup_123347 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_123347",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_123347,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_123347");
    }
    {
        ctx->mainzisegmap_intragroup_123476 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_123476",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_123476");
    }
    {
        ctx->mainzisegmap_intragroup_123686 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_123686",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_123686");
    }
    {
        ctx->mainzisegmap_intragroup_124166 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_124166",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_124166,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_124166,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_124166");
    }
    {
        ctx->mainzisegmap_intragroup_126827 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_126827",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_126827,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_126827");
    }
    {
        ctx->mainzisegmap_intragroup_126956 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_126956",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_126956");
    }
    {
        ctx->mainzisegmap_intragroup_127166 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_127166",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_127166");
    }
    {
        ctx->mainzisegmap_intragroup_127704 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_127704",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_127704,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_127704");
    }
    {
        ctx->mainzisegmap_intragroup_127994 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_127994",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_127994,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_127994");
    }
    {
        ctx->mainzisegmap_intragroup_129249 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_129249",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_129249,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_129249,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_129249");
    }
    {
        ctx->mainzisegmap_intragroup_129547 = clCreateKernel(prog,
                                                             "mainzisegmap_intragroup_129547",
                                                             &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_129547,
                                            0, sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegmap_intragroup_129547,
                                            2, sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segmap_intragroup_129547");
    }
    {
        ctx->mainzisegred_large_117097 = clCreateKernel(prog,
                                                        "mainzisegred_large_117097",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_117097, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_117097, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_117097");
    }
    {
        ctx->mainzisegred_large_117941 = clCreateKernel(prog,
                                                        "mainzisegred_large_117941",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_117941, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_117941");
    }
    {
        ctx->mainzisegred_large_119241 = clCreateKernel(prog,
                                                        "mainzisegred_large_119241",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_119241, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_119241");
    }
    {
        ctx->mainzisegred_large_119948 = clCreateKernel(prog,
                                                        "mainzisegred_large_119948",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_119948, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_119948, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_119948");
    }
    {
        ctx->mainzisegred_large_120463 = clCreateKernel(prog,
                                                        "mainzisegred_large_120463",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_120463, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_120463");
    }
    {
        ctx->mainzisegred_large_120526 = clCreateKernel(prog,
                                                        "mainzisegred_large_120526",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_120526, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_120526");
    }
    {
        ctx->mainzisegred_large_120587 = clCreateKernel(prog,
                                                        "mainzisegred_large_120587",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_120587, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_120587");
    }
    {
        ctx->mainzisegred_large_121036 = clCreateKernel(prog,
                                                        "mainzisegred_large_121036",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_121036, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_121036");
    }
    {
        ctx->mainzisegred_large_121098 = clCreateKernel(prog,
                                                        "mainzisegred_large_121098",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_121098, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_121098");
    }
    {
        ctx->mainzisegred_large_121729 = clCreateKernel(prog,
                                                        "mainzisegred_large_121729",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_121729, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_121729");
    }
    {
        ctx->mainzisegred_large_121818 = clCreateKernel(prog,
                                                        "mainzisegred_large_121818",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_121818, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_121818");
    }
    {
        ctx->mainzisegred_large_122662 = clCreateKernel(prog,
                                                        "mainzisegred_large_122662",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_122662, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_122662");
    }
    {
        ctx->mainzisegred_large_122783 = clCreateKernel(prog,
                                                        "mainzisegred_large_122783",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_122783, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_122783");
    }
    {
        ctx->mainzisegred_large_124516 = clCreateKernel(prog,
                                                        "mainzisegred_large_124516",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_124516, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_124516");
    }
    {
        ctx->mainzisegred_large_124578 = clCreateKernel(prog,
                                                        "mainzisegred_large_124578",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_124578, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_124578");
    }
    {
        ctx->mainzisegred_large_125209 = clCreateKernel(prog,
                                                        "mainzisegred_large_125209",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_125209, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_125209");
    }
    {
        ctx->mainzisegred_large_125298 = clCreateKernel(prog,
                                                        "mainzisegred_large_125298",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_125298, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_125298");
    }
    {
        ctx->mainzisegred_large_126142 = clCreateKernel(prog,
                                                        "mainzisegred_large_126142",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_126142, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_126142");
    }
    {
        ctx->mainzisegred_large_126263 = clCreateKernel(prog,
                                                        "mainzisegred_large_126263",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_126263, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_126263");
    }
    {
        ctx->mainzisegred_large_128539 = clCreateKernel(prog,
                                                        "mainzisegred_large_128539",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_large_128539, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_large_128539");
    }
    {
        ctx->mainzisegred_small_117097 = clCreateKernel(prog,
                                                        "mainzisegred_small_117097",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_117097, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_117097, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_117097");
    }
    {
        ctx->mainzisegred_small_117941 = clCreateKernel(prog,
                                                        "mainzisegred_small_117941",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_117941, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_117941");
    }
    {
        ctx->mainzisegred_small_119241 = clCreateKernel(prog,
                                                        "mainzisegred_small_119241",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_119241, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_119241");
    }
    {
        ctx->mainzisegred_small_119948 = clCreateKernel(prog,
                                                        "mainzisegred_small_119948",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_119948, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_119948, 2,
                                            sizeof(cl_mem),
                                            &ctx->global_failure_args));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_119948");
    }
    {
        ctx->mainzisegred_small_120463 = clCreateKernel(prog,
                                                        "mainzisegred_small_120463",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_120463, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_120463");
    }
    {
        ctx->mainzisegred_small_120526 = clCreateKernel(prog,
                                                        "mainzisegred_small_120526",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_120526, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_120526");
    }
    {
        ctx->mainzisegred_small_120587 = clCreateKernel(prog,
                                                        "mainzisegred_small_120587",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_120587, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_120587");
    }
    {
        ctx->mainzisegred_small_121036 = clCreateKernel(prog,
                                                        "mainzisegred_small_121036",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_121036, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_121036");
    }
    {
        ctx->mainzisegred_small_121098 = clCreateKernel(prog,
                                                        "mainzisegred_small_121098",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_121098, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_121098");
    }
    {
        ctx->mainzisegred_small_121729 = clCreateKernel(prog,
                                                        "mainzisegred_small_121729",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_121729, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_121729");
    }
    {
        ctx->mainzisegred_small_121818 = clCreateKernel(prog,
                                                        "mainzisegred_small_121818",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_121818, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_121818");
    }
    {
        ctx->mainzisegred_small_122662 = clCreateKernel(prog,
                                                        "mainzisegred_small_122662",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_122662, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_122662");
    }
    {
        ctx->mainzisegred_small_122783 = clCreateKernel(prog,
                                                        "mainzisegred_small_122783",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_122783, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_122783");
    }
    {
        ctx->mainzisegred_small_124516 = clCreateKernel(prog,
                                                        "mainzisegred_small_124516",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_124516, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_124516");
    }
    {
        ctx->mainzisegred_small_124578 = clCreateKernel(prog,
                                                        "mainzisegred_small_124578",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_124578, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_124578");
    }
    {
        ctx->mainzisegred_small_125209 = clCreateKernel(prog,
                                                        "mainzisegred_small_125209",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_125209, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_125209");
    }
    {
        ctx->mainzisegred_small_125298 = clCreateKernel(prog,
                                                        "mainzisegred_small_125298",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_125298, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_125298");
    }
    {
        ctx->mainzisegred_small_126142 = clCreateKernel(prog,
                                                        "mainzisegred_small_126142",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_126142, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_126142");
    }
    {
        ctx->mainzisegred_small_126263 = clCreateKernel(prog,
                                                        "mainzisegred_small_126263",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_126263, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_126263");
    }
    {
        ctx->mainzisegred_small_128539 = clCreateKernel(prog,
                                                        "mainzisegred_small_128539",
                                                        &error);
        OPENCL_SUCCEED_FATAL(error);
        OPENCL_SUCCEED_FATAL(clSetKernelArg(ctx->mainzisegred_small_128539, 0,
                                            sizeof(cl_mem),
                                            &ctx->global_failure));
        if (ctx->debugging)
            fprintf(ctx->log, "Created kernel %s.\n",
                    "main.segred_small_128539");
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_132470.references = NULL;
        ctx->mainzicounter_mem_132470.size = 0;
        ctx->mainzicounter_mem_132470.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_132470.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_135524,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_132683.references = NULL;
        ctx->mainzicounter_mem_132683.size = 0;
        ctx->mainzicounter_mem_132683.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_132683.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_135585,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_132901.references = NULL;
        ctx->mainzicounter_mem_132901.size = 0;
        ctx->mainzicounter_mem_132901.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_132901.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_135646,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_133066.references = NULL;
        ctx->mainzicounter_mem_133066.size = 0;
        ctx->mainzicounter_mem_133066.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_133066.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_135677,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_133233.references = NULL;
        ctx->mainzicounter_mem_133233.size = 0;
        ctx->mainzicounter_mem_133233.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_133233.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_135708,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_133353.references = NULL;
        ctx->mainzicounter_mem_133353.size = 0;
        ctx->mainzicounter_mem_133353.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_133353.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_135734,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_133473.references = NULL;
        ctx->mainzicounter_mem_133473.size = 0;
        ctx->mainzicounter_mem_133473.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_133473.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_135760,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_133637.references = NULL;
        ctx->mainzicounter_mem_133637.size = 0;
        ctx->mainzicounter_mem_133637.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_133637.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_135801,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_133715.references = NULL;
        ctx->mainzicounter_mem_133715.size = 0;
        ctx->mainzicounter_mem_133715.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_133715.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_135817,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_133837.references = NULL;
        ctx->mainzicounter_mem_133837.size = 0;
        ctx->mainzicounter_mem_133837.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_133837.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_135838,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_133934.references = NULL;
        ctx->mainzicounter_mem_133934.size = 0;
        ctx->mainzicounter_mem_133934.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_133934.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_135854,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_134080.references = NULL;
        ctx->mainzicounter_mem_134080.size = 0;
        ctx->mainzicounter_mem_134080.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_134080.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_135875,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_134189.references = NULL;
        ctx->mainzicounter_mem_134189.size = 0;
        ctx->mainzicounter_mem_134189.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_134189.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_135891,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_134414.references = NULL;
        ctx->mainzicounter_mem_134414.size = 0;
        ctx->mainzicounter_mem_134414.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_134414.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_135952,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_134492.references = NULL;
        ctx->mainzicounter_mem_134492.size = 0;
        ctx->mainzicounter_mem_134492.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_134492.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_135968,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_134614.references = NULL;
        ctx->mainzicounter_mem_134614.size = 0;
        ctx->mainzicounter_mem_134614.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_134614.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_135989,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_134711.references = NULL;
        ctx->mainzicounter_mem_134711.size = 0;
        ctx->mainzicounter_mem_134711.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_134711.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_136005,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_134857.references = NULL;
        ctx->mainzicounter_mem_134857.size = 0;
        ctx->mainzicounter_mem_134857.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_134857.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_136026,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_134966.references = NULL;
        ctx->mainzicounter_mem_134966.size = 0;
        ctx->mainzicounter_mem_134966.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_134966.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_136042,
                                                          0, NULL, NULL));
    }
    {
        cl_int success;
        
        ctx->mainzicounter_mem_135353.references = NULL;
        ctx->mainzicounter_mem_135353.size = 0;
        ctx->mainzicounter_mem_135353.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_135353.mem,
                                                          CL_TRUE, 0, 10240 *
                                                          sizeof(int32_t),
                                                          mainzicounter_mem_realtype_136123,
                                                          0, NULL, NULL));
    }
    ctx->sizes.builtinzhreplicate_f32zigroup_sizze_132961 = cfg->sizes[0];
    ctx->sizes.builtinzhreplicate_i64zigroup_sizze_132372 = cfg->sizes[1];
    ctx->sizes.mainzigroup_sizze_132363 = cfg->sizes[2];
    ctx->sizes.mainzigroup_sizze_132601 = cfg->sizes[3];
    ctx->sizes.mainzigroup_sizze_132606 = cfg->sizes[4];
    ctx->sizes.mainzigroup_sizze_132819 = cfg->sizes[5];
    ctx->sizes.mainzigroup_sizze_132824 = cfg->sizes[6];
    ctx->sizes.mainzisegmap_group_sizze_116798 = cfg->sizes[7];
    ctx->sizes.mainzisegmap_group_sizze_116916 = cfg->sizes[8];
    ctx->sizes.mainzisegmap_group_sizze_116953 = cfg->sizes[9];
    ctx->sizes.mainzisegmap_group_sizze_116994 = cfg->sizes[10];
    ctx->sizes.mainzisegmap_group_sizze_117079 = cfg->sizes[11];
    ctx->sizes.mainzisegmap_group_sizze_117352 = cfg->sizes[12];
    ctx->sizes.mainzisegmap_group_sizze_117736 = cfg->sizes[13];
    ctx->sizes.mainzisegmap_group_sizze_117862 = cfg->sizes[14];
    ctx->sizes.mainzisegmap_group_sizze_117963 = cfg->sizes[15];
    ctx->sizes.mainzisegmap_group_sizze_117978 = cfg->sizes[16];
    ctx->sizes.mainzisegmap_group_sizze_118169 = cfg->sizes[17];
    ctx->sizes.mainzisegmap_group_sizze_118191 = cfg->sizes[18];
    ctx->sizes.mainzisegmap_group_sizze_118652 = cfg->sizes[19];
    ctx->sizes.mainzisegmap_group_sizze_119036 = cfg->sizes[20];
    ctx->sizes.mainzisegmap_group_sizze_119162 = cfg->sizes[21];
    ctx->sizes.mainzisegmap_group_sizze_119263 = cfg->sizes[22];
    ctx->sizes.mainzisegmap_group_sizze_119278 = cfg->sizes[23];
    ctx->sizes.mainzisegmap_group_sizze_119469 = cfg->sizes[24];
    ctx->sizes.mainzisegmap_group_sizze_119491 = cfg->sizes[25];
    ctx->sizes.mainzisegmap_group_sizze_119815 = cfg->sizes[26];
    ctx->sizes.mainzisegmap_group_sizze_119847 = cfg->sizes[27];
    ctx->sizes.mainzisegmap_group_sizze_119931 = cfg->sizes[28];
    ctx->sizes.mainzisegmap_group_sizze_120063 = cfg->sizes[29];
    ctx->sizes.mainzisegmap_group_sizze_120135 = cfg->sizes[30];
    ctx->sizes.mainzisegmap_group_sizze_120745 = cfg->sizes[31];
    ctx->sizes.mainzisegmap_group_sizze_120813 = cfg->sizes[32];
    ctx->sizes.mainzisegmap_group_sizze_120954 = cfg->sizes[33];
    ctx->sizes.mainzisegmap_group_sizze_121082 = cfg->sizes[34];
    ctx->sizes.mainzisegmap_group_sizze_121414 = cfg->sizes[35];
    ctx->sizes.mainzisegmap_group_sizze_121614 = cfg->sizes[36];
    ctx->sizes.mainzisegmap_group_sizze_121793 = cfg->sizes[37];
    ctx->sizes.mainzisegmap_group_sizze_122247 = cfg->sizes[38];
    ctx->sizes.mainzisegmap_group_sizze_122511 = cfg->sizes[39];
    ctx->sizes.mainzisegmap_group_sizze_122739 = cfg->sizes[40];
    ctx->sizes.mainzisegmap_group_sizze_123941 = cfg->sizes[41];
    ctx->sizes.mainzisegmap_group_sizze_124119 = cfg->sizes[42];
    ctx->sizes.mainzisegmap_group_sizze_124205 = cfg->sizes[43];
    ctx->sizes.mainzisegmap_group_sizze_124242 = cfg->sizes[44];
    ctx->sizes.mainzisegmap_group_sizze_124293 = cfg->sizes[45];
    ctx->sizes.mainzisegmap_group_sizze_124434 = cfg->sizes[46];
    ctx->sizes.mainzisegmap_group_sizze_124562 = cfg->sizes[47];
    ctx->sizes.mainzisegmap_group_sizze_124894 = cfg->sizes[48];
    ctx->sizes.mainzisegmap_group_sizze_125094 = cfg->sizes[49];
    ctx->sizes.mainzisegmap_group_sizze_125273 = cfg->sizes[50];
    ctx->sizes.mainzisegmap_group_sizze_125727 = cfg->sizes[51];
    ctx->sizes.mainzisegmap_group_sizze_125991 = cfg->sizes[52];
    ctx->sizes.mainzisegmap_group_sizze_126219 = cfg->sizes[53];
    ctx->sizes.mainzisegmap_group_sizze_127421 = cfg->sizes[54];
    ctx->sizes.mainzisegmap_group_sizze_127599 = cfg->sizes[55];
    ctx->sizes.mainzisegmap_group_sizze_127654 = cfg->sizes[56];
    ctx->sizes.mainzisegmap_group_sizze_127710 = cfg->sizes[57];
    ctx->sizes.mainzisegmap_group_sizze_128094 = cfg->sizes[58];
    ctx->sizes.mainzisegmap_group_sizze_128492 = cfg->sizes[59];
    ctx->sizes.mainzisegmap_group_sizze_128523 = cfg->sizes[60];
    ctx->sizes.mainzisegmap_group_sizze_128582 = cfg->sizes[61];
    ctx->sizes.mainzisegmap_group_sizze_128673 = cfg->sizes[62];
    ctx->sizes.mainzisegmap_num_groups_116996 = cfg->sizes[63];
    ctx->sizes.mainzisegmap_num_groups_117354 = cfg->sizes[64];
    ctx->sizes.mainzisegmap_num_groups_118654 = cfg->sizes[65];
    ctx->sizes.mainzisegmap_num_groups_119849 = cfg->sizes[66];
    ctx->sizes.mainzisegmap_num_groups_120137 = cfg->sizes[67];
    ctx->sizes.mainzisegmap_num_groups_120815 = cfg->sizes[68];
    ctx->sizes.mainzisegmap_num_groups_121416 = cfg->sizes[69];
    ctx->sizes.mainzisegmap_num_groups_122249 = cfg->sizes[70];
    ctx->sizes.mainzisegmap_num_groups_124295 = cfg->sizes[71];
    ctx->sizes.mainzisegmap_num_groups_124896 = cfg->sizes[72];
    ctx->sizes.mainzisegmap_num_groups_125729 = cfg->sizes[73];
    ctx->sizes.mainzisegmap_num_groups_127712 = cfg->sizes[74];
    ctx->sizes.mainzisegred_group_sizze_117091 = cfg->sizes[75];
    ctx->sizes.mainzisegred_group_sizze_117935 = cfg->sizes[76];
    ctx->sizes.mainzisegred_group_sizze_119235 = cfg->sizes[77];
    ctx->sizes.mainzisegred_group_sizze_119942 = cfg->sizes[78];
    ctx->sizes.mainzisegred_group_sizze_120457 = cfg->sizes[79];
    ctx->sizes.mainzisegred_group_sizze_120520 = cfg->sizes[80];
    ctx->sizes.mainzisegred_group_sizze_120581 = cfg->sizes[81];
    ctx->sizes.mainzisegred_group_sizze_121030 = cfg->sizes[82];
    ctx->sizes.mainzisegred_group_sizze_121092 = cfg->sizes[83];
    ctx->sizes.mainzisegred_group_sizze_121723 = cfg->sizes[84];
    ctx->sizes.mainzisegred_group_sizze_121812 = cfg->sizes[85];
    ctx->sizes.mainzisegred_group_sizze_122656 = cfg->sizes[86];
    ctx->sizes.mainzisegred_group_sizze_122777 = cfg->sizes[87];
    ctx->sizes.mainzisegred_group_sizze_124510 = cfg->sizes[88];
    ctx->sizes.mainzisegred_group_sizze_124572 = cfg->sizes[89];
    ctx->sizes.mainzisegred_group_sizze_125203 = cfg->sizes[90];
    ctx->sizes.mainzisegred_group_sizze_125292 = cfg->sizes[91];
    ctx->sizes.mainzisegred_group_sizze_126136 = cfg->sizes[92];
    ctx->sizes.mainzisegred_group_sizze_126257 = cfg->sizes[93];
    ctx->sizes.mainzisegred_group_sizze_128533 = cfg->sizes[94];
    ctx->sizes.mainzisegred_num_groups_117093 = cfg->sizes[95];
    ctx->sizes.mainzisegred_num_groups_117937 = cfg->sizes[96];
    ctx->sizes.mainzisegred_num_groups_119237 = cfg->sizes[97];
    ctx->sizes.mainzisegred_num_groups_119944 = cfg->sizes[98];
    ctx->sizes.mainzisegred_num_groups_120459 = cfg->sizes[99];
    ctx->sizes.mainzisegred_num_groups_120522 = cfg->sizes[100];
    ctx->sizes.mainzisegred_num_groups_120583 = cfg->sizes[101];
    ctx->sizes.mainzisegred_num_groups_121032 = cfg->sizes[102];
    ctx->sizes.mainzisegred_num_groups_121094 = cfg->sizes[103];
    ctx->sizes.mainzisegred_num_groups_121725 = cfg->sizes[104];
    ctx->sizes.mainzisegred_num_groups_121814 = cfg->sizes[105];
    ctx->sizes.mainzisegred_num_groups_122658 = cfg->sizes[106];
    ctx->sizes.mainzisegred_num_groups_122779 = cfg->sizes[107];
    ctx->sizes.mainzisegred_num_groups_124512 = cfg->sizes[108];
    ctx->sizes.mainzisegred_num_groups_124574 = cfg->sizes[109];
    ctx->sizes.mainzisegred_num_groups_125205 = cfg->sizes[110];
    ctx->sizes.mainzisegred_num_groups_125294 = cfg->sizes[111];
    ctx->sizes.mainzisegred_num_groups_126138 = cfg->sizes[112];
    ctx->sizes.mainzisegred_num_groups_126259 = cfg->sizes[113];
    ctx->sizes.mainzisegred_num_groups_128535 = cfg->sizes[114];
    ctx->sizes.mainzisegscan_group_sizze_116843 = cfg->sizes[115];
    ctx->sizes.mainzisegscan_group_sizze_120422 = cfg->sizes[116];
    ctx->sizes.mainzisegscan_group_sizze_120485 = cfg->sizes[117];
    ctx->sizes.mainzisegscan_group_sizze_120547 = cfg->sizes[118];
    ctx->sizes.mainzisegscan_group_sizze_128137 = cfg->sizes[119];
    ctx->sizes.mainzisegscan_num_groups_116845 = cfg->sizes[120];
    ctx->sizes.mainzisegscan_num_groups_120424 = cfg->sizes[121];
    ctx->sizes.mainzisegscan_num_groups_120487 = cfg->sizes[122];
    ctx->sizes.mainzisegscan_num_groups_120549 = cfg->sizes[123];
    ctx->sizes.mainzisegscan_num_groups_128139 = cfg->sizes[124];
    ctx->sizes.mainzisuff_intra_par_0 = cfg->sizes[125];
    ctx->sizes.mainzisuff_intra_par_12 = cfg->sizes[126];
    ctx->sizes.mainzisuff_intra_par_19 = cfg->sizes[127];
    ctx->sizes.mainzisuff_intra_par_27 = cfg->sizes[128];
    ctx->sizes.mainzisuff_intra_par_28 = cfg->sizes[129];
    ctx->sizes.mainzisuff_intra_par_4 = cfg->sizes[130];
    ctx->sizes.mainzisuff_intra_par_7 = cfg->sizes[131];
    ctx->sizes.mainzisuff_outer_par_1 = cfg->sizes[132];
    ctx->sizes.mainzisuff_outer_par_10 = cfg->sizes[133];
    ctx->sizes.mainzisuff_outer_par_11 = cfg->sizes[134];
    ctx->sizes.mainzisuff_outer_par_13 = cfg->sizes[135];
    ctx->sizes.mainzisuff_outer_par_14 = cfg->sizes[136];
    ctx->sizes.mainzisuff_outer_par_15 = cfg->sizes[137];
    ctx->sizes.mainzisuff_outer_par_16 = cfg->sizes[138];
    ctx->sizes.mainzisuff_outer_par_17 = cfg->sizes[139];
    ctx->sizes.mainzisuff_outer_par_18 = cfg->sizes[140];
    ctx->sizes.mainzisuff_outer_par_2 = cfg->sizes[141];
    ctx->sizes.mainzisuff_outer_par_20 = cfg->sizes[142];
    ctx->sizes.mainzisuff_outer_par_21 = cfg->sizes[143];
    ctx->sizes.mainzisuff_outer_par_22 = cfg->sizes[144];
    ctx->sizes.mainzisuff_outer_par_23 = cfg->sizes[145];
    ctx->sizes.mainzisuff_outer_par_24 = cfg->sizes[146];
    ctx->sizes.mainzisuff_outer_par_25 = cfg->sizes[147];
    ctx->sizes.mainzisuff_outer_par_26 = cfg->sizes[148];
    ctx->sizes.mainzisuff_outer_par_29 = cfg->sizes[149];
    ctx->sizes.mainzisuff_outer_par_3 = cfg->sizes[150];
    ctx->sizes.mainzisuff_outer_par_5 = cfg->sizes[151];
    ctx->sizes.mainzisuff_outer_par_6 = cfg->sizes[152];
    ctx->sizes.mainzisuff_outer_par_8 = cfg->sizes[153];
    ctx->sizes.mainzisuff_outer_par_9 = cfg->sizes[154];
    ctx->sizes.mainzitile_sizze_129243 = cfg->sizes[155];
    ctx->sizes.mainzitile_sizze_129541 = cfg->sizes[156];
    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)
{
    struct futhark_context *ctx =
                           (struct futhark_context *) malloc(sizeof(struct futhark_context));
    
    if (ctx == NULL)
        return NULL;
    
    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)
{
    struct futhark_context *ctx =
                           (struct futhark_context *) malloc(sizeof(struct futhark_context));
    
    if (ctx == NULL)
        return NULL;
    
    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_132958));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->builtinzhreplicate_i64zireplicate_132369));
    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->gpu_map_transpose_i64));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->gpu_map_transpose_i64_low_height));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->gpu_map_transpose_i64_low_width));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->gpu_map_transpose_i64_small));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzicopy_132360));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzicopy_132598));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzicopy_132603));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzicopy_132816));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzicopy_132821));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_116849));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_120428));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_120491));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_120553));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage1_128143));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_116849));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_120428));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_120491));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_120553));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage2_128143));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_116849));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_120428));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_120491));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_120553));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainziscan_stage3_128143));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_116795));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_116913));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_116950));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_116992));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_117076));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_117350));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_117733));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_117859));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_117959));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_117975));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_118167));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_118188));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_118650));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_119033));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_119159));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_119259));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_119275));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_119467));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_119488));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_119812));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_119845));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_119928));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_120060));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_120133));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_120742));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_120811));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_120951));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_121079));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_121412));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_121611));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_121790));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_122245));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_122508));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_122736));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_123938));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_124116));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_124202));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_124239));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_124291));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_124431));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_124559));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_124892));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_125091));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_125270));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_125725));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_125988));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_126216));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_127418));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_127596));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_127651));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_127708));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_128091));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_128490));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_128521));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_128579));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_128670));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_116763));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_117346));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_118646));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_120129));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_123347));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_123476));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_123686));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_124166));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_126827));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_126956));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_127166));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_127704));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_127994));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_129249));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegmap_intragroup_129547));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_117097));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_117941));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_119241));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_119948));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_120463));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_120526));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_120587));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_121036));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_121098));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_121729));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_121818));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_122662));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_122783));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_124516));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_124578));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_125209));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_125298));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_126142));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_126263));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_large_128539));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_117097));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_117941));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_119241));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_119948));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_120463));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_120526));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_120587));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_121036));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_121098));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_121729));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_121818));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_122662));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_122783));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_124516));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_124578));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_125209));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_125298));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_126142));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_126263));
    OPENCL_SUCCEED_FATAL(clReleaseKernel(ctx->mainzisegred_small_128539));
    teardown_opencl(&ctx->opencl);
    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[3 + 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  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:152:30-55\n   #3  stl.fut:150:13-159:26\n   #4  stl.fut:148:5-160:11\n   #5  stl.fut:394:3-405:33\n   #6  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 1:
            {
                ctx->error =
                    msgprintf("Assertion is false: sub_series_is_not_all_nan\n-> #0  stl.fut:157:34-75\n   #1  stl.fut:150:13-159:26\n   #2  stl.fut:148:5-160:11\n   #3  stl.fut:394:3-405:33\n   #4  stl.fut:381:1-405:33\n");
                break;
            }
            
          case 2:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:152:30-55\n   #3  stl.fut:150:13-159:26\n   #4  stl.fut:148:5-160:11\n   #5  stl.fut:394:3-405:33\n   #6  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 3:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:152:30-55\n   #3  stl.fut:150:13-159:26\n   #4  stl.fut:148:5-160:11\n   #5  stl.fut:394:3-405:33\n   #6  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 4:
            {
                ctx->error =
                    msgprintf("Assertion is false: sub_series_is_not_all_nan\n-> #0  stl.fut:157:34-75\n   #1  stl.fut:150:13-159:26\n   #2  stl.fut:148:5-160:11\n   #3  stl.fut:394:3-405:33\n   #4  stl.fut:381:1-405:33\n");
                break;
            }
            
          case 5:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:152:30-55\n   #3  stl.fut:150:13-159:26\n   #4  stl.fut:148:5-160:11\n   #5  stl.fut:394:3-405:33\n   #6  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 6:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:152:30-55\n   #3  stl.fut:150:13-159:26\n   #4  stl.fut:148:5-160:11\n   #5  stl.fut:394:3-405:33\n   #6  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 7:
            {
                ctx->error =
                    msgprintf("Assertion is false: sub_series_is_not_all_nan\n-> #0  stl.fut:157:34-75\n   #1  stl.fut:150:13-159:26\n   #2  stl.fut:148:5-160:11\n   #3  stl.fut:394:3-405:33\n   #4  stl.fut:381:1-405:33\n");
                break;
            }
            
          case 8:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:343:19-30\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 9:
            {
                ctx->error =
                    msgprintf("Index [%lld:%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:350:25-55\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1], args[2]);
                break;
            }
            
          case 10:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:362:51-66\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:363:51-88\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:386:66-73\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:386:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:343:19-30\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 15:
            {
                ctx->error =
                    msgprintf("Index [%lld:%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:350:25-55\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1], args[2]);
                break;
            }
            
          case 16:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:362:51-66\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:363:51-88\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:386:66-73\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:386:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:343:19-30\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 21:
            {
                ctx->error =
                    msgprintf("Index [%lld:%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:350:25-55\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1], args[2]);
                break;
            }
            
          case 22:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:362:51-66\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:363:51-88\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:386:66-73\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:386:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:343:19-30\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 27:
            {
                ctx->error =
                    msgprintf("Index [%lld:%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:350:25-55\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1], args[2]);
                break;
            }
            
          case 28:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:362:51-66\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:363:51-88\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:386:66-73\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:386:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:166:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:164:5-167:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:343:19-30\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 33:
            {
                ctx->error =
                    msgprintf("Index [%lld:%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:350:25-55\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1], args[2]);
                break;
            }
            
          case 34:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:362:51-66\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:363:51-88\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:386:66-73\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:386:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:343:19-30\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 39:
            {
                ctx->error =
                    msgprintf("Index [%lld:%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:350:25-55\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1], args[2]);
                break;
            }
            
          case 40:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:362:51-66\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:363:51-88\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:386:66-73\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:386:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:343:19-30\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 45:
            {
                ctx->error =
                    msgprintf("Index [%lld:%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:350:25-55\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1], args[2]);
                break;
            }
            
          case 46:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:362:51-66\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:363:51-88\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:386:66-73\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:386:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:343:19-30\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 51:
            {
                ctx->error =
                    msgprintf("Index [%lld:%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:350:25-55\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1], args[2]);
                break;
            }
            
          case 52:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  loess.fut:362:51-66\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:363:51-88\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  loess.fut:335:3-373:7\n   #4  loess.fut:400:15-58\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:386:66-73\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\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:386:40-47\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  loess.fut:383:3-389:25\n   #4  loess.fut:401:18-55\n   #5  stl.fut:173:13-65\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:171:5-174:26\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 56:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:207:38-73\n   #3  /prelude/soacs.fut:67:19-23\n   #4  /prelude/soacs.fut:67:3-37\n   #5  stl.fut:205:21-210:44\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:203:13-211:43\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 57:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:207:38-73\n   #3  /prelude/soacs.fut:67:19-23\n   #4  /prelude/soacs.fut:67:3-37\n   #5  stl.fut:205:21-210:44\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:203:13-211:43\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 58:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:207:38-73\n   #3  /prelude/soacs.fut:67:19-23\n   #4  /prelude/soacs.fut:67:3-37\n   #5  stl.fut:205:21-210:44\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:203:13-211:43\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 59:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:207:38-73\n   #3  /prelude/soacs.fut:67:19-23\n   #4  /prelude/soacs.fut:67:3-37\n   #5  stl.fut:205:21-210:44\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:203:13-211:43\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 60:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:207:38-73\n   #3  /prelude/soacs.fut:67:19-23\n   #4  /prelude/soacs.fut:67:3-37\n   #5  stl.fut:205:21-210:44\n   #6  /prelude/soacs.fut:67:19-23\n   #7  /prelude/soacs.fut:67:3-37\n   #8  stl.fut:203:13-211:43\n   #9  stl.fut:394:3-405:33\n   #10 stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 61:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:217:43-59\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:217:21-60\n   #4  stl.fut:215:13-218:24\n   #5  stl.fut:394:3-405:33\n   #6  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 62:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:38:26-39\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  stl.fut:43:3-32\n   #5  stl.fut:223:30-50\n   #6  stl.fut:222:23-224:31\n   #7  stl.fut:394:3-405:33\n   #8  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 63:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:38:43-50\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  stl.fut:43:3-32\n   #5  stl.fut:223:30-50\n   #6  stl.fut:222:23-224:31\n   #7  stl.fut:394:3-405:33\n   #8  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 64:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:38:26-39\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  /prelude/functional.fut:9:42-44\n   #5  stl.fut:43:3-58\n   #6  stl.fut:223:30-50\n   #7  stl.fut:222:23-224:31\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 65:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:38:43-50\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  /prelude/functional.fut:9:42-44\n   #5  stl.fut:43:3-58\n   #6  stl.fut:223:30-50\n   #7  stl.fut:222:23-224:31\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 66:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:38:26-39\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  /prelude/functional.fut:9:42-44\n   #5  stl.fut:43:3-76\n   #6  stl.fut:223:30-50\n   #7  stl.fut:222:23-224:31\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 67:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:38:43-50\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  /prelude/functional.fut:9:42-44\n   #5  stl.fut:43:3-76\n   #6  stl.fut:223:30-50\n   #7  stl.fut:222:23-224:31\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 68:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:38:26-39\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  stl.fut:43:3-32\n   #5  stl.fut:223:30-50\n   #6  stl.fut:222:23-224:31\n   #7  stl.fut:394:3-405:33\n   #8  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 69:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:38:43-50\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  stl.fut:43:3-32\n   #5  stl.fut:223:30-50\n   #6  stl.fut:222:23-224:31\n   #7  stl.fut:394:3-405:33\n   #8  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 70:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:38:26-39\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  /prelude/functional.fut:9:42-44\n   #5  stl.fut:43:3-58\n   #6  stl.fut:223:30-50\n   #7  stl.fut:222:23-224:31\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 71:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:38:43-50\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  /prelude/functional.fut:9:42-44\n   #5  stl.fut:43:3-58\n   #6  stl.fut:223:30-50\n   #7  stl.fut:222:23-224:31\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 72:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:38:26-39\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  /prelude/functional.fut:9:42-44\n   #5  stl.fut:43:3-76\n   #6  stl.fut:223:30-50\n   #7  stl.fut:222:23-224:31\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 73:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:38:43-50\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  /prelude/functional.fut:9:42-44\n   #5  stl.fut:43:3-76\n   #6  stl.fut:223:30-50\n   #7  stl.fut:222:23-224:31\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 74:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:38:26-39\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  stl.fut:43:3-32\n   #5  stl.fut:223:30-50\n   #6  stl.fut:222:23-224:31\n   #7  stl.fut:394:3-405:33\n   #8  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 75:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:38:43-50\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  stl.fut:43:3-32\n   #5  stl.fut:223:30-50\n   #6  stl.fut:222:23-224:31\n   #7  stl.fut:394:3-405:33\n   #8  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 76:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:38:26-39\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  /prelude/functional.fut:9:42-44\n   #5  stl.fut:43:3-58\n   #6  stl.fut:223:30-50\n   #7  stl.fut:222:23-224:31\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 77:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:38:43-50\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  /prelude/functional.fut:9:42-44\n   #5  stl.fut:43:3-58\n   #6  stl.fut:223:30-50\n   #7  stl.fut:222:23-224:31\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 78:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:38:26-39\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  /prelude/functional.fut:9:42-44\n   #5  stl.fut:43:3-76\n   #6  stl.fut:223:30-50\n   #7  stl.fut:222:23-224:31\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 79:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:38:43-50\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:33:9-39:16\n   #4  /prelude/functional.fut:9:42-44\n   #5  stl.fut:43:3-76\n   #6  stl.fut:223:30-50\n   #7  stl.fut:222:23-224:31\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 80:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:231:36-58\n   #3  /prelude/soacs.fut:75:22-28\n   #4  /prelude/soacs.fut:75:3-45\n   #5  stl.fut:229:13-234:43\n   #6  stl.fut:394:3-405:33\n   #7  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 81:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:232:34-60\n   #3  /prelude/soacs.fut:75:22-28\n   #4  /prelude/soacs.fut:75:3-45\n   #5  stl.fut:229:13-234:43\n   #6  stl.fut:394:3-405:33\n   #7  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 82:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:63:41-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:54:3-67:14\n   #4  stl.fut:252:21-67\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:250:15-253:43\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 83:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:64:41-51\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:54:3-67:14\n   #4  stl.fut:252:21-67\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:250:15-253:43\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 84:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:279:21-41\n   #3  /prelude/soacs.fut:67:19-23\n   #4  /prelude/soacs.fut:67:3-37\n   #5  stl.fut:277:13-280:31\n   #6  stl.fut:394:3-405:33\n   #7  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 85:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:279:21-41\n   #3  /prelude/soacs.fut:67:19-23\n   #4  /prelude/soacs.fut:67:3-37\n   #5  stl.fut:277:13-280:31\n   #6  stl.fut:394:3-405:33\n   #7  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 86:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:63:41-47\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:54:3-67:14\n   #4  stl.fut:300:23-69\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:299:15-301:43\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 87:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  stl.fut:64:41-51\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:54:3-67:14\n   #4  stl.fut:300:23-69\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:299:15-301:43\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n",
                              args[0], args[1]);
                break;
            }
            
          case 88:
            {
                ctx->error =
                    msgprintf("Index [%lld] out of bounds for array of shape [%lld].\n-> #0  utils.fut:18:29-33\n   #1  utils.fut:18:3-49\n   #2  stl.fut:330:21-49\n   #3  /prelude/soacs.fut:67:19-23\n   #4  /prelude/soacs.fut:67:3-37\n   #5  stl.fut:328:13-331:35\n   #6  stl.fut:394:3-405:33\n   #7  stl.fut:381:1-405:33\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, 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 = (char *) malloc(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_num_sizes(void)
{
    return sizeof(size_names) / sizeof(size_names[0]);
}
const char *futhark_get_size_name(int i)
{
    return size_names[i];
}
const char *futhark_get_size_class(int i)
{
    return size_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_132958 ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->builtinzhreplicate_f32zireplicate_132958_runs,
                    (long) ctx->builtinzhreplicate_f32zireplicate_132958_total_runtime /
                    (ctx->builtinzhreplicate_f32zireplicate_132958_runs !=
                     0 ? ctx->builtinzhreplicate_f32zireplicate_132958_runs : 1),
                    (long) ctx->builtinzhreplicate_f32zireplicate_132958_total_runtime);
        ctx->total_runtime +=
            ctx->builtinzhreplicate_f32zireplicate_132958_total_runtime;
        ctx->total_runs += ctx->builtinzhreplicate_f32zireplicate_132958_runs;
        str_builder(&builder,
                    "builtin#replicate_i64.replicate_132369 ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->builtinzhreplicate_i64zireplicate_132369_runs,
                    (long) ctx->builtinzhreplicate_i64zireplicate_132369_total_runtime /
                    (ctx->builtinzhreplicate_i64zireplicate_132369_runs !=
                     0 ? ctx->builtinzhreplicate_i64zireplicate_132369_runs : 1),
                    (long) ctx->builtinzhreplicate_i64zireplicate_132369_total_runtime);
        ctx->total_runtime +=
            ctx->builtinzhreplicate_i64zireplicate_132369_total_runtime;
        ctx->total_runs += ctx->builtinzhreplicate_i64zireplicate_132369_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,
                    "gpu_map_transpose_i64                  ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->gpu_map_transpose_i64_runs,
                    (long) ctx->gpu_map_transpose_i64_total_runtime /
                    (ctx->gpu_map_transpose_i64_runs !=
                     0 ? ctx->gpu_map_transpose_i64_runs : 1),
                    (long) ctx->gpu_map_transpose_i64_total_runtime);
        ctx->total_runtime += ctx->gpu_map_transpose_i64_total_runtime;
        ctx->total_runs += ctx->gpu_map_transpose_i64_runs;
        str_builder(&builder,
                    "gpu_map_transpose_i64_low_height       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->gpu_map_transpose_i64_low_height_runs,
                    (long) ctx->gpu_map_transpose_i64_low_height_total_runtime /
                    (ctx->gpu_map_transpose_i64_low_height_runs !=
                     0 ? ctx->gpu_map_transpose_i64_low_height_runs : 1),
                    (long) ctx->gpu_map_transpose_i64_low_height_total_runtime);
        ctx->total_runtime +=
            ctx->gpu_map_transpose_i64_low_height_total_runtime;
        ctx->total_runs += ctx->gpu_map_transpose_i64_low_height_runs;
        str_builder(&builder,
                    "gpu_map_transpose_i64_low_width        ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->gpu_map_transpose_i64_low_width_runs,
                    (long) ctx->gpu_map_transpose_i64_low_width_total_runtime /
                    (ctx->gpu_map_transpose_i64_low_width_runs !=
                     0 ? ctx->gpu_map_transpose_i64_low_width_runs : 1),
                    (long) ctx->gpu_map_transpose_i64_low_width_total_runtime);
        ctx->total_runtime +=
            ctx->gpu_map_transpose_i64_low_width_total_runtime;
        ctx->total_runs += ctx->gpu_map_transpose_i64_low_width_runs;
        str_builder(&builder,
                    "gpu_map_transpose_i64_small            ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->gpu_map_transpose_i64_small_runs,
                    (long) ctx->gpu_map_transpose_i64_small_total_runtime /
                    (ctx->gpu_map_transpose_i64_small_runs !=
                     0 ? ctx->gpu_map_transpose_i64_small_runs : 1),
                    (long) ctx->gpu_map_transpose_i64_small_total_runtime);
        ctx->total_runtime += ctx->gpu_map_transpose_i64_small_total_runtime;
        ctx->total_runs += ctx->gpu_map_transpose_i64_small_runs;
        str_builder(&builder,
                    "main.copy_132360                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_132360_runs,
                    (long) ctx->mainzicopy_132360_total_runtime /
                    (ctx->mainzicopy_132360_runs !=
                     0 ? ctx->mainzicopy_132360_runs : 1),
                    (long) ctx->mainzicopy_132360_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_132360_total_runtime;
        ctx->total_runs += ctx->mainzicopy_132360_runs;
        str_builder(&builder,
                    "main.copy_132598                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_132598_runs,
                    (long) ctx->mainzicopy_132598_total_runtime /
                    (ctx->mainzicopy_132598_runs !=
                     0 ? ctx->mainzicopy_132598_runs : 1),
                    (long) ctx->mainzicopy_132598_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_132598_total_runtime;
        ctx->total_runs += ctx->mainzicopy_132598_runs;
        str_builder(&builder,
                    "main.copy_132603                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_132603_runs,
                    (long) ctx->mainzicopy_132603_total_runtime /
                    (ctx->mainzicopy_132603_runs !=
                     0 ? ctx->mainzicopy_132603_runs : 1),
                    (long) ctx->mainzicopy_132603_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_132603_total_runtime;
        ctx->total_runs += ctx->mainzicopy_132603_runs;
        str_builder(&builder,
                    "main.copy_132816                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_132816_runs,
                    (long) ctx->mainzicopy_132816_total_runtime /
                    (ctx->mainzicopy_132816_runs !=
                     0 ? ctx->mainzicopy_132816_runs : 1),
                    (long) ctx->mainzicopy_132816_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_132816_total_runtime;
        ctx->total_runs += ctx->mainzicopy_132816_runs;
        str_builder(&builder,
                    "main.copy_132821                       ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzicopy_132821_runs,
                    (long) ctx->mainzicopy_132821_total_runtime /
                    (ctx->mainzicopy_132821_runs !=
                     0 ? ctx->mainzicopy_132821_runs : 1),
                    (long) ctx->mainzicopy_132821_total_runtime);
        ctx->total_runtime += ctx->mainzicopy_132821_total_runtime;
        ctx->total_runs += ctx->mainzicopy_132821_runs;
        str_builder(&builder,
                    "main.scan_stage1_116849                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_116849_runs,
                    (long) ctx->mainziscan_stage1_116849_total_runtime /
                    (ctx->mainziscan_stage1_116849_runs !=
                     0 ? ctx->mainziscan_stage1_116849_runs : 1),
                    (long) ctx->mainziscan_stage1_116849_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_116849_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_116849_runs;
        str_builder(&builder,
                    "main.scan_stage1_120428                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_120428_runs,
                    (long) ctx->mainziscan_stage1_120428_total_runtime /
                    (ctx->mainziscan_stage1_120428_runs !=
                     0 ? ctx->mainziscan_stage1_120428_runs : 1),
                    (long) ctx->mainziscan_stage1_120428_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_120428_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_120428_runs;
        str_builder(&builder,
                    "main.scan_stage1_120491                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_120491_runs,
                    (long) ctx->mainziscan_stage1_120491_total_runtime /
                    (ctx->mainziscan_stage1_120491_runs !=
                     0 ? ctx->mainziscan_stage1_120491_runs : 1),
                    (long) ctx->mainziscan_stage1_120491_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_120491_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_120491_runs;
        str_builder(&builder,
                    "main.scan_stage1_120553                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_120553_runs,
                    (long) ctx->mainziscan_stage1_120553_total_runtime /
                    (ctx->mainziscan_stage1_120553_runs !=
                     0 ? ctx->mainziscan_stage1_120553_runs : 1),
                    (long) ctx->mainziscan_stage1_120553_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_120553_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_120553_runs;
        str_builder(&builder,
                    "main.scan_stage1_128143                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage1_128143_runs,
                    (long) ctx->mainziscan_stage1_128143_total_runtime /
                    (ctx->mainziscan_stage1_128143_runs !=
                     0 ? ctx->mainziscan_stage1_128143_runs : 1),
                    (long) ctx->mainziscan_stage1_128143_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage1_128143_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage1_128143_runs;
        str_builder(&builder,
                    "main.scan_stage2_116849                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_116849_runs,
                    (long) ctx->mainziscan_stage2_116849_total_runtime /
                    (ctx->mainziscan_stage2_116849_runs !=
                     0 ? ctx->mainziscan_stage2_116849_runs : 1),
                    (long) ctx->mainziscan_stage2_116849_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_116849_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_116849_runs;
        str_builder(&builder,
                    "main.scan_stage2_120428                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_120428_runs,
                    (long) ctx->mainziscan_stage2_120428_total_runtime /
                    (ctx->mainziscan_stage2_120428_runs !=
                     0 ? ctx->mainziscan_stage2_120428_runs : 1),
                    (long) ctx->mainziscan_stage2_120428_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_120428_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_120428_runs;
        str_builder(&builder,
                    "main.scan_stage2_120491                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_120491_runs,
                    (long) ctx->mainziscan_stage2_120491_total_runtime /
                    (ctx->mainziscan_stage2_120491_runs !=
                     0 ? ctx->mainziscan_stage2_120491_runs : 1),
                    (long) ctx->mainziscan_stage2_120491_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_120491_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_120491_runs;
        str_builder(&builder,
                    "main.scan_stage2_120553                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_120553_runs,
                    (long) ctx->mainziscan_stage2_120553_total_runtime /
                    (ctx->mainziscan_stage2_120553_runs !=
                     0 ? ctx->mainziscan_stage2_120553_runs : 1),
                    (long) ctx->mainziscan_stage2_120553_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_120553_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_120553_runs;
        str_builder(&builder,
                    "main.scan_stage2_128143                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage2_128143_runs,
                    (long) ctx->mainziscan_stage2_128143_total_runtime /
                    (ctx->mainziscan_stage2_128143_runs !=
                     0 ? ctx->mainziscan_stage2_128143_runs : 1),
                    (long) ctx->mainziscan_stage2_128143_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage2_128143_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage2_128143_runs;
        str_builder(&builder,
                    "main.scan_stage3_116849                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_116849_runs,
                    (long) ctx->mainziscan_stage3_116849_total_runtime /
                    (ctx->mainziscan_stage3_116849_runs !=
                     0 ? ctx->mainziscan_stage3_116849_runs : 1),
                    (long) ctx->mainziscan_stage3_116849_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_116849_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_116849_runs;
        str_builder(&builder,
                    "main.scan_stage3_120428                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_120428_runs,
                    (long) ctx->mainziscan_stage3_120428_total_runtime /
                    (ctx->mainziscan_stage3_120428_runs !=
                     0 ? ctx->mainziscan_stage3_120428_runs : 1),
                    (long) ctx->mainziscan_stage3_120428_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_120428_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_120428_runs;
        str_builder(&builder,
                    "main.scan_stage3_120491                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_120491_runs,
                    (long) ctx->mainziscan_stage3_120491_total_runtime /
                    (ctx->mainziscan_stage3_120491_runs !=
                     0 ? ctx->mainziscan_stage3_120491_runs : 1),
                    (long) ctx->mainziscan_stage3_120491_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_120491_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_120491_runs;
        str_builder(&builder,
                    "main.scan_stage3_120553                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_120553_runs,
                    (long) ctx->mainziscan_stage3_120553_total_runtime /
                    (ctx->mainziscan_stage3_120553_runs !=
                     0 ? ctx->mainziscan_stage3_120553_runs : 1),
                    (long) ctx->mainziscan_stage3_120553_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_120553_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_120553_runs;
        str_builder(&builder,
                    "main.scan_stage3_128143                ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainziscan_stage3_128143_runs,
                    (long) ctx->mainziscan_stage3_128143_total_runtime /
                    (ctx->mainziscan_stage3_128143_runs !=
                     0 ? ctx->mainziscan_stage3_128143_runs : 1),
                    (long) ctx->mainziscan_stage3_128143_total_runtime);
        ctx->total_runtime += ctx->mainziscan_stage3_128143_total_runtime;
        ctx->total_runs += ctx->mainziscan_stage3_128143_runs;
        str_builder(&builder,
                    "main.segmap_116795                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_116795_runs,
                    (long) ctx->mainzisegmap_116795_total_runtime /
                    (ctx->mainzisegmap_116795_runs !=
                     0 ? ctx->mainzisegmap_116795_runs : 1),
                    (long) ctx->mainzisegmap_116795_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_116795_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_116795_runs;
        str_builder(&builder,
                    "main.segmap_116913                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_116913_runs,
                    (long) ctx->mainzisegmap_116913_total_runtime /
                    (ctx->mainzisegmap_116913_runs !=
                     0 ? ctx->mainzisegmap_116913_runs : 1),
                    (long) ctx->mainzisegmap_116913_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_116913_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_116913_runs;
        str_builder(&builder,
                    "main.segmap_116950                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_116950_runs,
                    (long) ctx->mainzisegmap_116950_total_runtime /
                    (ctx->mainzisegmap_116950_runs !=
                     0 ? ctx->mainzisegmap_116950_runs : 1),
                    (long) ctx->mainzisegmap_116950_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_116950_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_116950_runs;
        str_builder(&builder,
                    "main.segmap_116992                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_116992_runs,
                    (long) ctx->mainzisegmap_116992_total_runtime /
                    (ctx->mainzisegmap_116992_runs !=
                     0 ? ctx->mainzisegmap_116992_runs : 1),
                    (long) ctx->mainzisegmap_116992_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_116992_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_116992_runs;
        str_builder(&builder,
                    "main.segmap_117076                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_117076_runs,
                    (long) ctx->mainzisegmap_117076_total_runtime /
                    (ctx->mainzisegmap_117076_runs !=
                     0 ? ctx->mainzisegmap_117076_runs : 1),
                    (long) ctx->mainzisegmap_117076_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_117076_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_117076_runs;
        str_builder(&builder,
                    "main.segmap_117350                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_117350_runs,
                    (long) ctx->mainzisegmap_117350_total_runtime /
                    (ctx->mainzisegmap_117350_runs !=
                     0 ? ctx->mainzisegmap_117350_runs : 1),
                    (long) ctx->mainzisegmap_117350_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_117350_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_117350_runs;
        str_builder(&builder,
                    "main.segmap_117733                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_117733_runs,
                    (long) ctx->mainzisegmap_117733_total_runtime /
                    (ctx->mainzisegmap_117733_runs !=
                     0 ? ctx->mainzisegmap_117733_runs : 1),
                    (long) ctx->mainzisegmap_117733_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_117733_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_117733_runs;
        str_builder(&builder,
                    "main.segmap_117859                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_117859_runs,
                    (long) ctx->mainzisegmap_117859_total_runtime /
                    (ctx->mainzisegmap_117859_runs !=
                     0 ? ctx->mainzisegmap_117859_runs : 1),
                    (long) ctx->mainzisegmap_117859_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_117859_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_117859_runs;
        str_builder(&builder,
                    "main.segmap_117959                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_117959_runs,
                    (long) ctx->mainzisegmap_117959_total_runtime /
                    (ctx->mainzisegmap_117959_runs !=
                     0 ? ctx->mainzisegmap_117959_runs : 1),
                    (long) ctx->mainzisegmap_117959_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_117959_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_117959_runs;
        str_builder(&builder,
                    "main.segmap_117975                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_117975_runs,
                    (long) ctx->mainzisegmap_117975_total_runtime /
                    (ctx->mainzisegmap_117975_runs !=
                     0 ? ctx->mainzisegmap_117975_runs : 1),
                    (long) ctx->mainzisegmap_117975_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_117975_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_117975_runs;
        str_builder(&builder,
                    "main.segmap_118167                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_118167_runs,
                    (long) ctx->mainzisegmap_118167_total_runtime /
                    (ctx->mainzisegmap_118167_runs !=
                     0 ? ctx->mainzisegmap_118167_runs : 1),
                    (long) ctx->mainzisegmap_118167_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_118167_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_118167_runs;
        str_builder(&builder,
                    "main.segmap_118188                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_118188_runs,
                    (long) ctx->mainzisegmap_118188_total_runtime /
                    (ctx->mainzisegmap_118188_runs !=
                     0 ? ctx->mainzisegmap_118188_runs : 1),
                    (long) ctx->mainzisegmap_118188_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_118188_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_118188_runs;
        str_builder(&builder,
                    "main.segmap_118650                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_118650_runs,
                    (long) ctx->mainzisegmap_118650_total_runtime /
                    (ctx->mainzisegmap_118650_runs !=
                     0 ? ctx->mainzisegmap_118650_runs : 1),
                    (long) ctx->mainzisegmap_118650_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_118650_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_118650_runs;
        str_builder(&builder,
                    "main.segmap_119033                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_119033_runs,
                    (long) ctx->mainzisegmap_119033_total_runtime /
                    (ctx->mainzisegmap_119033_runs !=
                     0 ? ctx->mainzisegmap_119033_runs : 1),
                    (long) ctx->mainzisegmap_119033_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_119033_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_119033_runs;
        str_builder(&builder,
                    "main.segmap_119159                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_119159_runs,
                    (long) ctx->mainzisegmap_119159_total_runtime /
                    (ctx->mainzisegmap_119159_runs !=
                     0 ? ctx->mainzisegmap_119159_runs : 1),
                    (long) ctx->mainzisegmap_119159_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_119159_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_119159_runs;
        str_builder(&builder,
                    "main.segmap_119259                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_119259_runs,
                    (long) ctx->mainzisegmap_119259_total_runtime /
                    (ctx->mainzisegmap_119259_runs !=
                     0 ? ctx->mainzisegmap_119259_runs : 1),
                    (long) ctx->mainzisegmap_119259_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_119259_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_119259_runs;
        str_builder(&builder,
                    "main.segmap_119275                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_119275_runs,
                    (long) ctx->mainzisegmap_119275_total_runtime /
                    (ctx->mainzisegmap_119275_runs !=
                     0 ? ctx->mainzisegmap_119275_runs : 1),
                    (long) ctx->mainzisegmap_119275_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_119275_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_119275_runs;
        str_builder(&builder,
                    "main.segmap_119467                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_119467_runs,
                    (long) ctx->mainzisegmap_119467_total_runtime /
                    (ctx->mainzisegmap_119467_runs !=
                     0 ? ctx->mainzisegmap_119467_runs : 1),
                    (long) ctx->mainzisegmap_119467_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_119467_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_119467_runs;
        str_builder(&builder,
                    "main.segmap_119488                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_119488_runs,
                    (long) ctx->mainzisegmap_119488_total_runtime /
                    (ctx->mainzisegmap_119488_runs !=
                     0 ? ctx->mainzisegmap_119488_runs : 1),
                    (long) ctx->mainzisegmap_119488_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_119488_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_119488_runs;
        str_builder(&builder,
                    "main.segmap_119812                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_119812_runs,
                    (long) ctx->mainzisegmap_119812_total_runtime /
                    (ctx->mainzisegmap_119812_runs !=
                     0 ? ctx->mainzisegmap_119812_runs : 1),
                    (long) ctx->mainzisegmap_119812_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_119812_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_119812_runs;
        str_builder(&builder,
                    "main.segmap_119845                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_119845_runs,
                    (long) ctx->mainzisegmap_119845_total_runtime /
                    (ctx->mainzisegmap_119845_runs !=
                     0 ? ctx->mainzisegmap_119845_runs : 1),
                    (long) ctx->mainzisegmap_119845_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_119845_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_119845_runs;
        str_builder(&builder,
                    "main.segmap_119928                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_119928_runs,
                    (long) ctx->mainzisegmap_119928_total_runtime /
                    (ctx->mainzisegmap_119928_runs !=
                     0 ? ctx->mainzisegmap_119928_runs : 1),
                    (long) ctx->mainzisegmap_119928_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_119928_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_119928_runs;
        str_builder(&builder,
                    "main.segmap_120060                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_120060_runs,
                    (long) ctx->mainzisegmap_120060_total_runtime /
                    (ctx->mainzisegmap_120060_runs !=
                     0 ? ctx->mainzisegmap_120060_runs : 1),
                    (long) ctx->mainzisegmap_120060_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_120060_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_120060_runs;
        str_builder(&builder,
                    "main.segmap_120133                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_120133_runs,
                    (long) ctx->mainzisegmap_120133_total_runtime /
                    (ctx->mainzisegmap_120133_runs !=
                     0 ? ctx->mainzisegmap_120133_runs : 1),
                    (long) ctx->mainzisegmap_120133_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_120133_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_120133_runs;
        str_builder(&builder,
                    "main.segmap_120742                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_120742_runs,
                    (long) ctx->mainzisegmap_120742_total_runtime /
                    (ctx->mainzisegmap_120742_runs !=
                     0 ? ctx->mainzisegmap_120742_runs : 1),
                    (long) ctx->mainzisegmap_120742_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_120742_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_120742_runs;
        str_builder(&builder,
                    "main.segmap_120811                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_120811_runs,
                    (long) ctx->mainzisegmap_120811_total_runtime /
                    (ctx->mainzisegmap_120811_runs !=
                     0 ? ctx->mainzisegmap_120811_runs : 1),
                    (long) ctx->mainzisegmap_120811_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_120811_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_120811_runs;
        str_builder(&builder,
                    "main.segmap_120951                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_120951_runs,
                    (long) ctx->mainzisegmap_120951_total_runtime /
                    (ctx->mainzisegmap_120951_runs !=
                     0 ? ctx->mainzisegmap_120951_runs : 1),
                    (long) ctx->mainzisegmap_120951_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_120951_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_120951_runs;
        str_builder(&builder,
                    "main.segmap_121079                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_121079_runs,
                    (long) ctx->mainzisegmap_121079_total_runtime /
                    (ctx->mainzisegmap_121079_runs !=
                     0 ? ctx->mainzisegmap_121079_runs : 1),
                    (long) ctx->mainzisegmap_121079_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_121079_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_121079_runs;
        str_builder(&builder,
                    "main.segmap_121412                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_121412_runs,
                    (long) ctx->mainzisegmap_121412_total_runtime /
                    (ctx->mainzisegmap_121412_runs !=
                     0 ? ctx->mainzisegmap_121412_runs : 1),
                    (long) ctx->mainzisegmap_121412_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_121412_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_121412_runs;
        str_builder(&builder,
                    "main.segmap_121611                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_121611_runs,
                    (long) ctx->mainzisegmap_121611_total_runtime /
                    (ctx->mainzisegmap_121611_runs !=
                     0 ? ctx->mainzisegmap_121611_runs : 1),
                    (long) ctx->mainzisegmap_121611_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_121611_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_121611_runs;
        str_builder(&builder,
                    "main.segmap_121790                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_121790_runs,
                    (long) ctx->mainzisegmap_121790_total_runtime /
                    (ctx->mainzisegmap_121790_runs !=
                     0 ? ctx->mainzisegmap_121790_runs : 1),
                    (long) ctx->mainzisegmap_121790_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_121790_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_121790_runs;
        str_builder(&builder,
                    "main.segmap_122245                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_122245_runs,
                    (long) ctx->mainzisegmap_122245_total_runtime /
                    (ctx->mainzisegmap_122245_runs !=
                     0 ? ctx->mainzisegmap_122245_runs : 1),
                    (long) ctx->mainzisegmap_122245_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_122245_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_122245_runs;
        str_builder(&builder,
                    "main.segmap_122508                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_122508_runs,
                    (long) ctx->mainzisegmap_122508_total_runtime /
                    (ctx->mainzisegmap_122508_runs !=
                     0 ? ctx->mainzisegmap_122508_runs : 1),
                    (long) ctx->mainzisegmap_122508_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_122508_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_122508_runs;
        str_builder(&builder,
                    "main.segmap_122736                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_122736_runs,
                    (long) ctx->mainzisegmap_122736_total_runtime /
                    (ctx->mainzisegmap_122736_runs !=
                     0 ? ctx->mainzisegmap_122736_runs : 1),
                    (long) ctx->mainzisegmap_122736_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_122736_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_122736_runs;
        str_builder(&builder,
                    "main.segmap_123938                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_123938_runs,
                    (long) ctx->mainzisegmap_123938_total_runtime /
                    (ctx->mainzisegmap_123938_runs !=
                     0 ? ctx->mainzisegmap_123938_runs : 1),
                    (long) ctx->mainzisegmap_123938_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_123938_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_123938_runs;
        str_builder(&builder,
                    "main.segmap_124116                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_124116_runs,
                    (long) ctx->mainzisegmap_124116_total_runtime /
                    (ctx->mainzisegmap_124116_runs !=
                     0 ? ctx->mainzisegmap_124116_runs : 1),
                    (long) ctx->mainzisegmap_124116_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_124116_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_124116_runs;
        str_builder(&builder,
                    "main.segmap_124202                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_124202_runs,
                    (long) ctx->mainzisegmap_124202_total_runtime /
                    (ctx->mainzisegmap_124202_runs !=
                     0 ? ctx->mainzisegmap_124202_runs : 1),
                    (long) ctx->mainzisegmap_124202_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_124202_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_124202_runs;
        str_builder(&builder,
                    "main.segmap_124239                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_124239_runs,
                    (long) ctx->mainzisegmap_124239_total_runtime /
                    (ctx->mainzisegmap_124239_runs !=
                     0 ? ctx->mainzisegmap_124239_runs : 1),
                    (long) ctx->mainzisegmap_124239_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_124239_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_124239_runs;
        str_builder(&builder,
                    "main.segmap_124291                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_124291_runs,
                    (long) ctx->mainzisegmap_124291_total_runtime /
                    (ctx->mainzisegmap_124291_runs !=
                     0 ? ctx->mainzisegmap_124291_runs : 1),
                    (long) ctx->mainzisegmap_124291_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_124291_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_124291_runs;
        str_builder(&builder,
                    "main.segmap_124431                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_124431_runs,
                    (long) ctx->mainzisegmap_124431_total_runtime /
                    (ctx->mainzisegmap_124431_runs !=
                     0 ? ctx->mainzisegmap_124431_runs : 1),
                    (long) ctx->mainzisegmap_124431_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_124431_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_124431_runs;
        str_builder(&builder,
                    "main.segmap_124559                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_124559_runs,
                    (long) ctx->mainzisegmap_124559_total_runtime /
                    (ctx->mainzisegmap_124559_runs !=
                     0 ? ctx->mainzisegmap_124559_runs : 1),
                    (long) ctx->mainzisegmap_124559_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_124559_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_124559_runs;
        str_builder(&builder,
                    "main.segmap_124892                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_124892_runs,
                    (long) ctx->mainzisegmap_124892_total_runtime /
                    (ctx->mainzisegmap_124892_runs !=
                     0 ? ctx->mainzisegmap_124892_runs : 1),
                    (long) ctx->mainzisegmap_124892_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_124892_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_124892_runs;
        str_builder(&builder,
                    "main.segmap_125091                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_125091_runs,
                    (long) ctx->mainzisegmap_125091_total_runtime /
                    (ctx->mainzisegmap_125091_runs !=
                     0 ? ctx->mainzisegmap_125091_runs : 1),
                    (long) ctx->mainzisegmap_125091_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_125091_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_125091_runs;
        str_builder(&builder,
                    "main.segmap_125270                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_125270_runs,
                    (long) ctx->mainzisegmap_125270_total_runtime /
                    (ctx->mainzisegmap_125270_runs !=
                     0 ? ctx->mainzisegmap_125270_runs : 1),
                    (long) ctx->mainzisegmap_125270_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_125270_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_125270_runs;
        str_builder(&builder,
                    "main.segmap_125725                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_125725_runs,
                    (long) ctx->mainzisegmap_125725_total_runtime /
                    (ctx->mainzisegmap_125725_runs !=
                     0 ? ctx->mainzisegmap_125725_runs : 1),
                    (long) ctx->mainzisegmap_125725_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_125725_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_125725_runs;
        str_builder(&builder,
                    "main.segmap_125988                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_125988_runs,
                    (long) ctx->mainzisegmap_125988_total_runtime /
                    (ctx->mainzisegmap_125988_runs !=
                     0 ? ctx->mainzisegmap_125988_runs : 1),
                    (long) ctx->mainzisegmap_125988_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_125988_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_125988_runs;
        str_builder(&builder,
                    "main.segmap_126216                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_126216_runs,
                    (long) ctx->mainzisegmap_126216_total_runtime /
                    (ctx->mainzisegmap_126216_runs !=
                     0 ? ctx->mainzisegmap_126216_runs : 1),
                    (long) ctx->mainzisegmap_126216_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_126216_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_126216_runs;
        str_builder(&builder,
                    "main.segmap_127418                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_127418_runs,
                    (long) ctx->mainzisegmap_127418_total_runtime /
                    (ctx->mainzisegmap_127418_runs !=
                     0 ? ctx->mainzisegmap_127418_runs : 1),
                    (long) ctx->mainzisegmap_127418_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_127418_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_127418_runs;
        str_builder(&builder,
                    "main.segmap_127596                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_127596_runs,
                    (long) ctx->mainzisegmap_127596_total_runtime /
                    (ctx->mainzisegmap_127596_runs !=
                     0 ? ctx->mainzisegmap_127596_runs : 1),
                    (long) ctx->mainzisegmap_127596_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_127596_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_127596_runs;
        str_builder(&builder,
                    "main.segmap_127651                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_127651_runs,
                    (long) ctx->mainzisegmap_127651_total_runtime /
                    (ctx->mainzisegmap_127651_runs !=
                     0 ? ctx->mainzisegmap_127651_runs : 1),
                    (long) ctx->mainzisegmap_127651_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_127651_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_127651_runs;
        str_builder(&builder,
                    "main.segmap_127708                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_127708_runs,
                    (long) ctx->mainzisegmap_127708_total_runtime /
                    (ctx->mainzisegmap_127708_runs !=
                     0 ? ctx->mainzisegmap_127708_runs : 1),
                    (long) ctx->mainzisegmap_127708_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_127708_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_127708_runs;
        str_builder(&builder,
                    "main.segmap_128091                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_128091_runs,
                    (long) ctx->mainzisegmap_128091_total_runtime /
                    (ctx->mainzisegmap_128091_runs !=
                     0 ? ctx->mainzisegmap_128091_runs : 1),
                    (long) ctx->mainzisegmap_128091_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_128091_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_128091_runs;
        str_builder(&builder,
                    "main.segmap_128490                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_128490_runs,
                    (long) ctx->mainzisegmap_128490_total_runtime /
                    (ctx->mainzisegmap_128490_runs !=
                     0 ? ctx->mainzisegmap_128490_runs : 1),
                    (long) ctx->mainzisegmap_128490_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_128490_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_128490_runs;
        str_builder(&builder,
                    "main.segmap_128521                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_128521_runs,
                    (long) ctx->mainzisegmap_128521_total_runtime /
                    (ctx->mainzisegmap_128521_runs !=
                     0 ? ctx->mainzisegmap_128521_runs : 1),
                    (long) ctx->mainzisegmap_128521_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_128521_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_128521_runs;
        str_builder(&builder,
                    "main.segmap_128579                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_128579_runs,
                    (long) ctx->mainzisegmap_128579_total_runtime /
                    (ctx->mainzisegmap_128579_runs !=
                     0 ? ctx->mainzisegmap_128579_runs : 1),
                    (long) ctx->mainzisegmap_128579_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_128579_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_128579_runs;
        str_builder(&builder,
                    "main.segmap_128670                     ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_128670_runs,
                    (long) ctx->mainzisegmap_128670_total_runtime /
                    (ctx->mainzisegmap_128670_runs !=
                     0 ? ctx->mainzisegmap_128670_runs : 1),
                    (long) ctx->mainzisegmap_128670_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_128670_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_128670_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_116763          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_116763_runs,
                    (long) ctx->mainzisegmap_intragroup_116763_total_runtime /
                    (ctx->mainzisegmap_intragroup_116763_runs !=
                     0 ? ctx->mainzisegmap_intragroup_116763_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_116763_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_116763_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_116763_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_117346          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_117346_runs,
                    (long) ctx->mainzisegmap_intragroup_117346_total_runtime /
                    (ctx->mainzisegmap_intragroup_117346_runs !=
                     0 ? ctx->mainzisegmap_intragroup_117346_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_117346_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_117346_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_117346_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_118646          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_118646_runs,
                    (long) ctx->mainzisegmap_intragroup_118646_total_runtime /
                    (ctx->mainzisegmap_intragroup_118646_runs !=
                     0 ? ctx->mainzisegmap_intragroup_118646_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_118646_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_118646_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_118646_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_120129          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_120129_runs,
                    (long) ctx->mainzisegmap_intragroup_120129_total_runtime /
                    (ctx->mainzisegmap_intragroup_120129_runs !=
                     0 ? ctx->mainzisegmap_intragroup_120129_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_120129_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_120129_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_120129_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_123347          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_123347_runs,
                    (long) ctx->mainzisegmap_intragroup_123347_total_runtime /
                    (ctx->mainzisegmap_intragroup_123347_runs !=
                     0 ? ctx->mainzisegmap_intragroup_123347_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_123347_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_123347_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_123347_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_123476          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_123476_runs,
                    (long) ctx->mainzisegmap_intragroup_123476_total_runtime /
                    (ctx->mainzisegmap_intragroup_123476_runs !=
                     0 ? ctx->mainzisegmap_intragroup_123476_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_123476_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_123476_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_123476_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_123686          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_123686_runs,
                    (long) ctx->mainzisegmap_intragroup_123686_total_runtime /
                    (ctx->mainzisegmap_intragroup_123686_runs !=
                     0 ? ctx->mainzisegmap_intragroup_123686_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_123686_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_123686_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_123686_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_124166          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_124166_runs,
                    (long) ctx->mainzisegmap_intragroup_124166_total_runtime /
                    (ctx->mainzisegmap_intragroup_124166_runs !=
                     0 ? ctx->mainzisegmap_intragroup_124166_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_124166_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_124166_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_124166_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_126827          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_126827_runs,
                    (long) ctx->mainzisegmap_intragroup_126827_total_runtime /
                    (ctx->mainzisegmap_intragroup_126827_runs !=
                     0 ? ctx->mainzisegmap_intragroup_126827_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_126827_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_126827_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_126827_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_126956          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_126956_runs,
                    (long) ctx->mainzisegmap_intragroup_126956_total_runtime /
                    (ctx->mainzisegmap_intragroup_126956_runs !=
                     0 ? ctx->mainzisegmap_intragroup_126956_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_126956_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_126956_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_126956_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_127166          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_127166_runs,
                    (long) ctx->mainzisegmap_intragroup_127166_total_runtime /
                    (ctx->mainzisegmap_intragroup_127166_runs !=
                     0 ? ctx->mainzisegmap_intragroup_127166_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_127166_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_127166_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_127166_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_127704          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_127704_runs,
                    (long) ctx->mainzisegmap_intragroup_127704_total_runtime /
                    (ctx->mainzisegmap_intragroup_127704_runs !=
                     0 ? ctx->mainzisegmap_intragroup_127704_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_127704_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_127704_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_127704_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_127994          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_127994_runs,
                    (long) ctx->mainzisegmap_intragroup_127994_total_runtime /
                    (ctx->mainzisegmap_intragroup_127994_runs !=
                     0 ? ctx->mainzisegmap_intragroup_127994_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_127994_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_127994_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_127994_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_129249          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_129249_runs,
                    (long) ctx->mainzisegmap_intragroup_129249_total_runtime /
                    (ctx->mainzisegmap_intragroup_129249_runs !=
                     0 ? ctx->mainzisegmap_intragroup_129249_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_129249_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_129249_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_129249_runs;
        str_builder(&builder,
                    "main.segmap_intragroup_129547          ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegmap_intragroup_129547_runs,
                    (long) ctx->mainzisegmap_intragroup_129547_total_runtime /
                    (ctx->mainzisegmap_intragroup_129547_runs !=
                     0 ? ctx->mainzisegmap_intragroup_129547_runs : 1),
                    (long) ctx->mainzisegmap_intragroup_129547_total_runtime);
        ctx->total_runtime += ctx->mainzisegmap_intragroup_129547_total_runtime;
        ctx->total_runs += ctx->mainzisegmap_intragroup_129547_runs;
        str_builder(&builder,
                    "main.segred_large_117097               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_117097_runs,
                    (long) ctx->mainzisegred_large_117097_total_runtime /
                    (ctx->mainzisegred_large_117097_runs !=
                     0 ? ctx->mainzisegred_large_117097_runs : 1),
                    (long) ctx->mainzisegred_large_117097_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_117097_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_117097_runs;
        str_builder(&builder,
                    "main.segred_large_117941               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_117941_runs,
                    (long) ctx->mainzisegred_large_117941_total_runtime /
                    (ctx->mainzisegred_large_117941_runs !=
                     0 ? ctx->mainzisegred_large_117941_runs : 1),
                    (long) ctx->mainzisegred_large_117941_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_117941_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_117941_runs;
        str_builder(&builder,
                    "main.segred_large_119241               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_119241_runs,
                    (long) ctx->mainzisegred_large_119241_total_runtime /
                    (ctx->mainzisegred_large_119241_runs !=
                     0 ? ctx->mainzisegred_large_119241_runs : 1),
                    (long) ctx->mainzisegred_large_119241_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_119241_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_119241_runs;
        str_builder(&builder,
                    "main.segred_large_119948               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_119948_runs,
                    (long) ctx->mainzisegred_large_119948_total_runtime /
                    (ctx->mainzisegred_large_119948_runs !=
                     0 ? ctx->mainzisegred_large_119948_runs : 1),
                    (long) ctx->mainzisegred_large_119948_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_119948_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_119948_runs;
        str_builder(&builder,
                    "main.segred_large_120463               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_120463_runs,
                    (long) ctx->mainzisegred_large_120463_total_runtime /
                    (ctx->mainzisegred_large_120463_runs !=
                     0 ? ctx->mainzisegred_large_120463_runs : 1),
                    (long) ctx->mainzisegred_large_120463_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_120463_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_120463_runs;
        str_builder(&builder,
                    "main.segred_large_120526               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_120526_runs,
                    (long) ctx->mainzisegred_large_120526_total_runtime /
                    (ctx->mainzisegred_large_120526_runs !=
                     0 ? ctx->mainzisegred_large_120526_runs : 1),
                    (long) ctx->mainzisegred_large_120526_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_120526_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_120526_runs;
        str_builder(&builder,
                    "main.segred_large_120587               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_120587_runs,
                    (long) ctx->mainzisegred_large_120587_total_runtime /
                    (ctx->mainzisegred_large_120587_runs !=
                     0 ? ctx->mainzisegred_large_120587_runs : 1),
                    (long) ctx->mainzisegred_large_120587_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_120587_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_120587_runs;
        str_builder(&builder,
                    "main.segred_large_121036               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_121036_runs,
                    (long) ctx->mainzisegred_large_121036_total_runtime /
                    (ctx->mainzisegred_large_121036_runs !=
                     0 ? ctx->mainzisegred_large_121036_runs : 1),
                    (long) ctx->mainzisegred_large_121036_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_121036_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_121036_runs;
        str_builder(&builder,
                    "main.segred_large_121098               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_121098_runs,
                    (long) ctx->mainzisegred_large_121098_total_runtime /
                    (ctx->mainzisegred_large_121098_runs !=
                     0 ? ctx->mainzisegred_large_121098_runs : 1),
                    (long) ctx->mainzisegred_large_121098_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_121098_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_121098_runs;
        str_builder(&builder,
                    "main.segred_large_121729               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_121729_runs,
                    (long) ctx->mainzisegred_large_121729_total_runtime /
                    (ctx->mainzisegred_large_121729_runs !=
                     0 ? ctx->mainzisegred_large_121729_runs : 1),
                    (long) ctx->mainzisegred_large_121729_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_121729_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_121729_runs;
        str_builder(&builder,
                    "main.segred_large_121818               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_121818_runs,
                    (long) ctx->mainzisegred_large_121818_total_runtime /
                    (ctx->mainzisegred_large_121818_runs !=
                     0 ? ctx->mainzisegred_large_121818_runs : 1),
                    (long) ctx->mainzisegred_large_121818_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_121818_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_121818_runs;
        str_builder(&builder,
                    "main.segred_large_122662               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_122662_runs,
                    (long) ctx->mainzisegred_large_122662_total_runtime /
                    (ctx->mainzisegred_large_122662_runs !=
                     0 ? ctx->mainzisegred_large_122662_runs : 1),
                    (long) ctx->mainzisegred_large_122662_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_122662_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_122662_runs;
        str_builder(&builder,
                    "main.segred_large_122783               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_122783_runs,
                    (long) ctx->mainzisegred_large_122783_total_runtime /
                    (ctx->mainzisegred_large_122783_runs !=
                     0 ? ctx->mainzisegred_large_122783_runs : 1),
                    (long) ctx->mainzisegred_large_122783_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_122783_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_122783_runs;
        str_builder(&builder,
                    "main.segred_large_124516               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_124516_runs,
                    (long) ctx->mainzisegred_large_124516_total_runtime /
                    (ctx->mainzisegred_large_124516_runs !=
                     0 ? ctx->mainzisegred_large_124516_runs : 1),
                    (long) ctx->mainzisegred_large_124516_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_124516_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_124516_runs;
        str_builder(&builder,
                    "main.segred_large_124578               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_124578_runs,
                    (long) ctx->mainzisegred_large_124578_total_runtime /
                    (ctx->mainzisegred_large_124578_runs !=
                     0 ? ctx->mainzisegred_large_124578_runs : 1),
                    (long) ctx->mainzisegred_large_124578_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_124578_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_124578_runs;
        str_builder(&builder,
                    "main.segred_large_125209               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_125209_runs,
                    (long) ctx->mainzisegred_large_125209_total_runtime /
                    (ctx->mainzisegred_large_125209_runs !=
                     0 ? ctx->mainzisegred_large_125209_runs : 1),
                    (long) ctx->mainzisegred_large_125209_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_125209_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_125209_runs;
        str_builder(&builder,
                    "main.segred_large_125298               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_125298_runs,
                    (long) ctx->mainzisegred_large_125298_total_runtime /
                    (ctx->mainzisegred_large_125298_runs !=
                     0 ? ctx->mainzisegred_large_125298_runs : 1),
                    (long) ctx->mainzisegred_large_125298_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_125298_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_125298_runs;
        str_builder(&builder,
                    "main.segred_large_126142               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_126142_runs,
                    (long) ctx->mainzisegred_large_126142_total_runtime /
                    (ctx->mainzisegred_large_126142_runs !=
                     0 ? ctx->mainzisegred_large_126142_runs : 1),
                    (long) ctx->mainzisegred_large_126142_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_126142_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_126142_runs;
        str_builder(&builder,
                    "main.segred_large_126263               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_126263_runs,
                    (long) ctx->mainzisegred_large_126263_total_runtime /
                    (ctx->mainzisegred_large_126263_runs !=
                     0 ? ctx->mainzisegred_large_126263_runs : 1),
                    (long) ctx->mainzisegred_large_126263_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_126263_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_126263_runs;
        str_builder(&builder,
                    "main.segred_large_128539               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_large_128539_runs,
                    (long) ctx->mainzisegred_large_128539_total_runtime /
                    (ctx->mainzisegred_large_128539_runs !=
                     0 ? ctx->mainzisegred_large_128539_runs : 1),
                    (long) ctx->mainzisegred_large_128539_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_large_128539_total_runtime;
        ctx->total_runs += ctx->mainzisegred_large_128539_runs;
        str_builder(&builder,
                    "main.segred_small_117097               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_117097_runs,
                    (long) ctx->mainzisegred_small_117097_total_runtime /
                    (ctx->mainzisegred_small_117097_runs !=
                     0 ? ctx->mainzisegred_small_117097_runs : 1),
                    (long) ctx->mainzisegred_small_117097_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_117097_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_117097_runs;
        str_builder(&builder,
                    "main.segred_small_117941               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_117941_runs,
                    (long) ctx->mainzisegred_small_117941_total_runtime /
                    (ctx->mainzisegred_small_117941_runs !=
                     0 ? ctx->mainzisegred_small_117941_runs : 1),
                    (long) ctx->mainzisegred_small_117941_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_117941_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_117941_runs;
        str_builder(&builder,
                    "main.segred_small_119241               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_119241_runs,
                    (long) ctx->mainzisegred_small_119241_total_runtime /
                    (ctx->mainzisegred_small_119241_runs !=
                     0 ? ctx->mainzisegred_small_119241_runs : 1),
                    (long) ctx->mainzisegred_small_119241_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_119241_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_119241_runs;
        str_builder(&builder,
                    "main.segred_small_119948               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_119948_runs,
                    (long) ctx->mainzisegred_small_119948_total_runtime /
                    (ctx->mainzisegred_small_119948_runs !=
                     0 ? ctx->mainzisegred_small_119948_runs : 1),
                    (long) ctx->mainzisegred_small_119948_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_119948_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_119948_runs;
        str_builder(&builder,
                    "main.segred_small_120463               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_120463_runs,
                    (long) ctx->mainzisegred_small_120463_total_runtime /
                    (ctx->mainzisegred_small_120463_runs !=
                     0 ? ctx->mainzisegred_small_120463_runs : 1),
                    (long) ctx->mainzisegred_small_120463_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_120463_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_120463_runs;
        str_builder(&builder,
                    "main.segred_small_120526               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_120526_runs,
                    (long) ctx->mainzisegred_small_120526_total_runtime /
                    (ctx->mainzisegred_small_120526_runs !=
                     0 ? ctx->mainzisegred_small_120526_runs : 1),
                    (long) ctx->mainzisegred_small_120526_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_120526_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_120526_runs;
        str_builder(&builder,
                    "main.segred_small_120587               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_120587_runs,
                    (long) ctx->mainzisegred_small_120587_total_runtime /
                    (ctx->mainzisegred_small_120587_runs !=
                     0 ? ctx->mainzisegred_small_120587_runs : 1),
                    (long) ctx->mainzisegred_small_120587_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_120587_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_120587_runs;
        str_builder(&builder,
                    "main.segred_small_121036               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_121036_runs,
                    (long) ctx->mainzisegred_small_121036_total_runtime /
                    (ctx->mainzisegred_small_121036_runs !=
                     0 ? ctx->mainzisegred_small_121036_runs : 1),
                    (long) ctx->mainzisegred_small_121036_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_121036_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_121036_runs;
        str_builder(&builder,
                    "main.segred_small_121098               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_121098_runs,
                    (long) ctx->mainzisegred_small_121098_total_runtime /
                    (ctx->mainzisegred_small_121098_runs !=
                     0 ? ctx->mainzisegred_small_121098_runs : 1),
                    (long) ctx->mainzisegred_small_121098_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_121098_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_121098_runs;
        str_builder(&builder,
                    "main.segred_small_121729               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_121729_runs,
                    (long) ctx->mainzisegred_small_121729_total_runtime /
                    (ctx->mainzisegred_small_121729_runs !=
                     0 ? ctx->mainzisegred_small_121729_runs : 1),
                    (long) ctx->mainzisegred_small_121729_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_121729_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_121729_runs;
        str_builder(&builder,
                    "main.segred_small_121818               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_121818_runs,
                    (long) ctx->mainzisegred_small_121818_total_runtime /
                    (ctx->mainzisegred_small_121818_runs !=
                     0 ? ctx->mainzisegred_small_121818_runs : 1),
                    (long) ctx->mainzisegred_small_121818_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_121818_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_121818_runs;
        str_builder(&builder,
                    "main.segred_small_122662               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_122662_runs,
                    (long) ctx->mainzisegred_small_122662_total_runtime /
                    (ctx->mainzisegred_small_122662_runs !=
                     0 ? ctx->mainzisegred_small_122662_runs : 1),
                    (long) ctx->mainzisegred_small_122662_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_122662_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_122662_runs;
        str_builder(&builder,
                    "main.segred_small_122783               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_122783_runs,
                    (long) ctx->mainzisegred_small_122783_total_runtime /
                    (ctx->mainzisegred_small_122783_runs !=
                     0 ? ctx->mainzisegred_small_122783_runs : 1),
                    (long) ctx->mainzisegred_small_122783_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_122783_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_122783_runs;
        str_builder(&builder,
                    "main.segred_small_124516               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_124516_runs,
                    (long) ctx->mainzisegred_small_124516_total_runtime /
                    (ctx->mainzisegred_small_124516_runs !=
                     0 ? ctx->mainzisegred_small_124516_runs : 1),
                    (long) ctx->mainzisegred_small_124516_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_124516_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_124516_runs;
        str_builder(&builder,
                    "main.segred_small_124578               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_124578_runs,
                    (long) ctx->mainzisegred_small_124578_total_runtime /
                    (ctx->mainzisegred_small_124578_runs !=
                     0 ? ctx->mainzisegred_small_124578_runs : 1),
                    (long) ctx->mainzisegred_small_124578_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_124578_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_124578_runs;
        str_builder(&builder,
                    "main.segred_small_125209               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_125209_runs,
                    (long) ctx->mainzisegred_small_125209_total_runtime /
                    (ctx->mainzisegred_small_125209_runs !=
                     0 ? ctx->mainzisegred_small_125209_runs : 1),
                    (long) ctx->mainzisegred_small_125209_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_125209_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_125209_runs;
        str_builder(&builder,
                    "main.segred_small_125298               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_125298_runs,
                    (long) ctx->mainzisegred_small_125298_total_runtime /
                    (ctx->mainzisegred_small_125298_runs !=
                     0 ? ctx->mainzisegred_small_125298_runs : 1),
                    (long) ctx->mainzisegred_small_125298_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_125298_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_125298_runs;
        str_builder(&builder,
                    "main.segred_small_126142               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_126142_runs,
                    (long) ctx->mainzisegred_small_126142_total_runtime /
                    (ctx->mainzisegred_small_126142_runs !=
                     0 ? ctx->mainzisegred_small_126142_runs : 1),
                    (long) ctx->mainzisegred_small_126142_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_126142_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_126142_runs;
        str_builder(&builder,
                    "main.segred_small_126263               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_126263_runs,
                    (long) ctx->mainzisegred_small_126263_total_runtime /
                    (ctx->mainzisegred_small_126263_runs !=
                     0 ? ctx->mainzisegred_small_126263_runs : 1),
                    (long) ctx->mainzisegred_small_126263_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_126263_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_126263_runs;
        str_builder(&builder,
                    "main.segred_small_128539               ran %5d times; avg: %8ldus; total: %8ldus\n",
                    ctx->mainzisegred_small_128539_runs,
                    (long) ctx->mainzisegred_small_128539_total_runtime /
                    (ctx->mainzisegred_small_128539_runs !=
                     0 ? ctx->mainzisegred_small_128539_runs : 1),
                    (long) ctx->mainzisegred_small_128539_total_runtime);
        ctx->total_runtime += ctx->mainzisegred_small_128539_total_runtime;
        ctx->total_runs += ctx->mainzisegred_small_128539_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_builtinzhgpu_map_transpose_i64(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_132954,
                                         int32_t num_elems_132955,
                                         float val_132956);
static int futrts_builtinzhreplicate_i64(struct futhark_context *ctx,
                                         struct memblock_device mem_132365,
                                         int32_t num_elems_132366,
                                         int64_t val_132367);
static int futrts_entry_main(struct futhark_context *ctx,
                             struct memblock_device *out_mem_p_135466,
                             struct memblock_device *out_mem_p_135467,
                             struct memblock_device *out_mem_p_135468,
                             struct memblock_device Y_mem_130086,
                             int64_t m_114533, int64_t n_114534,
                             int64_t n_p_114536, int64_t t_window_114537,
                             int64_t l_window_114538, int64_t t_degree_114539,
                             int64_t l_degree_114540, int64_t t_jump_114541,
                             int64_t l_jump_114542, int64_t inner_114543,
                             int64_t outer_114544,
                             int64_t jump_threshold_114545,
                             int64_t max_group_sizze_114546);
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, (size_t) (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, 0,
                                                      (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, int 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, (size_t) (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, offset, 0,
                                                     (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,
                                                     0,
                                                     (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,
                                                             sext_i32_i64(srcoffset_3),
                                                             sext_i32_i64(destoffset_1),
                                                             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, (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_135416[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_135420[3] = {16, 16, 1};
                    int64_t time_start_135417 = 0, time_end_135418 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "gpu_map_transpose_f32_low_width");
                        fprintf(ctx->log, "%zu", global_work_sizze_135416[0]);
                        fprintf(ctx->log, ", ");
                        fprintf(ctx->log, "%zu", global_work_sizze_135416[1]);
                        fprintf(ctx->log, ", ");
                        fprintf(ctx->log, "%zu", global_work_sizze_135416[2]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135420[0]);
                        fprintf(ctx->log, ", ");
                        fprintf(ctx->log, "%zu", local_work_sizze_135420[1]);
                        fprintf(ctx->log, ", ");
                        fprintf(ctx->log, "%zu", local_work_sizze_135420[2]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) (0 + (int64_t) 1088));
                        time_start_135417 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->gpu_map_transpose_f32_low_width,
                                                                    3, NULL,
                                                                    global_work_sizze_135416,
                                                                    local_work_sizze_135420,
                                                                    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_135418 = get_wall_time();
                        
                        long time_diff_135419 = time_end_135418 -
                             time_start_135417;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "gpu_map_transpose_f32_low_width",
                                time_diff_135419);
                    }
                }
            } 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, (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_135421[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_135425[3] = {16, 16, 1};
                        int64_t time_start_135422 = 0, time_end_135423 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [",
                                    "gpu_map_transpose_f32_low_height");
                            fprintf(ctx->log, "%zu",
                                    global_work_sizze_135421[0]);
                            fprintf(ctx->log, ", ");
                            fprintf(ctx->log, "%zu",
                                    global_work_sizze_135421[1]);
                            fprintf(ctx->log, ", ");
                            fprintf(ctx->log, "%zu",
                                    global_work_sizze_135421[2]);
                            fprintf(ctx->log, "] and local work size [");
                            fprintf(ctx->log, "%zu",
                                    local_work_sizze_135425[0]);
                            fprintf(ctx->log, ", ");
                            fprintf(ctx->log, "%zu",
                                    local_work_sizze_135425[1]);
                            fprintf(ctx->log, ", ");
                            fprintf(ctx->log, "%zu",
                                    local_work_sizze_135425[2]);
                            fprintf(ctx->log,
                                    "]; local memory parameters sum to %d bytes.\n",
                                    (int) (0 + (int64_t) 1088));
                            time_start_135422 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->gpu_map_transpose_f32_low_height,
                                                                        3, NULL,
                                                                        global_work_sizze_135421,
                                                                        local_work_sizze_135425,
                                                                        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_135423 = get_wall_time();
                            
                            long time_diff_135424 = time_end_135423 -
                                 time_start_135422;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "gpu_map_transpose_f32_low_height",
                                    time_diff_135424);
                        }
                    }
                } else {
                    if (sle32(x_elems_5, 8) && sle32(y_elems_6, 8)) {
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32_small,
                                                                0, (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_135426[1] =
                                         {(size_t) sdiv_up32(num_arrays_4 *
                                                             x_elems_5 *
                                                             y_elems_6, 256) *
                                         (size_t) 256};
                            const size_t local_work_sizze_135430[1] = {256};
                            int64_t time_start_135427 = 0, time_end_135428 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "gpu_map_transpose_f32_small");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135426[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135430[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + (int64_t) 1));
                                time_start_135427 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->gpu_map_transpose_f32_small,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135426,
                                                                            local_work_sizze_135430,
                                                                            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_135428 = get_wall_time();
                                
                                long time_diff_135429 = time_end_135428 -
                                     time_start_135427;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_f32_small",
                                        time_diff_135429);
                            }
                        }
                    } else {
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_f32,
                                                                0,
                                                                (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_135431[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_135435[3] = {32, 8,
                                                                       1};
                            int64_t time_start_135432 = 0, time_end_135433 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "gpu_map_transpose_f32");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135431[0]);
                                fprintf(ctx->log, ", ");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135431[1]);
                                fprintf(ctx->log, ", ");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135431[2]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135435[0]);
                                fprintf(ctx->log, ", ");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135435[1]);
                                fprintf(ctx->log, ", ");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135435[2]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + (int64_t) 4224));
                                time_start_135432 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->gpu_map_transpose_f32,
                                                                            3,
                                                                            NULL,
                                                                            global_work_sizze_135431,
                                                                            local_work_sizze_135435,
                                                                            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_135433 = get_wall_time();
                                
                                long time_diff_135434 = time_end_135433 -
                                     time_start_135432;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_f32",
                                        time_diff_135434);
                            }
                        }
                    }
                }
            }
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_builtinzhgpu_map_transpose_i64(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 * 8) > 0) {
                OPENCL_SUCCEED_OR_RETURN(clEnqueueCopyBuffer(ctx->opencl.queue,
                                                             srcmem_2.mem,
                                                             destmem_0.mem,
                                                             sext_i32_i64(srcoffset_3),
                                                             sext_i32_i64(destoffset_1),
                                                             sext_i32_i64(x_elems_5 *
                                                             y_elems_6 * 8), 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_i64_low_width,
                                                        0, (int64_t) 2176,
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_low_width,
                                                        1, sizeof(destoffset_1),
                                                        &destoffset_1));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_low_width,
                                                        2, sizeof(srcoffset_3),
                                                        &srcoffset_3));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_low_width,
                                                        3, sizeof(num_arrays_4),
                                                        &num_arrays_4));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_low_width,
                                                        4, sizeof(x_elems_5),
                                                        &x_elems_5));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_low_width,
                                                        5, sizeof(y_elems_6),
                                                        &y_elems_6));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_low_width,
                                                        6, sizeof(mulx_7),
                                                        &mulx_7));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_low_width,
                                                        7, sizeof(muly_8),
                                                        &muly_8));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_low_width,
                                                        8,
                                                        sizeof(destmem_0.mem),
                                                        &destmem_0.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_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_135436[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_135440[3] = {16, 16, 1};
                    int64_t time_start_135437 = 0, time_end_135438 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "gpu_map_transpose_i64_low_width");
                        fprintf(ctx->log, "%zu", global_work_sizze_135436[0]);
                        fprintf(ctx->log, ", ");
                        fprintf(ctx->log, "%zu", global_work_sizze_135436[1]);
                        fprintf(ctx->log, ", ");
                        fprintf(ctx->log, "%zu", global_work_sizze_135436[2]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135440[0]);
                        fprintf(ctx->log, ", ");
                        fprintf(ctx->log, "%zu", local_work_sizze_135440[1]);
                        fprintf(ctx->log, ", ");
                        fprintf(ctx->log, "%zu", local_work_sizze_135440[2]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) (0 + (int64_t) 2176));
                        time_start_135437 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->gpu_map_transpose_i64_low_width,
                                                                    3, NULL,
                                                                    global_work_sizze_135436,
                                                                    local_work_sizze_135440,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->gpu_map_transpose_i64_low_width_runs,
                                                                                                              &ctx->gpu_map_transpose_i64_low_width_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135438 = get_wall_time();
                        
                        long time_diff_135439 = time_end_135438 -
                             time_start_135437;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "gpu_map_transpose_i64_low_width",
                                time_diff_135439);
                    }
                }
            } else {
                if (sle32(y_elems_6, 8) && slt32(16, x_elems_5)) {
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_low_height,
                                                            0, (int64_t) 2176,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_low_height,
                                                            1,
                                                            sizeof(destoffset_1),
                                                            &destoffset_1));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_low_height,
                                                            2,
                                                            sizeof(srcoffset_3),
                                                            &srcoffset_3));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_low_height,
                                                            3,
                                                            sizeof(num_arrays_4),
                                                            &num_arrays_4));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_low_height,
                                                            4,
                                                            sizeof(x_elems_5),
                                                            &x_elems_5));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_low_height,
                                                            5,
                                                            sizeof(y_elems_6),
                                                            &y_elems_6));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_low_height,
                                                            6, sizeof(mulx_7),
                                                            &mulx_7));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_low_height,
                                                            7, sizeof(muly_8),
                                                            &muly_8));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_low_height,
                                                            8,
                                                            sizeof(destmem_0.mem),
                                                            &destmem_0.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_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_135441[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_135445[3] = {16, 16, 1};
                        int64_t time_start_135442 = 0, time_end_135443 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [",
                                    "gpu_map_transpose_i64_low_height");
                            fprintf(ctx->log, "%zu",
                                    global_work_sizze_135441[0]);
                            fprintf(ctx->log, ", ");
                            fprintf(ctx->log, "%zu",
                                    global_work_sizze_135441[1]);
                            fprintf(ctx->log, ", ");
                            fprintf(ctx->log, "%zu",
                                    global_work_sizze_135441[2]);
                            fprintf(ctx->log, "] and local work size [");
                            fprintf(ctx->log, "%zu",
                                    local_work_sizze_135445[0]);
                            fprintf(ctx->log, ", ");
                            fprintf(ctx->log, "%zu",
                                    local_work_sizze_135445[1]);
                            fprintf(ctx->log, ", ");
                            fprintf(ctx->log, "%zu",
                                    local_work_sizze_135445[2]);
                            fprintf(ctx->log,
                                    "]; local memory parameters sum to %d bytes.\n",
                                    (int) (0 + (int64_t) 2176));
                            time_start_135442 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->gpu_map_transpose_i64_low_height,
                                                                        3, NULL,
                                                                        global_work_sizze_135441,
                                                                        local_work_sizze_135445,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->gpu_map_transpose_i64_low_height_runs,
                                                                                                                  &ctx->gpu_map_transpose_i64_low_height_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_135443 = get_wall_time();
                            
                            long time_diff_135444 = time_end_135443 -
                                 time_start_135442;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "gpu_map_transpose_i64_low_height",
                                    time_diff_135444);
                        }
                    }
                } else {
                    if (sle32(x_elems_5, 8) && sle32(y_elems_6, 8)) {
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_small,
                                                                0, (int64_t) 1,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_small,
                                                                1,
                                                                sizeof(destoffset_1),
                                                                &destoffset_1));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_small,
                                                                2,
                                                                sizeof(srcoffset_3),
                                                                &srcoffset_3));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_small,
                                                                3,
                                                                sizeof(num_arrays_4),
                                                                &num_arrays_4));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_small,
                                                                4,
                                                                sizeof(x_elems_5),
                                                                &x_elems_5));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_small,
                                                                5,
                                                                sizeof(y_elems_6),
                                                                &y_elems_6));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_small,
                                                                6,
                                                                sizeof(mulx_7),
                                                                &mulx_7));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_small,
                                                                7,
                                                                sizeof(muly_8),
                                                                &muly_8));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_small,
                                                                8,
                                                                sizeof(destmem_0.mem),
                                                                &destmem_0.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64_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_135446[1] =
                                         {(size_t) sdiv_up32(num_arrays_4 *
                                                             x_elems_5 *
                                                             y_elems_6, 256) *
                                         (size_t) 256};
                            const size_t local_work_sizze_135450[1] = {256};
                            int64_t time_start_135447 = 0, time_end_135448 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "gpu_map_transpose_i64_small");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135446[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135450[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + (int64_t) 1));
                                time_start_135447 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->gpu_map_transpose_i64_small,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135446,
                                                                            local_work_sizze_135450,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->gpu_map_transpose_i64_small_runs,
                                                                                                                      &ctx->gpu_map_transpose_i64_small_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135448 = get_wall_time();
                                
                                long time_diff_135449 = time_end_135448 -
                                     time_start_135447;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_i64_small",
                                        time_diff_135449);
                            }
                        }
                    } else {
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64,
                                                                0,
                                                                (int64_t) 8448,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64,
                                                                1,
                                                                sizeof(destoffset_1),
                                                                &destoffset_1));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64,
                                                                2,
                                                                sizeof(srcoffset_3),
                                                                &srcoffset_3));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64,
                                                                3,
                                                                sizeof(num_arrays_4),
                                                                &num_arrays_4));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64,
                                                                4,
                                                                sizeof(x_elems_5),
                                                                &x_elems_5));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64,
                                                                5,
                                                                sizeof(y_elems_6),
                                                                &y_elems_6));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64,
                                                                6,
                                                                sizeof(mulx_7),
                                                                &mulx_7));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64,
                                                                7,
                                                                sizeof(muly_8),
                                                                &muly_8));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64,
                                                                8,
                                                                sizeof(destmem_0.mem),
                                                                &destmem_0.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->gpu_map_transpose_i64,
                                                                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_135451[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_135455[3] = {32, 8,
                                                                       1};
                            int64_t time_start_135452 = 0, time_end_135453 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "gpu_map_transpose_i64");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135451[0]);
                                fprintf(ctx->log, ", ");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135451[1]);
                                fprintf(ctx->log, ", ");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135451[2]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135455[0]);
                                fprintf(ctx->log, ", ");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135455[1]);
                                fprintf(ctx->log, ", ");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135455[2]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + (int64_t) 8448));
                                time_start_135452 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->gpu_map_transpose_i64,
                                                                            3,
                                                                            NULL,
                                                                            global_work_sizze_135451,
                                                                            local_work_sizze_135455,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->gpu_map_transpose_i64_runs,
                                                                                                                      &ctx->gpu_map_transpose_i64_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135453 = get_wall_time();
                                
                                long time_diff_135454 = time_end_135453 -
                                     time_start_135452;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "gpu_map_transpose_i64",
                                        time_diff_135454);
                            }
                        }
                    }
                }
            }
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_builtinzhreplicate_f32(struct futhark_context *ctx,
                                         struct memblock_device mem_132954,
                                         int32_t num_elems_132955,
                                         float val_132956)
{
    (void) ctx;
    
    int err = 0;
    int64_t group_sizze_132961;
    
    group_sizze_132961 = ctx->sizes.builtinzhreplicate_f32zigroup_sizze_132961;
    
    int64_t num_groups_132962 = sdiv_up64(num_elems_132955, group_sizze_132961);
    
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_f32zireplicate_132958,
                                            0, sizeof(num_elems_132955),
                                            &num_elems_132955));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_f32zireplicate_132958,
                                            1, sizeof(val_132956),
                                            &val_132956));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_f32zireplicate_132958,
                                            2, sizeof(mem_132954.mem),
                                            &mem_132954.mem));
    if (1 * ((size_t) num_groups_132962 * (size_t) group_sizze_132961) != 0) {
        const size_t global_work_sizze_135456[1] = {(size_t) num_groups_132962 *
                     (size_t) group_sizze_132961};
        const size_t local_work_sizze_135460[1] = {group_sizze_132961};
        int64_t time_start_135457 = 0, time_end_135458 = 0;
        
        if (ctx->debugging) {
            fprintf(ctx->log, "Launching %s with global work size [",
                    "builtin#replicate_f32.replicate_132958");
            fprintf(ctx->log, "%zu", global_work_sizze_135456[0]);
            fprintf(ctx->log, "] and local work size [");
            fprintf(ctx->log, "%zu", local_work_sizze_135460[0]);
            fprintf(ctx->log, "]; local memory parameters sum to %d bytes.\n",
                    (int) 0);
            time_start_135457 = get_wall_time();
        }
        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                        ctx->builtinzhreplicate_f32zireplicate_132958,
                                                        1, NULL,
                                                        global_work_sizze_135456,
                                                        local_work_sizze_135460,
                                                        0, NULL,
                                                        ctx->profiling_paused ||
                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                  &ctx->builtinzhreplicate_f32zireplicate_132958_runs,
                                                                                                  &ctx->builtinzhreplicate_f32zireplicate_132958_total_runtime)));
        if (ctx->debugging) {
            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
            time_end_135458 = get_wall_time();
            
            long time_diff_135459 = time_end_135458 - time_start_135457;
            
            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                    "builtin#replicate_f32.replicate_132958", time_diff_135459);
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_builtinzhreplicate_i64(struct futhark_context *ctx,
                                         struct memblock_device mem_132365,
                                         int32_t num_elems_132366,
                                         int64_t val_132367)
{
    (void) ctx;
    
    int err = 0;
    int64_t group_sizze_132372;
    
    group_sizze_132372 = ctx->sizes.builtinzhreplicate_i64zigroup_sizze_132372;
    
    int64_t num_groups_132373 = sdiv_up64(num_elems_132366, group_sizze_132372);
    
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_i64zireplicate_132369,
                                            0, sizeof(num_elems_132366),
                                            &num_elems_132366));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_i64zireplicate_132369,
                                            1, sizeof(val_132367),
                                            &val_132367));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->builtinzhreplicate_i64zireplicate_132369,
                                            2, sizeof(mem_132365.mem),
                                            &mem_132365.mem));
    if (1 * ((size_t) num_groups_132373 * (size_t) group_sizze_132372) != 0) {
        const size_t global_work_sizze_135461[1] = {(size_t) num_groups_132373 *
                     (size_t) group_sizze_132372};
        const size_t local_work_sizze_135465[1] = {group_sizze_132372};
        int64_t time_start_135462 = 0, time_end_135463 = 0;
        
        if (ctx->debugging) {
            fprintf(ctx->log, "Launching %s with global work size [",
                    "builtin#replicate_i64.replicate_132369");
            fprintf(ctx->log, "%zu", global_work_sizze_135461[0]);
            fprintf(ctx->log, "] and local work size [");
            fprintf(ctx->log, "%zu", local_work_sizze_135465[0]);
            fprintf(ctx->log, "]; local memory parameters sum to %d bytes.\n",
                    (int) 0);
            time_start_135462 = get_wall_time();
        }
        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                        ctx->builtinzhreplicate_i64zireplicate_132369,
                                                        1, NULL,
                                                        global_work_sizze_135461,
                                                        local_work_sizze_135465,
                                                        0, NULL,
                                                        ctx->profiling_paused ||
                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                  &ctx->builtinzhreplicate_i64zireplicate_132369_runs,
                                                                                                  &ctx->builtinzhreplicate_i64zireplicate_132369_total_runtime)));
        if (ctx->debugging) {
            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
            time_end_135463 = get_wall_time();
            
            long time_diff_135464 = time_end_135463 - time_start_135462;
            
            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                    "builtin#replicate_i64.replicate_132369", time_diff_135464);
        }
    }
    
  cleanup:
    { }
    return err;
}
static int futrts_entry_main(struct futhark_context *ctx,
                             struct memblock_device *out_mem_p_135466,
                             struct memblock_device *out_mem_p_135467,
                             struct memblock_device *out_mem_p_135468,
                             struct memblock_device Y_mem_130086,
                             int64_t m_114533, int64_t n_114534,
                             int64_t n_p_114536, int64_t t_window_114537,
                             int64_t l_window_114538, int64_t t_degree_114539,
                             int64_t l_degree_114540, int64_t t_jump_114541,
                             int64_t l_jump_114542, int64_t inner_114543,
                             int64_t outer_114544,
                             int64_t jump_threshold_114545,
                             int64_t max_group_sizze_114546)
{
    (void) ctx;
    
    int err = 0;
    struct memblock_device out_mem_132281;
    
    out_mem_132281.references = NULL;
    
    struct memblock_device out_mem_132282;
    
    out_mem_132282.references = NULL;
    
    struct memblock_device out_mem_132283;
    
    out_mem_132283.references = NULL;
    
    bool assert_cond_114547 = sle64((int64_t) 4, n_p_114536);
    bool assert_c_114548;
    
    if (!assert_cond_114547) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (n_p >= 4)",
                               "-> #0  stl.fut:90:13-33\n   #1  stl.fut:394:3-405:33\n   #2  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    int64_t x_114549 = smod64(t_window_114537, (int64_t) 2);
    bool assert_cond_114550 = x_114549 == (int64_t) 1;
    bool assert_c_114551;
    
    if (!assert_cond_114550) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x % 2 == 1)",
                               "-> #0  utils.fut:5:3-23\n   #1  /prelude/functional.fut:39:62-64\n   #2  stl.fut:92:18-35\n   #3  stl.fut:394:3-405:33\n   #4  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    bool assert_cond_114552 = slt64((int64_t) 0, t_window_114537);
    bool assert_c_114553;
    
    if (!assert_cond_114552) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:2:3-18\n   #1  /prelude/functional.fut:39:59-65\n   #2  stl.fut:92:18-35\n   #3  stl.fut:394:3-405:33\n   #4  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    int64_t x_114554 = smod64(l_window_114538, (int64_t) 2);
    bool assert_cond_114555 = x_114554 == (int64_t) 1;
    bool assert_c_114556;
    
    if (!assert_cond_114555) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x % 2 == 1)",
                               "-> #0  utils.fut:5:3-23\n   #1  /prelude/functional.fut:39:62-64\n   #2  stl.fut:93:18-35\n   #3  stl.fut:394:3-405:33\n   #4  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    bool assert_cond_114557 = slt64((int64_t) 0, l_window_114538);
    bool assert_c_114558;
    
    if (!assert_cond_114557) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:2:3-18\n   #1  /prelude/functional.fut:39:59-65\n   #2  stl.fut:93:18-35\n   #3  stl.fut:394:3-405:33\n   #4  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    bool cond_114559 = sle64((int64_t) 0, t_degree_114539);
    bool assert_cond_t_res_114560 = sle64(t_degree_114539, (int64_t) 2);
    bool x_114561 = cond_114559 && assert_cond_t_res_114560;
    bool assert_c_114562;
    
    if (!x_114561) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x >= 0 && x <= 2)",
                               "-> #0  utils.fut:8:3-29\n   #1  stl.fut:95:18-35\n   #2  stl.fut:394:3-405:33\n   #3  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    bool cond_114563 = sle64((int64_t) 0, l_degree_114540);
    bool assert_cond_t_res_114564 = sle64(l_degree_114540, (int64_t) 2);
    bool x_114565 = cond_114563 && assert_cond_t_res_114564;
    bool assert_c_114566;
    
    if (!x_114565) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x >= 0 && x <= 2)",
                               "-> #0  utils.fut:8:3-29\n   #1  stl.fut:96:18-35\n   #2  stl.fut:394:3-405:33\n   #3  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    bool assert_cond_114567 = sle64((int64_t) 0, t_jump_114541);
    bool assert_c_114568;
    
    if (!assert_cond_114567) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x >= 0)",
                               "-> #0  utils.fut:14:3-19\n   #1  stl.fut:98:16-34\n   #2  stl.fut:394:3-405:33\n   #3  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    bool assert_cond_114569 = sle64((int64_t) 0, l_jump_114542);
    bool assert_c_114570;
    
    if (!assert_cond_114569) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x >= 0)",
                               "-> #0  utils.fut:14:3-19\n   #1  stl.fut:99:16-34\n   #2  stl.fut:394:3-405:33\n   #3  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    bool assert_cond_114571 = slt64((int64_t) 0, inner_114543);
    bool assert_c_114572;
    
    if (!assert_cond_114571) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x > 0)",
                               "-> #0  utils.fut:2:3-18\n   #1  stl.fut:101:15-29\n   #2  stl.fut:394:3-405:33\n   #3  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    bool assert_cond_114573 = sle64((int64_t) 0, outer_114544);
    bool assert_c_114574;
    
    if (!assert_cond_114573) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "Assertion is false: (x >= 0)",
                               "-> #0  utils.fut:14:3-19\n   #1  stl.fut:102:15-32\n   #2  stl.fut:394:3-405:33\n   #3  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    float i64_res_114575 = sitofp_i64_f32(n_114534);
    float i64_res_114576 = sitofp_i64_f32(n_p_114536);
    float binop_p_114577 = i64_res_114575 / i64_res_114576;
    float defunc_0_f_res_114578;
    
    defunc_0_f_res_114578 = futrts_ceil32(binop_p_114577);
    
    int64_t defunc_0_f_res_114579 = fptosi_f32_i64(defunc_0_f_res_114578);
    int64_t css_chunk_len_114580 = add64((int64_t) 2, defunc_0_f_res_114579);
    int64_t y_114581 = mul64((int64_t) 2, n_p_114536);
    int64_t C_len_114582 = add64(n_114534, y_114581);
    bool cond_114583 = l_jump_114542 == (int64_t) 1;
    int64_t l_n_m_114584;
    
    if (cond_114583) {
        l_n_m_114584 = n_114534;
    } else {
        bool zzero_114585 = l_jump_114542 == (int64_t) 0;
        bool nonzzero_114586 = !zzero_114585;
        bool nonzzero_cert_114587;
        
        if (!nonzzero_114586) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  stl.fut:110:42-51\n   #1  stl.fut:394:3-405:33\n   #2  stl.fut:381:1-405:33\n");
            if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") !=
                0)
                return 1;
            return 1;
        }
        
        int64_t x_114588 = sdiv64(n_114534, l_jump_114542);
        int64_t l_n_m_f_res_114589 = add64((int64_t) 1, x_114588);
        
        l_n_m_114584 = l_n_m_f_res_114589;
    }
    
    bool cond_114590 = t_jump_114541 == (int64_t) 1;
    int64_t t_n_m_114591;
    
    if (cond_114590) {
        t_n_m_114591 = n_114534;
    } else {
        bool zzero_114592 = t_jump_114541 == (int64_t) 0;
        bool nonzzero_114593 = !zzero_114592;
        bool nonzzero_cert_114594;
        
        if (!nonzzero_114593) {
            ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                   "division by zero",
                                   "-> #0  stl.fut:114:42-51\n   #1  stl.fut:394:3-405:33\n   #2  stl.fut:381:1-405:33\n");
            if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") !=
                0)
                return 1;
            return 1;
        }
        
        int64_t x_114595 = sdiv64(n_114534, t_jump_114541);
        int64_t t_n_m_f_res_114596 = add64((int64_t) 1, x_114595);
        
        t_n_m_114591 = t_n_m_f_res_114596;
    }
    
    float x_114597 = i64_res_114575 / 2.0F;
    float floor_arg_114598 = 1.0F + x_114597;
    float floor_res_114599;
    
    floor_res_114599 = futrts_floor32(floor_arg_114598);
    
    int64_t defunc_0_f_res_114600 = fptosi_f32_i64(floor_res_114599);
    int64_t x_114601 = sub64(n_114534, defunc_0_f_res_114600);
    int64_t mid2_114602 = add64((int64_t) 1, x_114601);
    bool cond_114603 = defunc_0_f_res_114600 == mid2_114602;
    int64_t stl_res_114604;
    int64_t stl_res_114605;
    
    if (cond_114603) {
        int64_t stl_res_t_res_114606 = sub64(defunc_0_f_res_114600,
                                             (int64_t) 1);
        
        stl_res_114604 = stl_res_t_res_114606;
        stl_res_114605 = defunc_0_f_res_114600;
    } else {
        int64_t min_res_114607 = smin64(defunc_0_f_res_114600, mid2_114602);
        int64_t stl_res_f_res_114608 = sub64(min_res_114607, (int64_t) 1);
        int64_t max_res_114609 = smax64(defunc_0_f_res_114600, mid2_114602);
        
        stl_res_114604 = stl_res_f_res_114608;
        stl_res_114605 = max_res_114609;
    }
    
    int64_t i_114610 = sub64(n_114534, (int64_t) 1);
    bool x_114611 = sle64((int64_t) 0, i_114610);
    bool y_114612 = slt64(i_114610, n_114534);
    bool bounds_check_114613 = x_114611 && y_114612;
    bool index_certs_114614;
    
    if (!bounds_check_114613) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", i_114610,
                               "] out of bounds for array of shape [", n_114534,
                               "].",
                               "-> #0  /prelude/array.fut:26:29-34\n   #1  utils.fut:38:13-20\n   #2  stl.fut:128:31-49\n   #3  stl.fut:394:3-405:33\n   #4  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    int64_t max_group_sizze_116766;
    
    max_group_sizze_116766 = ctx->opencl.max_group_size;
    
    bool fits_116767 = sle64(n_114534, max_group_sizze_116766);
    bool suff_intra_par_116765;
    
    suff_intra_par_116765 = ctx->sizes.mainzisuff_intra_par_0 <= n_114534;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_0",
                (long) n_114534, suff_intra_par_116765 ? "true" : "false");
    
    bool intra_suff_and_fits_116768 = suff_intra_par_116765 && fits_116767;
    int64_t nest_sizze_116859 = m_114533 * n_114534;
    int64_t segscan_group_sizze_116860;
    
    segscan_group_sizze_116860 = ctx->sizes.mainzisegscan_group_sizze_116843;
    
    int64_t num_groups_116861;
    int32_t max_num_groups_132284;
    
    max_num_groups_132284 = ctx->sizes.mainzisegscan_num_groups_116845;
    num_groups_116861 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_116859,
                                                             segscan_group_sizze_116860),
                                                   sext_i32_i64(max_num_groups_132284))));
    
    int64_t segmap_group_sizze_116891;
    
    segmap_group_sizze_116891 = ctx->sizes.mainzisegmap_group_sizze_116798;
    
    int64_t binop_y_130098 = (int64_t) 8 * nest_sizze_116859;
    int64_t bytes_130096 = smax64((int64_t) 0, binop_y_130098);
    int64_t binop_y_130101 = (int64_t) 8 * m_114533;
    int64_t bytes_130100 = smax64((int64_t) 0, binop_y_130101);
    int64_t binop_y_130090 = (int64_t) 8 * n_114534;
    int64_t bytes_130089 = smax64((int64_t) 0, binop_y_130090);
    struct memblock_device defunc_3_map_res_mem_130116;
    
    defunc_3_map_res_mem_130116.references = NULL;
    
    struct memblock_device defunc_3_map_res_mem_130117;
    
    defunc_3_map_res_mem_130117.references = NULL;
    
    int32_t local_memory_capacity_132384;
    
    local_memory_capacity_132384 = ctx->opencl.max_local_memory;
    if (sle64(bytes_130089 + srem64((int64_t) 8 - srem64(bytes_130089,
                                                         (int64_t) 8),
                                    (int64_t) 8) + (bytes_130089 +
                                                    srem64((int64_t) 8 -
                                                           srem64(bytes_130089,
                                                                  (int64_t) 8),
                                                           (int64_t) 8)),
              sext_i32_i64(local_memory_capacity_132384)) &&
        intra_suff_and_fits_116768) {
        struct memblock_device mem_130099;
        
        mem_130099.references = NULL;
        if (memblock_alloc_device(ctx, &mem_130099, bytes_130096,
                                  "mem_130099")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_130102;
        
        mem_130102.references = NULL;
        if (memblock_alloc_device(ctx, &mem_130102, bytes_130100,
                                  "mem_130102")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_116763,
                                                1, bytes_130089, NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_116763,
                                                2, bytes_130089, NULL));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_116763,
                                                3, sizeof(m_114533),
                                                &m_114533));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_116763,
                                                4, sizeof(n_114534),
                                                &n_114534));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_116763,
                                                5, sizeof(i_114610),
                                                &i_114610));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_116763,
                                                6, sizeof(Y_mem_130086.mem),
                                                &Y_mem_130086.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_116763,
                                                7, sizeof(mem_130099.mem),
                                                &mem_130099.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_116763,
                                                8, sizeof(mem_130102.mem),
                                                &mem_130102.mem));
        if (1 * ((size_t) m_114533 * (size_t) n_114534) != 0) {
            const size_t global_work_sizze_135469[1] = {(size_t) m_114533 *
                         (size_t) n_114534};
            const size_t local_work_sizze_135473[1] = {n_114534};
            int64_t time_start_135470 = 0, time_end_135471 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log, "Launching %s with global work size [",
                        "main.segmap_intragroup_116763");
                fprintf(ctx->log, "%zu", global_work_sizze_135469[0]);
                fprintf(ctx->log, "] and local work size [");
                fprintf(ctx->log, "%zu", local_work_sizze_135473[0]);
                fprintf(ctx->log,
                        "]; local memory parameters sum to %d bytes.\n",
                        (int) (0 + bytes_130089 + bytes_130089));
                time_start_135470 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_intragroup_116763,
                                                            1, NULL,
                                                            global_work_sizze_135469,
                                                            local_work_sizze_135473,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_intragroup_116763_runs,
                                                                                                      &ctx->mainzisegmap_intragroup_116763_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_135471 = get_wall_time();
                
                long time_diff_135472 = time_end_135471 - time_start_135470;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_intragroup_116763", time_diff_135472);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_set_device(ctx, &defunc_3_map_res_mem_130116, &mem_130099,
                                "mem_130099") != 0)
            return 1;
        if (memblock_set_device(ctx, &defunc_3_map_res_mem_130117, &mem_130102,
                                "mem_130102") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130102, "mem_130102") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130099, "mem_130099") != 0)
            return 1;
    } else {
        struct memblock_device mem_130107;
        
        mem_130107.references = NULL;
        if (memblock_alloc_device(ctx, &mem_130107, bytes_130096,
                                  "mem_130107")) {
            err = 1;
            goto cleanup;
        }
        if (slt64((int64_t) 0, m_114533 * n_114534)) {
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegScan");
            
            int64_t stage1_max_num_groups_132304;
            
            stage1_max_num_groups_132304 = ctx->opencl.max_group_size;
            
            int64_t stage1_num_groups_132305 =
                    smin64(stage1_max_num_groups_132304, num_groups_116861);
            int32_t num_threads_132306 = sext_i64_i32(stage1_num_groups_132305 *
                    segscan_group_sizze_116860);
            
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_116849,
                                                    1, smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              segscan_group_sizze_116860),
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_116849,
                                                    2, sizeof(m_114533),
                                                    &m_114533));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_116849,
                                                    3, sizeof(n_114534),
                                                    &n_114534));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_116849,
                                                    4,
                                                    sizeof(num_threads_132306),
                                                    &num_threads_132306));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_116849,
                                                    5, sizeof(Y_mem_130086.mem),
                                                    &Y_mem_130086.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_116849,
                                                    6, sizeof(mem_130107.mem),
                                                    &mem_130107.mem));
            if (1 * ((size_t) stage1_num_groups_132305 *
                     (size_t) segscan_group_sizze_116860) != 0) {
                const size_t global_work_sizze_135474[1] =
                             {(size_t) stage1_num_groups_132305 *
                             (size_t) segscan_group_sizze_116860};
                const size_t local_work_sizze_135478[1] =
                             {segscan_group_sizze_116860};
                int64_t time_start_135475 = 0, time_end_135476 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log, "Launching %s with global work size [",
                            "main.scan_stage1_116849");
                    fprintf(ctx->log, "%zu", global_work_sizze_135474[0]);
                    fprintf(ctx->log, "] and local work size [");
                    fprintf(ctx->log, "%zu", local_work_sizze_135478[0]);
                    fprintf(ctx->log,
                            "]; local memory parameters sum to %d bytes.\n",
                            (int) (0 + smax64((int64_t) 1, (int64_t) 8 *
                                              segscan_group_sizze_116860)));
                    time_start_135475 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainziscan_stage1_116849,
                                                                1, NULL,
                                                                global_work_sizze_135474,
                                                                local_work_sizze_135478,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainziscan_stage1_116849_runs,
                                                                                                          &ctx->mainziscan_stage1_116849_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_135476 = get_wall_time();
                    
                    long time_diff_135477 = time_end_135476 - time_start_135475;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.scan_stage1_116849", time_diff_135477);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                        (long long) (segscan_group_sizze_116860 *
                                     sdiv_up64(m_114533 * n_114534,
                                               sext_i32_i64(num_threads_132306))),
                        '\n');
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_116849,
                                                    1, smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              stage1_num_groups_132305),
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_116849,
                                                    2, sizeof(m_114533),
                                                    &m_114533));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_116849,
                                                    3, sizeof(n_114534),
                                                    &n_114534));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_116849,
                                                    4,
                                                    sizeof(stage1_num_groups_132305),
                                                    &stage1_num_groups_132305));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_116849,
                                                    5,
                                                    sizeof(num_threads_132306),
                                                    &num_threads_132306));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_116849,
                                                    6, sizeof(mem_130107.mem),
                                                    &mem_130107.mem));
            if (1 * ((size_t) (int64_t) 1 *
                     (size_t) stage1_num_groups_132305) != 0) {
                const size_t global_work_sizze_135479[1] =
                             {(size_t) (int64_t) 1 *
                             (size_t) stage1_num_groups_132305};
                const size_t local_work_sizze_135483[1] =
                             {stage1_num_groups_132305};
                int64_t time_start_135480 = 0, time_end_135481 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log, "Launching %s with global work size [",
                            "main.scan_stage2_116849");
                    fprintf(ctx->log, "%zu", global_work_sizze_135479[0]);
                    fprintf(ctx->log, "] and local work size [");
                    fprintf(ctx->log, "%zu", local_work_sizze_135483[0]);
                    fprintf(ctx->log,
                            "]; local memory parameters sum to %d bytes.\n",
                            (int) (0 + smax64((int64_t) 1, (int64_t) 8 *
                                              stage1_num_groups_132305)));
                    time_start_135480 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainziscan_stage2_116849,
                                                                1, NULL,
                                                                global_work_sizze_135479,
                                                                local_work_sizze_135483,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainziscan_stage2_116849_runs,
                                                                                                          &ctx->mainziscan_stage2_116849_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_135481 = get_wall_time();
                    
                    long time_diff_135482 = time_end_135481 - time_start_135480;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.scan_stage2_116849", time_diff_135482);
                }
            }
            
            int32_t required_groups_132348 = sext_i64_i32(sdiv_up64(m_114533 *
                                                                    n_114534,
                                                                    segscan_group_sizze_116860));
            
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_116849,
                                                    1, sizeof(m_114533),
                                                    &m_114533));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_116849,
                                                    2, sizeof(n_114534),
                                                    &n_114534));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_116849,
                                                    3,
                                                    sizeof(num_groups_116861),
                                                    &num_groups_116861));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_116849,
                                                    4,
                                                    sizeof(num_threads_132306),
                                                    &num_threads_132306));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_116849,
                                                    5,
                                                    sizeof(required_groups_132348),
                                                    &required_groups_132348));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_116849,
                                                    6, sizeof(mem_130107.mem),
                                                    &mem_130107.mem));
            if (1 * ((size_t) num_groups_116861 *
                     (size_t) segscan_group_sizze_116860) != 0) {
                const size_t global_work_sizze_135484[1] =
                             {(size_t) num_groups_116861 *
                             (size_t) segscan_group_sizze_116860};
                const size_t local_work_sizze_135488[1] =
                             {segscan_group_sizze_116860};
                int64_t time_start_135485 = 0, time_end_135486 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log, "Launching %s with global work size [",
                            "main.scan_stage3_116849");
                    fprintf(ctx->log, "%zu", global_work_sizze_135484[0]);
                    fprintf(ctx->log, "] and local work size [");
                    fprintf(ctx->log, "%zu", local_work_sizze_135488[0]);
                    fprintf(ctx->log,
                            "]; local memory parameters sum to %d bytes.\n",
                            (int) 0);
                    time_start_135485 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainziscan_stage3_116849,
                                                                1, NULL,
                                                                global_work_sizze_135484,
                                                                local_work_sizze_135488,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainziscan_stage3_116849_runs,
                                                                                                          &ctx->mainziscan_stage3_116849_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_135486 = get_wall_time();
                    
                    long time_diff_135487 = time_end_135486 - time_start_135485;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.scan_stage3_116849", time_diff_135487);
                }
            }
        }
        
        struct memblock_device mem_130110;
        
        mem_130110.references = NULL;
        if (memblock_alloc_device(ctx, &mem_130110, bytes_130100,
                                  "mem_130110")) {
            err = 1;
            goto cleanup;
        }
        
        int64_t group_sizze_132363;
        
        group_sizze_132363 = ctx->sizes.mainzigroup_sizze_132363;
        
        int64_t num_groups_132364 = sdiv_up64(m_114533, group_sizze_132363);
        
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132360, 0,
                                                sizeof(m_114533), &m_114533));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132360, 1,
                                                sizeof(n_114534), &n_114534));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132360, 2,
                                                sizeof(i_114610), &i_114610));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132360, 3,
                                                sizeof(mem_130107.mem),
                                                &mem_130107.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132360, 4,
                                                sizeof(mem_130110.mem),
                                                &mem_130110.mem));
        if (1 * ((size_t) num_groups_132364 * (size_t) group_sizze_132363) !=
            0) {
            const size_t global_work_sizze_135489[1] =
                         {(size_t) num_groups_132364 *
                         (size_t) group_sizze_132363};
            const size_t local_work_sizze_135493[1] = {group_sizze_132363};
            int64_t time_start_135490 = 0, time_end_135491 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log, "Launching %s with global work size [",
                        "main.copy_132360");
                fprintf(ctx->log, "%zu", global_work_sizze_135489[0]);
                fprintf(ctx->log, "] and local work size [");
                fprintf(ctx->log, "%zu", local_work_sizze_135493[0]);
                fprintf(ctx->log,
                        "]; local memory parameters sum to %d bytes.\n",
                        (int) 0);
                time_start_135490 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzicopy_132360,
                                                            1, NULL,
                                                            global_work_sizze_135489,
                                                            local_work_sizze_135493,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzicopy_132360_runs,
                                                                                                      &ctx->mainzicopy_132360_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_135491 = get_wall_time();
                
                long time_diff_135492 = time_end_135491 - time_start_135490;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.copy_132360", time_diff_135492);
            }
        }
        
        struct memblock_device mem_130114;
        
        mem_130114.references = NULL;
        if (memblock_alloc_device(ctx, &mem_130114, bytes_130096,
                                  "mem_130114")) {
            err = 1;
            goto cleanup;
        }
        if (futrts_builtinzhreplicate_i64(ctx, mem_130114, m_114533 * n_114534,
                                          (int64_t) -1) != 0) {
            err = 1;
            goto cleanup;
        }
        
        int64_t segmap_usable_groups_116892 = sdiv_up64(nest_sizze_116859,
                                                        segmap_group_sizze_116891);
        
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116795, 1,
                                                sizeof(m_114533), &m_114533));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116795, 2,
                                                sizeof(n_114534), &n_114534));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116795, 3,
                                                sizeof(Y_mem_130086.mem),
                                                &Y_mem_130086.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116795, 4,
                                                sizeof(mem_130107.mem),
                                                &mem_130107.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116795, 5,
                                                sizeof(mem_130114.mem),
                                                &mem_130114.mem));
        if (1 * ((size_t) segmap_usable_groups_116892 *
                 (size_t) segmap_group_sizze_116891) != 0) {
            const size_t global_work_sizze_135494[1] =
                         {(size_t) segmap_usable_groups_116892 *
                         (size_t) segmap_group_sizze_116891};
            const size_t local_work_sizze_135498[1] =
                         {segmap_group_sizze_116891};
            int64_t time_start_135495 = 0, time_end_135496 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log, "Launching %s with global work size [",
                        "main.segmap_116795");
                fprintf(ctx->log, "%zu", global_work_sizze_135494[0]);
                fprintf(ctx->log, "] and local work size [");
                fprintf(ctx->log, "%zu", local_work_sizze_135498[0]);
                fprintf(ctx->log,
                        "]; local memory parameters sum to %d bytes.\n",
                        (int) 0);
                time_start_135495 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_116795,
                                                            1, NULL,
                                                            global_work_sizze_135494,
                                                            local_work_sizze_135498,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_116795_runs,
                                                                                                      &ctx->mainzisegmap_116795_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_135496 = get_wall_time();
                
                long time_diff_135497 = time_end_135496 - time_start_135495;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_116795", time_diff_135497);
            }
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_unref_device(ctx, &mem_130107, "mem_130107") != 0)
            return 1;
        if (memblock_set_device(ctx, &defunc_3_map_res_mem_130116, &mem_130114,
                                "mem_130114") != 0)
            return 1;
        if (memblock_set_device(ctx, &defunc_3_map_res_mem_130117, &mem_130110,
                                "mem_130110") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130114, "mem_130114") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130110, "mem_130110") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130107, "mem_130107") != 0)
            return 1;
    }
    
    int64_t segmap_group_sizze_116934;
    
    segmap_group_sizze_116934 = ctx->sizes.mainzisegmap_group_sizze_116916;
    
    int64_t segmap_usable_groups_116935 = sdiv_up64(nest_sizze_116859,
                                                    segmap_group_sizze_116934);
    int64_t binop_y_130121 = (int64_t) 4 * nest_sizze_116859;
    int64_t bytes_130119 = smax64((int64_t) 0, binop_y_130121);
    struct memblock_device mem_130122;
    
    mem_130122.references = NULL;
    if (memblock_alloc_device(ctx, &mem_130122, bytes_130119, "mem_130122")) {
        err = 1;
        goto cleanup;
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "\n# SegMap");
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116913, 1,
                                            sizeof(m_114533), &m_114533));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116913, 2,
                                            sizeof(n_114534), &n_114534));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116913, 3,
                                            sizeof(defunc_3_map_res_mem_130116.mem),
                                            &defunc_3_map_res_mem_130116.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116913, 4,
                                            sizeof(mem_130122.mem),
                                            &mem_130122.mem));
    if (1 * ((size_t) segmap_usable_groups_116935 *
             (size_t) segmap_group_sizze_116934) != 0) {
        const size_t global_work_sizze_135499[1] =
                     {(size_t) segmap_usable_groups_116935 *
                     (size_t) segmap_group_sizze_116934};
        const size_t local_work_sizze_135503[1] = {segmap_group_sizze_116934};
        int64_t time_start_135500 = 0, time_end_135501 = 0;
        
        if (ctx->debugging) {
            fprintf(ctx->log, "Launching %s with global work size [",
                    "main.segmap_116913");
            fprintf(ctx->log, "%zu", global_work_sizze_135499[0]);
            fprintf(ctx->log, "] and local work size [");
            fprintf(ctx->log, "%zu", local_work_sizze_135503[0]);
            fprintf(ctx->log, "]; local memory parameters sum to %d bytes.\n",
                    (int) 0);
            time_start_135500 = get_wall_time();
        }
        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                        ctx->mainzisegmap_116913,
                                                        1, NULL,
                                                        global_work_sizze_135499,
                                                        local_work_sizze_135503,
                                                        0, NULL,
                                                        ctx->profiling_paused ||
                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                  &ctx->mainzisegmap_116913_runs,
                                                                                                  &ctx->mainzisegmap_116913_total_runtime)));
        if (ctx->debugging) {
            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
            time_end_135501 = get_wall_time();
            
            long time_diff_135502 = time_end_135501 - time_start_135500;
            
            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                    "main.segmap_116913", time_diff_135502);
        }
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "");
    
    bool bounds_invalid_upwards_114645 = slt64(n_p_114536, (int64_t) 0);
    bool valid_114646 = !bounds_invalid_upwards_114645;
    bool range_valid_c_114647;
    
    if (!valid_114646) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (int64_t) 0, "..", (int64_t) 1, "..<",
                               n_p_114536, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  stl.fut:134:5-144:14\n   #3  stl.fut:394:3-405:33\n   #4  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &mem_130122, "mem_130122") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                                  "defunc_3_map_res_mem_130117") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                                  "defunc_3_map_res_mem_130116") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    bool bounds_invalid_upwards_114649 = slt64(css_chunk_len_114580,
                                               (int64_t) 0);
    bool valid_114650 = !bounds_invalid_upwards_114649;
    bool range_valid_c_114651;
    
    if (!valid_114650) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (int64_t) 0, "..", (int64_t) 1, "..<",
                               css_chunk_len_114580, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  stl.fut:137:16-143:39\n   #3  /prelude/soacs.fut:59:3-10\n   #4  /prelude/array.fut:195:3-17\n   #5  stl.fut:134:5-144:14\n   #6  stl.fut:394:3-405:33\n   #7  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &mem_130122, "mem_130122") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                                  "defunc_3_map_res_mem_130117") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                                  "defunc_3_map_res_mem_130116") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    int64_t nest_sizze_116978 = n_p_114536 * css_chunk_len_114580;
    int64_t segmap_group_sizze_116979;
    
    segmap_group_sizze_116979 = ctx->sizes.mainzisegmap_group_sizze_116953;
    
    int64_t segmap_usable_groups_116980 = sdiv_up64(nest_sizze_116978,
                                                    segmap_group_sizze_116979);
    int64_t binop_y_130126 = (int64_t) 8 * nest_sizze_116978;
    int64_t bytes_130124 = smax64((int64_t) 0, binop_y_130126);
    struct memblock_device mem_130127;
    
    mem_130127.references = NULL;
    if (memblock_alloc_device(ctx, &mem_130127, bytes_130124, "mem_130127")) {
        err = 1;
        goto cleanup;
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "\n# SegMap");
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116950, 1,
                                            sizeof(n_p_114536), &n_p_114536));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116950, 2,
                                            sizeof(css_chunk_len_114580),
                                            &css_chunk_len_114580));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116950, 3,
                                            sizeof(i_114610), &i_114610));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116950, 4,
                                            sizeof(mem_130127.mem),
                                            &mem_130127.mem));
    if (1 * ((size_t) segmap_usable_groups_116980 *
             (size_t) segmap_group_sizze_116979) != 0) {
        const size_t global_work_sizze_135504[1] =
                     {(size_t) segmap_usable_groups_116980 *
                     (size_t) segmap_group_sizze_116979};
        const size_t local_work_sizze_135508[1] = {segmap_group_sizze_116979};
        int64_t time_start_135505 = 0, time_end_135506 = 0;
        
        if (ctx->debugging) {
            fprintf(ctx->log, "Launching %s with global work size [",
                    "main.segmap_116950");
            fprintf(ctx->log, "%zu", global_work_sizze_135504[0]);
            fprintf(ctx->log, "] and local work size [");
            fprintf(ctx->log, "%zu", local_work_sizze_135508[0]);
            fprintf(ctx->log, "]; local memory parameters sum to %d bytes.\n",
                    (int) 0);
            time_start_135505 = get_wall_time();
        }
        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                        ctx->mainzisegmap_116950,
                                                        1, NULL,
                                                        global_work_sizze_135504,
                                                        local_work_sizze_135508,
                                                        0, NULL,
                                                        ctx->profiling_paused ||
                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                  &ctx->mainzisegmap_116950_runs,
                                                                                                  &ctx->mainzisegmap_116950_total_runtime)));
        if (ctx->debugging) {
            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
            time_end_135506 = get_wall_time();
            
            long time_diff_135507 = time_end_135506 - time_start_135505;
            
            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                    "main.segmap_116950", time_diff_135507);
        }
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "");
    
    bool suff_outer_par_116990;
    
    suff_outer_par_116990 = ctx->sizes.mainzisuff_outer_par_1 <= m_114533;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_1",
                (long) m_114533, suff_outer_par_116990 ? "true" : "false");
    
    int64_t segmap_group_sizze_117019;
    
    segmap_group_sizze_117019 = ctx->sizes.mainzisegmap_group_sizze_116994;
    
    int64_t num_groups_117020;
    int32_t max_num_groups_132405;
    
    max_num_groups_132405 = ctx->sizes.mainzisegmap_num_groups_116996;
    num_groups_117020 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(m_114533,
                                                             segmap_group_sizze_117019),
                                                   sext_i32_i64(max_num_groups_132405))));
    
    int64_t comparatee_117148 = m_114533 * n_p_114536;
    bool suff_outer_par_117149;
    
    suff_outer_par_117149 = ctx->sizes.mainzisuff_outer_par_2 <=
        comparatee_117148;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_2",
                (long) comparatee_117148,
                suff_outer_par_117149 ? "true" : "false");
    
    int64_t nest_sizze_117172 = css_chunk_len_114580 * comparatee_117148;
    int64_t segred_group_sizze_117173;
    
    segred_group_sizze_117173 = ctx->sizes.mainzisegred_group_sizze_117091;
    
    int64_t num_groups_117174;
    int32_t max_num_groups_132406;
    
    max_num_groups_132406 = ctx->sizes.mainzisegred_num_groups_117093;
    num_groups_117174 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_117172,
                                                             segred_group_sizze_117173),
                                                   sext_i32_i64(max_num_groups_132406))));
    
    int64_t segmap_group_sizze_117193;
    
    segmap_group_sizze_117193 = ctx->sizes.mainzisegmap_group_sizze_117079;
    
    int64_t tile_sizze_129244;
    
    tile_sizze_129244 = ctx->sizes.mainzitile_sizze_129243;
    
    int64_t group_sizze_129245 = tile_sizze_129244 * tile_sizze_129244;
    int64_t bytes_130147 = (int64_t) 4 * comparatee_117148;
    int64_t binop_y_130133 = (int64_t) 4 * n_p_114536;
    int64_t bytes_130132 = smax64((int64_t) 0, binop_y_130133);
    int64_t bytes_130198 = smax64((int64_t) 0, bytes_130147);
    int64_t bytes_130155 = (int64_t) 4 * group_sizze_129245;
    int64_t binop_y_130162 = (int64_t) 8 * group_sizze_129245;
    int64_t bytes_130160 = smax64((int64_t) 0, binop_y_130162);
    int64_t binop_x_132015 = (int64_t) 4 * tile_sizze_129244;
    int64_t sizze_132016 = tile_sizze_129244 * binop_x_132015;
    int64_t maxSubHelper_132066 = umax64(bytes_130155, sizze_132016);
    int64_t num_threads_132160 = segmap_group_sizze_117019 * num_groups_117020;
    int64_t total_sizze_132161 = bytes_130132 * num_threads_132160;
    struct memblock_device defunc_3_map_res_mem_130203;
    
    defunc_3_map_res_mem_130203.references = NULL;
    
    int32_t local_memory_capacity_132517;
    
    local_memory_capacity_132517 = ctx->opencl.max_local_memory;
    if (sle64((int64_t) 0, sext_i32_i64(local_memory_capacity_132517)) &&
        suff_outer_par_116990) {
        struct memblock_device mem_130130;
        
        mem_130130.references = NULL;
        if (memblock_alloc_device(ctx, &mem_130130, binop_y_130121,
                                  "mem_130130")) {
            err = 1;
            goto cleanup;
        }
        if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_130130, (int64_t) 0,
                                                  Y_mem_130086, (int64_t) 0,
                                                  (int64_t) 1, n_114534,
                                                  m_114533) != 0) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_130149;
        
        mem_130149.references = NULL;
        if (memblock_alloc_device(ctx, &mem_130149, bytes_130147,
                                  "mem_130149")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device color_132065;
        
        color_132065.references = NULL;
        if (memblock_alloc_device(ctx, &color_132065, total_sizze_132161,
                                  "color_132065")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116992, 1,
                                                sizeof(ctx->failure_is_an_option),
                                                &ctx->failure_is_an_option));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116992, 3,
                                                sizeof(m_114533), &m_114533));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116992, 4,
                                                sizeof(n_114534), &n_114534));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116992, 5,
                                                sizeof(n_p_114536),
                                                &n_p_114536));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116992, 6,
                                                sizeof(css_chunk_len_114580),
                                                &css_chunk_len_114580));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116992, 7,
                                                sizeof(num_groups_117020),
                                                &num_groups_117020));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116992, 8,
                                                sizeof(num_threads_132160),
                                                &num_threads_132160));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116992, 9,
                                                sizeof(mem_130127.mem),
                                                &mem_130127.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116992, 10,
                                                sizeof(mem_130130.mem),
                                                &mem_130130.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116992, 11,
                                                sizeof(mem_130149.mem),
                                                &mem_130149.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_116992, 12,
                                                sizeof(color_132065.mem),
                                                &color_132065.mem));
        if (1 * ((size_t) num_groups_117020 *
                 (size_t) segmap_group_sizze_117019) != 0) {
            const size_t global_work_sizze_135509[1] =
                         {(size_t) num_groups_117020 *
                         (size_t) segmap_group_sizze_117019};
            const size_t local_work_sizze_135513[1] =
                         {segmap_group_sizze_117019};
            int64_t time_start_135510 = 0, time_end_135511 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log, "Launching %s with global work size [",
                        "main.segmap_116992");
                fprintf(ctx->log, "%zu", global_work_sizze_135509[0]);
                fprintf(ctx->log, "] and local work size [");
                fprintf(ctx->log, "%zu", local_work_sizze_135513[0]);
                fprintf(ctx->log,
                        "]; local memory parameters sum to %d bytes.\n",
                        (int) 0);
                time_start_135510 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_116992,
                                                            1, NULL,
                                                            global_work_sizze_135509,
                                                            local_work_sizze_135513,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_116992_runs,
                                                                                                      &ctx->mainzisegmap_116992_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_135511 = get_wall_time();
                
                long time_diff_135512 = time_end_135511 - time_start_135510;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_116992", time_diff_135512);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_unref_device(ctx, &mem_130130, "mem_130130") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_132065, "color_132065") != 0)
            return 1;
        
        struct memblock_device mem_130201;
        
        mem_130201.references = NULL;
        if (memblock_alloc_device(ctx, &mem_130201, bytes_130198,
                                  "mem_130201")) {
            err = 1;
            goto cleanup;
        }
        if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_130201, (int64_t) 0,
                                                  mem_130149, (int64_t) 0,
                                                  (int64_t) 1, m_114533,
                                                  n_p_114536) != 0) {
            err = 1;
            goto cleanup;
        }
        if (memblock_unref_device(ctx, &mem_130149, "mem_130149") != 0)
            return 1;
        if (memblock_set_device(ctx, &defunc_3_map_res_mem_130203, &mem_130201,
                                "mem_130201") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130201, "mem_130201") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_132065, "color_132065") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130149, "mem_130149") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130130, "mem_130130") != 0)
            return 1;
    } else {
        struct memblock_device defunc_3_map_res_mem_130197;
        
        defunc_3_map_res_mem_130197.references = NULL;
        
        int32_t local_memory_capacity_132516;
        
        local_memory_capacity_132516 = ctx->opencl.max_local_memory;
        if (sle64(bytes_130160 + srem64((int64_t) 8 - srem64(bytes_130160,
                                                             (int64_t) 8),
                                        (int64_t) 8),
                  sext_i32_i64(local_memory_capacity_132516)) &&
            suff_outer_par_117149) {
            struct memblock_device mem_130152;
            
            mem_130152.references = NULL;
            if (memblock_alloc_device(ctx, &mem_130152, binop_y_130126,
                                      "mem_130152")) {
                err = 1;
                goto cleanup;
            }
            if (futrts_builtinzhgpu_map_transpose_i64(ctx, mem_130152,
                                                      (int64_t) 0, mem_130127,
                                                      (int64_t) 0, (int64_t) 1,
                                                      css_chunk_len_114580,
                                                      n_p_114536) != 0) {
                err = 1;
                goto cleanup;
            }
            
            int64_t num_groups_x_129246 = sdiv_up64(m_114533,
                                                    tile_sizze_129244);
            int64_t num_groups_y_129247 = sdiv_up64(n_p_114536,
                                                    tile_sizze_129244);
            int64_t num_groups_top_129248 = num_groups_x_129246 *
                    num_groups_y_129247;
            int64_t num_whole_tiles_129265 = squot64(css_chunk_len_114580,
                                                     tile_sizze_129244);
            int64_t residual_input_129400 = srem64(css_chunk_len_114580,
                                                   tile_sizze_129244);
            bool cond_129401 = residual_input_129400 == (int64_t) 0;
            struct memblock_device mem_130186;
            
            mem_130186.references = NULL;
            if (memblock_alloc_device(ctx, &mem_130186, bytes_130198,
                                      "mem_130186")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129249,
                                                    1,
                                                    sizeof(ctx->failure_is_an_option),
                                                    &ctx->failure_is_an_option));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129249,
                                                    3, bytes_130160, NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129249,
                                                    4, sizeof(m_114533),
                                                    &m_114533));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129249,
                                                    5, sizeof(n_114534),
                                                    &n_114534));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129249,
                                                    6, sizeof(n_p_114536),
                                                    &n_p_114536));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129249,
                                                    7,
                                                    sizeof(css_chunk_len_114580),
                                                    &css_chunk_len_114580));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129249,
                                                    8,
                                                    sizeof(num_groups_x_129246),
                                                    &num_groups_x_129246));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129249,
                                                    9,
                                                    sizeof(num_groups_y_129247),
                                                    &num_groups_y_129247));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129249,
                                                    10,
                                                    sizeof(num_whole_tiles_129265),
                                                    &num_whole_tiles_129265));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129249,
                                                    11,
                                                    sizeof(residual_input_129400),
                                                    &residual_input_129400));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129249,
                                                    12, sizeof(cond_129401),
                                                    &cond_129401));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129249,
                                                    13,
                                                    sizeof(Y_mem_130086.mem),
                                                    &Y_mem_130086.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129249,
                                                    14, sizeof(mem_130152.mem),
                                                    &mem_130152.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129249,
                                                    15, sizeof(mem_130186.mem),
                                                    &mem_130186.mem));
            if (1 * ((size_t) num_groups_top_129248 *
                     (size_t) group_sizze_129245) != 0) {
                const size_t global_work_sizze_135514[1] =
                             {(size_t) num_groups_top_129248 *
                             (size_t) group_sizze_129245};
                const size_t local_work_sizze_135518[1] = {group_sizze_129245};
                int64_t time_start_135515 = 0, time_end_135516 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log, "Launching %s with global work size [",
                            "main.segmap_intragroup_129249");
                    fprintf(ctx->log, "%zu", global_work_sizze_135514[0]);
                    fprintf(ctx->log, "] and local work size [");
                    fprintf(ctx->log, "%zu", local_work_sizze_135518[0]);
                    fprintf(ctx->log,
                            "]; local memory parameters sum to %d bytes.\n",
                            (int) (0 + bytes_130160));
                    time_start_135515 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_intragroup_129249,
                                                                1, NULL,
                                                                global_work_sizze_135514,
                                                                local_work_sizze_135518,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_intragroup_129249_runs,
                                                                                                          &ctx->mainzisegmap_intragroup_129249_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_135516 = get_wall_time();
                    
                    long time_diff_135517 = time_end_135516 - time_start_135515;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_intragroup_129249", time_diff_135517);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &mem_130152, "mem_130152") != 0)
                return 1;
            if (memblock_set_device(ctx, &defunc_3_map_res_mem_130197,
                                    &mem_130186, "mem_130186") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130186, "mem_130186") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130152, "mem_130152") != 0)
                return 1;
        } else {
            struct memblock_device mem_130191;
            
            mem_130191.references = NULL;
            if (memblock_alloc_device(ctx, &mem_130191, bytes_130198,
                                      "mem_130191")) {
                err = 1;
                goto cleanup;
            }
            if (slt64(css_chunk_len_114580 * (int64_t) 2,
                      segred_group_sizze_117173)) {
                int64_t segment_sizze_nonzzero_132438 = smax64((int64_t) 1,
                                                               css_chunk_len_114580);
                int64_t num_threads_132439 = num_groups_117174 *
                        segred_group_sizze_117173;
                
                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_114533 * n_p_114536), '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "segment_size",
                            (long long) css_chunk_len_114580, '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "segments_per_group",
                            (long long) squot64(segred_group_sizze_117173,
                                                segment_sizze_nonzzero_132438),
                            '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "required_groups",
                            (long long) sext_i64_i32(sdiv_up64(m_114533 *
                                                               n_p_114536,
                                                               squot64(segred_group_sizze_117173,
                                                                       segment_sizze_nonzzero_132438))),
                            '\n');
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117097,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117097,
                                                        3, (int64_t) 4 *
                                                        segred_group_sizze_117173,
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117097,
                                                        4, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117097,
                                                        5, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117097,
                                                        6, sizeof(n_p_114536),
                                                        &n_p_114536));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117097,
                                                        7,
                                                        sizeof(css_chunk_len_114580),
                                                        &css_chunk_len_114580));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117097,
                                                        8,
                                                        sizeof(num_groups_117174),
                                                        &num_groups_117174));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117097,
                                                        9,
                                                        sizeof(segment_sizze_nonzzero_132438),
                                                        &segment_sizze_nonzzero_132438));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117097,
                                                        10,
                                                        sizeof(Y_mem_130086.mem),
                                                        &Y_mem_130086.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117097,
                                                        11,
                                                        sizeof(mem_130127.mem),
                                                        &mem_130127.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117097,
                                                        12,
                                                        sizeof(mem_130191.mem),
                                                        &mem_130191.mem));
                if (1 * ((size_t) num_groups_117174 *
                         (size_t) segred_group_sizze_117173) != 0) {
                    const size_t global_work_sizze_135519[1] =
                                 {(size_t) num_groups_117174 *
                                 (size_t) segred_group_sizze_117173};
                    const size_t local_work_sizze_135523[1] =
                                 {segred_group_sizze_117173};
                    int64_t time_start_135520 = 0, time_end_135521 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segred_small_117097");
                        fprintf(ctx->log, "%zu", global_work_sizze_135519[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135523[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) (0 + (int64_t) 4 *
                                       segred_group_sizze_117173));
                        time_start_135520 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegred_small_117097,
                                                                    1, NULL,
                                                                    global_work_sizze_135519,
                                                                    local_work_sizze_135523,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegred_small_117097_runs,
                                                                                                              &ctx->mainzisegred_small_117097_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135521 = get_wall_time();
                        
                        long time_diff_135522 = time_end_135521 -
                             time_start_135520;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segred_small_117097", time_diff_135522);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
            } else {
                int64_t groups_per_segment_132463 = sdiv_up64(num_groups_117174,
                                                              smax64((int64_t) 1,
                                                                     m_114533 *
                                                                     n_p_114536));
                int64_t elements_per_thread_132464 =
                        sdiv_up64(css_chunk_len_114580,
                                  segred_group_sizze_117173 *
                                  groups_per_segment_132463);
                int64_t virt_num_groups_132465 = groups_per_segment_132463 *
                        (m_114533 * n_p_114536);
                int64_t num_threads_132466 = num_groups_117174 *
                        segred_group_sizze_117173;
                int64_t threads_per_segment_132467 = groups_per_segment_132463 *
                        segred_group_sizze_117173;
                
                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_114533 * n_p_114536), '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "segment_size",
                            (long long) css_chunk_len_114580, '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                            (long long) virt_num_groups_132465, '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "num_groups",
                            (long long) num_groups_117174, '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "group_size",
                            (long long) segred_group_sizze_117173, '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                            (long long) elements_per_thread_132464, '\n');
                if (ctx->debugging)
                    fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                            (long long) groups_per_segment_132463, '\n');
                
                struct memblock_device segred_tmp_mem_132468;
                
                segred_tmp_mem_132468.references = NULL;
                if (memblock_alloc_device(ctx, &segred_tmp_mem_132468,
                                          (int64_t) 4 * virt_num_groups_132465,
                                          "segred_tmp_mem_132468")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mainzicounter_mem_132470 =
                                       ctx->mainzicounter_mem_132470;
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117097,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117097,
                                                        3, 1, NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117097,
                                                        4, (int64_t) 4 *
                                                        segred_group_sizze_117173,
                                                        NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117097,
                                                        5, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117097,
                                                        6, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117097,
                                                        7, sizeof(n_p_114536),
                                                        &n_p_114536));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117097,
                                                        8,
                                                        sizeof(css_chunk_len_114580),
                                                        &css_chunk_len_114580));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117097,
                                                        9,
                                                        sizeof(num_groups_117174),
                                                        &num_groups_117174));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117097,
                                                        10,
                                                        sizeof(groups_per_segment_132463),
                                                        &groups_per_segment_132463));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117097,
                                                        11,
                                                        sizeof(elements_per_thread_132464),
                                                        &elements_per_thread_132464));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117097,
                                                        12,
                                                        sizeof(virt_num_groups_132465),
                                                        &virt_num_groups_132465));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117097,
                                                        13,
                                                        sizeof(threads_per_segment_132467),
                                                        &threads_per_segment_132467));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117097,
                                                        14,
                                                        sizeof(Y_mem_130086.mem),
                                                        &Y_mem_130086.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117097,
                                                        15,
                                                        sizeof(mem_130127.mem),
                                                        &mem_130127.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117097,
                                                        16,
                                                        sizeof(mem_130191.mem),
                                                        &mem_130191.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117097,
                                                        17,
                                                        sizeof(segred_tmp_mem_132468.mem),
                                                        &segred_tmp_mem_132468.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117097,
                                                        18,
                                                        sizeof(mainzicounter_mem_132470.mem),
                                                        &mainzicounter_mem_132470.mem));
                if (1 * ((size_t) num_groups_117174 *
                         (size_t) segred_group_sizze_117173) != 0) {
                    const size_t global_work_sizze_135525[1] =
                                 {(size_t) num_groups_117174 *
                                 (size_t) segred_group_sizze_117173};
                    const size_t local_work_sizze_135529[1] =
                                 {segred_group_sizze_117173};
                    int64_t time_start_135526 = 0, time_end_135527 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segred_large_117097");
                        fprintf(ctx->log, "%zu", global_work_sizze_135525[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135529[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) (0 + 1 + (int64_t) 4 *
                                       segred_group_sizze_117173));
                        time_start_135526 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegred_large_117097,
                                                                    1, NULL,
                                                                    global_work_sizze_135525,
                                                                    local_work_sizze_135529,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegred_large_117097_runs,
                                                                                                              &ctx->mainzisegred_large_117097_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135527 = get_wall_time();
                        
                        long time_diff_135528 = time_end_135527 -
                             time_start_135526;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segred_large_117097", time_diff_135528);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &segred_tmp_mem_132468,
                                          "segred_tmp_mem_132468") != 0)
                    return 1;
            }
            
            int64_t segmap_usable_groups_117194 = sdiv_up64(comparatee_117148,
                                                            segmap_group_sizze_117193);
            struct memblock_device mem_130196;
            
            mem_130196.references = NULL;
            if (memblock_alloc_device(ctx, &mem_130196, bytes_130198,
                                      "mem_130196")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117076, 1,
                                                    sizeof(ctx->failure_is_an_option),
                                                    &ctx->failure_is_an_option));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117076, 3,
                                                    sizeof(m_114533),
                                                    &m_114533));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117076, 4,
                                                    sizeof(n_p_114536),
                                                    &n_p_114536));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117076, 5,
                                                    sizeof(mem_130191.mem),
                                                    &mem_130191.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117076, 6,
                                                    sizeof(mem_130196.mem),
                                                    &mem_130196.mem));
            if (1 * ((size_t) segmap_usable_groups_117194 *
                     (size_t) segmap_group_sizze_117193) != 0) {
                const size_t global_work_sizze_135530[1] =
                             {(size_t) segmap_usable_groups_117194 *
                             (size_t) segmap_group_sizze_117193};
                const size_t local_work_sizze_135534[1] =
                             {segmap_group_sizze_117193};
                int64_t time_start_135531 = 0, time_end_135532 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log, "Launching %s with global work size [",
                            "main.segmap_117076");
                    fprintf(ctx->log, "%zu", global_work_sizze_135530[0]);
                    fprintf(ctx->log, "] and local work size [");
                    fprintf(ctx->log, "%zu", local_work_sizze_135534[0]);
                    fprintf(ctx->log,
                            "]; local memory parameters sum to %d bytes.\n",
                            (int) 0);
                    time_start_135531 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_117076,
                                                                1, NULL,
                                                                global_work_sizze_135530,
                                                                local_work_sizze_135534,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_117076_runs,
                                                                                                          &ctx->mainzisegmap_117076_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_135532 = get_wall_time();
                    
                    long time_diff_135533 = time_end_135532 - time_start_135531;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_117076", time_diff_135533);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &mem_130191, "mem_130191") != 0)
                return 1;
            if (memblock_set_device(ctx, &defunc_3_map_res_mem_130197,
                                    &mem_130196, "mem_130196") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130196, "mem_130196") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130191, "mem_130191") != 0)
                return 1;
        }
        if (memblock_set_device(ctx, &defunc_3_map_res_mem_130203,
                                &defunc_3_map_res_mem_130197,
                                "defunc_3_map_res_mem_130197") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130197,
                                  "defunc_3_map_res_mem_130197") != 0)
            return 1;
    }
    
    int64_t min_res_114683 = smin64(n_114534, l_window_114538);
    bool bounds_invalid_upwards_114684 = slt64(l_n_m_114584, (int64_t) 0);
    bool valid_114685 = !bounds_invalid_upwards_114684;
    bool range_valid_c_114686;
    
    if (!valid_114685) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (int64_t) 0, "..", (int64_t) 1, "..<",
                               l_n_m_114584, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  loess.fut:335:3-373:7\n   #3  loess.fut:400:15-58\n   #4  stl.fut:166:13-65\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:164:5-167:26\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130203,
                                  "defunc_3_map_res_mem_130203") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130127, "mem_130127") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130122, "mem_130122") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                                  "defunc_3_map_res_mem_130117") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                                  "defunc_3_map_res_mem_130116") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    bool empty_slice_114688 = min_res_114683 == (int64_t) 0;
    int64_t m_114689 = sub64(min_res_114683, (int64_t) 1);
    float i64_res_114690 = sitofp_i64_f32(l_window_114538);
    bool suff_outer_par_117348;
    
    suff_outer_par_117348 = ctx->sizes.mainzisuff_outer_par_3 <= m_114533;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_3",
                (long) m_114533, suff_outer_par_117348 ? "true" : "false");
    
    int64_t one_intra_par_min_117336 = l_n_m_114584 * min_res_114683;
    int64_t y_117340 = smin64(n_114534, one_intra_par_min_117336);
    int64_t y_117341 = smin64(one_intra_par_min_117336, y_117340);
    int64_t intra_avail_par_117342 = smin64(l_n_m_114584, y_117341);
    int64_t y_117344 = smax64(n_114534, one_intra_par_min_117336);
    int64_t computed_group_sizze_117204 = smax64(l_n_m_114584, y_117344);
    bool fits_117594 = sle64(computed_group_sizze_117204,
                             max_group_sizze_116766);
    bool suff_intra_par_117592;
    
    suff_intra_par_117592 = ctx->sizes.mainzisuff_intra_par_4 <=
        intra_avail_par_117342;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_4",
                (long) intra_avail_par_117342,
                suff_intra_par_117592 ? "true" : "false");
    
    bool intra_suff_and_fits_117595 = suff_intra_par_117592 && fits_117594;
    int64_t segmap_group_sizze_117472;
    
    segmap_group_sizze_117472 = ctx->sizes.mainzisegmap_group_sizze_117352;
    
    int64_t num_groups_117473;
    int32_t max_num_groups_132518;
    
    max_num_groups_132518 = ctx->sizes.mainzisegmap_num_groups_117354;
    num_groups_117473 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(m_114533,
                                                             segmap_group_sizze_117472),
                                                   sext_i32_i64(max_num_groups_132518))));
    
    int64_t segmap_group_sizze_118214;
    
    segmap_group_sizze_118214 = ctx->sizes.mainzisegmap_group_sizze_118191;
    
    int64_t segmap_group_sizze_118225;
    
    segmap_group_sizze_118225 = ctx->sizes.mainzisegmap_group_sizze_118169;
    
    int64_t nest_sizze_118236 = m_114533 * l_n_m_114584;
    int64_t segmap_group_sizze_118237;
    
    segmap_group_sizze_118237 = ctx->sizes.mainzisegmap_group_sizze_117736;
    
    bool suff_outer_par_118241;
    
    suff_outer_par_118241 = ctx->sizes.mainzisuff_outer_par_5 <=
        nest_sizze_118236;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_5",
                (long) nest_sizze_118236,
                suff_outer_par_118241 ? "true" : "false");
    
    int64_t segmap_group_sizze_118353;
    
    segmap_group_sizze_118353 = ctx->sizes.mainzisegmap_group_sizze_117978;
    
    int64_t nest_sizze_118399 = m_114533 * one_intra_par_min_117336;
    int64_t segmap_group_sizze_118400;
    
    segmap_group_sizze_118400 = ctx->sizes.mainzisegmap_group_sizze_117963;
    
    int64_t nest_sizze_118412 = min_res_114683 * nest_sizze_118236;
    int64_t segred_group_sizze_118413;
    
    segred_group_sizze_118413 = ctx->sizes.mainzisegred_group_sizze_117935;
    
    int64_t num_groups_118414;
    int32_t max_num_groups_132519;
    
    max_num_groups_132519 = ctx->sizes.mainzisegred_num_groups_117937;
    num_groups_118414 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_118412,
                                                             segred_group_sizze_118413),
                                                   sext_i32_i64(max_num_groups_132519))));
    
    int64_t segmap_group_sizze_118429;
    
    segmap_group_sizze_118429 = ctx->sizes.mainzisegmap_group_sizze_117862;
    
    int64_t bytes_130268 = (int64_t) 8 * nest_sizze_118236;
    int64_t bytes_130271 = (int64_t) 4 * nest_sizze_118236;
    int64_t binop_y_130239 = (int64_t) 4 * l_n_m_114584;
    int64_t bytes_130238 = smax64((int64_t) 0, binop_y_130239);
    int64_t binop_y_130242 = (int64_t) 8 * l_n_m_114584;
    int64_t bytes_130241 = smax64((int64_t) 0, binop_y_130242);
    int64_t bytes_130394 = smax64((int64_t) 0, bytes_130268);
    int64_t bytes_130399 = smax64((int64_t) 0, bytes_130271);
    int64_t binop_y_130297 = (int64_t) 8 * one_intra_par_min_117336;
    int64_t bytes_130295 = smax64((int64_t) 0, binop_y_130297);
    int64_t binop_y_130332 = (int64_t) 4 * m_114533;
    int64_t bytes_130331 = smax64((int64_t) 0, binop_y_130332);
    int64_t binop_y_130374 = (int64_t) 8 * nest_sizze_118412;
    int64_t bytes_130371 = smax64((int64_t) 0, binop_y_130374);
    int64_t maxSubHelper_132074 = umax64(bytes_130089, bytes_130241);
    int64_t maxSubHelper_132075 = umax64(bytes_130295, maxSubHelper_132074);
    int64_t maxSubHelper_132076 = umax64((int64_t) 0, bytes_130238);
    int64_t num_threads_132165 = segmap_group_sizze_117472 * num_groups_117473;
    int64_t total_sizze_132166 = bytes_130241 * num_threads_132165;
    int64_t total_sizze_132167 = bytes_130238 * num_threads_132165;
    int64_t total_sizze_132168 = bytes_130089 * num_threads_132165;
    int64_t total_sizze_132169 = bytes_130089 * num_threads_132165;
    struct memblock_device defunc_3_map_res_mem_130404;
    
    defunc_3_map_res_mem_130404.references = NULL;
    
    struct memblock_device defunc_3_map_res_mem_130405;
    
    defunc_3_map_res_mem_130405.references = NULL;
    
    int32_t local_memory_capacity_132735;
    
    local_memory_capacity_132735 = ctx->opencl.max_local_memory;
    if (sle64((int64_t) 0, sext_i32_i64(local_memory_capacity_132735)) &&
        suff_outer_par_117348) {
        struct memblock_device mem_130206;
        
        mem_130206.references = NULL;
        if (memblock_alloc_device(ctx, &mem_130206, binop_y_130098,
                                  "mem_130206")) {
            err = 1;
            goto cleanup;
        }
        if (futrts_builtinzhgpu_map_transpose_i64(ctx, mem_130206, (int64_t) 0,
                                                  defunc_3_map_res_mem_130116,
                                                  (int64_t) 0, (int64_t) 1,
                                                  n_114534, m_114533) != 0) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_130270;
        
        mem_130270.references = NULL;
        if (memblock_alloc_device(ctx, &mem_130270, bytes_130268,
                                  "mem_130270")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_130273;
        
        mem_130273.references = NULL;
        if (memblock_alloc_device(ctx, &mem_130273, bytes_130271,
                                  "mem_130273")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device color_132070;
        
        color_132070.references = NULL;
        if (memblock_alloc_device(ctx, &color_132070, total_sizze_132166,
                                  "color_132070")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device color_132071;
        
        color_132071.references = NULL;
        if (memblock_alloc_device(ctx, &color_132071, total_sizze_132167,
                                  "color_132071")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device color_132072;
        
        color_132072.references = NULL;
        if (memblock_alloc_device(ctx, &color_132072, total_sizze_132168,
                                  "color_132072")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device color_132073;
        
        color_132073.references = NULL;
        if (memblock_alloc_device(ctx, &color_132073, total_sizze_132169,
                                  "color_132073")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 1,
                                                sizeof(ctx->failure_is_an_option),
                                                &ctx->failure_is_an_option));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 3,
                                                sizeof(m_114533), &m_114533));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 4,
                                                sizeof(n_114534), &n_114534));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 5,
                                                sizeof(l_jump_114542),
                                                &l_jump_114542));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 6,
                                                sizeof(l_n_m_114584),
                                                &l_n_m_114584));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 7,
                                                sizeof(i_114610), &i_114610));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 8,
                                                sizeof(x_114611), &x_114611));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 9,
                                                sizeof(min_res_114683),
                                                &min_res_114683));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 10,
                                                sizeof(empty_slice_114688),
                                                &empty_slice_114688));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 11,
                                                sizeof(m_114689), &m_114689));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 12,
                                                sizeof(i64_res_114690),
                                                &i64_res_114690));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 13,
                                                sizeof(num_groups_117473),
                                                &num_groups_117473));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 14,
                                                sizeof(num_threads_132165),
                                                &num_threads_132165));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 15,
                                                sizeof(defunc_3_map_res_mem_130116.mem),
                                                &defunc_3_map_res_mem_130116.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 16,
                                                sizeof(defunc_3_map_res_mem_130117.mem),
                                                &defunc_3_map_res_mem_130117.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 17,
                                                sizeof(mem_130206.mem),
                                                &mem_130206.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 18,
                                                sizeof(mem_130270.mem),
                                                &mem_130270.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 19,
                                                sizeof(mem_130273.mem),
                                                &mem_130273.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 20,
                                                sizeof(color_132070.mem),
                                                &color_132070.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 21,
                                                sizeof(color_132071.mem),
                                                &color_132071.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 22,
                                                sizeof(color_132072.mem),
                                                &color_132072.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117350, 23,
                                                sizeof(color_132073.mem),
                                                &color_132073.mem));
        if (1 * ((size_t) num_groups_117473 *
                 (size_t) segmap_group_sizze_117472) != 0) {
            const size_t global_work_sizze_135535[1] =
                         {(size_t) num_groups_117473 *
                         (size_t) segmap_group_sizze_117472};
            const size_t local_work_sizze_135539[1] =
                         {segmap_group_sizze_117472};
            int64_t time_start_135536 = 0, time_end_135537 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log, "Launching %s with global work size [",
                        "main.segmap_117350");
                fprintf(ctx->log, "%zu", global_work_sizze_135535[0]);
                fprintf(ctx->log, "] and local work size [");
                fprintf(ctx->log, "%zu", local_work_sizze_135539[0]);
                fprintf(ctx->log,
                        "]; local memory parameters sum to %d bytes.\n",
                        (int) 0);
                time_start_135536 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_117350,
                                                            1, NULL,
                                                            global_work_sizze_135535,
                                                            local_work_sizze_135539,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_117350_runs,
                                                                                                      &ctx->mainzisegmap_117350_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_135537 = get_wall_time();
                
                long time_diff_135538 = time_end_135537 - time_start_135536;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_117350", time_diff_135538);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_unref_device(ctx, &mem_130206, "mem_130206") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_132070, "color_132070") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_132071, "color_132071") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_132072, "color_132072") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_132073, "color_132073") != 0)
            return 1;
        
        struct memblock_device mem_130397;
        
        mem_130397.references = NULL;
        if (memblock_alloc_device(ctx, &mem_130397, bytes_130394,
                                  "mem_130397")) {
            err = 1;
            goto cleanup;
        }
        if (futrts_builtinzhgpu_map_transpose_i64(ctx, mem_130397, (int64_t) 0,
                                                  mem_130270, (int64_t) 0,
                                                  (int64_t) 1, m_114533,
                                                  l_n_m_114584) != 0) {
            err = 1;
            goto cleanup;
        }
        if (memblock_unref_device(ctx, &mem_130270, "mem_130270") != 0)
            return 1;
        
        struct memblock_device mem_130402;
        
        mem_130402.references = NULL;
        if (memblock_alloc_device(ctx, &mem_130402, bytes_130399,
                                  "mem_130402")) {
            err = 1;
            goto cleanup;
        }
        if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_130402, (int64_t) 0,
                                                  mem_130273, (int64_t) 0,
                                                  (int64_t) 1, m_114533,
                                                  l_n_m_114584) != 0) {
            err = 1;
            goto cleanup;
        }
        if (memblock_unref_device(ctx, &mem_130273, "mem_130273") != 0)
            return 1;
        if (memblock_set_device(ctx, &defunc_3_map_res_mem_130404, &mem_130397,
                                "mem_130397") != 0)
            return 1;
        if (memblock_set_device(ctx, &defunc_3_map_res_mem_130405, &mem_130402,
                                "mem_130402") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130402, "mem_130402") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130397, "mem_130397") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_132073, "color_132073") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_132072, "color_132072") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_132071, "color_132071") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_132070, "color_132070") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130273, "mem_130273") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130270, "mem_130270") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130206, "mem_130206") != 0)
            return 1;
    } else {
        struct memblock_device defunc_3_map_res_mem_130392;
        
        defunc_3_map_res_mem_130392.references = NULL;
        
        struct memblock_device defunc_3_map_res_mem_130393;
        
        defunc_3_map_res_mem_130393.references = NULL;
        
        int32_t local_memory_capacity_132734;
        
        local_memory_capacity_132734 = ctx->opencl.max_local_memory;
        if (sle64(maxSubHelper_132075 + srem64((int64_t) 8 -
                                               srem64(maxSubHelper_132075,
                                                      (int64_t) 8),
                                               (int64_t) 8) +
                  (maxSubHelper_132076 + srem64((int64_t) 8 -
                                                srem64(maxSubHelper_132076,
                                                       (int64_t) 8),
                                                (int64_t) 8)) + (bytes_130241 +
                                                                 srem64((int64_t) 8 -
                                                                        srem64(bytes_130241,
                                                                               (int64_t) 8),
                                                                        (int64_t) 8)) +
                  (bytes_130241 + srem64((int64_t) 8 - srem64(bytes_130241,
                                                              (int64_t) 8),
                                         (int64_t) 8)) + (bytes_130241 +
                                                          srem64((int64_t) 8 -
                                                                 srem64(bytes_130241,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                  (bytes_130241 + srem64((int64_t) 8 - srem64(bytes_130241,
                                                              (int64_t) 8),
                                         (int64_t) 8)) + (bytes_130089 +
                                                          srem64((int64_t) 8 -
                                                                 srem64(bytes_130089,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                  ((int64_t) 8 * (l_n_m_114584 * min_res_114683) +
                   srem64((int64_t) 8 - srem64((int64_t) 8 * (l_n_m_114584 *
                                                              min_res_114683),
                                               (int64_t) 8), (int64_t) 8)),
                  sext_i32_i64(local_memory_capacity_132734)) &&
            intra_suff_and_fits_117595) {
            struct memblock_device mem_130313;
            
            mem_130313.references = NULL;
            if (memblock_alloc_device(ctx, &mem_130313, bytes_130394,
                                      "mem_130313")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_130317;
            
            mem_130317.references = NULL;
            if (memblock_alloc_device(ctx, &mem_130317, bytes_130399,
                                      "mem_130317")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    1,
                                                    sizeof(ctx->failure_is_an_option),
                                                    &ctx->failure_is_an_option));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    3, (int64_t) 8 *
                                                    (l_n_m_114584 *
                                                     min_res_114683), NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    4, bytes_130089, NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    5, bytes_130241, NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    6, bytes_130241, NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    7, bytes_130241, NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    8, bytes_130241, NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    9, maxSubHelper_132076,
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    10, maxSubHelper_132075,
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    11, sizeof(m_114533),
                                                    &m_114533));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    12, sizeof(n_114534),
                                                    &n_114534));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    13, sizeof(l_jump_114542),
                                                    &l_jump_114542));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    14, sizeof(l_n_m_114584),
                                                    &l_n_m_114584));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    15, sizeof(i_114610),
                                                    &i_114610));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    16, sizeof(x_114611),
                                                    &x_114611));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    17, sizeof(min_res_114683),
                                                    &min_res_114683));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    18,
                                                    sizeof(empty_slice_114688),
                                                    &empty_slice_114688));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    19, sizeof(m_114689),
                                                    &m_114689));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    20, sizeof(i64_res_114690),
                                                    &i64_res_114690));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    21,
                                                    sizeof(computed_group_sizze_117204),
                                                    &computed_group_sizze_117204));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    22,
                                                    sizeof(defunc_3_map_res_mem_130116.mem),
                                                    &defunc_3_map_res_mem_130116.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    23,
                                                    sizeof(defunc_3_map_res_mem_130117.mem),
                                                    &defunc_3_map_res_mem_130117.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    24, sizeof(mem_130313.mem),
                                                    &mem_130313.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_117346,
                                                    25, sizeof(mem_130317.mem),
                                                    &mem_130317.mem));
            if (1 * ((size_t) m_114533 *
                     (size_t) computed_group_sizze_117204) != 0) {
                const size_t global_work_sizze_135540[1] = {(size_t) m_114533 *
                             (size_t) computed_group_sizze_117204};
                const size_t local_work_sizze_135544[1] =
                             {computed_group_sizze_117204};
                int64_t time_start_135541 = 0, time_end_135542 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log, "Launching %s with global work size [",
                            "main.segmap_intragroup_117346");
                    fprintf(ctx->log, "%zu", global_work_sizze_135540[0]);
                    fprintf(ctx->log, "] and local work size [");
                    fprintf(ctx->log, "%zu", local_work_sizze_135544[0]);
                    fprintf(ctx->log,
                            "]; local memory parameters sum to %d bytes.\n",
                            (int) (0 + (int64_t) 8 * (l_n_m_114584 *
                                                      min_res_114683) +
                                   bytes_130089 + bytes_130241 + bytes_130241 +
                                   bytes_130241 + bytes_130241 +
                                   maxSubHelper_132076 + maxSubHelper_132075));
                    time_start_135541 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_intragroup_117346,
                                                                1, NULL,
                                                                global_work_sizze_135540,
                                                                local_work_sizze_135544,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_intragroup_117346_runs,
                                                                                                          &ctx->mainzisegmap_intragroup_117346_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_135542 = get_wall_time();
                    
                    long time_diff_135543 = time_end_135542 - time_start_135541;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_intragroup_117346", time_diff_135543);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_set_device(ctx, &defunc_3_map_res_mem_130392,
                                    &mem_130313, "mem_130313") != 0)
                return 1;
            if (memblock_set_device(ctx, &defunc_3_map_res_mem_130393,
                                    &mem_130317, "mem_130317") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130317, "mem_130317") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130313, "mem_130313") != 0)
                return 1;
        } else {
            int64_t segmap_usable_groups_118215 = sdiv_up64(nest_sizze_116859,
                                                            segmap_group_sizze_118214);
            struct memblock_device mem_130322;
            
            mem_130322.references = NULL;
            if (memblock_alloc_device(ctx, &mem_130322, bytes_130096,
                                      "mem_130322")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_130326;
            
            mem_130326.references = NULL;
            if (memblock_alloc_device(ctx, &mem_130326, bytes_130096,
                                      "mem_130326")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118188, 1,
                                                    sizeof(m_114533),
                                                    &m_114533));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118188, 2,
                                                    sizeof(n_114534),
                                                    &n_114534));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118188, 3,
                                                    sizeof(defunc_3_map_res_mem_130116.mem),
                                                    &defunc_3_map_res_mem_130116.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118188, 4,
                                                    sizeof(mem_130322.mem),
                                                    &mem_130322.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118188, 5,
                                                    sizeof(mem_130326.mem),
                                                    &mem_130326.mem));
            if (1 * ((size_t) segmap_usable_groups_118215 *
                     (size_t) segmap_group_sizze_118214) != 0) {
                const size_t global_work_sizze_135545[1] =
                             {(size_t) segmap_usable_groups_118215 *
                             (size_t) segmap_group_sizze_118214};
                const size_t local_work_sizze_135549[1] =
                             {segmap_group_sizze_118214};
                int64_t time_start_135546 = 0, time_end_135547 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log, "Launching %s with global work size [",
                            "main.segmap_118188");
                    fprintf(ctx->log, "%zu", global_work_sizze_135545[0]);
                    fprintf(ctx->log, "] and local work size [");
                    fprintf(ctx->log, "%zu", local_work_sizze_135549[0]);
                    fprintf(ctx->log,
                            "]; local memory parameters sum to %d bytes.\n",
                            (int) 0);
                    time_start_135546 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_118188,
                                                                1, NULL,
                                                                global_work_sizze_135545,
                                                                local_work_sizze_135549,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_118188_runs,
                                                                                                          &ctx->mainzisegmap_118188_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_135547 = get_wall_time();
                    
                    long time_diff_135548 = time_end_135547 - time_start_135546;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_118188", time_diff_135548);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int64_t segmap_usable_groups_118226 = sdiv_up64(m_114533,
                                                            segmap_group_sizze_118225);
            struct memblock_device mem_130330;
            
            mem_130330.references = NULL;
            if (memblock_alloc_device(ctx, &mem_130330, bytes_130100,
                                      "mem_130330")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_130333;
            
            mem_130333.references = NULL;
            if (memblock_alloc_device(ctx, &mem_130333, bytes_130331,
                                      "mem_130333")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118167, 1,
                                                    sizeof(m_114533),
                                                    &m_114533));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118167, 2,
                                                    sizeof(min_res_114683),
                                                    &min_res_114683));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118167, 3,
                                                    sizeof(i64_res_114690),
                                                    &i64_res_114690));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118167, 4,
                                                    sizeof(defunc_3_map_res_mem_130117.mem),
                                                    &defunc_3_map_res_mem_130117.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118167, 5,
                                                    sizeof(mem_130330.mem),
                                                    &mem_130330.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118167, 6,
                                                    sizeof(mem_130333.mem),
                                                    &mem_130333.mem));
            if (1 * ((size_t) segmap_usable_groups_118226 *
                     (size_t) segmap_group_sizze_118225) != 0) {
                const size_t global_work_sizze_135550[1] =
                             {(size_t) segmap_usable_groups_118226 *
                             (size_t) segmap_group_sizze_118225};
                const size_t local_work_sizze_135554[1] =
                             {segmap_group_sizze_118225};
                int64_t time_start_135551 = 0, time_end_135552 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log, "Launching %s with global work size [",
                            "main.segmap_118167");
                    fprintf(ctx->log, "%zu", global_work_sizze_135550[0]);
                    fprintf(ctx->log, "] and local work size [");
                    fprintf(ctx->log, "%zu", local_work_sizze_135554[0]);
                    fprintf(ctx->log,
                            "]; local memory parameters sum to %d bytes.\n",
                            (int) 0);
                    time_start_135551 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_118167,
                                                                1, NULL,
                                                                global_work_sizze_135550,
                                                                local_work_sizze_135554,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_118167_runs,
                                                                                                          &ctx->mainzisegmap_118167_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_135552 = get_wall_time();
                    
                    long time_diff_135553 = time_end_135552 - time_start_135551;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_118167", time_diff_135553);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int64_t segmap_usable_groups_118238 = sdiv_up64(nest_sizze_118236,
                                                            segmap_group_sizze_118237);
            struct memblock_device defunc_3_map_res_mem_130390;
            
            defunc_3_map_res_mem_130390.references = NULL;
            
            struct memblock_device defunc_3_map_res_mem_130391;
            
            defunc_3_map_res_mem_130391.references = NULL;
            
            int32_t local_memory_capacity_132733;
            
            local_memory_capacity_132733 = ctx->opencl.max_local_memory;
            if (((sle64((int64_t) 0,
                        sext_i32_i64(local_memory_capacity_132733)) &&
                  sle64((int64_t) 0,
                        sext_i32_i64(local_memory_capacity_132733))) &&
                 sle64((int64_t) 0,
                       sext_i32_i64(local_memory_capacity_132733))) &&
                suff_outer_par_118241) {
                int64_t y_129095 = smod64(n_114534, l_n_m_114584);
                int64_t x_129096 = sub64(l_n_m_114584, y_129095);
                int64_t y_129097 = smod64(x_129096, l_n_m_114584);
                int64_t padded_sizze_129098 = add64(n_114534, y_129097);
                int64_t per_chunk_129100 = squot64(padded_sizze_129098,
                                                   l_n_m_114584);
                int64_t binop_x_130335 = m_114533 * y_129097;
                int64_t binop_y_130336 = (int64_t) 8 * binop_x_130335;
                int64_t bytes_130334 = smax64((int64_t) 0, binop_y_130336);
                struct memblock_device mem_130337;
                
                mem_130337.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130337, bytes_130334,
                                          "mem_130337")) {
                    err = 1;
                    goto cleanup;
                }
                
                int64_t binop_x_130339 = m_114533 * padded_sizze_129098;
                int64_t binop_y_130340 = (int64_t) 8 * binop_x_130339;
                int64_t bytes_130338 = smax64((int64_t) 0, binop_y_130340);
                struct memblock_device mem_130341;
                
                mem_130341.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130341, bytes_130338,
                                          "mem_130341")) {
                    err = 1;
                    goto cleanup;
                }
                
                int64_t tmp_offs_132597 = (int64_t) 0;
                int64_t group_sizze_132601;
                
                group_sizze_132601 = ctx->sizes.mainzigroup_sizze_132601;
                
                int64_t num_groups_132602 = sdiv_up64(m_114533 * n_114534,
                                                      group_sizze_132601);
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132598,
                                                        0, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132598,
                                                        1, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132598,
                                                        2,
                                                        sizeof(padded_sizze_129098),
                                                        &padded_sizze_129098));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132598,
                                                        3,
                                                        sizeof(tmp_offs_132597),
                                                        &tmp_offs_132597));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132598,
                                                        4,
                                                        sizeof(mem_130326.mem),
                                                        &mem_130326.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132598,
                                                        5,
                                                        sizeof(mem_130341.mem),
                                                        &mem_130341.mem));
                if (1 * ((size_t) num_groups_132602 *
                         (size_t) group_sizze_132601) != 0) {
                    const size_t global_work_sizze_135555[1] =
                                 {(size_t) num_groups_132602 *
                                 (size_t) group_sizze_132601};
                    const size_t local_work_sizze_135559[1] =
                                 {group_sizze_132601};
                    int64_t time_start_135556 = 0, time_end_135557 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.copy_132598");
                        fprintf(ctx->log, "%zu", global_work_sizze_135555[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135559[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_135556 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzicopy_132598,
                                                                    1, NULL,
                                                                    global_work_sizze_135555,
                                                                    local_work_sizze_135559,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzicopy_132598_runs,
                                                                                                              &ctx->mainzicopy_132598_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135557 = get_wall_time();
                        
                        long time_diff_135558 = time_end_135557 -
                             time_start_135556;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.copy_132598", time_diff_135558);
                    }
                }
                tmp_offs_132597 += n_114534;
                
                int64_t group_sizze_132606;
                
                group_sizze_132606 = ctx->sizes.mainzigroup_sizze_132606;
                
                int64_t num_groups_132607 = sdiv_up64(m_114533 * y_129097,
                                                      group_sizze_132606);
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132603,
                                                        0, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132603,
                                                        1, sizeof(y_129097),
                                                        &y_129097));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132603,
                                                        2,
                                                        sizeof(padded_sizze_129098),
                                                        &padded_sizze_129098));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132603,
                                                        3,
                                                        sizeof(tmp_offs_132597),
                                                        &tmp_offs_132597));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132603,
                                                        4,
                                                        sizeof(mem_130337.mem),
                                                        &mem_130337.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132603,
                                                        5,
                                                        sizeof(mem_130341.mem),
                                                        &mem_130341.mem));
                if (1 * ((size_t) num_groups_132607 *
                         (size_t) group_sizze_132606) != 0) {
                    const size_t global_work_sizze_135560[1] =
                                 {(size_t) num_groups_132607 *
                                 (size_t) group_sizze_132606};
                    const size_t local_work_sizze_135564[1] =
                                 {group_sizze_132606};
                    int64_t time_start_135561 = 0, time_end_135562 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.copy_132603");
                        fprintf(ctx->log, "%zu", global_work_sizze_135560[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135564[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_135561 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzicopy_132603,
                                                                    1, NULL,
                                                                    global_work_sizze_135560,
                                                                    local_work_sizze_135564,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzicopy_132603_runs,
                                                                                                              &ctx->mainzicopy_132603_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135562 = get_wall_time();
                        
                        long time_diff_135563 = time_end_135562 -
                             time_start_135561;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.copy_132603", time_diff_135563);
                    }
                }
                tmp_offs_132597 += y_129097;
                if (memblock_unref_device(ctx, &mem_130337, "mem_130337") != 0)
                    return 1;
                
                int64_t binop_x_130343 = m_114533 * per_chunk_129100;
                int64_t binop_x_130344 = l_n_m_114584 * binop_x_130343;
                int64_t bytes_130342 = (int64_t) 8 * binop_x_130344;
                struct memblock_device mem_130345;
                
                mem_130345.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130345, bytes_130342,
                                          "mem_130345")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_i64(ctx, mem_130345,
                                                          (int64_t) 0,
                                                          mem_130341,
                                                          (int64_t) 0, m_114533,
                                                          per_chunk_129100,
                                                          l_n_m_114584) != 0) {
                    err = 1;
                    goto cleanup;
                }
                if (memblock_unref_device(ctx, &mem_130341, "mem_130341") != 0)
                    return 1;
                
                int64_t binop_y_130018 = l_n_m_114584 * per_chunk_129100;
                struct memblock_device mem_130350;
                
                mem_130350.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130350, bytes_130394,
                                          "mem_130350")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_130354;
                
                mem_130354.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130354, bytes_130399,
                                          "mem_130354")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        3, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        4, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        5,
                                                        sizeof(l_jump_114542),
                                                        &l_jump_114542));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        6, sizeof(l_n_m_114584),
                                                        &l_n_m_114584));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        7, sizeof(i_114610),
                                                        &i_114610));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        8, sizeof(x_114611),
                                                        &x_114611));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        9,
                                                        sizeof(min_res_114683),
                                                        &min_res_114683));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        10,
                                                        sizeof(empty_slice_114688),
                                                        &empty_slice_114688));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        11, sizeof(m_114689),
                                                        &m_114689));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        12,
                                                        sizeof(padded_sizze_129098),
                                                        &padded_sizze_129098));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        13,
                                                        sizeof(per_chunk_129100),
                                                        &per_chunk_129100));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        14,
                                                        sizeof(binop_y_130018),
                                                        &binop_y_130018));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        15,
                                                        sizeof(defunc_3_map_res_mem_130116.mem),
                                                        &defunc_3_map_res_mem_130116.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        16,
                                                        sizeof(defunc_3_map_res_mem_130117.mem),
                                                        &defunc_3_map_res_mem_130117.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        17,
                                                        sizeof(mem_130322.mem),
                                                        &mem_130322.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        18,
                                                        sizeof(mem_130326.mem),
                                                        &mem_130326.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        19,
                                                        sizeof(mem_130330.mem),
                                                        &mem_130330.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        20,
                                                        sizeof(mem_130333.mem),
                                                        &mem_130333.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        21,
                                                        sizeof(mem_130345.mem),
                                                        &mem_130345.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        22,
                                                        sizeof(mem_130350.mem),
                                                        &mem_130350.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117733,
                                                        23,
                                                        sizeof(mem_130354.mem),
                                                        &mem_130354.mem));
                if (1 * ((size_t) segmap_usable_groups_118238 *
                         (size_t) segmap_group_sizze_118237) != 0) {
                    const size_t global_work_sizze_135565[1] =
                                 {(size_t) segmap_usable_groups_118238 *
                                 (size_t) segmap_group_sizze_118237};
                    const size_t local_work_sizze_135569[1] =
                                 {segmap_group_sizze_118237};
                    int64_t time_start_135566 = 0, time_end_135567 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segmap_117733");
                        fprintf(ctx->log, "%zu", global_work_sizze_135565[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135569[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_135566 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_117733,
                                                                    1, NULL,
                                                                    global_work_sizze_135565,
                                                                    local_work_sizze_135569,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_117733_runs,
                                                                                                              &ctx->mainzisegmap_117733_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135567 = get_wall_time();
                        
                        long time_diff_135568 = time_end_135567 -
                             time_start_135566;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_117733", time_diff_135568);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_130345, "mem_130345") != 0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_3_map_res_mem_130390,
                                        &mem_130350, "mem_130350") != 0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_3_map_res_mem_130391,
                                        &mem_130354, "mem_130354") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130354, "mem_130354") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130350, "mem_130350") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130345, "mem_130345") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130341, "mem_130341") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130337, "mem_130337") != 0)
                    return 1;
            } else {
                int64_t segmap_usable_groups_118354 =
                        sdiv_up64(nest_sizze_118236, segmap_group_sizze_118353);
                struct memblock_device mem_130357;
                
                mem_130357.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130357, (int64_t) 0,
                                          "mem_130357")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_130361;
                
                mem_130361.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130361, bytes_130394,
                                          "mem_130361")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_130365;
                
                mem_130365.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130365, bytes_130394,
                                          "mem_130365")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_130369;
                
                mem_130369.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130369, bytes_130394,
                                          "mem_130369")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117975,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117975,
                                                        3, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117975,
                                                        4, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117975,
                                                        5,
                                                        sizeof(l_jump_114542),
                                                        &l_jump_114542));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117975,
                                                        6, sizeof(l_n_m_114584),
                                                        &l_n_m_114584));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117975,
                                                        7, sizeof(i_114610),
                                                        &i_114610));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117975,
                                                        8, sizeof(x_114611),
                                                        &x_114611));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117975,
                                                        9,
                                                        sizeof(min_res_114683),
                                                        &min_res_114683));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117975,
                                                        10,
                                                        sizeof(empty_slice_114688),
                                                        &empty_slice_114688));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117975,
                                                        11, sizeof(m_114689),
                                                        &m_114689));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117975,
                                                        12,
                                                        sizeof(mem_130322.mem),
                                                        &mem_130322.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117975,
                                                        13,
                                                        sizeof(mem_130357.mem),
                                                        &mem_130357.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117975,
                                                        14,
                                                        sizeof(mem_130361.mem),
                                                        &mem_130361.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117975,
                                                        15,
                                                        sizeof(mem_130365.mem),
                                                        &mem_130365.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117975,
                                                        16,
                                                        sizeof(mem_130369.mem),
                                                        &mem_130369.mem));
                if (1 * ((size_t) segmap_usable_groups_118354 *
                         (size_t) segmap_group_sizze_118353) != 0) {
                    const size_t global_work_sizze_135570[1] =
                                 {(size_t) segmap_usable_groups_118354 *
                                 (size_t) segmap_group_sizze_118353};
                    const size_t local_work_sizze_135574[1] =
                                 {segmap_group_sizze_118353};
                    int64_t time_start_135571 = 0, time_end_135572 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segmap_117975");
                        fprintf(ctx->log, "%zu", global_work_sizze_135570[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135574[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_135571 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_117975,
                                                                    1, NULL,
                                                                    global_work_sizze_135570,
                                                                    local_work_sizze_135574,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_117975_runs,
                                                                                                              &ctx->mainzisegmap_117975_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135572 = get_wall_time();
                        
                        long time_diff_135573 = time_end_135572 -
                             time_start_135571;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_117975", time_diff_135573);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_130361, "mem_130361") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130365, "mem_130365") != 0)
                    return 1;
                
                int64_t segmap_usable_groups_118401 =
                        sdiv_up64(nest_sizze_118399, segmap_group_sizze_118400);
                struct memblock_device mem_130375;
                
                mem_130375.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130375, bytes_130371,
                                          "mem_130375")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117959,
                                                        1, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117959,
                                                        2, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117959,
                                                        3, sizeof(l_n_m_114584),
                                                        &l_n_m_114584));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117959,
                                                        4,
                                                        sizeof(min_res_114683),
                                                        &min_res_114683));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117959,
                                                        5,
                                                        sizeof(mem_130326.mem),
                                                        &mem_130326.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117959,
                                                        6,
                                                        sizeof(mem_130357.mem),
                                                        &mem_130357.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117959,
                                                        7,
                                                        sizeof(mem_130369.mem),
                                                        &mem_130369.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117959,
                                                        8,
                                                        sizeof(mem_130375.mem),
                                                        &mem_130375.mem));
                if (1 * ((size_t) segmap_usable_groups_118401 *
                         (size_t) segmap_group_sizze_118400) != 0) {
                    const size_t global_work_sizze_135575[1] =
                                 {(size_t) segmap_usable_groups_118401 *
                                 (size_t) segmap_group_sizze_118400};
                    const size_t local_work_sizze_135579[1] =
                                 {segmap_group_sizze_118400};
                    int64_t time_start_135576 = 0, time_end_135577 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segmap_117959");
                        fprintf(ctx->log, "%zu", global_work_sizze_135575[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135579[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_135576 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_117959,
                                                                    1, NULL,
                                                                    global_work_sizze_135575,
                                                                    local_work_sizze_135579,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_117959_runs,
                                                                                                              &ctx->mainzisegmap_117959_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135577 = get_wall_time();
                        
                        long time_diff_135578 = time_end_135577 -
                             time_start_135576;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_117959", time_diff_135578);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_130357, "mem_130357") != 0)
                    return 1;
                
                struct memblock_device mem_130380;
                
                mem_130380.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130380, bytes_130394,
                                          "mem_130380")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64(min_res_114683 * (int64_t) 2,
                          segred_group_sizze_118413)) {
                    int64_t segment_sizze_nonzzero_132651 = smax64((int64_t) 1,
                                                                   min_res_114683);
                    int64_t num_threads_132652 = num_groups_118414 *
                            segred_group_sizze_118413;
                    
                    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_114533 * l_n_m_114584), '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) min_res_114683, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segments_per_group",
                                (long long) squot64(segred_group_sizze_118413,
                                                    segment_sizze_nonzzero_132651),
                                '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                (long long) sext_i64_i32(sdiv_up64(m_114533 *
                                                                   l_n_m_114584,
                                                                   squot64(segred_group_sizze_118413,
                                                                           segment_sizze_nonzzero_132651))),
                                '\n');
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117941,
                                                            1, (int64_t) 8 *
                                                            segred_group_sizze_118413,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117941,
                                                            2, sizeof(m_114533),
                                                            &m_114533));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117941,
                                                            3,
                                                            sizeof(l_jump_114542),
                                                            &l_jump_114542));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117941,
                                                            4,
                                                            sizeof(l_n_m_114584),
                                                            &l_n_m_114584));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117941,
                                                            5, sizeof(i_114610),
                                                            &i_114610));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117941,
                                                            6,
                                                            sizeof(min_res_114683),
                                                            &min_res_114683));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117941,
                                                            7,
                                                            sizeof(num_groups_118414),
                                                            &num_groups_118414));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117941,
                                                            8,
                                                            sizeof(segment_sizze_nonzzero_132651),
                                                            &segment_sizze_nonzzero_132651));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117941,
                                                            9,
                                                            sizeof(mem_130375.mem),
                                                            &mem_130375.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_117941,
                                                            10,
                                                            sizeof(mem_130380.mem),
                                                            &mem_130380.mem));
                    if (1 * ((size_t) num_groups_118414 *
                             (size_t) segred_group_sizze_118413) != 0) {
                        const size_t global_work_sizze_135580[1] =
                                     {(size_t) num_groups_118414 *
                                     (size_t) segred_group_sizze_118413};
                        const size_t local_work_sizze_135584[1] =
                                     {segred_group_sizze_118413};
                        int64_t time_start_135581 = 0, time_end_135582 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [",
                                    "main.segred_small_117941");
                            fprintf(ctx->log, "%zu",
                                    global_work_sizze_135580[0]);
                            fprintf(ctx->log, "] and local work size [");
                            fprintf(ctx->log, "%zu",
                                    local_work_sizze_135584[0]);
                            fprintf(ctx->log,
                                    "]; local memory parameters sum to %d bytes.\n",
                                    (int) (0 + (int64_t) 8 *
                                           segred_group_sizze_118413));
                            time_start_135581 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_small_117941,
                                                                        1, NULL,
                                                                        global_work_sizze_135580,
                                                                        local_work_sizze_135584,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_small_117941_runs,
                                                                                                                  &ctx->mainzisegred_small_117941_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_135582 = get_wall_time();
                            
                            long time_diff_135583 = time_end_135582 -
                                 time_start_135581;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_small_117941",
                                    time_diff_135583);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                } else {
                    int64_t groups_per_segment_132676 =
                            sdiv_up64(num_groups_118414, smax64((int64_t) 1,
                                                                m_114533 *
                                                                l_n_m_114584));
                    int64_t elements_per_thread_132677 =
                            sdiv_up64(min_res_114683,
                                      segred_group_sizze_118413 *
                                      groups_per_segment_132676);
                    int64_t virt_num_groups_132678 = groups_per_segment_132676 *
                            (m_114533 * l_n_m_114584);
                    int64_t num_threads_132679 = num_groups_118414 *
                            segred_group_sizze_118413;
                    int64_t threads_per_segment_132680 =
                            groups_per_segment_132676 *
                            segred_group_sizze_118413;
                    
                    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_114533 * l_n_m_114584), '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) min_res_114683, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                (long long) virt_num_groups_132678, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                (long long) num_groups_118414, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "group_size",
                                (long long) segred_group_sizze_118413, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                (long long) elements_per_thread_132677, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                                (long long) groups_per_segment_132676, '\n');
                    
                    struct memblock_device segred_tmp_mem_132681;
                    
                    segred_tmp_mem_132681.references = NULL;
                    if (memblock_alloc_device(ctx, &segred_tmp_mem_132681,
                                              (int64_t) 8 *
                                              virt_num_groups_132678,
                                              "segred_tmp_mem_132681")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mainzicounter_mem_132683 =
                                           ctx->mainzicounter_mem_132683;
                    
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117941,
                                                            1, 1, NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117941,
                                                            2, (int64_t) 8 *
                                                            segred_group_sizze_118413,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117941,
                                                            3, sizeof(m_114533),
                                                            &m_114533));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117941,
                                                            4,
                                                            sizeof(l_jump_114542),
                                                            &l_jump_114542));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117941,
                                                            5,
                                                            sizeof(l_n_m_114584),
                                                            &l_n_m_114584));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117941,
                                                            6, sizeof(i_114610),
                                                            &i_114610));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117941,
                                                            7,
                                                            sizeof(min_res_114683),
                                                            &min_res_114683));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117941,
                                                            8,
                                                            sizeof(num_groups_118414),
                                                            &num_groups_118414));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117941,
                                                            9,
                                                            sizeof(groups_per_segment_132676),
                                                            &groups_per_segment_132676));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117941,
                                                            10,
                                                            sizeof(elements_per_thread_132677),
                                                            &elements_per_thread_132677));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117941,
                                                            11,
                                                            sizeof(virt_num_groups_132678),
                                                            &virt_num_groups_132678));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117941,
                                                            12,
                                                            sizeof(threads_per_segment_132680),
                                                            &threads_per_segment_132680));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117941,
                                                            13,
                                                            sizeof(mem_130375.mem),
                                                            &mem_130375.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117941,
                                                            14,
                                                            sizeof(mem_130380.mem),
                                                            &mem_130380.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117941,
                                                            15,
                                                            sizeof(segred_tmp_mem_132681.mem),
                                                            &segred_tmp_mem_132681.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_117941,
                                                            16,
                                                            sizeof(mainzicounter_mem_132683.mem),
                                                            &mainzicounter_mem_132683.mem));
                    if (1 * ((size_t) num_groups_118414 *
                             (size_t) segred_group_sizze_118413) != 0) {
                        const size_t global_work_sizze_135586[1] =
                                     {(size_t) num_groups_118414 *
                                     (size_t) segred_group_sizze_118413};
                        const size_t local_work_sizze_135590[1] =
                                     {segred_group_sizze_118413};
                        int64_t time_start_135587 = 0, time_end_135588 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [",
                                    "main.segred_large_117941");
                            fprintf(ctx->log, "%zu",
                                    global_work_sizze_135586[0]);
                            fprintf(ctx->log, "] and local work size [");
                            fprintf(ctx->log, "%zu",
                                    local_work_sizze_135590[0]);
                            fprintf(ctx->log,
                                    "]; local memory parameters sum to %d bytes.\n",
                                    (int) (0 + 1 + (int64_t) 8 *
                                           segred_group_sizze_118413));
                            time_start_135587 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_large_117941,
                                                                        1, NULL,
                                                                        global_work_sizze_135586,
                                                                        local_work_sizze_135590,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_large_117941_runs,
                                                                                                                  &ctx->mainzisegred_large_117941_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_135588 = get_wall_time();
                            
                            long time_diff_135589 = time_end_135588 -
                                 time_start_135587;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_large_117941",
                                    time_diff_135589);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &segred_tmp_mem_132681,
                                              "segred_tmp_mem_132681") != 0)
                        return 1;
                }
                if (memblock_unref_device(ctx, &mem_130375, "mem_130375") != 0)
                    return 1;
                
                int64_t segmap_usable_groups_118430 =
                        sdiv_up64(nest_sizze_118236, segmap_group_sizze_118429);
                struct memblock_device mem_130385;
                
                mem_130385.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130385, bytes_130399,
                                          "mem_130385")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_130389;
                
                mem_130389.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130389, bytes_130394,
                                          "mem_130389")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117859,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117859,
                                                        3, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117859,
                                                        4, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117859,
                                                        5,
                                                        sizeof(l_jump_114542),
                                                        &l_jump_114542));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117859,
                                                        6, sizeof(l_n_m_114584),
                                                        &l_n_m_114584));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117859,
                                                        7, sizeof(i_114610),
                                                        &i_114610));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117859,
                                                        8,
                                                        sizeof(min_res_114683),
                                                        &min_res_114683));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117859,
                                                        9,
                                                        sizeof(defunc_3_map_res_mem_130116.mem),
                                                        &defunc_3_map_res_mem_130116.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117859,
                                                        10,
                                                        sizeof(defunc_3_map_res_mem_130117.mem),
                                                        &defunc_3_map_res_mem_130117.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117859,
                                                        11,
                                                        sizeof(mem_130326.mem),
                                                        &mem_130326.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117859,
                                                        12,
                                                        sizeof(mem_130330.mem),
                                                        &mem_130330.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117859,
                                                        13,
                                                        sizeof(mem_130333.mem),
                                                        &mem_130333.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117859,
                                                        14,
                                                        sizeof(mem_130369.mem),
                                                        &mem_130369.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117859,
                                                        15,
                                                        sizeof(mem_130380.mem),
                                                        &mem_130380.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117859,
                                                        16,
                                                        sizeof(mem_130385.mem),
                                                        &mem_130385.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_117859,
                                                        17,
                                                        sizeof(mem_130389.mem),
                                                        &mem_130389.mem));
                if (1 * ((size_t) segmap_usable_groups_118430 *
                         (size_t) segmap_group_sizze_118429) != 0) {
                    const size_t global_work_sizze_135591[1] =
                                 {(size_t) segmap_usable_groups_118430 *
                                 (size_t) segmap_group_sizze_118429};
                    const size_t local_work_sizze_135595[1] =
                                 {segmap_group_sizze_118429};
                    int64_t time_start_135592 = 0, time_end_135593 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segmap_117859");
                        fprintf(ctx->log, "%zu", global_work_sizze_135591[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135595[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_135592 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_117859,
                                                                    1, NULL,
                                                                    global_work_sizze_135591,
                                                                    local_work_sizze_135595,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_117859_runs,
                                                                                                              &ctx->mainzisegmap_117859_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135593 = get_wall_time();
                        
                        long time_diff_135594 = time_end_135593 -
                             time_start_135592;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_117859", time_diff_135594);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_130369, "mem_130369") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130380, "mem_130380") != 0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_3_map_res_mem_130390,
                                        &mem_130389, "mem_130389") != 0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_3_map_res_mem_130391,
                                        &mem_130385, "mem_130385") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130389, "mem_130389") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130385, "mem_130385") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130380, "mem_130380") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130375, "mem_130375") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130369, "mem_130369") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130365, "mem_130365") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130361, "mem_130361") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130357, "mem_130357") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &mem_130322, "mem_130322") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130326, "mem_130326") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130330, "mem_130330") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130333, "mem_130333") != 0)
                return 1;
            if (memblock_set_device(ctx, &defunc_3_map_res_mem_130392,
                                    &defunc_3_map_res_mem_130390,
                                    "defunc_3_map_res_mem_130390") != 0)
                return 1;
            if (memblock_set_device(ctx, &defunc_3_map_res_mem_130393,
                                    &defunc_3_map_res_mem_130391,
                                    "defunc_3_map_res_mem_130391") != 0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130391,
                                      "defunc_3_map_res_mem_130391") != 0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130390,
                                      "defunc_3_map_res_mem_130390") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130333, "mem_130333") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130330, "mem_130330") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130326, "mem_130326") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130322, "mem_130322") != 0)
                return 1;
        }
        if (memblock_set_device(ctx, &defunc_3_map_res_mem_130404,
                                &defunc_3_map_res_mem_130392,
                                "defunc_3_map_res_mem_130392") != 0)
            return 1;
        if (memblock_set_device(ctx, &defunc_3_map_res_mem_130405,
                                &defunc_3_map_res_mem_130393,
                                "defunc_3_map_res_mem_130393") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130393,
                                  "defunc_3_map_res_mem_130393") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130392,
                                  "defunc_3_map_res_mem_130392") != 0)
            return 1;
    }
    
    int64_t min_res_114809 = smin64(n_114534, t_window_114537);
    bool bounds_invalid_upwards_114810 = slt64(t_n_m_114591, (int64_t) 0);
    bool valid_114811 = !bounds_invalid_upwards_114810;
    bool range_valid_c_114812;
    
    if (!valid_114811) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (int64_t) 0, "..", (int64_t) 1, "..<",
                               t_n_m_114591, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  loess.fut:335:3-373:7\n   #3  loess.fut:400:15-58\n   #4  stl.fut:173:13-65\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:171:5-174:26\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130405,
                                  "defunc_3_map_res_mem_130405") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130404,
                                  "defunc_3_map_res_mem_130404") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130203,
                                  "defunc_3_map_res_mem_130203") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130127, "mem_130127") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130122, "mem_130122") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                                  "defunc_3_map_res_mem_130117") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                                  "defunc_3_map_res_mem_130116") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    bool empty_slice_114814 = min_res_114809 == (int64_t) 0;
    int64_t m_114815 = sub64(min_res_114809, (int64_t) 1);
    float i64_res_114816 = sitofp_i64_f32(t_window_114537);
    bool suff_outer_par_118648;
    
    suff_outer_par_118648 = ctx->sizes.mainzisuff_outer_par_6 <= m_114533;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_6",
                (long) m_114533, suff_outer_par_118648 ? "true" : "false");
    
    int64_t one_intra_par_min_118636 = t_n_m_114591 * min_res_114809;
    int64_t y_118640 = smin64(n_114534, one_intra_par_min_118636);
    int64_t y_118641 = smin64(one_intra_par_min_118636, y_118640);
    int64_t intra_avail_par_118642 = smin64(t_n_m_114591, y_118641);
    int64_t y_118644 = smax64(n_114534, one_intra_par_min_118636);
    int64_t computed_group_sizze_118504 = smax64(t_n_m_114591, y_118644);
    bool fits_118894 = sle64(computed_group_sizze_118504,
                             max_group_sizze_116766);
    bool suff_intra_par_118892;
    
    suff_intra_par_118892 = ctx->sizes.mainzisuff_intra_par_7 <=
        intra_avail_par_118642;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_7",
                (long) intra_avail_par_118642,
                suff_intra_par_118892 ? "true" : "false");
    
    bool intra_suff_and_fits_118895 = suff_intra_par_118892 && fits_118894;
    int64_t segmap_group_sizze_118772;
    
    segmap_group_sizze_118772 = ctx->sizes.mainzisegmap_group_sizze_118652;
    
    int64_t num_groups_118773;
    int32_t max_num_groups_132736;
    
    max_num_groups_132736 = ctx->sizes.mainzisegmap_num_groups_118654;
    num_groups_118773 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(m_114533,
                                                             segmap_group_sizze_118772),
                                                   sext_i32_i64(max_num_groups_132736))));
    
    int64_t segmap_group_sizze_119514;
    
    segmap_group_sizze_119514 = ctx->sizes.mainzisegmap_group_sizze_119491;
    
    int64_t segmap_group_sizze_119525;
    
    segmap_group_sizze_119525 = ctx->sizes.mainzisegmap_group_sizze_119469;
    
    int64_t nest_sizze_119536 = m_114533 * t_n_m_114591;
    int64_t segmap_group_sizze_119537;
    
    segmap_group_sizze_119537 = ctx->sizes.mainzisegmap_group_sizze_119036;
    
    bool suff_outer_par_119541;
    
    suff_outer_par_119541 = ctx->sizes.mainzisuff_outer_par_8 <=
        nest_sizze_119536;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_8",
                (long) nest_sizze_119536,
                suff_outer_par_119541 ? "true" : "false");
    
    int64_t segmap_group_sizze_119653;
    
    segmap_group_sizze_119653 = ctx->sizes.mainzisegmap_group_sizze_119278;
    
    int64_t nest_sizze_119699 = m_114533 * one_intra_par_min_118636;
    int64_t segmap_group_sizze_119700;
    
    segmap_group_sizze_119700 = ctx->sizes.mainzisegmap_group_sizze_119263;
    
    int64_t nest_sizze_119712 = min_res_114809 * nest_sizze_119536;
    int64_t segred_group_sizze_119713;
    
    segred_group_sizze_119713 = ctx->sizes.mainzisegred_group_sizze_119235;
    
    int64_t num_groups_119714;
    int32_t max_num_groups_132737;
    
    max_num_groups_132737 = ctx->sizes.mainzisegred_num_groups_119237;
    num_groups_119714 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_119712,
                                                             segred_group_sizze_119713),
                                                   sext_i32_i64(max_num_groups_132737))));
    
    int64_t segmap_group_sizze_119729;
    
    segmap_group_sizze_119729 = ctx->sizes.mainzisegmap_group_sizze_119162;
    
    int64_t bytes_130470 = (int64_t) 8 * nest_sizze_119536;
    int64_t bytes_130473 = (int64_t) 4 * nest_sizze_119536;
    int64_t binop_y_130441 = (int64_t) 4 * t_n_m_114591;
    int64_t bytes_130440 = smax64((int64_t) 0, binop_y_130441);
    int64_t binop_y_130444 = (int64_t) 8 * t_n_m_114591;
    int64_t bytes_130443 = smax64((int64_t) 0, binop_y_130444);
    int64_t bytes_130596 = smax64((int64_t) 0, bytes_130470);
    int64_t bytes_130601 = smax64((int64_t) 0, bytes_130473);
    int64_t binop_y_130499 = (int64_t) 8 * one_intra_par_min_118636;
    int64_t bytes_130497 = smax64((int64_t) 0, binop_y_130499);
    int64_t binop_y_130576 = (int64_t) 8 * nest_sizze_119712;
    int64_t bytes_130573 = smax64((int64_t) 0, binop_y_130576);
    int64_t maxSubHelper_132088 = umax64(bytes_130089, bytes_130443);
    int64_t maxSubHelper_132089 = umax64(bytes_130497, maxSubHelper_132088);
    int64_t maxSubHelper_132090 = umax64((int64_t) 0, bytes_130440);
    int64_t num_threads_132178 = segmap_group_sizze_118772 * num_groups_118773;
    int64_t total_sizze_132179 = bytes_130443 * num_threads_132178;
    int64_t total_sizze_132180 = bytes_130440 * num_threads_132178;
    int64_t total_sizze_132181 = bytes_130089 * num_threads_132178;
    int64_t total_sizze_132182 = bytes_130089 * num_threads_132178;
    struct memblock_device defunc_3_map_res_mem_130606;
    
    defunc_3_map_res_mem_130606.references = NULL;
    
    struct memblock_device defunc_3_map_res_mem_130607;
    
    defunc_3_map_res_mem_130607.references = NULL;
    
    int32_t local_memory_capacity_132953;
    
    local_memory_capacity_132953 = ctx->opencl.max_local_memory;
    if (sle64((int64_t) 0, sext_i32_i64(local_memory_capacity_132953)) &&
        suff_outer_par_118648) {
        struct memblock_device mem_130408;
        
        mem_130408.references = NULL;
        if (memblock_alloc_device(ctx, &mem_130408, binop_y_130098,
                                  "mem_130408")) {
            err = 1;
            goto cleanup;
        }
        if (futrts_builtinzhgpu_map_transpose_i64(ctx, mem_130408, (int64_t) 0,
                                                  defunc_3_map_res_mem_130116,
                                                  (int64_t) 0, (int64_t) 1,
                                                  n_114534, m_114533) != 0) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_130472;
        
        mem_130472.references = NULL;
        if (memblock_alloc_device(ctx, &mem_130472, bytes_130470,
                                  "mem_130472")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device mem_130475;
        
        mem_130475.references = NULL;
        if (memblock_alloc_device(ctx, &mem_130475, bytes_130473,
                                  "mem_130475")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device color_132084;
        
        color_132084.references = NULL;
        if (memblock_alloc_device(ctx, &color_132084, total_sizze_132179,
                                  "color_132084")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device color_132085;
        
        color_132085.references = NULL;
        if (memblock_alloc_device(ctx, &color_132085, total_sizze_132180,
                                  "color_132085")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device color_132086;
        
        color_132086.references = NULL;
        if (memblock_alloc_device(ctx, &color_132086, total_sizze_132181,
                                  "color_132086")) {
            err = 1;
            goto cleanup;
        }
        
        struct memblock_device color_132087;
        
        color_132087.references = NULL;
        if (memblock_alloc_device(ctx, &color_132087, total_sizze_132182,
                                  "color_132087")) {
            err = 1;
            goto cleanup;
        }
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "\n# SegMap");
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 1,
                                                sizeof(ctx->failure_is_an_option),
                                                &ctx->failure_is_an_option));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 3,
                                                sizeof(m_114533), &m_114533));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 4,
                                                sizeof(n_114534), &n_114534));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 5,
                                                sizeof(t_jump_114541),
                                                &t_jump_114541));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 6,
                                                sizeof(t_n_m_114591),
                                                &t_n_m_114591));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 7,
                                                sizeof(i_114610), &i_114610));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 8,
                                                sizeof(x_114611), &x_114611));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 9,
                                                sizeof(min_res_114809),
                                                &min_res_114809));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 10,
                                                sizeof(empty_slice_114814),
                                                &empty_slice_114814));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 11,
                                                sizeof(m_114815), &m_114815));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 12,
                                                sizeof(i64_res_114816),
                                                &i64_res_114816));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 13,
                                                sizeof(num_groups_118773),
                                                &num_groups_118773));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 14,
                                                sizeof(num_threads_132178),
                                                &num_threads_132178));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 15,
                                                sizeof(defunc_3_map_res_mem_130116.mem),
                                                &defunc_3_map_res_mem_130116.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 16,
                                                sizeof(defunc_3_map_res_mem_130117.mem),
                                                &defunc_3_map_res_mem_130117.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 17,
                                                sizeof(mem_130408.mem),
                                                &mem_130408.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 18,
                                                sizeof(mem_130472.mem),
                                                &mem_130472.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 19,
                                                sizeof(mem_130475.mem),
                                                &mem_130475.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 20,
                                                sizeof(color_132084.mem),
                                                &color_132084.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 21,
                                                sizeof(color_132085.mem),
                                                &color_132085.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 22,
                                                sizeof(color_132086.mem),
                                                &color_132086.mem));
        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_118650, 23,
                                                sizeof(color_132087.mem),
                                                &color_132087.mem));
        if (1 * ((size_t) num_groups_118773 *
                 (size_t) segmap_group_sizze_118772) != 0) {
            const size_t global_work_sizze_135596[1] =
                         {(size_t) num_groups_118773 *
                         (size_t) segmap_group_sizze_118772};
            const size_t local_work_sizze_135600[1] =
                         {segmap_group_sizze_118772};
            int64_t time_start_135597 = 0, time_end_135598 = 0;
            
            if (ctx->debugging) {
                fprintf(ctx->log, "Launching %s with global work size [",
                        "main.segmap_118650");
                fprintf(ctx->log, "%zu", global_work_sizze_135596[0]);
                fprintf(ctx->log, "] and local work size [");
                fprintf(ctx->log, "%zu", local_work_sizze_135600[0]);
                fprintf(ctx->log,
                        "]; local memory parameters sum to %d bytes.\n",
                        (int) 0);
                time_start_135597 = get_wall_time();
            }
            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                            ctx->mainzisegmap_118650,
                                                            1, NULL,
                                                            global_work_sizze_135596,
                                                            local_work_sizze_135600,
                                                            0, NULL,
                                                            ctx->profiling_paused ||
                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                      &ctx->mainzisegmap_118650_runs,
                                                                                                      &ctx->mainzisegmap_118650_total_runtime)));
            if (ctx->debugging) {
                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                time_end_135598 = get_wall_time();
                
                long time_diff_135599 = time_end_135598 - time_start_135597;
                
                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                        "main.segmap_118650", time_diff_135599);
            }
        }
        ctx->failure_is_an_option = 1;
        if (ctx->debugging)
            fprintf(ctx->log, "%s\n", "");
        if (memblock_unref_device(ctx, &mem_130408, "mem_130408") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_132084, "color_132084") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_132085, "color_132085") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_132086, "color_132086") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_132087, "color_132087") != 0)
            return 1;
        
        struct memblock_device mem_130599;
        
        mem_130599.references = NULL;
        if (memblock_alloc_device(ctx, &mem_130599, bytes_130596,
                                  "mem_130599")) {
            err = 1;
            goto cleanup;
        }
        if (futrts_builtinzhgpu_map_transpose_i64(ctx, mem_130599, (int64_t) 0,
                                                  mem_130472, (int64_t) 0,
                                                  (int64_t) 1, m_114533,
                                                  t_n_m_114591) != 0) {
            err = 1;
            goto cleanup;
        }
        if (memblock_unref_device(ctx, &mem_130472, "mem_130472") != 0)
            return 1;
        
        struct memblock_device mem_130604;
        
        mem_130604.references = NULL;
        if (memblock_alloc_device(ctx, &mem_130604, bytes_130601,
                                  "mem_130604")) {
            err = 1;
            goto cleanup;
        }
        if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_130604, (int64_t) 0,
                                                  mem_130475, (int64_t) 0,
                                                  (int64_t) 1, m_114533,
                                                  t_n_m_114591) != 0) {
            err = 1;
            goto cleanup;
        }
        if (memblock_unref_device(ctx, &mem_130475, "mem_130475") != 0)
            return 1;
        if (memblock_set_device(ctx, &defunc_3_map_res_mem_130606, &mem_130599,
                                "mem_130599") != 0)
            return 1;
        if (memblock_set_device(ctx, &defunc_3_map_res_mem_130607, &mem_130604,
                                "mem_130604") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130604, "mem_130604") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130599, "mem_130599") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_132087, "color_132087") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_132086, "color_132086") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_132085, "color_132085") != 0)
            return 1;
        if (memblock_unref_device(ctx, &color_132084, "color_132084") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130475, "mem_130475") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130472, "mem_130472") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130408, "mem_130408") != 0)
            return 1;
    } else {
        struct memblock_device defunc_3_map_res_mem_130594;
        
        defunc_3_map_res_mem_130594.references = NULL;
        
        struct memblock_device defunc_3_map_res_mem_130595;
        
        defunc_3_map_res_mem_130595.references = NULL;
        
        int32_t local_memory_capacity_132952;
        
        local_memory_capacity_132952 = ctx->opencl.max_local_memory;
        if (sle64(maxSubHelper_132089 + srem64((int64_t) 8 -
                                               srem64(maxSubHelper_132089,
                                                      (int64_t) 8),
                                               (int64_t) 8) +
                  (maxSubHelper_132090 + srem64((int64_t) 8 -
                                                srem64(maxSubHelper_132090,
                                                       (int64_t) 8),
                                                (int64_t) 8)) + (bytes_130443 +
                                                                 srem64((int64_t) 8 -
                                                                        srem64(bytes_130443,
                                                                               (int64_t) 8),
                                                                        (int64_t) 8)) +
                  (bytes_130443 + srem64((int64_t) 8 - srem64(bytes_130443,
                                                              (int64_t) 8),
                                         (int64_t) 8)) + (bytes_130443 +
                                                          srem64((int64_t) 8 -
                                                                 srem64(bytes_130443,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                  (bytes_130443 + srem64((int64_t) 8 - srem64(bytes_130443,
                                                              (int64_t) 8),
                                         (int64_t) 8)) + (bytes_130089 +
                                                          srem64((int64_t) 8 -
                                                                 srem64(bytes_130089,
                                                                        (int64_t) 8),
                                                                 (int64_t) 8)) +
                  ((int64_t) 8 * (t_n_m_114591 * min_res_114809) +
                   srem64((int64_t) 8 - srem64((int64_t) 8 * (t_n_m_114591 *
                                                              min_res_114809),
                                               (int64_t) 8), (int64_t) 8)),
                  sext_i32_i64(local_memory_capacity_132952)) &&
            intra_suff_and_fits_118895) {
            struct memblock_device mem_130515;
            
            mem_130515.references = NULL;
            if (memblock_alloc_device(ctx, &mem_130515, bytes_130596,
                                      "mem_130515")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_130519;
            
            mem_130519.references = NULL;
            if (memblock_alloc_device(ctx, &mem_130519, bytes_130601,
                                      "mem_130519")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    1,
                                                    sizeof(ctx->failure_is_an_option),
                                                    &ctx->failure_is_an_option));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    3, (int64_t) 8 *
                                                    (t_n_m_114591 *
                                                     min_res_114809), NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    4, bytes_130089, NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    5, bytes_130443, NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    6, bytes_130443, NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    7, bytes_130443, NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    8, bytes_130443, NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    9, maxSubHelper_132090,
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    10, maxSubHelper_132089,
                                                    NULL));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    11, sizeof(m_114533),
                                                    &m_114533));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    12, sizeof(n_114534),
                                                    &n_114534));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    13, sizeof(t_jump_114541),
                                                    &t_jump_114541));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    14, sizeof(t_n_m_114591),
                                                    &t_n_m_114591));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    15, sizeof(i_114610),
                                                    &i_114610));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    16, sizeof(x_114611),
                                                    &x_114611));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    17, sizeof(min_res_114809),
                                                    &min_res_114809));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    18,
                                                    sizeof(empty_slice_114814),
                                                    &empty_slice_114814));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    19, sizeof(m_114815),
                                                    &m_114815));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    20, sizeof(i64_res_114816),
                                                    &i64_res_114816));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    21,
                                                    sizeof(computed_group_sizze_118504),
                                                    &computed_group_sizze_118504));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    22,
                                                    sizeof(defunc_3_map_res_mem_130116.mem),
                                                    &defunc_3_map_res_mem_130116.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    23,
                                                    sizeof(defunc_3_map_res_mem_130117.mem),
                                                    &defunc_3_map_res_mem_130117.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    24, sizeof(mem_130515.mem),
                                                    &mem_130515.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_118646,
                                                    25, sizeof(mem_130519.mem),
                                                    &mem_130519.mem));
            if (1 * ((size_t) m_114533 *
                     (size_t) computed_group_sizze_118504) != 0) {
                const size_t global_work_sizze_135601[1] = {(size_t) m_114533 *
                             (size_t) computed_group_sizze_118504};
                const size_t local_work_sizze_135605[1] =
                             {computed_group_sizze_118504};
                int64_t time_start_135602 = 0, time_end_135603 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log, "Launching %s with global work size [",
                            "main.segmap_intragroup_118646");
                    fprintf(ctx->log, "%zu", global_work_sizze_135601[0]);
                    fprintf(ctx->log, "] and local work size [");
                    fprintf(ctx->log, "%zu", local_work_sizze_135605[0]);
                    fprintf(ctx->log,
                            "]; local memory parameters sum to %d bytes.\n",
                            (int) (0 + (int64_t) 8 * (t_n_m_114591 *
                                                      min_res_114809) +
                                   bytes_130089 + bytes_130443 + bytes_130443 +
                                   bytes_130443 + bytes_130443 +
                                   maxSubHelper_132090 + maxSubHelper_132089));
                    time_start_135602 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_intragroup_118646,
                                                                1, NULL,
                                                                global_work_sizze_135601,
                                                                local_work_sizze_135605,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_intragroup_118646_runs,
                                                                                                          &ctx->mainzisegmap_intragroup_118646_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_135603 = get_wall_time();
                    
                    long time_diff_135604 = time_end_135603 - time_start_135602;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_intragroup_118646", time_diff_135604);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_set_device(ctx, &defunc_3_map_res_mem_130594,
                                    &mem_130515, "mem_130515") != 0)
                return 1;
            if (memblock_set_device(ctx, &defunc_3_map_res_mem_130595,
                                    &mem_130519, "mem_130519") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130519, "mem_130519") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130515, "mem_130515") != 0)
                return 1;
        } else {
            int64_t segmap_usable_groups_119515 = sdiv_up64(nest_sizze_116859,
                                                            segmap_group_sizze_119514);
            struct memblock_device mem_130524;
            
            mem_130524.references = NULL;
            if (memblock_alloc_device(ctx, &mem_130524, bytes_130096,
                                      "mem_130524")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_130528;
            
            mem_130528.references = NULL;
            if (memblock_alloc_device(ctx, &mem_130528, bytes_130096,
                                      "mem_130528")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119488, 1,
                                                    sizeof(m_114533),
                                                    &m_114533));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119488, 2,
                                                    sizeof(n_114534),
                                                    &n_114534));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119488, 3,
                                                    sizeof(defunc_3_map_res_mem_130116.mem),
                                                    &defunc_3_map_res_mem_130116.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119488, 4,
                                                    sizeof(mem_130524.mem),
                                                    &mem_130524.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119488, 5,
                                                    sizeof(mem_130528.mem),
                                                    &mem_130528.mem));
            if (1 * ((size_t) segmap_usable_groups_119515 *
                     (size_t) segmap_group_sizze_119514) != 0) {
                const size_t global_work_sizze_135606[1] =
                             {(size_t) segmap_usable_groups_119515 *
                             (size_t) segmap_group_sizze_119514};
                const size_t local_work_sizze_135610[1] =
                             {segmap_group_sizze_119514};
                int64_t time_start_135607 = 0, time_end_135608 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log, "Launching %s with global work size [",
                            "main.segmap_119488");
                    fprintf(ctx->log, "%zu", global_work_sizze_135606[0]);
                    fprintf(ctx->log, "] and local work size [");
                    fprintf(ctx->log, "%zu", local_work_sizze_135610[0]);
                    fprintf(ctx->log,
                            "]; local memory parameters sum to %d bytes.\n",
                            (int) 0);
                    time_start_135607 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_119488,
                                                                1, NULL,
                                                                global_work_sizze_135606,
                                                                local_work_sizze_135610,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_119488_runs,
                                                                                                          &ctx->mainzisegmap_119488_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_135608 = get_wall_time();
                    
                    long time_diff_135609 = time_end_135608 - time_start_135607;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_119488", time_diff_135609);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int64_t segmap_usable_groups_119526 = sdiv_up64(m_114533,
                                                            segmap_group_sizze_119525);
            struct memblock_device mem_130532;
            
            mem_130532.references = NULL;
            if (memblock_alloc_device(ctx, &mem_130532, bytes_130100,
                                      "mem_130532")) {
                err = 1;
                goto cleanup;
            }
            
            struct memblock_device mem_130535;
            
            mem_130535.references = NULL;
            if (memblock_alloc_device(ctx, &mem_130535, bytes_130331,
                                      "mem_130535")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119467, 1,
                                                    sizeof(m_114533),
                                                    &m_114533));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119467, 2,
                                                    sizeof(min_res_114809),
                                                    &min_res_114809));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119467, 3,
                                                    sizeof(i64_res_114816),
                                                    &i64_res_114816));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119467, 4,
                                                    sizeof(defunc_3_map_res_mem_130117.mem),
                                                    &defunc_3_map_res_mem_130117.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119467, 5,
                                                    sizeof(mem_130532.mem),
                                                    &mem_130532.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119467, 6,
                                                    sizeof(mem_130535.mem),
                                                    &mem_130535.mem));
            if (1 * ((size_t) segmap_usable_groups_119526 *
                     (size_t) segmap_group_sizze_119525) != 0) {
                const size_t global_work_sizze_135611[1] =
                             {(size_t) segmap_usable_groups_119526 *
                             (size_t) segmap_group_sizze_119525};
                const size_t local_work_sizze_135615[1] =
                             {segmap_group_sizze_119525};
                int64_t time_start_135612 = 0, time_end_135613 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log, "Launching %s with global work size [",
                            "main.segmap_119467");
                    fprintf(ctx->log, "%zu", global_work_sizze_135611[0]);
                    fprintf(ctx->log, "] and local work size [");
                    fprintf(ctx->log, "%zu", local_work_sizze_135615[0]);
                    fprintf(ctx->log,
                            "]; local memory parameters sum to %d bytes.\n",
                            (int) 0);
                    time_start_135612 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_119467,
                                                                1, NULL,
                                                                global_work_sizze_135611,
                                                                local_work_sizze_135615,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_119467_runs,
                                                                                                          &ctx->mainzisegmap_119467_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_135613 = get_wall_time();
                    
                    long time_diff_135614 = time_end_135613 - time_start_135612;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_119467", time_diff_135614);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int64_t segmap_usable_groups_119538 = sdiv_up64(nest_sizze_119536,
                                                            segmap_group_sizze_119537);
            struct memblock_device defunc_3_map_res_mem_130592;
            
            defunc_3_map_res_mem_130592.references = NULL;
            
            struct memblock_device defunc_3_map_res_mem_130593;
            
            defunc_3_map_res_mem_130593.references = NULL;
            
            int32_t local_memory_capacity_132951;
            
            local_memory_capacity_132951 = ctx->opencl.max_local_memory;
            if (((sle64((int64_t) 0,
                        sext_i32_i64(local_memory_capacity_132951)) &&
                  sle64((int64_t) 0,
                        sext_i32_i64(local_memory_capacity_132951))) &&
                 sle64((int64_t) 0,
                       sext_i32_i64(local_memory_capacity_132951))) &&
                suff_outer_par_119541) {
                int64_t y_129116 = smod64(n_114534, t_n_m_114591);
                int64_t x_129117 = sub64(t_n_m_114591, y_129116);
                int64_t y_129118 = smod64(x_129117, t_n_m_114591);
                int64_t padded_sizze_129119 = add64(n_114534, y_129118);
                int64_t per_chunk_129121 = squot64(padded_sizze_129119,
                                                   t_n_m_114591);
                int64_t binop_x_130537 = m_114533 * y_129118;
                int64_t binop_y_130538 = (int64_t) 8 * binop_x_130537;
                int64_t bytes_130536 = smax64((int64_t) 0, binop_y_130538);
                struct memblock_device mem_130539;
                
                mem_130539.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130539, bytes_130536,
                                          "mem_130539")) {
                    err = 1;
                    goto cleanup;
                }
                
                int64_t binop_x_130541 = m_114533 * padded_sizze_129119;
                int64_t binop_y_130542 = (int64_t) 8 * binop_x_130541;
                int64_t bytes_130540 = smax64((int64_t) 0, binop_y_130542);
                struct memblock_device mem_130543;
                
                mem_130543.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130543, bytes_130540,
                                          "mem_130543")) {
                    err = 1;
                    goto cleanup;
                }
                
                int64_t tmp_offs_132815 = (int64_t) 0;
                int64_t group_sizze_132819;
                
                group_sizze_132819 = ctx->sizes.mainzigroup_sizze_132819;
                
                int64_t num_groups_132820 = sdiv_up64(m_114533 * n_114534,
                                                      group_sizze_132819);
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132816,
                                                        0, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132816,
                                                        1, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132816,
                                                        2,
                                                        sizeof(padded_sizze_129119),
                                                        &padded_sizze_129119));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132816,
                                                        3,
                                                        sizeof(tmp_offs_132815),
                                                        &tmp_offs_132815));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132816,
                                                        4,
                                                        sizeof(mem_130528.mem),
                                                        &mem_130528.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132816,
                                                        5,
                                                        sizeof(mem_130543.mem),
                                                        &mem_130543.mem));
                if (1 * ((size_t) num_groups_132820 *
                         (size_t) group_sizze_132819) != 0) {
                    const size_t global_work_sizze_135616[1] =
                                 {(size_t) num_groups_132820 *
                                 (size_t) group_sizze_132819};
                    const size_t local_work_sizze_135620[1] =
                                 {group_sizze_132819};
                    int64_t time_start_135617 = 0, time_end_135618 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.copy_132816");
                        fprintf(ctx->log, "%zu", global_work_sizze_135616[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135620[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_135617 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzicopy_132816,
                                                                    1, NULL,
                                                                    global_work_sizze_135616,
                                                                    local_work_sizze_135620,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzicopy_132816_runs,
                                                                                                              &ctx->mainzicopy_132816_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135618 = get_wall_time();
                        
                        long time_diff_135619 = time_end_135618 -
                             time_start_135617;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.copy_132816", time_diff_135619);
                    }
                }
                tmp_offs_132815 += n_114534;
                
                int64_t group_sizze_132824;
                
                group_sizze_132824 = ctx->sizes.mainzigroup_sizze_132824;
                
                int64_t num_groups_132825 = sdiv_up64(m_114533 * y_129118,
                                                      group_sizze_132824);
                
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132821,
                                                        0, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132821,
                                                        1, sizeof(y_129118),
                                                        &y_129118));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132821,
                                                        2,
                                                        sizeof(padded_sizze_129119),
                                                        &padded_sizze_129119));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132821,
                                                        3,
                                                        sizeof(tmp_offs_132815),
                                                        &tmp_offs_132815));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132821,
                                                        4,
                                                        sizeof(mem_130539.mem),
                                                        &mem_130539.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzicopy_132821,
                                                        5,
                                                        sizeof(mem_130543.mem),
                                                        &mem_130543.mem));
                if (1 * ((size_t) num_groups_132825 *
                         (size_t) group_sizze_132824) != 0) {
                    const size_t global_work_sizze_135621[1] =
                                 {(size_t) num_groups_132825 *
                                 (size_t) group_sizze_132824};
                    const size_t local_work_sizze_135625[1] =
                                 {group_sizze_132824};
                    int64_t time_start_135622 = 0, time_end_135623 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.copy_132821");
                        fprintf(ctx->log, "%zu", global_work_sizze_135621[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135625[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_135622 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzicopy_132821,
                                                                    1, NULL,
                                                                    global_work_sizze_135621,
                                                                    local_work_sizze_135625,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzicopy_132821_runs,
                                                                                                              &ctx->mainzicopy_132821_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135623 = get_wall_time();
                        
                        long time_diff_135624 = time_end_135623 -
                             time_start_135622;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.copy_132821", time_diff_135624);
                    }
                }
                tmp_offs_132815 += y_129118;
                if (memblock_unref_device(ctx, &mem_130539, "mem_130539") != 0)
                    return 1;
                
                int64_t binop_x_130545 = m_114533 * per_chunk_129121;
                int64_t binop_x_130546 = t_n_m_114591 * binop_x_130545;
                int64_t bytes_130544 = (int64_t) 8 * binop_x_130546;
                struct memblock_device mem_130547;
                
                mem_130547.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130547, bytes_130544,
                                          "mem_130547")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_i64(ctx, mem_130547,
                                                          (int64_t) 0,
                                                          mem_130543,
                                                          (int64_t) 0, m_114533,
                                                          per_chunk_129121,
                                                          t_n_m_114591) != 0) {
                    err = 1;
                    goto cleanup;
                }
                if (memblock_unref_device(ctx, &mem_130543, "mem_130543") != 0)
                    return 1;
                
                int64_t binop_y_130053 = t_n_m_114591 * per_chunk_129121;
                struct memblock_device mem_130552;
                
                mem_130552.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130552, bytes_130596,
                                          "mem_130552")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_130556;
                
                mem_130556.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130556, bytes_130601,
                                          "mem_130556")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        3, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        4, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        5,
                                                        sizeof(t_jump_114541),
                                                        &t_jump_114541));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        6, sizeof(t_n_m_114591),
                                                        &t_n_m_114591));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        7, sizeof(i_114610),
                                                        &i_114610));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        8, sizeof(x_114611),
                                                        &x_114611));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        9,
                                                        sizeof(min_res_114809),
                                                        &min_res_114809));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        10,
                                                        sizeof(empty_slice_114814),
                                                        &empty_slice_114814));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        11, sizeof(m_114815),
                                                        &m_114815));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        12,
                                                        sizeof(padded_sizze_129119),
                                                        &padded_sizze_129119));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        13,
                                                        sizeof(per_chunk_129121),
                                                        &per_chunk_129121));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        14,
                                                        sizeof(binop_y_130053),
                                                        &binop_y_130053));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        15,
                                                        sizeof(defunc_3_map_res_mem_130116.mem),
                                                        &defunc_3_map_res_mem_130116.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        16,
                                                        sizeof(defunc_3_map_res_mem_130117.mem),
                                                        &defunc_3_map_res_mem_130117.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        17,
                                                        sizeof(mem_130524.mem),
                                                        &mem_130524.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        18,
                                                        sizeof(mem_130528.mem),
                                                        &mem_130528.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        19,
                                                        sizeof(mem_130532.mem),
                                                        &mem_130532.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        20,
                                                        sizeof(mem_130535.mem),
                                                        &mem_130535.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        21,
                                                        sizeof(mem_130547.mem),
                                                        &mem_130547.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        22,
                                                        sizeof(mem_130552.mem),
                                                        &mem_130552.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119033,
                                                        23,
                                                        sizeof(mem_130556.mem),
                                                        &mem_130556.mem));
                if (1 * ((size_t) segmap_usable_groups_119538 *
                         (size_t) segmap_group_sizze_119537) != 0) {
                    const size_t global_work_sizze_135626[1] =
                                 {(size_t) segmap_usable_groups_119538 *
                                 (size_t) segmap_group_sizze_119537};
                    const size_t local_work_sizze_135630[1] =
                                 {segmap_group_sizze_119537};
                    int64_t time_start_135627 = 0, time_end_135628 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segmap_119033");
                        fprintf(ctx->log, "%zu", global_work_sizze_135626[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135630[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_135627 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_119033,
                                                                    1, NULL,
                                                                    global_work_sizze_135626,
                                                                    local_work_sizze_135630,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_119033_runs,
                                                                                                              &ctx->mainzisegmap_119033_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135628 = get_wall_time();
                        
                        long time_diff_135629 = time_end_135628 -
                             time_start_135627;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_119033", time_diff_135629);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_130547, "mem_130547") != 0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_3_map_res_mem_130592,
                                        &mem_130552, "mem_130552") != 0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_3_map_res_mem_130593,
                                        &mem_130556, "mem_130556") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130556, "mem_130556") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130552, "mem_130552") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130547, "mem_130547") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130543, "mem_130543") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130539, "mem_130539") != 0)
                    return 1;
            } else {
                int64_t segmap_usable_groups_119654 =
                        sdiv_up64(nest_sizze_119536, segmap_group_sizze_119653);
                struct memblock_device mem_130559;
                
                mem_130559.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130559, (int64_t) 0,
                                          "mem_130559")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_130563;
                
                mem_130563.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130563, bytes_130596,
                                          "mem_130563")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_130567;
                
                mem_130567.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130567, bytes_130596,
                                          "mem_130567")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_130571;
                
                mem_130571.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130571, bytes_130596,
                                          "mem_130571")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119275,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119275,
                                                        3, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119275,
                                                        4, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119275,
                                                        5,
                                                        sizeof(t_jump_114541),
                                                        &t_jump_114541));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119275,
                                                        6, sizeof(t_n_m_114591),
                                                        &t_n_m_114591));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119275,
                                                        7, sizeof(i_114610),
                                                        &i_114610));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119275,
                                                        8, sizeof(x_114611),
                                                        &x_114611));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119275,
                                                        9,
                                                        sizeof(min_res_114809),
                                                        &min_res_114809));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119275,
                                                        10,
                                                        sizeof(empty_slice_114814),
                                                        &empty_slice_114814));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119275,
                                                        11, sizeof(m_114815),
                                                        &m_114815));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119275,
                                                        12,
                                                        sizeof(mem_130524.mem),
                                                        &mem_130524.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119275,
                                                        13,
                                                        sizeof(mem_130559.mem),
                                                        &mem_130559.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119275,
                                                        14,
                                                        sizeof(mem_130563.mem),
                                                        &mem_130563.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119275,
                                                        15,
                                                        sizeof(mem_130567.mem),
                                                        &mem_130567.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119275,
                                                        16,
                                                        sizeof(mem_130571.mem),
                                                        &mem_130571.mem));
                if (1 * ((size_t) segmap_usable_groups_119654 *
                         (size_t) segmap_group_sizze_119653) != 0) {
                    const size_t global_work_sizze_135631[1] =
                                 {(size_t) segmap_usable_groups_119654 *
                                 (size_t) segmap_group_sizze_119653};
                    const size_t local_work_sizze_135635[1] =
                                 {segmap_group_sizze_119653};
                    int64_t time_start_135632 = 0, time_end_135633 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segmap_119275");
                        fprintf(ctx->log, "%zu", global_work_sizze_135631[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135635[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_135632 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_119275,
                                                                    1, NULL,
                                                                    global_work_sizze_135631,
                                                                    local_work_sizze_135635,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_119275_runs,
                                                                                                              &ctx->mainzisegmap_119275_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135633 = get_wall_time();
                        
                        long time_diff_135634 = time_end_135633 -
                             time_start_135632;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_119275", time_diff_135634);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_130563, "mem_130563") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130567, "mem_130567") != 0)
                    return 1;
                
                int64_t segmap_usable_groups_119701 =
                        sdiv_up64(nest_sizze_119699, segmap_group_sizze_119700);
                struct memblock_device mem_130577;
                
                mem_130577.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130577, bytes_130573,
                                          "mem_130577")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119259,
                                                        1, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119259,
                                                        2, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119259,
                                                        3, sizeof(t_n_m_114591),
                                                        &t_n_m_114591));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119259,
                                                        4,
                                                        sizeof(min_res_114809),
                                                        &min_res_114809));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119259,
                                                        5,
                                                        sizeof(mem_130528.mem),
                                                        &mem_130528.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119259,
                                                        6,
                                                        sizeof(mem_130559.mem),
                                                        &mem_130559.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119259,
                                                        7,
                                                        sizeof(mem_130571.mem),
                                                        &mem_130571.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119259,
                                                        8,
                                                        sizeof(mem_130577.mem),
                                                        &mem_130577.mem));
                if (1 * ((size_t) segmap_usable_groups_119701 *
                         (size_t) segmap_group_sizze_119700) != 0) {
                    const size_t global_work_sizze_135636[1] =
                                 {(size_t) segmap_usable_groups_119701 *
                                 (size_t) segmap_group_sizze_119700};
                    const size_t local_work_sizze_135640[1] =
                                 {segmap_group_sizze_119700};
                    int64_t time_start_135637 = 0, time_end_135638 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segmap_119259");
                        fprintf(ctx->log, "%zu", global_work_sizze_135636[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135640[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_135637 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_119259,
                                                                    1, NULL,
                                                                    global_work_sizze_135636,
                                                                    local_work_sizze_135640,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_119259_runs,
                                                                                                              &ctx->mainzisegmap_119259_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135638 = get_wall_time();
                        
                        long time_diff_135639 = time_end_135638 -
                             time_start_135637;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_119259", time_diff_135639);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_130559, "mem_130559") != 0)
                    return 1;
                
                struct memblock_device mem_130582;
                
                mem_130582.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130582, bytes_130596,
                                          "mem_130582")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64(min_res_114809 * (int64_t) 2,
                          segred_group_sizze_119713)) {
                    int64_t segment_sizze_nonzzero_132869 = smax64((int64_t) 1,
                                                                   min_res_114809);
                    int64_t num_threads_132870 = num_groups_119714 *
                            segred_group_sizze_119713;
                    
                    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_114533 * t_n_m_114591), '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) min_res_114809, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segments_per_group",
                                (long long) squot64(segred_group_sizze_119713,
                                                    segment_sizze_nonzzero_132869),
                                '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                (long long) sext_i64_i32(sdiv_up64(m_114533 *
                                                                   t_n_m_114591,
                                                                   squot64(segred_group_sizze_119713,
                                                                           segment_sizze_nonzzero_132869))),
                                '\n');
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119241,
                                                            1, (int64_t) 8 *
                                                            segred_group_sizze_119713,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119241,
                                                            2, sizeof(m_114533),
                                                            &m_114533));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119241,
                                                            3,
                                                            sizeof(t_jump_114541),
                                                            &t_jump_114541));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119241,
                                                            4,
                                                            sizeof(t_n_m_114591),
                                                            &t_n_m_114591));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119241,
                                                            5, sizeof(i_114610),
                                                            &i_114610));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119241,
                                                            6,
                                                            sizeof(min_res_114809),
                                                            &min_res_114809));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119241,
                                                            7,
                                                            sizeof(num_groups_119714),
                                                            &num_groups_119714));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119241,
                                                            8,
                                                            sizeof(segment_sizze_nonzzero_132869),
                                                            &segment_sizze_nonzzero_132869));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119241,
                                                            9,
                                                            sizeof(mem_130577.mem),
                                                            &mem_130577.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119241,
                                                            10,
                                                            sizeof(mem_130582.mem),
                                                            &mem_130582.mem));
                    if (1 * ((size_t) num_groups_119714 *
                             (size_t) segred_group_sizze_119713) != 0) {
                        const size_t global_work_sizze_135641[1] =
                                     {(size_t) num_groups_119714 *
                                     (size_t) segred_group_sizze_119713};
                        const size_t local_work_sizze_135645[1] =
                                     {segred_group_sizze_119713};
                        int64_t time_start_135642 = 0, time_end_135643 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [",
                                    "main.segred_small_119241");
                            fprintf(ctx->log, "%zu",
                                    global_work_sizze_135641[0]);
                            fprintf(ctx->log, "] and local work size [");
                            fprintf(ctx->log, "%zu",
                                    local_work_sizze_135645[0]);
                            fprintf(ctx->log,
                                    "]; local memory parameters sum to %d bytes.\n",
                                    (int) (0 + (int64_t) 8 *
                                           segred_group_sizze_119713));
                            time_start_135642 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_small_119241,
                                                                        1, NULL,
                                                                        global_work_sizze_135641,
                                                                        local_work_sizze_135645,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_small_119241_runs,
                                                                                                                  &ctx->mainzisegred_small_119241_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_135643 = get_wall_time();
                            
                            long time_diff_135644 = time_end_135643 -
                                 time_start_135642;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_small_119241",
                                    time_diff_135644);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                } else {
                    int64_t groups_per_segment_132894 =
                            sdiv_up64(num_groups_119714, smax64((int64_t) 1,
                                                                m_114533 *
                                                                t_n_m_114591));
                    int64_t elements_per_thread_132895 =
                            sdiv_up64(min_res_114809,
                                      segred_group_sizze_119713 *
                                      groups_per_segment_132894);
                    int64_t virt_num_groups_132896 = groups_per_segment_132894 *
                            (m_114533 * t_n_m_114591);
                    int64_t num_threads_132897 = num_groups_119714 *
                            segred_group_sizze_119713;
                    int64_t threads_per_segment_132898 =
                            groups_per_segment_132894 *
                            segred_group_sizze_119713;
                    
                    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_114533 * t_n_m_114591), '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) min_res_114809, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                (long long) virt_num_groups_132896, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                (long long) num_groups_119714, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "group_size",
                                (long long) segred_group_sizze_119713, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                (long long) elements_per_thread_132895, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                                (long long) groups_per_segment_132894, '\n');
                    
                    struct memblock_device segred_tmp_mem_132899;
                    
                    segred_tmp_mem_132899.references = NULL;
                    if (memblock_alloc_device(ctx, &segred_tmp_mem_132899,
                                              (int64_t) 8 *
                                              virt_num_groups_132896,
                                              "segred_tmp_mem_132899")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mainzicounter_mem_132901 =
                                           ctx->mainzicounter_mem_132901;
                    
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119241,
                                                            1, 1, NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119241,
                                                            2, (int64_t) 8 *
                                                            segred_group_sizze_119713,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119241,
                                                            3, sizeof(m_114533),
                                                            &m_114533));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119241,
                                                            4,
                                                            sizeof(t_jump_114541),
                                                            &t_jump_114541));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119241,
                                                            5,
                                                            sizeof(t_n_m_114591),
                                                            &t_n_m_114591));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119241,
                                                            6, sizeof(i_114610),
                                                            &i_114610));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119241,
                                                            7,
                                                            sizeof(min_res_114809),
                                                            &min_res_114809));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119241,
                                                            8,
                                                            sizeof(num_groups_119714),
                                                            &num_groups_119714));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119241,
                                                            9,
                                                            sizeof(groups_per_segment_132894),
                                                            &groups_per_segment_132894));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119241,
                                                            10,
                                                            sizeof(elements_per_thread_132895),
                                                            &elements_per_thread_132895));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119241,
                                                            11,
                                                            sizeof(virt_num_groups_132896),
                                                            &virt_num_groups_132896));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119241,
                                                            12,
                                                            sizeof(threads_per_segment_132898),
                                                            &threads_per_segment_132898));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119241,
                                                            13,
                                                            sizeof(mem_130577.mem),
                                                            &mem_130577.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119241,
                                                            14,
                                                            sizeof(mem_130582.mem),
                                                            &mem_130582.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119241,
                                                            15,
                                                            sizeof(segred_tmp_mem_132899.mem),
                                                            &segred_tmp_mem_132899.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119241,
                                                            16,
                                                            sizeof(mainzicounter_mem_132901.mem),
                                                            &mainzicounter_mem_132901.mem));
                    if (1 * ((size_t) num_groups_119714 *
                             (size_t) segred_group_sizze_119713) != 0) {
                        const size_t global_work_sizze_135647[1] =
                                     {(size_t) num_groups_119714 *
                                     (size_t) segred_group_sizze_119713};
                        const size_t local_work_sizze_135651[1] =
                                     {segred_group_sizze_119713};
                        int64_t time_start_135648 = 0, time_end_135649 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [",
                                    "main.segred_large_119241");
                            fprintf(ctx->log, "%zu",
                                    global_work_sizze_135647[0]);
                            fprintf(ctx->log, "] and local work size [");
                            fprintf(ctx->log, "%zu",
                                    local_work_sizze_135651[0]);
                            fprintf(ctx->log,
                                    "]; local memory parameters sum to %d bytes.\n",
                                    (int) (0 + 1 + (int64_t) 8 *
                                           segred_group_sizze_119713));
                            time_start_135648 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_large_119241,
                                                                        1, NULL,
                                                                        global_work_sizze_135647,
                                                                        local_work_sizze_135651,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_large_119241_runs,
                                                                                                                  &ctx->mainzisegred_large_119241_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_135649 = get_wall_time();
                            
                            long time_diff_135650 = time_end_135649 -
                                 time_start_135648;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_large_119241",
                                    time_diff_135650);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &segred_tmp_mem_132899,
                                              "segred_tmp_mem_132899") != 0)
                        return 1;
                }
                if (memblock_unref_device(ctx, &mem_130577, "mem_130577") != 0)
                    return 1;
                
                int64_t segmap_usable_groups_119730 =
                        sdiv_up64(nest_sizze_119536, segmap_group_sizze_119729);
                struct memblock_device mem_130587;
                
                mem_130587.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130587, bytes_130601,
                                          "mem_130587")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_130591;
                
                mem_130591.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130591, bytes_130596,
                                          "mem_130591")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119159,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119159,
                                                        3, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119159,
                                                        4, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119159,
                                                        5,
                                                        sizeof(t_jump_114541),
                                                        &t_jump_114541));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119159,
                                                        6, sizeof(t_n_m_114591),
                                                        &t_n_m_114591));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119159,
                                                        7, sizeof(i_114610),
                                                        &i_114610));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119159,
                                                        8,
                                                        sizeof(min_res_114809),
                                                        &min_res_114809));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119159,
                                                        9,
                                                        sizeof(defunc_3_map_res_mem_130116.mem),
                                                        &defunc_3_map_res_mem_130116.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119159,
                                                        10,
                                                        sizeof(defunc_3_map_res_mem_130117.mem),
                                                        &defunc_3_map_res_mem_130117.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119159,
                                                        11,
                                                        sizeof(mem_130528.mem),
                                                        &mem_130528.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119159,
                                                        12,
                                                        sizeof(mem_130532.mem),
                                                        &mem_130532.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119159,
                                                        13,
                                                        sizeof(mem_130535.mem),
                                                        &mem_130535.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119159,
                                                        14,
                                                        sizeof(mem_130571.mem),
                                                        &mem_130571.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119159,
                                                        15,
                                                        sizeof(mem_130582.mem),
                                                        &mem_130582.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119159,
                                                        16,
                                                        sizeof(mem_130587.mem),
                                                        &mem_130587.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119159,
                                                        17,
                                                        sizeof(mem_130591.mem),
                                                        &mem_130591.mem));
                if (1 * ((size_t) segmap_usable_groups_119730 *
                         (size_t) segmap_group_sizze_119729) != 0) {
                    const size_t global_work_sizze_135652[1] =
                                 {(size_t) segmap_usable_groups_119730 *
                                 (size_t) segmap_group_sizze_119729};
                    const size_t local_work_sizze_135656[1] =
                                 {segmap_group_sizze_119729};
                    int64_t time_start_135653 = 0, time_end_135654 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segmap_119159");
                        fprintf(ctx->log, "%zu", global_work_sizze_135652[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135656[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_135653 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_119159,
                                                                    1, NULL,
                                                                    global_work_sizze_135652,
                                                                    local_work_sizze_135656,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_119159_runs,
                                                                                                              &ctx->mainzisegmap_119159_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135654 = get_wall_time();
                        
                        long time_diff_135655 = time_end_135654 -
                             time_start_135653;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_119159", time_diff_135655);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_130571, "mem_130571") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130582, "mem_130582") != 0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_3_map_res_mem_130592,
                                        &mem_130591, "mem_130591") != 0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_3_map_res_mem_130593,
                                        &mem_130587, "mem_130587") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130591, "mem_130591") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130587, "mem_130587") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130582, "mem_130582") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130577, "mem_130577") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130571, "mem_130571") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130567, "mem_130567") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130563, "mem_130563") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130559, "mem_130559") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &mem_130524, "mem_130524") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130528, "mem_130528") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130532, "mem_130532") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130535, "mem_130535") != 0)
                return 1;
            if (memblock_set_device(ctx, &defunc_3_map_res_mem_130594,
                                    &defunc_3_map_res_mem_130592,
                                    "defunc_3_map_res_mem_130592") != 0)
                return 1;
            if (memblock_set_device(ctx, &defunc_3_map_res_mem_130595,
                                    &defunc_3_map_res_mem_130593,
                                    "defunc_3_map_res_mem_130593") != 0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130593,
                                      "defunc_3_map_res_mem_130593") != 0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130592,
                                      "defunc_3_map_res_mem_130592") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130535, "mem_130535") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130532, "mem_130532") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130528, "mem_130528") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_130524, "mem_130524") != 0)
                return 1;
        }
        if (memblock_set_device(ctx, &defunc_3_map_res_mem_130606,
                                &defunc_3_map_res_mem_130594,
                                "defunc_3_map_res_mem_130594") != 0)
            return 1;
        if (memblock_set_device(ctx, &defunc_3_map_res_mem_130607,
                                &defunc_3_map_res_mem_130595,
                                "defunc_3_map_res_mem_130595") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130595,
                                  "defunc_3_map_res_mem_130595") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130594,
                                  "defunc_3_map_res_mem_130594") != 0)
            return 1;
    }
    
    bool bounds_invalid_upwards_114936 = slt64(nest_sizze_116859, (int64_t) 0);
    bool valid_114937 = !bounds_invalid_upwards_114936;
    bool range_valid_c_114938;
    
    if (!valid_114937) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (int64_t) 0, "..", (int64_t) 1, "..<",
                               nest_sizze_116859, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:108:18-23\n   #2  stl.fut:177:20-46\n   #3  stl.fut:394:3-405:33\n   #4  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130607,
                                  "defunc_3_map_res_mem_130607") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130606,
                                  "defunc_3_map_res_mem_130606") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130405,
                                  "defunc_3_map_res_mem_130405") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130404,
                                  "defunc_3_map_res_mem_130404") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130203,
                                  "defunc_3_map_res_mem_130203") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130127, "mem_130127") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130122, "mem_130122") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                                  "defunc_3_map_res_mem_130117") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                                  "defunc_3_map_res_mem_130116") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    struct memblock_device mem_130611;
    
    mem_130611.references = NULL;
    if (memblock_alloc_device(ctx, &mem_130611, bytes_130119, "mem_130611")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f32(ctx, mem_130611, m_114533 * n_114534,
                                      0.0F) != 0) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_130615;
    
    mem_130615.references = NULL;
    if (memblock_alloc_device(ctx, &mem_130615, bytes_130119, "mem_130615")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhreplicate_f32(ctx, mem_130615, m_114533 * n_114534,
                                      1.0F) != 0) {
        err = 1;
        goto cleanup;
    }
    
    bool cond_114941 = slt64((int64_t) 1, l_jump_114542);
    bool cond_114942 = slt64((int64_t) 1, t_jump_114541);
    int64_t y_114943 = sub64(outer_114544, (int64_t) 1);
    bool loop_nonempty_114944 = slt64((int64_t) 0, outer_114544);
    bool bounds_invalid_upwards_114945 = slt64(C_len_114582, (int64_t) 0);
    bool valid_114946 = !bounds_invalid_upwards_114945;
    bool loop_not_taken_114947 = !assert_cond_114571;
    bool protect_assert_disj_114948 = valid_114946 || loop_not_taken_114947;
    bool loop_not_taken_114949 = !loop_nonempty_114944;
    bool protect_assert_disj_114950 = protect_assert_disj_114948 ||
         loop_not_taken_114949;
    bool range_valid_c_114951;
    
    if (!protect_assert_disj_114950) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (int64_t) 0, "..", (int64_t) 1, "..<",
                               C_len_114582, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  stl.fut:217:21-60\n   #3  stl.fut:215:13-218:24\n   #4  stl.fut:394:3-405:33\n   #5  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &mem_130615, "mem_130615") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130611, "mem_130611") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130607,
                                  "defunc_3_map_res_mem_130607") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130606,
                                  "defunc_3_map_res_mem_130606") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130405,
                                  "defunc_3_map_res_mem_130405") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130404,
                                  "defunc_3_map_res_mem_130404") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130203,
                                  "defunc_3_map_res_mem_130203") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130127, "mem_130127") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130122, "mem_130122") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                                  "defunc_3_map_res_mem_130117") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                                  "defunc_3_map_res_mem_130116") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    bool zzero_114953 = n_p_114536 == (int64_t) 0;
    bool nonzzero_114954 = !zzero_114953;
    bool protect_assert_disj_114955 = loop_not_taken_114947 || nonzzero_114954;
    bool protect_assert_disj_114956 = loop_not_taken_114949 ||
         protect_assert_disj_114955;
    bool nonzzero_cert_114957;
    
    if (!protect_assert_disj_114956) {
        ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                               "division by zero",
                               "-> #0  stl.fut:217:52-58\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:217:21-60\n   #4  stl.fut:215:13-218:24\n   #5  stl.fut:394:3-405:33\n   #6  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &mem_130615, "mem_130615") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130611, "mem_130611") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130607,
                                  "defunc_3_map_res_mem_130607") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130606,
                                  "defunc_3_map_res_mem_130606") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130405,
                                  "defunc_3_map_res_mem_130405") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130404,
                                  "defunc_3_map_res_mem_130404") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130203,
                                  "defunc_3_map_res_mem_130203") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130127, "mem_130127") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130122, "mem_130122") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                                  "defunc_3_map_res_mem_130117") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                                  "defunc_3_map_res_mem_130116") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    int64_t x_114958 = add64(n_114534, n_p_114536);
    int64_t lifted_single_ma_arg_114959 = add64((int64_t) 1, x_114958);
    int64_t m_114960 = sub64(n_p_114536, (int64_t) 1);
    bool zzero_leq_i_p_m_t_s_114961 = sle64((int64_t) 0, m_114960);
    bool i_p_m_t_s_leq_w_114962 = slt64(m_114960, C_len_114582);
    bool i_lte_j_114963 = sle64((int64_t) 0, n_p_114536);
    bool y_114964 = zzero_leq_i_p_m_t_s_114961 && i_p_m_t_s_leq_w_114962;
    bool y_114965 = i_lte_j_114963 && y_114964;
    bool ok_or_empty_114966 = zzero_114953 || y_114965;
    bool protect_assert_disj_114967 = loop_not_taken_114947 ||
         ok_or_empty_114966;
    bool protect_assert_disj_114968 = loop_not_taken_114949 ||
         protect_assert_disj_114967;
    bool index_certs_114969;
    
    if (!protect_assert_disj_114968) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", n_p_114536,
                               "] out of bounds for array of shape [",
                               C_len_114582, "].",
                               "-> #0  stl.fut:30:24-30\n   #1  stl.fut:43:3-32\n   #2  stl.fut:223:30-50\n   #3  stl.fut:222:23-224:31\n   #4  stl.fut:394:3-405:33\n   #5  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &mem_130615, "mem_130615") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130611, "mem_130611") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130607,
                                  "defunc_3_map_res_mem_130607") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130606,
                                  "defunc_3_map_res_mem_130606") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130405,
                                  "defunc_3_map_res_mem_130405") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130404,
                                  "defunc_3_map_res_mem_130404") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130203,
                                  "defunc_3_map_res_mem_130203") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130127, "mem_130127") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130122, "mem_130122") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                                  "defunc_3_map_res_mem_130117") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                                  "defunc_3_map_res_mem_130116") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    bool bounds_invalid_upwards_114970 = slt64(lifted_single_ma_arg_114959,
                                               (int64_t) 0);
    bool valid_114971 = !bounds_invalid_upwards_114970;
    bool protect_assert_disj_114972 = loop_not_taken_114947 || valid_114971;
    bool protect_assert_disj_114973 = loop_not_taken_114949 ||
         protect_assert_disj_114972;
    bool range_valid_c_114974;
    
    if (!protect_assert_disj_114973) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (int64_t) 0, "..", (int64_t) 1, "..<",
                               lifted_single_ma_arg_114959, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  stl.fut:33:9-39:16\n   #3  stl.fut:43:3-32\n   #4  stl.fut:223:30-50\n   #5  stl.fut:222:23-224:31\n   #6  stl.fut:394:3-405:33\n   #7  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &mem_130615, "mem_130615") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130611, "mem_130611") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130607,
                                  "defunc_3_map_res_mem_130607") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130606,
                                  "defunc_3_map_res_mem_130606") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130405,
                                  "defunc_3_map_res_mem_130405") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130404,
                                  "defunc_3_map_res_mem_130404") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130203,
                                  "defunc_3_map_res_mem_130203") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130127, "mem_130127") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130122, "mem_130122") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                                  "defunc_3_map_res_mem_130117") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                                  "defunc_3_map_res_mem_130116") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    int64_t lifted_single_ma_arg_114976 = add64((int64_t) 2, n_114534);
    bool i_p_m_t_s_leq_w_114977 = slt64(m_114960, lifted_single_ma_arg_114959);
    bool y_114978 = zzero_leq_i_p_m_t_s_114961 && i_p_m_t_s_leq_w_114977;
    bool y_114979 = i_lte_j_114963 && y_114978;
    bool ok_or_empty_114980 = zzero_114953 || y_114979;
    bool protect_assert_disj_114981 = loop_not_taken_114947 ||
         ok_or_empty_114980;
    bool protect_assert_disj_114982 = loop_not_taken_114949 ||
         protect_assert_disj_114981;
    bool index_certs_114983;
    
    if (!protect_assert_disj_114982) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", n_p_114536,
                               "] out of bounds for array of shape [",
                               lifted_single_ma_arg_114959, "].",
                               "-> #0  stl.fut:30:24-30\n   #1  /prelude/functional.fut:9:42-44\n   #2  stl.fut:43:3-58\n   #3  stl.fut:223:30-50\n   #4  stl.fut:222:23-224:31\n   #5  stl.fut:394:3-405:33\n   #6  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &mem_130615, "mem_130615") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130611, "mem_130611") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130607,
                                  "defunc_3_map_res_mem_130607") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130606,
                                  "defunc_3_map_res_mem_130606") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130405,
                                  "defunc_3_map_res_mem_130405") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130404,
                                  "defunc_3_map_res_mem_130404") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130203,
                                  "defunc_3_map_res_mem_130203") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130127, "mem_130127") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130122, "mem_130122") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                                  "defunc_3_map_res_mem_130117") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                                  "defunc_3_map_res_mem_130116") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    bool bounds_invalid_upwards_114984 = slt64(lifted_single_ma_arg_114976,
                                               (int64_t) 0);
    bool valid_114985 = !bounds_invalid_upwards_114984;
    bool protect_assert_disj_114986 = loop_not_taken_114947 || valid_114985;
    bool protect_assert_disj_114987 = loop_not_taken_114949 ||
         protect_assert_disj_114986;
    bool range_valid_c_114988;
    
    if (!protect_assert_disj_114987) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Range ", (int64_t) 0, "..", (int64_t) 1, "..<",
                               lifted_single_ma_arg_114976, " is invalid.",
                               "-> #0  /prelude/array.fut:90:3-10\n   #1  /prelude/array.fut:195:11-16\n   #2  stl.fut:33:9-39:16\n   #3  /prelude/functional.fut:9:42-44\n   #4  stl.fut:43:3-58\n   #5  stl.fut:223:30-50\n   #6  stl.fut:222:23-224:31\n   #7  stl.fut:394:3-405:33\n   #8  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &mem_130615, "mem_130615") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130611, "mem_130611") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130607,
                                  "defunc_3_map_res_mem_130607") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130606,
                                  "defunc_3_map_res_mem_130606") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130405,
                                  "defunc_3_map_res_mem_130405") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130404,
                                  "defunc_3_map_res_mem_130404") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130203,
                                  "defunc_3_map_res_mem_130203") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130127, "mem_130127") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130122, "mem_130122") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                                  "defunc_3_map_res_mem_130117") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                                  "defunc_3_map_res_mem_130116") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    bool i_p_m_t_s_leq_w_114990 = slt64((int64_t) 2,
                                        lifted_single_ma_arg_114976);
    bool protect_assert_disj_114991 = loop_not_taken_114947 ||
         i_p_m_t_s_leq_w_114990;
    bool protect_assert_disj_114992 = loop_not_taken_114949 ||
         protect_assert_disj_114991;
    bool index_certs_114993;
    
    if (!protect_assert_disj_114992) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [:", (int64_t) 3,
                               "] out of bounds for array of shape [",
                               lifted_single_ma_arg_114976, "].",
                               "-> #0  stl.fut:30:24-30\n   #1  /prelude/functional.fut:9:42-44\n   #2  stl.fut:43:3-76\n   #3  stl.fut:223:30-50\n   #4  stl.fut:222:23-224:31\n   #5  stl.fut:394:3-405:33\n   #6  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &mem_130615, "mem_130615") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130611, "mem_130611") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130607,
                                  "defunc_3_map_res_mem_130607") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130606,
                                  "defunc_3_map_res_mem_130606") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130405,
                                  "defunc_3_map_res_mem_130405") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130404,
                                  "defunc_3_map_res_mem_130404") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130203,
                                  "defunc_3_map_res_mem_130203") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130127, "mem_130127") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130122, "mem_130122") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                                  "defunc_3_map_res_mem_130117") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                                  "defunc_3_map_res_mem_130116") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    bool empty_slice_114994 = n_114534 == (int64_t) 0;
    int64_t i_p_m_t_s_114995 = add64(n_p_114536, i_114610);
    bool zzero_leq_i_p_m_t_s_114996 = sle64((int64_t) 0, i_p_m_t_s_114995);
    bool i_p_m_t_s_leq_w_114997 = slt64(i_p_m_t_s_114995, C_len_114582);
    bool i_lte_j_114998 = sle64(n_p_114536, x_114958);
    bool y_114999 = i_lte_j_114963 && i_p_m_t_s_leq_w_114997;
    bool y_115000 = zzero_leq_i_p_m_t_s_114996 && y_114999;
    bool y_115001 = i_lte_j_114998 && y_115000;
    bool forwards_ok_115002 = i_lte_j_114963 && y_115001;
    bool ok_or_empty_115003 = empty_slice_114994 || forwards_ok_115002;
    bool protect_assert_disj_115004 = loop_not_taken_114947 ||
         ok_or_empty_115003;
    bool protect_assert_disj_115005 = loop_not_taken_114949 ||
         protect_assert_disj_115004;
    bool index_certs_115006;
    
    if (!protect_assert_disj_115005) {
        ctx->error = msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                               "Index [", n_p_114536, ":", x_114958,
                               "] out of bounds for array of shape [",
                               C_len_114582, "].",
                               "-> #0  stl.fut:262:35-50\n   #1  /prelude/soacs.fut:67:19-23\n   #2  /prelude/soacs.fut:67:3-37\n   #3  stl.fut:260:13-265:26\n   #4  stl.fut:394:3-405:33\n   #5  stl.fut:381:1-405:33\n");
        if (memblock_unref_device(ctx, &mem_130615, "mem_130615") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130611, "mem_130611") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130607,
                                  "defunc_3_map_res_mem_130607") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130606,
                                  "defunc_3_map_res_mem_130606") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130405,
                                  "defunc_3_map_res_mem_130405") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130404,
                                  "defunc_3_map_res_mem_130404") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130203,
                                  "defunc_3_map_res_mem_130203") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130127, "mem_130127") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_130122, "mem_130122") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                                  "defunc_3_map_res_mem_130117") != 0)
            return 1;
        if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                                  "defunc_3_map_res_mem_130116") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
            return 1;
        if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
            return 1;
        return 1;
    }
    
    int64_t j_m_i_115007 = sub64(stl_res_114605, stl_res_114604);
    bool cond_115008 = slt64(l_jump_114542, jump_threshold_114545);
    bool cond_f_res_115009 = slt64(max_group_sizze_114546, l_window_114538);
    bool x_115010 = !cond_115008;
    bool y_115011 = cond_f_res_115009 && x_115010;
    bool cond_115012 = cond_115008 || y_115011;
    bool cond_115013 = slt64(t_jump_114541, jump_threshold_114545);
    bool cond_f_res_115014 = slt64(max_group_sizze_114546, t_window_114537);
    bool x_115015 = !cond_115013;
    bool y_115016 = cond_f_res_115014 && x_115015;
    bool cond_115017 = cond_115013 || y_115016;
    int64_t segmap_group_sizze_119835;
    
    segmap_group_sizze_119835 = ctx->sizes.mainzisegmap_group_sizze_119815;
    
    int64_t segmap_usable_groups_119836 = sdiv_up_safe64(nest_sizze_116859,
                                                         segmap_group_sizze_119835);
    bool suff_outer_par_119843;
    
    suff_outer_par_119843 = ctx->sizes.mainzisuff_outer_par_9 <= m_114533;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_9",
                (long) m_114533, suff_outer_par_119843 ? "true" : "false");
    
    int64_t segmap_group_sizze_119872;
    
    segmap_group_sizze_119872 = ctx->sizes.mainzisegmap_group_sizze_119847;
    
    int64_t num_groups_119873;
    int32_t max_num_groups_132963;
    
    max_num_groups_132963 = ctx->sizes.mainzisegmap_num_groups_119849;
    num_groups_119873 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(m_114533,
                                                             segmap_group_sizze_119872),
                                                   sext_i32_i64(max_num_groups_132963))));
    
    bool suff_outer_par_119999;
    
    suff_outer_par_119999 = ctx->sizes.mainzisuff_outer_par_10 <=
        comparatee_117148;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_10",
                (long) comparatee_117148,
                suff_outer_par_119999 ? "true" : "false");
    
    int64_t segred_group_sizze_120022;
    
    segred_group_sizze_120022 = ctx->sizes.mainzisegred_group_sizze_119942;
    
    int64_t num_groups_120023;
    int32_t max_num_groups_132964;
    
    max_num_groups_132964 = ctx->sizes.mainzisegred_num_groups_119944;
    num_groups_120023 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_117172,
                                                             segred_group_sizze_120022),
                                                   sext_i32_i64(max_num_groups_132964))));
    
    int64_t segmap_group_sizze_120042;
    
    segmap_group_sizze_120042 = ctx->sizes.mainzisegmap_group_sizze_119931;
    
    int64_t nest_sizze_120092 = m_114533 * C_len_114582;
    int64_t segmap_group_sizze_120093;
    
    segmap_group_sizze_120093 = ctx->sizes.mainzisegmap_group_sizze_120063;
    
    int64_t segmap_usable_groups_120094 = sdiv_up_safe64(nest_sizze_120092,
                                                         segmap_group_sizze_120093);
    bool suff_outer_par_120131;
    
    suff_outer_par_120131 = ctx->sizes.mainzisuff_outer_par_11 <= m_114533;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_outer_par_11",
                (long) m_114533, suff_outer_par_120131 ? "true" : "false");
    
    int64_t y_120120 = smin64((int64_t) 3, lifted_single_ma_arg_114976);
    int64_t y_120121 = smin64(lifted_single_ma_arg_114959, y_120120);
    int64_t y_120122 = smin64(n_p_114536, y_120121);
    int64_t intra_avail_par_120123 = smin64(n_114534, y_120122);
    int64_t y_120124 = smax64((int64_t) 3, lifted_single_ma_arg_114976);
    int64_t y_120125 = smax64(lifted_single_ma_arg_114959, y_120124);
    int64_t y_120126 = smax64(n_p_114536, y_120125);
    int64_t computed_group_sizze_120107 = smax64(n_114534, y_120126);
    bool fits_120324 = sle64(computed_group_sizze_120107,
                             max_group_sizze_116766);
    bool suff_intra_par_120322;
    
    suff_intra_par_120322 = ctx->sizes.mainzisuff_intra_par_12 <=
        intra_avail_par_120123;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_12",
                (long) intra_avail_par_120123,
                suff_intra_par_120322 ? "true" : "false");
    
    bool intra_suff_and_fits_120325 = suff_intra_par_120322 && fits_120324;
    int64_t segmap_group_sizze_120229;
    
    segmap_group_sizze_120229 = ctx->sizes.mainzisegmap_group_sizze_120135;
    
    int64_t num_groups_120230;
    int32_t max_num_groups_132965;
    
    max_num_groups_132965 = ctx->sizes.mainzisegmap_num_groups_120137;
    num_groups_120230 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(m_114533,
                                                             segmap_group_sizze_120229),
                                                   sext_i32_i64(max_num_groups_132965))));
    
    int64_t segred_group_sizze_120595;
    
    segred_group_sizze_120595 = ctx->sizes.mainzisegred_group_sizze_120581;
    
    int64_t num_groups_120596;
    int32_t max_num_groups_132966;
    
    max_num_groups_132966 = ctx->sizes.mainzisegred_num_groups_120583;
    num_groups_120596 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(comparatee_117148,
                                                             segred_group_sizze_120595),
                                                   sext_i32_i64(max_num_groups_132966))));
    
    int64_t nest_sizze_120605 = m_114533 * lifted_single_ma_arg_114959;
    int64_t segscan_group_sizze_120606;
    
    segscan_group_sizze_120606 = ctx->sizes.mainzisegscan_group_sizze_120547;
    
    int64_t num_groups_120607;
    int32_t max_num_groups_132967;
    
    max_num_groups_132967 = ctx->sizes.mainzisegscan_num_groups_120549;
    num_groups_120607 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_120605,
                                                             segscan_group_sizze_120606),
                                                   sext_i32_i64(max_num_groups_132967))));
    
    int64_t segred_group_sizze_120643;
    
    segred_group_sizze_120643 = ctx->sizes.mainzisegred_group_sizze_120520;
    
    int64_t num_groups_120644;
    int32_t max_num_groups_132968;
    
    max_num_groups_132968 = ctx->sizes.mainzisegred_num_groups_120522;
    num_groups_120644 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(comparatee_117148,
                                                             segred_group_sizze_120643),
                                                   sext_i32_i64(max_num_groups_132968))));
    
    int64_t nest_sizze_120653 = m_114533 * lifted_single_ma_arg_114976;
    int64_t segscan_group_sizze_120654;
    
    segscan_group_sizze_120654 = ctx->sizes.mainzisegscan_group_sizze_120485;
    
    int64_t num_groups_120655;
    int32_t max_num_groups_132969;
    
    max_num_groups_132969 = ctx->sizes.mainzisegscan_num_groups_120487;
    num_groups_120655 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_120653,
                                                             segscan_group_sizze_120654),
                                                   sext_i32_i64(max_num_groups_132969))));
    
    int64_t nest_sizze_120690 = (int64_t) 3 * m_114533;
    int64_t segred_group_sizze_120691;
    
    segred_group_sizze_120691 = ctx->sizes.mainzisegred_group_sizze_120457;
    
    int64_t num_groups_120692;
    int32_t max_num_groups_132970;
    
    max_num_groups_132970 = ctx->sizes.mainzisegred_num_groups_120459;
    num_groups_120692 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_120690,
                                                             segred_group_sizze_120691),
                                                   sext_i32_i64(max_num_groups_132970))));
    
    int64_t segscan_group_sizze_120702;
    
    segscan_group_sizze_120702 = ctx->sizes.mainzisegscan_group_sizze_120422;
    
    int64_t num_groups_120703;
    int32_t max_num_groups_132971;
    
    max_num_groups_132971 = ctx->sizes.mainzisegscan_num_groups_120424;
    num_groups_120703 = sext_i64_i32(smax64((int64_t) 1,
                                            smin64(sdiv_up64(nest_sizze_116859,
                                                             segscan_group_sizze_120702),
                                                   sext_i32_i64(max_num_groups_132971))));
    
    int64_t segmap_group_sizze_120788;
    
    segmap_group_sizze_120788 = ctx->sizes.mainzisegmap_group_sizze_120745;
    
    int64_t segmap_usable_groups_120789 = sdiv_up_safe64(nest_sizze_116859,
                                                         segmap_group_sizze_120788);
    int64_t segmap_group_sizze_124139;
    
    segmap_group_sizze_124139 = ctx->sizes.mainzisegmap_group_sizze_124119;
    
    int64_t segmap_usable_groups_124140 = sdiv_up_safe64(nest_sizze_116859,
                                                         segmap_group_sizze_124139);
    bool suff_intra_par_124168;
    
    suff_intra_par_124168 = ctx->sizes.mainzisuff_intra_par_19 <= n_114534;
    if (ctx->logging)
        fprintf(ctx->log, "Compared %s <= %ld: %s.\n", "main.suff_intra_par_19",
                (long) n_114534, suff_intra_par_124168 ? "true" : "false");
    
    bool intra_suff_and_fits_124171 = fits_116767 && suff_intra_par_124168;
    int64_t segmap_group_sizze_124262;
    
    segmap_group_sizze_124262 = ctx->sizes.mainzisegmap_group_sizze_124242;
    
    int64_t segmap_group_sizze_124275;
    
    segmap_group_sizze_124275 = ctx->sizes.mainzisegmap_group_sizze_124205;
    
    int64_t segmap_usable_groups_120043 = sdiv_up_safe64(comparatee_117148,
                                                         segmap_group_sizze_120042);
    int64_t segmap_usable_groups_124263 = sdiv_up_safe64(nest_sizze_116859,
                                                         segmap_group_sizze_124262);
    int64_t segmap_usable_groups_124276 = sdiv_up_safe64(nest_sizze_116859,
                                                         segmap_group_sizze_124275);
    struct memblock_device mem_130618;
    
    mem_130618.references = NULL;
    if (memblock_alloc_device(ctx, &mem_130618, bytes_130147, "mem_130618")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_130618, (int64_t) 0,
                                              defunc_3_map_res_mem_130203,
                                              (int64_t) 0, (int64_t) 1,
                                              n_p_114536, m_114533) != 0) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_130621;
    
    mem_130621.references = NULL;
    if (memblock_alloc_device(ctx, &mem_130621, binop_y_130126, "mem_130621")) {
        err = 1;
        goto cleanup;
    }
    if (futrts_builtinzhgpu_map_transpose_i64(ctx, mem_130621, (int64_t) 0,
                                              mem_130127, (int64_t) 0,
                                              (int64_t) 1, css_chunk_len_114580,
                                              n_p_114536) != 0) {
        err = 1;
        goto cleanup;
    }
    
    int64_t tile_sizze_129542;
    
    tile_sizze_129542 = ctx->sizes.mainzitile_sizze_129541;
    
    int64_t group_sizze_129543 = tile_sizze_129542 * tile_sizze_129542;
    int64_t num_groups_x_129544 = sdiv_up_safe64(m_114533, tile_sizze_129542);
    int64_t num_groups_y_129545 = sdiv_up_safe64(n_p_114536, tile_sizze_129542);
    int64_t num_groups_top_129546 = num_groups_x_129544 * num_groups_y_129545;
    int64_t num_whole_tiles_129563 = squot_safe64(css_chunk_len_114580,
                                                  tile_sizze_129542);
    int64_t residual_input_129698 = srem_safe64(css_chunk_len_114580,
                                                tile_sizze_129542);
    bool cond_129699 = residual_input_129698 == (int64_t) 0;
    struct memblock_device mem_130672;
    
    mem_130672.references = NULL;
    if (memblock_alloc_device(ctx, &mem_130672, bytes_130119, "mem_130672")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t bytes_130697 = (int64_t) 4 * group_sizze_129543;
    int64_t binop_y_130704 = (int64_t) 8 * group_sizze_129543;
    int64_t bytes_130702 = smax64((int64_t) 0, binop_y_130704);
    int64_t binop_x_132025 = (int64_t) 4 * tile_sizze_129542;
    int64_t sizze_132026 = tile_sizze_129542 * binop_x_132025;
    int64_t binop_y_130749 = (int64_t) 4 * nest_sizze_120092;
    int64_t bytes_130747 = smax64((int64_t) 0, binop_y_130749);
    struct memblock_device mem_130750;
    
    mem_130750.references = NULL;
    if (memblock_alloc_device(ctx, &mem_130750, bytes_130747, "mem_130750")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t binop_y_130756 = (int64_t) 4 * lifted_single_ma_arg_114959;
    int64_t bytes_130755 = smax64((int64_t) 0, binop_y_130756);
    int64_t binop_y_130771 = (int64_t) 4 * lifted_single_ma_arg_114976;
    int64_t bytes_130770 = smax64((int64_t) 0, binop_y_130771);
    int64_t binop_y_130786 = (int64_t) 4 * n_114534;
    int64_t bytes_130785 = smax64((int64_t) 0, binop_y_130786);
    int64_t binop_y_130830 = (int64_t) 4 * nest_sizze_120605;
    int64_t bytes_130828 = smax64((int64_t) 0, binop_y_130830);
    int64_t binop_y_130839 = (int64_t) 4 * nest_sizze_120653;
    int64_t bytes_130837 = smax64((int64_t) 0, binop_y_130839);
    struct memblock_device mem_130861;
    
    mem_130861.references = NULL;
    if (memblock_alloc_device(ctx, &mem_130861, bytes_130119, "mem_130861")) {
        err = 1;
        goto cleanup;
    }
    
    struct memblock_device mem_130865;
    
    mem_130865.references = NULL;
    if (memblock_alloc_device(ctx, &mem_130865, bytes_130119, "mem_130865")) {
        err = 1;
        goto cleanup;
    }
    
    int64_t L_l_ixfn_131237;
    
    if (cond_114941) {
        L_l_ixfn_131237 = n_114534;
    } else {
        L_l_ixfn_131237 = l_n_m_114584;
    }
    
    int64_t trend_l_ixfn_131639;
    
    if (cond_114942) {
        trend_l_ixfn_131639 = n_114534;
    } else {
        trend_l_ixfn_131639 = t_n_m_114591;
    }
    
    int64_t maxSubHelper_132099 = umax64(bytes_130697, sizze_132026);
    int64_t maxSubHelper_132103 = umax64(bytes_130755, bytes_130785);
    int64_t maxSubHelper_132106 = umax64(bytes_130755, bytes_130785);
    int64_t num_threads_132192 = segmap_group_sizze_119872 * num_groups_119873;
    int64_t total_sizze_132193 = bytes_130132 * num_threads_132192;
    int64_t num_threads_132198 = segmap_group_sizze_120229 * num_groups_120230;
    int64_t total_sizze_132199 = maxSubHelper_132103 * num_threads_132198;
    int64_t total_sizze_132200 = bytes_130770 * num_threads_132198;
    int64_t sizze_115018;
    int64_t stl_res_ixfn_131980;
    int64_t stl_res_ixfn_131982;
    int64_t stl_res_ixfn_131987;
    int64_t stl_res_ixfn_131988;
    int64_t stl_res_ixfn_131989;
    int64_t stl_res_ixfn_131990;
    int64_t stl_res_ixfn_131992;
    int64_t stl_res_ixfn_131993;
    struct memblock_device stl_res_mem_131978;
    
    stl_res_mem_131978.references = NULL;
    
    struct memblock_device stl_res_mem_131986;
    
    stl_res_mem_131986.references = NULL;
    
    struct memblock_device stl_res_mem_131994;
    
    stl_res_mem_131994.references = NULL;
    
    int64_t loopz2081Uz2085Uz2089U_115023;
    struct memblock_device mem_param_130629;
    
    mem_param_130629.references = NULL;
    
    int64_t ctx_param_ext_130631;
    int64_t ctx_param_ext_130633;
    struct memblock_device mem_param_130637;
    
    mem_param_130637.references = NULL;
    
    int64_t ctx_param_ext_130638;
    int64_t ctx_param_ext_130639;
    int64_t ctx_param_ext_130640;
    int64_t ctx_param_ext_130641;
    int64_t ctx_param_ext_130643;
    int64_t ctx_param_ext_130644;
    struct memblock_device mem_param_130645;
    
    mem_param_130645.references = NULL;
    loopz2081Uz2085Uz2089U_115023 = n_114534;
    ctx_param_ext_130631 = n_114534;
    ctx_param_ext_130633 = n_114534;
    ctx_param_ext_130638 = m_114533;
    ctx_param_ext_130639 = n_114534;
    ctx_param_ext_130640 = (int64_t) 0;
    ctx_param_ext_130641 = n_114534;
    ctx_param_ext_130643 = (int64_t) 1;
    ctx_param_ext_130644 = n_114534;
    if (memblock_set_device(ctx, &mem_param_130629, &mem_130611,
                            "mem_130611") != 0)
        return 1;
    if (memblock_set_device(ctx, &mem_param_130637, &mem_130611,
                            "mem_130611") != 0)
        return 1;
    if (memblock_set_device(ctx, &mem_param_130645, &mem_130615,
                            "mem_130615") != 0)
        return 1;
    for (int64_t i_outer_115022 = 0; i_outer_115022 < outer_114544;
         i_outer_115022++) {
        int64_t loopres_ixfn_131654;
        int64_t loopres_ixfn_131656;
        struct memblock_device loopres_mem_131652;
        
        loopres_mem_131652.references = NULL;
        
        struct memblock_device loopres_mem_131660;
        
        loopres_mem_131660.references = NULL;
        
        struct memblock_device mem_param_130659;
        
        mem_param_130659.references = NULL;
        
        int64_t ctx_param_ext_130661;
        int64_t ctx_param_ext_130663;
        struct memblock_device mem_param_130667;
        
        mem_param_130667.references = NULL;
        ctx_param_ext_130661 = ctx_param_ext_130631;
        ctx_param_ext_130663 = ctx_param_ext_130633;
        if (memblock_set_device(ctx, &mem_param_130659, &mem_param_130629,
                                "mem_param_130629") != 0)
            return 1;
        if (memblock_set_device(ctx, &mem_param_130667, &mem_param_130637,
                                "mem_param_130637") != 0)
            return 1;
        for (int64_t _i_inner_115029 = 0; _i_inner_115029 < inner_114543;
             _i_inner_115029++) {
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119812, 1,
                                                    sizeof(m_114533),
                                                    &m_114533));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119812, 2,
                                                    sizeof(n_114534),
                                                    &n_114534));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119812, 3,
                                                    sizeof(ctx_param_ext_130663),
                                                    &ctx_param_ext_130663));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119812, 4,
                                                    sizeof(Y_mem_130086.mem),
                                                    &Y_mem_130086.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119812, 5,
                                                    sizeof(mem_param_130667.mem),
                                                    &mem_param_130667.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119812, 6,
                                                    sizeof(mem_130672.mem),
                                                    &mem_130672.mem));
            if (1 * ((size_t) segmap_usable_groups_119836 *
                     (size_t) segmap_group_sizze_119835) != 0) {
                const size_t global_work_sizze_135657[1] =
                             {(size_t) segmap_usable_groups_119836 *
                             (size_t) segmap_group_sizze_119835};
                const size_t local_work_sizze_135661[1] =
                             {segmap_group_sizze_119835};
                int64_t time_start_135658 = 0, time_end_135659 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log, "Launching %s with global work size [",
                            "main.segmap_119812");
                    fprintf(ctx->log, "%zu", global_work_sizze_135657[0]);
                    fprintf(ctx->log, "] and local work size [");
                    fprintf(ctx->log, "%zu", local_work_sizze_135661[0]);
                    fprintf(ctx->log,
                            "]; local memory parameters sum to %d bytes.\n",
                            (int) 0);
                    time_start_135658 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_119812,
                                                                1, NULL,
                                                                global_work_sizze_135657,
                                                                local_work_sizze_135661,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_119812_runs,
                                                                                                          &ctx->mainzisegmap_119812_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_135659 = get_wall_time();
                    
                    long time_diff_135660 = time_end_135659 - time_start_135658;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_119812", time_diff_135660);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            struct memblock_device defunc_4_map_res_mem_130745;
            
            defunc_4_map_res_mem_130745.references = NULL;
            
            int32_t local_memory_capacity_133113;
            
            local_memory_capacity_133113 = ctx->opencl.max_local_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_133113)) &&
                suff_outer_par_119843) {
                struct memblock_device mem_130675;
                
                mem_130675.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130675, binop_y_130121,
                                          "mem_130675")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_130675,
                                                          (int64_t) 0,
                                                          mem_130672,
                                                          (int64_t) 0,
                                                          (int64_t) 1, n_114534,
                                                          m_114533) != 0) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_130694;
                
                mem_130694.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130694, bytes_130147,
                                          "mem_130694")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_132098;
                
                color_132098.references = NULL;
                if (memblock_alloc_device(ctx, &color_132098,
                                          total_sizze_132193, "color_132098")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119845,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119845,
                                                        3, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119845,
                                                        4, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119845,
                                                        5, sizeof(n_p_114536),
                                                        &n_p_114536));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119845,
                                                        6,
                                                        sizeof(css_chunk_len_114580),
                                                        &css_chunk_len_114580));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119845,
                                                        7,
                                                        sizeof(num_groups_119873),
                                                        &num_groups_119873));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119845,
                                                        8,
                                                        sizeof(num_threads_132192),
                                                        &num_threads_132192));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119845,
                                                        9,
                                                        sizeof(mem_130127.mem),
                                                        &mem_130127.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119845,
                                                        10,
                                                        sizeof(mem_130618.mem),
                                                        &mem_130618.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119845,
                                                        11,
                                                        sizeof(mem_130675.mem),
                                                        &mem_130675.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119845,
                                                        12,
                                                        sizeof(mem_130694.mem),
                                                        &mem_130694.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119845,
                                                        13,
                                                        sizeof(color_132098.mem),
                                                        &color_132098.mem));
                if (1 * ((size_t) num_groups_119873 *
                         (size_t) segmap_group_sizze_119872) != 0) {
                    const size_t global_work_sizze_135662[1] =
                                 {(size_t) num_groups_119873 *
                                 (size_t) segmap_group_sizze_119872};
                    const size_t local_work_sizze_135666[1] =
                                 {segmap_group_sizze_119872};
                    int64_t time_start_135663 = 0, time_end_135664 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segmap_119845");
                        fprintf(ctx->log, "%zu", global_work_sizze_135662[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135666[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_135663 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_119845,
                                                                    1, NULL,
                                                                    global_work_sizze_135662,
                                                                    local_work_sizze_135666,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_119845_runs,
                                                                                                              &ctx->mainzisegmap_119845_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135664 = get_wall_time();
                        
                        long time_diff_135665 = time_end_135664 -
                             time_start_135663;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_119845", time_diff_135665);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_130675, "mem_130675") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132098, "color_132098") !=
                    0)
                    return 1;
                
                struct memblock_device mem_130743;
                
                mem_130743.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130743, bytes_130198,
                                          "mem_130743")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_130743,
                                                          (int64_t) 0,
                                                          mem_130694,
                                                          (int64_t) 0,
                                                          (int64_t) 1, m_114533,
                                                          n_p_114536) != 0) {
                    err = 1;
                    goto cleanup;
                }
                if (memblock_unref_device(ctx, &mem_130694, "mem_130694") != 0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_4_map_res_mem_130745,
                                        &mem_130743, "mem_130743") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130743, "mem_130743") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132098, "color_132098") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130694, "mem_130694") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130675, "mem_130675") != 0)
                    return 1;
            } else {
                struct memblock_device defunc_4_map_res_mem_130739;
                
                defunc_4_map_res_mem_130739.references = NULL;
                
                int32_t local_memory_capacity_133112;
                
                local_memory_capacity_133112 = ctx->opencl.max_local_memory;
                if (sle64(bytes_130702 + srem64((int64_t) 8 -
                                                srem64(bytes_130702,
                                                       (int64_t) 8),
                                                (int64_t) 8),
                          sext_i32_i64(local_memory_capacity_133112)) &&
                    suff_outer_par_119999) {
                    struct memblock_device mem_130728;
                    
                    mem_130728.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_130728, bytes_130198,
                                              "mem_130728")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129547,
                                                            1,
                                                            sizeof(ctx->failure_is_an_option),
                                                            &ctx->failure_is_an_option));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129547,
                                                            3, bytes_130702,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129547,
                                                            4, sizeof(m_114533),
                                                            &m_114533));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129547,
                                                            5, sizeof(n_114534),
                                                            &n_114534));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129547,
                                                            6,
                                                            sizeof(n_p_114536),
                                                            &n_p_114536));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129547,
                                                            7,
                                                            sizeof(css_chunk_len_114580),
                                                            &css_chunk_len_114580));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129547,
                                                            8,
                                                            sizeof(num_groups_x_129544),
                                                            &num_groups_x_129544));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129547,
                                                            9,
                                                            sizeof(num_groups_y_129545),
                                                            &num_groups_y_129545));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129547,
                                                            10,
                                                            sizeof(num_whole_tiles_129563),
                                                            &num_whole_tiles_129563));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129547,
                                                            11,
                                                            sizeof(residual_input_129698),
                                                            &residual_input_129698));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129547,
                                                            12,
                                                            sizeof(cond_129699),
                                                            &cond_129699));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129547,
                                                            13,
                                                            sizeof(defunc_3_map_res_mem_130203.mem),
                                                            &defunc_3_map_res_mem_130203.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129547,
                                                            14,
                                                            sizeof(mem_130621.mem),
                                                            &mem_130621.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129547,
                                                            15,
                                                            sizeof(mem_130672.mem),
                                                            &mem_130672.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_129547,
                                                            16,
                                                            sizeof(mem_130728.mem),
                                                            &mem_130728.mem));
                    if (1 * ((size_t) num_groups_top_129546 *
                             (size_t) group_sizze_129543) != 0) {
                        const size_t global_work_sizze_135667[1] =
                                     {(size_t) num_groups_top_129546 *
                                     (size_t) group_sizze_129543};
                        const size_t local_work_sizze_135671[1] =
                                     {group_sizze_129543};
                        int64_t time_start_135668 = 0, time_end_135669 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [",
                                    "main.segmap_intragroup_129547");
                            fprintf(ctx->log, "%zu",
                                    global_work_sizze_135667[0]);
                            fprintf(ctx->log, "] and local work size [");
                            fprintf(ctx->log, "%zu",
                                    local_work_sizze_135671[0]);
                            fprintf(ctx->log,
                                    "]; local memory parameters sum to %d bytes.\n",
                                    (int) (0 + bytes_130702));
                            time_start_135668 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_intragroup_129547,
                                                                        1, NULL,
                                                                        global_work_sizze_135667,
                                                                        local_work_sizze_135671,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_intragroup_129547_runs,
                                                                                                                  &ctx->mainzisegmap_intragroup_129547_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_135669 = get_wall_time();
                            
                            long time_diff_135670 = time_end_135669 -
                                 time_start_135668;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_129547",
                                    time_diff_135670);
                        }
                    }
                    ctx->failure_is_an_option = 1;
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_set_device(ctx, &defunc_4_map_res_mem_130739,
                                            &mem_130728, "mem_130728") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130728, "mem_130728") !=
                        0)
                        return 1;
                } else {
                    struct memblock_device mem_130733;
                    
                    mem_130733.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_130733, bytes_130198,
                                              "mem_130733")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (slt64(css_chunk_len_114580 * (int64_t) 2,
                              segred_group_sizze_120022)) {
                        int64_t segment_sizze_nonzzero_133034 =
                                smax64((int64_t) 1, css_chunk_len_114580);
                        int64_t num_threads_133035 = num_groups_120023 *
                                segred_group_sizze_120022;
                        
                        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_114533 * n_p_114536), '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                    (long long) css_chunk_len_114580, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c",
                                    "segments_per_group",
                                    (long long) squot64(segred_group_sizze_120022,
                                                        segment_sizze_nonzzero_133034),
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                    (long long) sext_i64_i32(sdiv_up64(m_114533 *
                                                                       n_p_114536,
                                                                       squot64(segred_group_sizze_120022,
                                                                               segment_sizze_nonzzero_133034))),
                                    '\n');
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119948,
                                                                1,
                                                                sizeof(ctx->failure_is_an_option),
                                                                &ctx->failure_is_an_option));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119948,
                                                                3, (int64_t) 4 *
                                                                segred_group_sizze_120022,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119948,
                                                                4,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119948,
                                                                5,
                                                                sizeof(n_114534),
                                                                &n_114534));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119948,
                                                                6,
                                                                sizeof(n_p_114536),
                                                                &n_p_114536));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119948,
                                                                7,
                                                                sizeof(css_chunk_len_114580),
                                                                &css_chunk_len_114580));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119948,
                                                                8,
                                                                sizeof(num_groups_120023),
                                                                &num_groups_120023));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119948,
                                                                9,
                                                                sizeof(segment_sizze_nonzzero_133034),
                                                                &segment_sizze_nonzzero_133034));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119948,
                                                                10,
                                                                sizeof(mem_130127.mem),
                                                                &mem_130127.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119948,
                                                                11,
                                                                sizeof(mem_130672.mem),
                                                                &mem_130672.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_119948,
                                                                12,
                                                                sizeof(mem_130733.mem),
                                                                &mem_130733.mem));
                        if (1 * ((size_t) num_groups_120023 *
                                 (size_t) segred_group_sizze_120022) != 0) {
                            const size_t global_work_sizze_135672[1] =
                                         {(size_t) num_groups_120023 *
                                         (size_t) segred_group_sizze_120022};
                            const size_t local_work_sizze_135676[1] =
                                         {segred_group_sizze_120022};
                            int64_t time_start_135673 = 0, time_end_135674 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.segred_small_119948");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135672[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135676[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + (int64_t) 4 *
                                               segred_group_sizze_120022));
                                time_start_135673 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegred_small_119948,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135672,
                                                                            local_work_sizze_135676,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegred_small_119948_runs,
                                                                                                                      &ctx->mainzisegred_small_119948_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135674 = get_wall_time();
                                
                                long time_diff_135675 = time_end_135674 -
                                     time_start_135673;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segred_small_119948",
                                        time_diff_135675);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                    } else {
                        int64_t groups_per_segment_133059 =
                                sdiv_up64(num_groups_120023, smax64((int64_t) 1,
                                                                    m_114533 *
                                                                    n_p_114536));
                        int64_t elements_per_thread_133060 =
                                sdiv_up64(css_chunk_len_114580,
                                          segred_group_sizze_120022 *
                                          groups_per_segment_133059);
                        int64_t virt_num_groups_133061 =
                                groups_per_segment_133059 * (m_114533 *
                                                             n_p_114536);
                        int64_t num_threads_133062 = num_groups_120023 *
                                segred_group_sizze_120022;
                        int64_t threads_per_segment_133063 =
                                groups_per_segment_133059 *
                                segred_group_sizze_120022;
                        
                        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_114533 * n_p_114536), '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                    (long long) css_chunk_len_114580, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                    (long long) virt_num_groups_133061, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                    (long long) num_groups_120023, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "group_size",
                                    (long long) segred_group_sizze_120022,
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                    (long long) elements_per_thread_133060,
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c",
                                    "groups_per_segment",
                                    (long long) groups_per_segment_133059,
                                    '\n');
                        
                        struct memblock_device segred_tmp_mem_133064;
                        
                        segred_tmp_mem_133064.references = NULL;
                        if (memblock_alloc_device(ctx, &segred_tmp_mem_133064,
                                                  (int64_t) 4 *
                                                  virt_num_groups_133061,
                                                  "segred_tmp_mem_133064")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mainzicounter_mem_133066 =
                                               ctx->mainzicounter_mem_133066;
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119948,
                                                                1,
                                                                sizeof(ctx->failure_is_an_option),
                                                                &ctx->failure_is_an_option));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119948,
                                                                3, 1, NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119948,
                                                                4, (int64_t) 4 *
                                                                segred_group_sizze_120022,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119948,
                                                                5,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119948,
                                                                6,
                                                                sizeof(n_114534),
                                                                &n_114534));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119948,
                                                                7,
                                                                sizeof(n_p_114536),
                                                                &n_p_114536));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119948,
                                                                8,
                                                                sizeof(css_chunk_len_114580),
                                                                &css_chunk_len_114580));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119948,
                                                                9,
                                                                sizeof(num_groups_120023),
                                                                &num_groups_120023));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119948,
                                                                10,
                                                                sizeof(groups_per_segment_133059),
                                                                &groups_per_segment_133059));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119948,
                                                                11,
                                                                sizeof(elements_per_thread_133060),
                                                                &elements_per_thread_133060));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119948,
                                                                12,
                                                                sizeof(virt_num_groups_133061),
                                                                &virt_num_groups_133061));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119948,
                                                                13,
                                                                sizeof(threads_per_segment_133063),
                                                                &threads_per_segment_133063));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119948,
                                                                14,
                                                                sizeof(mem_130127.mem),
                                                                &mem_130127.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119948,
                                                                15,
                                                                sizeof(mem_130672.mem),
                                                                &mem_130672.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119948,
                                                                16,
                                                                sizeof(mem_130733.mem),
                                                                &mem_130733.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119948,
                                                                17,
                                                                sizeof(segred_tmp_mem_133064.mem),
                                                                &segred_tmp_mem_133064.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_119948,
                                                                18,
                                                                sizeof(mainzicounter_mem_133066.mem),
                                                                &mainzicounter_mem_133066.mem));
                        if (1 * ((size_t) num_groups_120023 *
                                 (size_t) segred_group_sizze_120022) != 0) {
                            const size_t global_work_sizze_135678[1] =
                                         {(size_t) num_groups_120023 *
                                         (size_t) segred_group_sizze_120022};
                            const size_t local_work_sizze_135682[1] =
                                         {segred_group_sizze_120022};
                            int64_t time_start_135679 = 0, time_end_135680 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.segred_large_119948");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135678[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135682[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + 1 + (int64_t) 4 *
                                               segred_group_sizze_120022));
                                time_start_135679 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegred_large_119948,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135678,
                                                                            local_work_sizze_135682,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegred_large_119948_runs,
                                                                                                                      &ctx->mainzisegred_large_119948_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135680 = get_wall_time();
                                
                                long time_diff_135681 = time_end_135680 -
                                     time_start_135679;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segred_large_119948",
                                        time_diff_135681);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &segred_tmp_mem_133064,
                                                  "segred_tmp_mem_133064") != 0)
                            return 1;
                    }
                    
                    struct memblock_device mem_130738;
                    
                    mem_130738.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_130738, bytes_130198,
                                              "mem_130738")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119928,
                                                            1, sizeof(m_114533),
                                                            &m_114533));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119928,
                                                            2,
                                                            sizeof(n_p_114536),
                                                            &n_p_114536));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119928,
                                                            3,
                                                            sizeof(defunc_3_map_res_mem_130203.mem),
                                                            &defunc_3_map_res_mem_130203.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119928,
                                                            4,
                                                            sizeof(mem_130733.mem),
                                                            &mem_130733.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_119928,
                                                            5,
                                                            sizeof(mem_130738.mem),
                                                            &mem_130738.mem));
                    if (1 * ((size_t) segmap_usable_groups_120043 *
                             (size_t) segmap_group_sizze_120042) != 0) {
                        const size_t global_work_sizze_135683[1] =
                                     {(size_t) segmap_usable_groups_120043 *
                                     (size_t) segmap_group_sizze_120042};
                        const size_t local_work_sizze_135687[1] =
                                     {segmap_group_sizze_120042};
                        int64_t time_start_135684 = 0, time_end_135685 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [",
                                    "main.segmap_119928");
                            fprintf(ctx->log, "%zu",
                                    global_work_sizze_135683[0]);
                            fprintf(ctx->log, "] and local work size [");
                            fprintf(ctx->log, "%zu",
                                    local_work_sizze_135687[0]);
                            fprintf(ctx->log,
                                    "]; local memory parameters sum to %d bytes.\n",
                                    (int) 0);
                            time_start_135684 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_119928,
                                                                        1, NULL,
                                                                        global_work_sizze_135683,
                                                                        local_work_sizze_135687,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_119928_runs,
                                                                                                                  &ctx->mainzisegmap_119928_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_135685 = get_wall_time();
                            
                            long time_diff_135686 = time_end_135685 -
                                 time_start_135684;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_119928", time_diff_135686);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &mem_130733, "mem_130733") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &defunc_4_map_res_mem_130739,
                                            &mem_130738, "mem_130738") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130738, "mem_130738") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130733, "mem_130733") !=
                        0)
                        return 1;
                }
                if (memblock_set_device(ctx, &defunc_4_map_res_mem_130745,
                                        &defunc_4_map_res_mem_130739,
                                        "defunc_4_map_res_mem_130739") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &defunc_4_map_res_mem_130739,
                                          "defunc_4_map_res_mem_130739") != 0)
                    return 1;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120060, 1,
                                                    sizeof(ctx->failure_is_an_option),
                                                    &ctx->failure_is_an_option));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120060, 3,
                                                    sizeof(m_114533),
                                                    &m_114533));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120060, 4,
                                                    sizeof(n_p_114536),
                                                    &n_p_114536));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120060, 5,
                                                    sizeof(C_len_114582),
                                                    &C_len_114582));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120060, 6,
                                                    sizeof(defunc_4_map_res_mem_130745.mem),
                                                    &defunc_4_map_res_mem_130745.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120060, 7,
                                                    sizeof(mem_130750.mem),
                                                    &mem_130750.mem));
            if (1 * ((size_t) segmap_usable_groups_120094 *
                     (size_t) segmap_group_sizze_120093) != 0) {
                const size_t global_work_sizze_135688[1] =
                             {(size_t) segmap_usable_groups_120094 *
                             (size_t) segmap_group_sizze_120093};
                const size_t local_work_sizze_135692[1] =
                             {segmap_group_sizze_120093};
                int64_t time_start_135689 = 0, time_end_135690 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log, "Launching %s with global work size [",
                            "main.segmap_120060");
                    fprintf(ctx->log, "%zu", global_work_sizze_135688[0]);
                    fprintf(ctx->log, "] and local work size [");
                    fprintf(ctx->log, "%zu", local_work_sizze_135692[0]);
                    fprintf(ctx->log,
                            "]; local memory parameters sum to %d bytes.\n",
                            (int) 0);
                    time_start_135689 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_120060,
                                                                1, NULL,
                                                                global_work_sizze_135688,
                                                                local_work_sizze_135692,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_120060_runs,
                                                                                                          &ctx->mainzisegmap_120060_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_135690 = get_wall_time();
                    
                    long time_diff_135691 = time_end_135690 - time_start_135689;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_120060", time_diff_135691);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &defunc_4_map_res_mem_130745,
                                      "defunc_4_map_res_mem_130745") != 0)
                return 1;
            
            struct memblock_device defunc_3_map_res_mem_130856;
            
            defunc_3_map_res_mem_130856.references = NULL;
            
            int32_t local_memory_capacity_133564;
            
            local_memory_capacity_133564 = ctx->opencl.max_local_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_133564)) &&
                suff_outer_par_120131) {
                struct memblock_device mem_130753;
                
                mem_130753.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130753, binop_y_130749,
                                          "mem_130753")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_130753,
                                                          (int64_t) 0,
                                                          mem_130750,
                                                          (int64_t) 0,
                                                          (int64_t) 1,
                                                          C_len_114582,
                                                          m_114533) != 0) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_130802;
                
                mem_130802.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130802, binop_y_130121,
                                          "mem_130802")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_132104;
                
                color_132104.references = NULL;
                if (memblock_alloc_device(ctx, &color_132104,
                                          total_sizze_132199, "color_132104")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_132105;
                
                color_132105.references = NULL;
                if (memblock_alloc_device(ctx, &color_132105,
                                          total_sizze_132200, "color_132105")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120133,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120133,
                                                        3, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120133,
                                                        4, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120133,
                                                        5, sizeof(n_p_114536),
                                                        &n_p_114536));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120133,
                                                        6,
                                                        sizeof(i64_res_114576),
                                                        &i64_res_114576));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120133,
                                                        7, sizeof(C_len_114582),
                                                        &C_len_114582));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120133,
                                                        8,
                                                        sizeof(lifted_single_ma_arg_114959),
                                                        &lifted_single_ma_arg_114959));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120133,
                                                        9,
                                                        sizeof(lifted_single_ma_arg_114976),
                                                        &lifted_single_ma_arg_114976));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120133,
                                                        10,
                                                        sizeof(num_groups_120230),
                                                        &num_groups_120230));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120133,
                                                        11,
                                                        sizeof(num_threads_132198),
                                                        &num_threads_132198));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120133,
                                                        12,
                                                        sizeof(mem_130753.mem),
                                                        &mem_130753.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120133,
                                                        13,
                                                        sizeof(mem_130802.mem),
                                                        &mem_130802.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120133,
                                                        14,
                                                        sizeof(color_132104.mem),
                                                        &color_132104.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120133,
                                                        15,
                                                        sizeof(color_132105.mem),
                                                        &color_132105.mem));
                if (1 * ((size_t) num_groups_120230 *
                         (size_t) segmap_group_sizze_120229) != 0) {
                    const size_t global_work_sizze_135693[1] =
                                 {(size_t) num_groups_120230 *
                                 (size_t) segmap_group_sizze_120229};
                    const size_t local_work_sizze_135697[1] =
                                 {segmap_group_sizze_120229};
                    int64_t time_start_135694 = 0, time_end_135695 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segmap_120133");
                        fprintf(ctx->log, "%zu", global_work_sizze_135693[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135697[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_135694 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_120133,
                                                                    1, NULL,
                                                                    global_work_sizze_135693,
                                                                    local_work_sizze_135697,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_120133_runs,
                                                                                                              &ctx->mainzisegmap_120133_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135695 = get_wall_time();
                        
                        long time_diff_135696 = time_end_135695 -
                             time_start_135694;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_120133", time_diff_135696);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_130753, "mem_130753") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132104, "color_132104") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132105, "color_132105") !=
                    0)
                    return 1;
                
                struct memblock_device mem_130854;
                
                mem_130854.references = NULL;
                if (memblock_alloc_device(ctx, &mem_130854, bytes_130119,
                                          "mem_130854")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_130854,
                                                          (int64_t) 0,
                                                          mem_130802,
                                                          (int64_t) 0,
                                                          (int64_t) 1, m_114533,
                                                          n_114534) != 0) {
                    err = 1;
                    goto cleanup;
                }
                if (memblock_unref_device(ctx, &mem_130802, "mem_130802") != 0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_3_map_res_mem_130856,
                                        &mem_130854, "mem_130854") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130854, "mem_130854") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132105, "color_132105") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132104, "color_132104") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130802, "mem_130802") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130753, "mem_130753") != 0)
                    return 1;
            } else {
                struct memblock_device defunc_3_map_res_mem_130850;
                
                defunc_3_map_res_mem_130850.references = NULL;
                
                int32_t local_memory_capacity_133563;
                
                local_memory_capacity_133563 = ctx->opencl.max_local_memory;
                if (sle64(maxSubHelper_132106 + srem64((int64_t) 8 -
                                                       srem64(maxSubHelper_132106,
                                                              (int64_t) 8),
                                                       (int64_t) 8) +
                          (bytes_130770 + srem64((int64_t) 8 -
                                                 srem64(bytes_130770,
                                                        (int64_t) 8),
                                                 (int64_t) 8)) + ((int64_t) 4 *
                                                                  n_p_114536 +
                                                                  srem64((int64_t) 8 -
                                                                         srem64((int64_t) 4 *
                                                                                n_p_114536,
                                                                                (int64_t) 8),
                                                                         (int64_t) 8)) +
                          ((int64_t) 4 * n_p_114536 + srem64((int64_t) 8 -
                                                             srem64((int64_t) 4 *
                                                                    n_p_114536,
                                                                    (int64_t) 8),
                                                             (int64_t) 8)) +
                          (int64_t) 16,
                          sext_i32_i64(local_memory_capacity_133563)) &&
                    intra_suff_and_fits_120325) {
                    struct memblock_device mem_130822;
                    
                    mem_130822.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_130822, bytes_130119,
                                              "mem_130822")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_120129,
                                                            1,
                                                            sizeof(ctx->failure_is_an_option),
                                                            &ctx->failure_is_an_option));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_120129,
                                                            3, (int64_t) 12,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_120129,
                                                            4, (int64_t) 4 *
                                                            n_p_114536, NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_120129,
                                                            5, (int64_t) 4 *
                                                            n_p_114536, NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_120129,
                                                            6, bytes_130770,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_120129,
                                                            7,
                                                            maxSubHelper_132106,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_120129,
                                                            8, sizeof(m_114533),
                                                            &m_114533));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_120129,
                                                            9, sizeof(n_114534),
                                                            &n_114534));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_120129,
                                                            10,
                                                            sizeof(n_p_114536),
                                                            &n_p_114536));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_120129,
                                                            11,
                                                            sizeof(i64_res_114576),
                                                            &i64_res_114576));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_120129,
                                                            12,
                                                            sizeof(C_len_114582),
                                                            &C_len_114582));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_120129,
                                                            13,
                                                            sizeof(lifted_single_ma_arg_114959),
                                                            &lifted_single_ma_arg_114959));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_120129,
                                                            14,
                                                            sizeof(lifted_single_ma_arg_114976),
                                                            &lifted_single_ma_arg_114976));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_120129,
                                                            15,
                                                            sizeof(computed_group_sizze_120107),
                                                            &computed_group_sizze_120107));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_120129,
                                                            16,
                                                            sizeof(mem_130750.mem),
                                                            &mem_130750.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_120129,
                                                            17,
                                                            sizeof(mem_130822.mem),
                                                            &mem_130822.mem));
                    if (1 * ((size_t) m_114533 *
                             (size_t) computed_group_sizze_120107) != 0) {
                        const size_t global_work_sizze_135698[1] =
                                     {(size_t) m_114533 *
                                     (size_t) computed_group_sizze_120107};
                        const size_t local_work_sizze_135702[1] =
                                     {computed_group_sizze_120107};
                        int64_t time_start_135699 = 0, time_end_135700 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [",
                                    "main.segmap_intragroup_120129");
                            fprintf(ctx->log, "%zu",
                                    global_work_sizze_135698[0]);
                            fprintf(ctx->log, "] and local work size [");
                            fprintf(ctx->log, "%zu",
                                    local_work_sizze_135702[0]);
                            fprintf(ctx->log,
                                    "]; local memory parameters sum to %d bytes.\n",
                                    (int) (0 + (int64_t) 12 + (int64_t) 4 *
                                           n_p_114536 + (int64_t) 4 *
                                           n_p_114536 + bytes_130770 +
                                           maxSubHelper_132106));
                            time_start_135699 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_intragroup_120129,
                                                                        1, NULL,
                                                                        global_work_sizze_135698,
                                                                        local_work_sizze_135702,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_intragroup_120129_runs,
                                                                                                                  &ctx->mainzisegmap_intragroup_120129_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_135700 = get_wall_time();
                            
                            long time_diff_135701 = time_end_135700 -
                                 time_start_135699;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_120129",
                                    time_diff_135701);
                        }
                    }
                    ctx->failure_is_an_option = 1;
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_set_device(ctx, &defunc_3_map_res_mem_130850,
                                            &mem_130822, "mem_130822") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130822, "mem_130822") !=
                        0)
                        return 1;
                } else {
                    struct memblock_device mem_130826;
                    
                    mem_130826.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_130826, bytes_130331,
                                              "mem_130826")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (slt64(n_p_114536 * (int64_t) 2,
                              segred_group_sizze_120595)) {
                        int64_t segment_sizze_nonzzero_133203 =
                                smax64((int64_t) 1, n_p_114536);
                        int64_t num_threads_133204 = num_groups_120596 *
                                segred_group_sizze_120595;
                        
                        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_114533, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                    (long long) n_p_114536, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c",
                                    "segments_per_group",
                                    (long long) squot64(segred_group_sizze_120595,
                                                        segment_sizze_nonzzero_133203),
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                    (long long) sext_i64_i32(sdiv_up64(m_114533,
                                                                       squot64(segred_group_sizze_120595,
                                                                               segment_sizze_nonzzero_133203))),
                                    '\n');
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120587,
                                                                1, (int64_t) 4 *
                                                                segred_group_sizze_120595,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120587,
                                                                2,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120587,
                                                                3,
                                                                sizeof(n_p_114536),
                                                                &n_p_114536));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120587,
                                                                4,
                                                                sizeof(C_len_114582),
                                                                &C_len_114582));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120587,
                                                                5,
                                                                sizeof(num_groups_120596),
                                                                &num_groups_120596));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120587,
                                                                6,
                                                                sizeof(segment_sizze_nonzzero_133203),
                                                                &segment_sizze_nonzzero_133203));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120587,
                                                                7,
                                                                sizeof(mem_130750.mem),
                                                                &mem_130750.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120587,
                                                                8,
                                                                sizeof(mem_130826.mem),
                                                                &mem_130826.mem));
                        if (1 * ((size_t) num_groups_120596 *
                                 (size_t) segred_group_sizze_120595) != 0) {
                            const size_t global_work_sizze_135703[1] =
                                         {(size_t) num_groups_120596 *
                                         (size_t) segred_group_sizze_120595};
                            const size_t local_work_sizze_135707[1] =
                                         {segred_group_sizze_120595};
                            int64_t time_start_135704 = 0, time_end_135705 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.segred_small_120587");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135703[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135707[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + (int64_t) 4 *
                                               segred_group_sizze_120595));
                                time_start_135704 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegred_small_120587,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135703,
                                                                            local_work_sizze_135707,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegred_small_120587_runs,
                                                                                                                      &ctx->mainzisegred_small_120587_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135705 = get_wall_time();
                                
                                long time_diff_135706 = time_end_135705 -
                                     time_start_135704;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segred_small_120587",
                                        time_diff_135706);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                    } else {
                        int64_t groups_per_segment_133226 =
                                sdiv_up64(num_groups_120596, smax64((int64_t) 1,
                                                                    m_114533));
                        int64_t elements_per_thread_133227 =
                                sdiv_up64(n_p_114536,
                                          segred_group_sizze_120595 *
                                          groups_per_segment_133226);
                        int64_t virt_num_groups_133228 =
                                groups_per_segment_133226 * m_114533;
                        int64_t num_threads_133229 = num_groups_120596 *
                                segred_group_sizze_120595;
                        int64_t threads_per_segment_133230 =
                                groups_per_segment_133226 *
                                segred_group_sizze_120595;
                        
                        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_114533, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                    (long long) n_p_114536, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                    (long long) virt_num_groups_133228, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                    (long long) num_groups_120596, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "group_size",
                                    (long long) segred_group_sizze_120595,
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                    (long long) elements_per_thread_133227,
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c",
                                    "groups_per_segment",
                                    (long long) groups_per_segment_133226,
                                    '\n');
                        
                        struct memblock_device segred_tmp_mem_133231;
                        
                        segred_tmp_mem_133231.references = NULL;
                        if (memblock_alloc_device(ctx, &segred_tmp_mem_133231,
                                                  (int64_t) 4 *
                                                  virt_num_groups_133228,
                                                  "segred_tmp_mem_133231")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mainzicounter_mem_133233 =
                                               ctx->mainzicounter_mem_133233;
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120587,
                                                                1, 1, NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120587,
                                                                2, (int64_t) 4 *
                                                                segred_group_sizze_120595,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120587,
                                                                3,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120587,
                                                                4,
                                                                sizeof(n_p_114536),
                                                                &n_p_114536));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120587,
                                                                5,
                                                                sizeof(C_len_114582),
                                                                &C_len_114582));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120587,
                                                                6,
                                                                sizeof(num_groups_120596),
                                                                &num_groups_120596));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120587,
                                                                7,
                                                                sizeof(groups_per_segment_133226),
                                                                &groups_per_segment_133226));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120587,
                                                                8,
                                                                sizeof(elements_per_thread_133227),
                                                                &elements_per_thread_133227));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120587,
                                                                9,
                                                                sizeof(virt_num_groups_133228),
                                                                &virt_num_groups_133228));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120587,
                                                                10,
                                                                sizeof(threads_per_segment_133230),
                                                                &threads_per_segment_133230));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120587,
                                                                11,
                                                                sizeof(mem_130750.mem),
                                                                &mem_130750.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120587,
                                                                12,
                                                                sizeof(mem_130826.mem),
                                                                &mem_130826.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120587,
                                                                13,
                                                                sizeof(segred_tmp_mem_133231.mem),
                                                                &segred_tmp_mem_133231.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120587,
                                                                14,
                                                                sizeof(mainzicounter_mem_133233.mem),
                                                                &mainzicounter_mem_133233.mem));
                        if (1 * ((size_t) num_groups_120596 *
                                 (size_t) segred_group_sizze_120595) != 0) {
                            const size_t global_work_sizze_135709[1] =
                                         {(size_t) num_groups_120596 *
                                         (size_t) segred_group_sizze_120595};
                            const size_t local_work_sizze_135713[1] =
                                         {segred_group_sizze_120595};
                            int64_t time_start_135710 = 0, time_end_135711 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.segred_large_120587");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135709[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135713[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + 1 + (int64_t) 4 *
                                               segred_group_sizze_120595));
                                time_start_135710 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegred_large_120587,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135709,
                                                                            local_work_sizze_135713,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegred_large_120587_runs,
                                                                                                                      &ctx->mainzisegred_large_120587_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135711 = get_wall_time();
                                
                                long time_diff_135712 = time_end_135711 -
                                     time_start_135710;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segred_large_120587",
                                        time_diff_135712);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &segred_tmp_mem_133231,
                                                  "segred_tmp_mem_133231") != 0)
                            return 1;
                    }
                    
                    struct memblock_device mem_130831;
                    
                    mem_130831.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_130831, bytes_130828,
                                              "mem_130831")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (slt64((int64_t) 0, m_114533 *
                              lifted_single_ma_arg_114959)) {
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegScan");
                        
                        int64_t stage1_max_num_groups_133267;
                        
                        stage1_max_num_groups_133267 =
                            ctx->opencl.max_group_size;
                        
                        int64_t stage1_num_groups_133268 =
                                smin64(stage1_max_num_groups_133267,
                                       num_groups_120607);
                        int32_t num_threads_133269 =
                                sext_i64_i32(stage1_num_groups_133268 *
                                segscan_group_sizze_120606);
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120553,
                                                                1,
                                                                sizeof(ctx->failure_is_an_option),
                                                                &ctx->failure_is_an_option));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120553,
                                                                3,
                                                                smax64((int64_t) 1,
                                                                       (int64_t) 4 *
                                                                       segscan_group_sizze_120606),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120553,
                                                                4,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120553,
                                                                5,
                                                                sizeof(n_p_114536),
                                                                &n_p_114536));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120553,
                                                                6,
                                                                sizeof(i64_res_114576),
                                                                &i64_res_114576));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120553,
                                                                7,
                                                                sizeof(C_len_114582),
                                                                &C_len_114582));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120553,
                                                                8,
                                                                sizeof(lifted_single_ma_arg_114959),
                                                                &lifted_single_ma_arg_114959));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120553,
                                                                9,
                                                                sizeof(num_threads_133269),
                                                                &num_threads_133269));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120553,
                                                                10,
                                                                sizeof(mem_130750.mem),
                                                                &mem_130750.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120553,
                                                                11,
                                                                sizeof(mem_130826.mem),
                                                                &mem_130826.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120553,
                                                                12,
                                                                sizeof(mem_130831.mem),
                                                                &mem_130831.mem));
                        if (1 * ((size_t) stage1_num_groups_133268 *
                                 (size_t) segscan_group_sizze_120606) != 0) {
                            const size_t global_work_sizze_135714[1] =
                                         {(size_t) stage1_num_groups_133268 *
                                         (size_t) segscan_group_sizze_120606};
                            const size_t local_work_sizze_135718[1] =
                                         {segscan_group_sizze_120606};
                            int64_t time_start_135715 = 0, time_end_135716 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.scan_stage1_120553");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135714[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135718[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + smax64((int64_t) 1,
                                                          (int64_t) 4 *
                                                          segscan_group_sizze_120606)));
                                time_start_135715 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainziscan_stage1_120553,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135714,
                                                                            local_work_sizze_135718,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainziscan_stage1_120553_runs,
                                                                                                                      &ctx->mainziscan_stage1_120553_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135716 = get_wall_time();
                                
                                long time_diff_135717 = time_end_135716 -
                                     time_start_135715;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.scan_stage1_120553",
                                        time_diff_135717);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                                    (long long) (segscan_group_sizze_120606 *
                                                 sdiv_up64(m_114533 *
                                                           lifted_single_ma_arg_114959,
                                                           sext_i32_i64(num_threads_133269))),
                                    '\n');
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_120553,
                                                                1,
                                                                smax64((int64_t) 1,
                                                                       (int64_t) 4 *
                                                                       stage1_num_groups_133268),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_120553,
                                                                2,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_120553,
                                                                3,
                                                                sizeof(lifted_single_ma_arg_114959),
                                                                &lifted_single_ma_arg_114959));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_120553,
                                                                4,
                                                                sizeof(stage1_num_groups_133268),
                                                                &stage1_num_groups_133268));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_120553,
                                                                5,
                                                                sizeof(num_threads_133269),
                                                                &num_threads_133269));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_120553,
                                                                6,
                                                                sizeof(mem_130831.mem),
                                                                &mem_130831.mem));
                        if (1 * ((size_t) (int64_t) 1 *
                                 (size_t) stage1_num_groups_133268) != 0) {
                            const size_t global_work_sizze_135719[1] =
                                         {(size_t) (int64_t) 1 *
                                         (size_t) stage1_num_groups_133268};
                            const size_t local_work_sizze_135723[1] =
                                         {stage1_num_groups_133268};
                            int64_t time_start_135720 = 0, time_end_135721 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.scan_stage2_120553");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135719[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135723[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + smax64((int64_t) 1,
                                                          (int64_t) 4 *
                                                          stage1_num_groups_133268)));
                                time_start_135720 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainziscan_stage2_120553,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135719,
                                                                            local_work_sizze_135723,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainziscan_stage2_120553_runs,
                                                                                                                      &ctx->mainziscan_stage2_120553_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135721 = get_wall_time();
                                
                                long time_diff_135722 = time_end_135721 -
                                     time_start_135720;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.scan_stage2_120553",
                                        time_diff_135722);
                            }
                        }
                        
                        int32_t required_groups_133311 =
                                sext_i64_i32(sdiv_up64(m_114533 *
                                                       lifted_single_ma_arg_114959,
                                                       segscan_group_sizze_120606));
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_120553,
                                                                1,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_120553,
                                                                2,
                                                                sizeof(lifted_single_ma_arg_114959),
                                                                &lifted_single_ma_arg_114959));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_120553,
                                                                3,
                                                                sizeof(num_groups_120607),
                                                                &num_groups_120607));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_120553,
                                                                4,
                                                                sizeof(num_threads_133269),
                                                                &num_threads_133269));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_120553,
                                                                5,
                                                                sizeof(required_groups_133311),
                                                                &required_groups_133311));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_120553,
                                                                6,
                                                                sizeof(mem_130831.mem),
                                                                &mem_130831.mem));
                        if (1 * ((size_t) num_groups_120607 *
                                 (size_t) segscan_group_sizze_120606) != 0) {
                            const size_t global_work_sizze_135724[1] =
                                         {(size_t) num_groups_120607 *
                                         (size_t) segscan_group_sizze_120606};
                            const size_t local_work_sizze_135728[1] =
                                         {segscan_group_sizze_120606};
                            int64_t time_start_135725 = 0, time_end_135726 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.scan_stage3_120553");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135724[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135728[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) 0);
                                time_start_135725 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainziscan_stage3_120553,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135724,
                                                                            local_work_sizze_135728,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainziscan_stage3_120553_runs,
                                                                                                                      &ctx->mainziscan_stage3_120553_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135726 = get_wall_time();
                                
                                long time_diff_135727 = time_end_135726 -
                                     time_start_135725;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.scan_stage3_120553",
                                        time_diff_135727);
                            }
                        }
                    }
                    if (memblock_unref_device(ctx, &mem_130826, "mem_130826") !=
                        0)
                        return 1;
                    
                    struct memblock_device mem_130835;
                    
                    mem_130835.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_130835, bytes_130331,
                                              "mem_130835")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (slt64(n_p_114536 * (int64_t) 2,
                              segred_group_sizze_120643)) {
                        int64_t segment_sizze_nonzzero_133323 =
                                smax64((int64_t) 1, n_p_114536);
                        int64_t num_threads_133324 = num_groups_120644 *
                                segred_group_sizze_120643;
                        
                        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_114533, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                    (long long) n_p_114536, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c",
                                    "segments_per_group",
                                    (long long) squot64(segred_group_sizze_120643,
                                                        segment_sizze_nonzzero_133323),
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                    (long long) sext_i64_i32(sdiv_up64(m_114533,
                                                                       squot64(segred_group_sizze_120643,
                                                                               segment_sizze_nonzzero_133323))),
                                    '\n');
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120526,
                                                                1, (int64_t) 4 *
                                                                segred_group_sizze_120643,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120526,
                                                                2,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120526,
                                                                3,
                                                                sizeof(n_p_114536),
                                                                &n_p_114536));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120526,
                                                                4,
                                                                sizeof(lifted_single_ma_arg_114959),
                                                                &lifted_single_ma_arg_114959));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120526,
                                                                5,
                                                                sizeof(num_groups_120644),
                                                                &num_groups_120644));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120526,
                                                                6,
                                                                sizeof(segment_sizze_nonzzero_133323),
                                                                &segment_sizze_nonzzero_133323));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120526,
                                                                7,
                                                                sizeof(mem_130831.mem),
                                                                &mem_130831.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120526,
                                                                8,
                                                                sizeof(mem_130835.mem),
                                                                &mem_130835.mem));
                        if (1 * ((size_t) num_groups_120644 *
                                 (size_t) segred_group_sizze_120643) != 0) {
                            const size_t global_work_sizze_135729[1] =
                                         {(size_t) num_groups_120644 *
                                         (size_t) segred_group_sizze_120643};
                            const size_t local_work_sizze_135733[1] =
                                         {segred_group_sizze_120643};
                            int64_t time_start_135730 = 0, time_end_135731 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.segred_small_120526");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135729[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135733[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + (int64_t) 4 *
                                               segred_group_sizze_120643));
                                time_start_135730 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegred_small_120526,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135729,
                                                                            local_work_sizze_135733,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegred_small_120526_runs,
                                                                                                                      &ctx->mainzisegred_small_120526_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135731 = get_wall_time();
                                
                                long time_diff_135732 = time_end_135731 -
                                     time_start_135730;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segred_small_120526",
                                        time_diff_135732);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                    } else {
                        int64_t groups_per_segment_133346 =
                                sdiv_up64(num_groups_120644, smax64((int64_t) 1,
                                                                    m_114533));
                        int64_t elements_per_thread_133347 =
                                sdiv_up64(n_p_114536,
                                          segred_group_sizze_120643 *
                                          groups_per_segment_133346);
                        int64_t virt_num_groups_133348 =
                                groups_per_segment_133346 * m_114533;
                        int64_t num_threads_133349 = num_groups_120644 *
                                segred_group_sizze_120643;
                        int64_t threads_per_segment_133350 =
                                groups_per_segment_133346 *
                                segred_group_sizze_120643;
                        
                        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_114533, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                    (long long) n_p_114536, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                    (long long) virt_num_groups_133348, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                    (long long) num_groups_120644, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "group_size",
                                    (long long) segred_group_sizze_120643,
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                    (long long) elements_per_thread_133347,
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c",
                                    "groups_per_segment",
                                    (long long) groups_per_segment_133346,
                                    '\n');
                        
                        struct memblock_device segred_tmp_mem_133351;
                        
                        segred_tmp_mem_133351.references = NULL;
                        if (memblock_alloc_device(ctx, &segred_tmp_mem_133351,
                                                  (int64_t) 4 *
                                                  virt_num_groups_133348,
                                                  "segred_tmp_mem_133351")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mainzicounter_mem_133353 =
                                               ctx->mainzicounter_mem_133353;
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120526,
                                                                1, 1, NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120526,
                                                                2, (int64_t) 4 *
                                                                segred_group_sizze_120643,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120526,
                                                                3,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120526,
                                                                4,
                                                                sizeof(n_p_114536),
                                                                &n_p_114536));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120526,
                                                                5,
                                                                sizeof(lifted_single_ma_arg_114959),
                                                                &lifted_single_ma_arg_114959));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120526,
                                                                6,
                                                                sizeof(num_groups_120644),
                                                                &num_groups_120644));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120526,
                                                                7,
                                                                sizeof(groups_per_segment_133346),
                                                                &groups_per_segment_133346));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120526,
                                                                8,
                                                                sizeof(elements_per_thread_133347),
                                                                &elements_per_thread_133347));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120526,
                                                                9,
                                                                sizeof(virt_num_groups_133348),
                                                                &virt_num_groups_133348));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120526,
                                                                10,
                                                                sizeof(threads_per_segment_133350),
                                                                &threads_per_segment_133350));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120526,
                                                                11,
                                                                sizeof(mem_130831.mem),
                                                                &mem_130831.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120526,
                                                                12,
                                                                sizeof(mem_130835.mem),
                                                                &mem_130835.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120526,
                                                                13,
                                                                sizeof(segred_tmp_mem_133351.mem),
                                                                &segred_tmp_mem_133351.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120526,
                                                                14,
                                                                sizeof(mainzicounter_mem_133353.mem),
                                                                &mainzicounter_mem_133353.mem));
                        if (1 * ((size_t) num_groups_120644 *
                                 (size_t) segred_group_sizze_120643) != 0) {
                            const size_t global_work_sizze_135735[1] =
                                         {(size_t) num_groups_120644 *
                                         (size_t) segred_group_sizze_120643};
                            const size_t local_work_sizze_135739[1] =
                                         {segred_group_sizze_120643};
                            int64_t time_start_135736 = 0, time_end_135737 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.segred_large_120526");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135735[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135739[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + 1 + (int64_t) 4 *
                                               segred_group_sizze_120643));
                                time_start_135736 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegred_large_120526,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135735,
                                                                            local_work_sizze_135739,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegred_large_120526_runs,
                                                                                                                      &ctx->mainzisegred_large_120526_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135737 = get_wall_time();
                                
                                long time_diff_135738 = time_end_135737 -
                                     time_start_135736;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segred_large_120526",
                                        time_diff_135738);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &segred_tmp_mem_133351,
                                                  "segred_tmp_mem_133351") != 0)
                            return 1;
                    }
                    
                    struct memblock_device mem_130840;
                    
                    mem_130840.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_130840, bytes_130837,
                                              "mem_130840")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (slt64((int64_t) 0, m_114533 *
                              lifted_single_ma_arg_114976)) {
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegScan");
                        
                        int64_t stage1_max_num_groups_133387;
                        
                        stage1_max_num_groups_133387 =
                            ctx->opencl.max_group_size;
                        
                        int64_t stage1_num_groups_133388 =
                                smin64(stage1_max_num_groups_133387,
                                       num_groups_120655);
                        int32_t num_threads_133389 =
                                sext_i64_i32(stage1_num_groups_133388 *
                                segscan_group_sizze_120654);
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120491,
                                                                1,
                                                                sizeof(ctx->failure_is_an_option),
                                                                &ctx->failure_is_an_option));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120491,
                                                                3,
                                                                smax64((int64_t) 1,
                                                                       (int64_t) 4 *
                                                                       segscan_group_sizze_120654),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120491,
                                                                4,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120491,
                                                                5,
                                                                sizeof(n_p_114536),
                                                                &n_p_114536));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120491,
                                                                6,
                                                                sizeof(i64_res_114576),
                                                                &i64_res_114576));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120491,
                                                                7,
                                                                sizeof(lifted_single_ma_arg_114959),
                                                                &lifted_single_ma_arg_114959));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120491,
                                                                8,
                                                                sizeof(lifted_single_ma_arg_114976),
                                                                &lifted_single_ma_arg_114976));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120491,
                                                                9,
                                                                sizeof(num_threads_133389),
                                                                &num_threads_133389));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120491,
                                                                10,
                                                                sizeof(mem_130831.mem),
                                                                &mem_130831.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120491,
                                                                11,
                                                                sizeof(mem_130835.mem),
                                                                &mem_130835.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120491,
                                                                12,
                                                                sizeof(mem_130840.mem),
                                                                &mem_130840.mem));
                        if (1 * ((size_t) stage1_num_groups_133388 *
                                 (size_t) segscan_group_sizze_120654) != 0) {
                            const size_t global_work_sizze_135740[1] =
                                         {(size_t) stage1_num_groups_133388 *
                                         (size_t) segscan_group_sizze_120654};
                            const size_t local_work_sizze_135744[1] =
                                         {segscan_group_sizze_120654};
                            int64_t time_start_135741 = 0, time_end_135742 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.scan_stage1_120491");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135740[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135744[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + smax64((int64_t) 1,
                                                          (int64_t) 4 *
                                                          segscan_group_sizze_120654)));
                                time_start_135741 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainziscan_stage1_120491,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135740,
                                                                            local_work_sizze_135744,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainziscan_stage1_120491_runs,
                                                                                                                      &ctx->mainziscan_stage1_120491_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135742 = get_wall_time();
                                
                                long time_diff_135743 = time_end_135742 -
                                     time_start_135741;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.scan_stage1_120491",
                                        time_diff_135743);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                                    (long long) (segscan_group_sizze_120654 *
                                                 sdiv_up64(m_114533 *
                                                           lifted_single_ma_arg_114976,
                                                           sext_i32_i64(num_threads_133389))),
                                    '\n');
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_120491,
                                                                1,
                                                                smax64((int64_t) 1,
                                                                       (int64_t) 4 *
                                                                       stage1_num_groups_133388),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_120491,
                                                                2,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_120491,
                                                                3,
                                                                sizeof(lifted_single_ma_arg_114976),
                                                                &lifted_single_ma_arg_114976));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_120491,
                                                                4,
                                                                sizeof(stage1_num_groups_133388),
                                                                &stage1_num_groups_133388));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_120491,
                                                                5,
                                                                sizeof(num_threads_133389),
                                                                &num_threads_133389));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_120491,
                                                                6,
                                                                sizeof(mem_130840.mem),
                                                                &mem_130840.mem));
                        if (1 * ((size_t) (int64_t) 1 *
                                 (size_t) stage1_num_groups_133388) != 0) {
                            const size_t global_work_sizze_135745[1] =
                                         {(size_t) (int64_t) 1 *
                                         (size_t) stage1_num_groups_133388};
                            const size_t local_work_sizze_135749[1] =
                                         {stage1_num_groups_133388};
                            int64_t time_start_135746 = 0, time_end_135747 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.scan_stage2_120491");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135745[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135749[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + smax64((int64_t) 1,
                                                          (int64_t) 4 *
                                                          stage1_num_groups_133388)));
                                time_start_135746 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainziscan_stage2_120491,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135745,
                                                                            local_work_sizze_135749,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainziscan_stage2_120491_runs,
                                                                                                                      &ctx->mainziscan_stage2_120491_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135747 = get_wall_time();
                                
                                long time_diff_135748 = time_end_135747 -
                                     time_start_135746;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.scan_stage2_120491",
                                        time_diff_135748);
                            }
                        }
                        
                        int32_t required_groups_133431 =
                                sext_i64_i32(sdiv_up64(m_114533 *
                                                       lifted_single_ma_arg_114976,
                                                       segscan_group_sizze_120654));
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_120491,
                                                                1,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_120491,
                                                                2,
                                                                sizeof(lifted_single_ma_arg_114976),
                                                                &lifted_single_ma_arg_114976));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_120491,
                                                                3,
                                                                sizeof(num_groups_120655),
                                                                &num_groups_120655));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_120491,
                                                                4,
                                                                sizeof(num_threads_133389),
                                                                &num_threads_133389));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_120491,
                                                                5,
                                                                sizeof(required_groups_133431),
                                                                &required_groups_133431));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_120491,
                                                                6,
                                                                sizeof(mem_130840.mem),
                                                                &mem_130840.mem));
                        if (1 * ((size_t) num_groups_120655 *
                                 (size_t) segscan_group_sizze_120654) != 0) {
                            const size_t global_work_sizze_135750[1] =
                                         {(size_t) num_groups_120655 *
                                         (size_t) segscan_group_sizze_120654};
                            const size_t local_work_sizze_135754[1] =
                                         {segscan_group_sizze_120654};
                            int64_t time_start_135751 = 0, time_end_135752 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.scan_stage3_120491");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135750[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135754[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) 0);
                                time_start_135751 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainziscan_stage3_120491,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135750,
                                                                            local_work_sizze_135754,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainziscan_stage3_120491_runs,
                                                                                                                      &ctx->mainziscan_stage3_120491_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135752 = get_wall_time();
                                
                                long time_diff_135753 = time_end_135752 -
                                     time_start_135751;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.scan_stage3_120491",
                                        time_diff_135753);
                            }
                        }
                    }
                    if (memblock_unref_device(ctx, &mem_130831, "mem_130831") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130835, "mem_130835") !=
                        0)
                        return 1;
                    
                    struct memblock_device mem_130844;
                    
                    mem_130844.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_130844, bytes_130331,
                                              "mem_130844")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (slt64((int64_t) 6, segred_group_sizze_120691)) {
                        int64_t segment_sizze_nonzzero_133443 = (int64_t) 3;
                        int64_t num_threads_133444 = num_groups_120692 *
                                segred_group_sizze_120691;
                        
                        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_114533, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                    (long long) (int64_t) 3, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c",
                                    "segments_per_group",
                                    (long long) squot64(segred_group_sizze_120691,
                                                        segment_sizze_nonzzero_133443),
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                    (long long) sext_i64_i32(sdiv_up64(m_114533,
                                                                       squot64(segred_group_sizze_120691,
                                                                               segment_sizze_nonzzero_133443))),
                                    '\n');
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120463,
                                                                1, (int64_t) 4 *
                                                                segred_group_sizze_120691,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120463,
                                                                2,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120463,
                                                                3,
                                                                sizeof(lifted_single_ma_arg_114976),
                                                                &lifted_single_ma_arg_114976));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120463,
                                                                4,
                                                                sizeof(num_groups_120692),
                                                                &num_groups_120692));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120463,
                                                                5,
                                                                sizeof(segment_sizze_nonzzero_133443),
                                                                &segment_sizze_nonzzero_133443));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120463,
                                                                6,
                                                                sizeof(mem_130840.mem),
                                                                &mem_130840.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_120463,
                                                                7,
                                                                sizeof(mem_130844.mem),
                                                                &mem_130844.mem));
                        if (1 * ((size_t) num_groups_120692 *
                                 (size_t) segred_group_sizze_120691) != 0) {
                            const size_t global_work_sizze_135755[1] =
                                         {(size_t) num_groups_120692 *
                                         (size_t) segred_group_sizze_120691};
                            const size_t local_work_sizze_135759[1] =
                                         {segred_group_sizze_120691};
                            int64_t time_start_135756 = 0, time_end_135757 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.segred_small_120463");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135755[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135759[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + (int64_t) 4 *
                                               segred_group_sizze_120691));
                                time_start_135756 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegred_small_120463,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135755,
                                                                            local_work_sizze_135759,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegred_small_120463_runs,
                                                                                                                      &ctx->mainzisegred_small_120463_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135757 = get_wall_time();
                                
                                long time_diff_135758 = time_end_135757 -
                                     time_start_135756;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segred_small_120463",
                                        time_diff_135758);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                    } else {
                        int64_t groups_per_segment_133466 =
                                sdiv_up64(num_groups_120692, smax64((int64_t) 1,
                                                                    m_114533));
                        int64_t elements_per_thread_133467 =
                                sdiv_up64((int64_t) 3,
                                          segred_group_sizze_120691 *
                                          groups_per_segment_133466);
                        int64_t virt_num_groups_133468 =
                                groups_per_segment_133466 * m_114533;
                        int64_t num_threads_133469 = num_groups_120692 *
                                segred_group_sizze_120691;
                        int64_t threads_per_segment_133470 =
                                groups_per_segment_133466 *
                                segred_group_sizze_120691;
                        
                        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_114533, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                    (long long) (int64_t) 3, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                    (long long) virt_num_groups_133468, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                    (long long) num_groups_120692, '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "group_size",
                                    (long long) segred_group_sizze_120691,
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                    (long long) elements_per_thread_133467,
                                    '\n');
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c",
                                    "groups_per_segment",
                                    (long long) groups_per_segment_133466,
                                    '\n');
                        
                        struct memblock_device segred_tmp_mem_133471;
                        
                        segred_tmp_mem_133471.references = NULL;
                        if (memblock_alloc_device(ctx, &segred_tmp_mem_133471,
                                                  (int64_t) 4 *
                                                  virt_num_groups_133468,
                                                  "segred_tmp_mem_133471")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mainzicounter_mem_133473 =
                                               ctx->mainzicounter_mem_133473;
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120463,
                                                                1, 1, NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120463,
                                                                2, (int64_t) 4 *
                                                                segred_group_sizze_120691,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120463,
                                                                3,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120463,
                                                                4,
                                                                sizeof(lifted_single_ma_arg_114976),
                                                                &lifted_single_ma_arg_114976));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120463,
                                                                5,
                                                                sizeof(num_groups_120692),
                                                                &num_groups_120692));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120463,
                                                                6,
                                                                sizeof(groups_per_segment_133466),
                                                                &groups_per_segment_133466));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120463,
                                                                7,
                                                                sizeof(elements_per_thread_133467),
                                                                &elements_per_thread_133467));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120463,
                                                                8,
                                                                sizeof(virt_num_groups_133468),
                                                                &virt_num_groups_133468));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120463,
                                                                9,
                                                                sizeof(threads_per_segment_133470),
                                                                &threads_per_segment_133470));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120463,
                                                                10,
                                                                sizeof(mem_130840.mem),
                                                                &mem_130840.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120463,
                                                                11,
                                                                sizeof(mem_130844.mem),
                                                                &mem_130844.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120463,
                                                                12,
                                                                sizeof(segred_tmp_mem_133471.mem),
                                                                &segred_tmp_mem_133471.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_120463,
                                                                13,
                                                                sizeof(mainzicounter_mem_133473.mem),
                                                                &mainzicounter_mem_133473.mem));
                        if (1 * ((size_t) num_groups_120692 *
                                 (size_t) segred_group_sizze_120691) != 0) {
                            const size_t global_work_sizze_135761[1] =
                                         {(size_t) num_groups_120692 *
                                         (size_t) segred_group_sizze_120691};
                            const size_t local_work_sizze_135765[1] =
                                         {segred_group_sizze_120691};
                            int64_t time_start_135762 = 0, time_end_135763 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.segred_large_120463");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135761[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135765[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + 1 + (int64_t) 4 *
                                               segred_group_sizze_120691));
                                time_start_135762 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegred_large_120463,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135761,
                                                                            local_work_sizze_135765,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegred_large_120463_runs,
                                                                                                                      &ctx->mainzisegred_large_120463_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135763 = get_wall_time();
                                
                                long time_diff_135764 = time_end_135763 -
                                     time_start_135762;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segred_large_120463",
                                        time_diff_135764);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &segred_tmp_mem_133471,
                                                  "segred_tmp_mem_133471") != 0)
                            return 1;
                    }
                    
                    struct memblock_device mem_130849;
                    
                    mem_130849.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_130849, bytes_130119,
                                              "mem_130849")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (slt64((int64_t) 0, m_114533 * n_114534)) {
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegScan");
                        
                        int64_t stage1_max_num_groups_133507;
                        
                        stage1_max_num_groups_133507 =
                            ctx->opencl.max_group_size;
                        
                        int64_t stage1_num_groups_133508 =
                                smin64(stage1_max_num_groups_133507,
                                       num_groups_120703);
                        int32_t num_threads_133509 =
                                sext_i64_i32(stage1_num_groups_133508 *
                                segscan_group_sizze_120702);
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120428,
                                                                1,
                                                                sizeof(ctx->failure_is_an_option),
                                                                &ctx->failure_is_an_option));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120428,
                                                                3,
                                                                smax64((int64_t) 1,
                                                                       (int64_t) 4 *
                                                                       segscan_group_sizze_120702),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120428,
                                                                4,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120428,
                                                                5,
                                                                sizeof(n_114534),
                                                                &n_114534));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120428,
                                                                6,
                                                                sizeof(lifted_single_ma_arg_114976),
                                                                &lifted_single_ma_arg_114976));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120428,
                                                                7,
                                                                sizeof(num_threads_133509),
                                                                &num_threads_133509));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120428,
                                                                8,
                                                                sizeof(mem_130840.mem),
                                                                &mem_130840.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120428,
                                                                9,
                                                                sizeof(mem_130844.mem),
                                                                &mem_130844.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_120428,
                                                                10,
                                                                sizeof(mem_130849.mem),
                                                                &mem_130849.mem));
                        if (1 * ((size_t) stage1_num_groups_133508 *
                                 (size_t) segscan_group_sizze_120702) != 0) {
                            const size_t global_work_sizze_135766[1] =
                                         {(size_t) stage1_num_groups_133508 *
                                         (size_t) segscan_group_sizze_120702};
                            const size_t local_work_sizze_135770[1] =
                                         {segscan_group_sizze_120702};
                            int64_t time_start_135767 = 0, time_end_135768 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.scan_stage1_120428");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135766[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135770[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + smax64((int64_t) 1,
                                                          (int64_t) 4 *
                                                          segscan_group_sizze_120702)));
                                time_start_135767 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainziscan_stage1_120428,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135766,
                                                                            local_work_sizze_135770,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainziscan_stage1_120428_runs,
                                                                                                                      &ctx->mainziscan_stage1_120428_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135768 = get_wall_time();
                                
                                long time_diff_135769 = time_end_135768 -
                                     time_start_135767;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.scan_stage1_120428",
                                        time_diff_135769);
                            }
                        }
                        ctx->failure_is_an_option = 1;
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s: %llu%c", "elems_per_group",
                                    (long long) (segscan_group_sizze_120702 *
                                                 sdiv_up64(m_114533 * n_114534,
                                                           sext_i32_i64(num_threads_133509))),
                                    '\n');
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_120428,
                                                                1,
                                                                smax64((int64_t) 1,
                                                                       (int64_t) 4 *
                                                                       stage1_num_groups_133508),
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_120428,
                                                                2,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_120428,
                                                                3,
                                                                sizeof(n_114534),
                                                                &n_114534));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_120428,
                                                                4,
                                                                sizeof(stage1_num_groups_133508),
                                                                &stage1_num_groups_133508));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_120428,
                                                                5,
                                                                sizeof(num_threads_133509),
                                                                &num_threads_133509));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_120428,
                                                                6,
                                                                sizeof(mem_130849.mem),
                                                                &mem_130849.mem));
                        if (1 * ((size_t) (int64_t) 1 *
                                 (size_t) stage1_num_groups_133508) != 0) {
                            const size_t global_work_sizze_135771[1] =
                                         {(size_t) (int64_t) 1 *
                                         (size_t) stage1_num_groups_133508};
                            const size_t local_work_sizze_135775[1] =
                                         {stage1_num_groups_133508};
                            int64_t time_start_135772 = 0, time_end_135773 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.scan_stage2_120428");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135771[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135775[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + smax64((int64_t) 1,
                                                          (int64_t) 4 *
                                                          stage1_num_groups_133508)));
                                time_start_135772 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainziscan_stage2_120428,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135771,
                                                                            local_work_sizze_135775,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainziscan_stage2_120428_runs,
                                                                                                                      &ctx->mainziscan_stage2_120428_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135773 = get_wall_time();
                                
                                long time_diff_135774 = time_end_135773 -
                                     time_start_135772;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.scan_stage2_120428",
                                        time_diff_135774);
                            }
                        }
                        
                        int32_t required_groups_133551 =
                                sext_i64_i32(sdiv_up64(m_114533 * n_114534,
                                                       segscan_group_sizze_120702));
                        
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_120428,
                                                                1,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_120428,
                                                                2,
                                                                sizeof(n_114534),
                                                                &n_114534));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_120428,
                                                                3,
                                                                sizeof(num_groups_120703),
                                                                &num_groups_120703));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_120428,
                                                                4,
                                                                sizeof(num_threads_133509),
                                                                &num_threads_133509));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_120428,
                                                                5,
                                                                sizeof(required_groups_133551),
                                                                &required_groups_133551));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_120428,
                                                                6,
                                                                sizeof(mem_130849.mem),
                                                                &mem_130849.mem));
                        if (1 * ((size_t) num_groups_120703 *
                                 (size_t) segscan_group_sizze_120702) != 0) {
                            const size_t global_work_sizze_135776[1] =
                                         {(size_t) num_groups_120703 *
                                         (size_t) segscan_group_sizze_120702};
                            const size_t local_work_sizze_135780[1] =
                                         {segscan_group_sizze_120702};
                            int64_t time_start_135777 = 0, time_end_135778 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.scan_stage3_120428");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135776[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135780[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) 0);
                                time_start_135777 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainziscan_stage3_120428,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135776,
                                                                            local_work_sizze_135780,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainziscan_stage3_120428_runs,
                                                                                                                      &ctx->mainziscan_stage3_120428_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135778 = get_wall_time();
                                
                                long time_diff_135779 = time_end_135778 -
                                     time_start_135777;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.scan_stage3_120428",
                                        time_diff_135779);
                            }
                        }
                    }
                    if (memblock_unref_device(ctx, &mem_130840, "mem_130840") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130844, "mem_130844") !=
                        0)
                        return 1;
                    if (memblock_set_device(ctx, &defunc_3_map_res_mem_130850,
                                            &mem_130849, "mem_130849") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130849, "mem_130849") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130844, "mem_130844") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130840, "mem_130840") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130835, "mem_130835") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130831, "mem_130831") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130826, "mem_130826") !=
                        0)
                        return 1;
                }
                if (memblock_set_device(ctx, &defunc_3_map_res_mem_130856,
                                        &defunc_3_map_res_mem_130850,
                                        "defunc_3_map_res_mem_130850") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130850,
                                          "defunc_3_map_res_mem_130850") != 0)
                    return 1;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120742, 1,
                                                    sizeof(ctx->failure_is_an_option),
                                                    &ctx->failure_is_an_option));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120742, 3,
                                                    sizeof(m_114533),
                                                    &m_114533));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120742, 4,
                                                    sizeof(n_114534),
                                                    &n_114534));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120742, 5,
                                                    sizeof(loopz2081Uz2085Uz2089U_115023),
                                                    &loopz2081Uz2085Uz2089U_115023));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120742, 6,
                                                    sizeof(ctx_param_ext_130640),
                                                    &ctx_param_ext_130640));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120742, 7,
                                                    sizeof(ctx_param_ext_130641),
                                                    &ctx_param_ext_130641));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120742, 8,
                                                    sizeof(ctx_param_ext_130643),
                                                    &ctx_param_ext_130643));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120742, 9,
                                                    sizeof(defunc_3_map_res_mem_130116.mem),
                                                    &defunc_3_map_res_mem_130116.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120742,
                                                    10,
                                                    sizeof(mem_param_130645.mem),
                                                    &mem_param_130645.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120742,
                                                    11,
                                                    sizeof(defunc_3_map_res_mem_130856.mem),
                                                    &defunc_3_map_res_mem_130856.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120742,
                                                    12, sizeof(mem_130861.mem),
                                                    &mem_130861.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120742,
                                                    13, sizeof(mem_130865.mem),
                                                    &mem_130865.mem));
            if (1 * ((size_t) segmap_usable_groups_120789 *
                     (size_t) segmap_group_sizze_120788) != 0) {
                const size_t global_work_sizze_135781[1] =
                             {(size_t) segmap_usable_groups_120789 *
                             (size_t) segmap_group_sizze_120788};
                const size_t local_work_sizze_135785[1] =
                             {segmap_group_sizze_120788};
                int64_t time_start_135782 = 0, time_end_135783 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log, "Launching %s with global work size [",
                            "main.segmap_120742");
                    fprintf(ctx->log, "%zu", global_work_sizze_135781[0]);
                    fprintf(ctx->log, "] and local work size [");
                    fprintf(ctx->log, "%zu", local_work_sizze_135785[0]);
                    fprintf(ctx->log,
                            "]; local memory parameters sum to %d bytes.\n",
                            (int) 0);
                    time_start_135782 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_120742,
                                                                1, NULL,
                                                                global_work_sizze_135781,
                                                                local_work_sizze_135785,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_120742_runs,
                                                                                                          &ctx->mainzisegmap_120742_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_135783 = get_wall_time();
                    
                    long time_diff_135784 = time_end_135783 - time_start_135782;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_120742", time_diff_135784);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130856,
                                      "defunc_3_map_res_mem_130856") != 0)
                return 1;
            
            struct memblock_device defunc_11_loess_l_res_mem_131230;
            
            defunc_11_loess_l_res_mem_131230.references = NULL;
            
            struct memblock_device defunc_11_loess_l_res_mem_131231;
            
            defunc_11_loess_l_res_mem_131231.references = NULL;
            if (cond_115012) {
                bool match_lit_115186 = (int64_t) 0 == l_degree_114540;
                struct memblock_device
                defunc_12_lifted_use_version_res_mem_131169;
                
                defunc_12_lifted_use_version_res_mem_131169.references = NULL;
                
                struct memblock_device
                defunc_12_lifted_use_version_res_mem_131170;
                
                defunc_12_lifted_use_version_res_mem_131170.references = NULL;
                if (match_lit_115186) {
                    struct memblock_device mem_130869;
                    
                    mem_130869.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_130869, bytes_130399,
                                              "mem_130869")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f32(ctx, mem_130869,
                                                      m_114533 * l_n_m_114584,
                                                      0.0F) != 0) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    bool suff_outer_par_120809;
                    
                    suff_outer_par_120809 =
                        ctx->sizes.mainzisuff_outer_par_13 <= m_114533;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_13", (long) m_114533,
                                suff_outer_par_120809 ? "true" : "false");
                    
                    int64_t segmap_group_sizze_120882;
                    
                    segmap_group_sizze_120882 =
                        ctx->sizes.mainzisegmap_group_sizze_120813;
                    
                    int64_t num_groups_120883;
                    int32_t max_num_groups_133575;
                    
                    max_num_groups_133575 =
                        ctx->sizes.mainzisegmap_num_groups_120815;
                    num_groups_120883 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(m_114533,
                                                                             segmap_group_sizze_120882),
                                                                   sext_i32_i64(max_num_groups_133575))));
                    
                    int64_t segmap_group_sizze_121242;
                    
                    segmap_group_sizze_121242 =
                        ctx->sizes.mainzisegmap_group_sizze_120954;
                    
                    bool suff_outer_par_121246;
                    
                    suff_outer_par_121246 =
                        ctx->sizes.mainzisuff_outer_par_14 <= nest_sizze_118236;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_14",
                                (long) nest_sizze_118236,
                                suff_outer_par_121246 ? "true" : "false");
                    
                    int64_t nest_sizze_121320 = l_window_114538 *
                            nest_sizze_118236;
                    int64_t segred_group_sizze_121321;
                    
                    segred_group_sizze_121321 =
                        ctx->sizes.mainzisegred_group_sizze_121092;
                    
                    int64_t num_groups_121322;
                    int32_t max_num_groups_133576;
                    
                    max_num_groups_133576 =
                        ctx->sizes.mainzisegred_num_groups_121094;
                    num_groups_121322 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_121320,
                                                                             segred_group_sizze_121321),
                                                                   sext_i32_i64(max_num_groups_133576))));
                    
                    int64_t segmap_group_sizze_121357;
                    
                    segmap_group_sizze_121357 =
                        ctx->sizes.mainzisegmap_group_sizze_121082;
                    
                    int64_t segred_group_sizze_121365;
                    
                    segred_group_sizze_121365 =
                        ctx->sizes.mainzisegred_group_sizze_121030;
                    
                    int64_t num_groups_121366;
                    int32_t max_num_groups_133577;
                    
                    max_num_groups_133577 =
                        ctx->sizes.mainzisegred_num_groups_121032;
                    num_groups_121366 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_121320,
                                                                             segred_group_sizze_121365),
                                                                   sext_i32_i64(max_num_groups_133577))));
                    
                    int64_t num_threads_132209 = segmap_group_sizze_120882 *
                            num_groups_120883;
                    int64_t total_sizze_132210 = bytes_130238 *
                            num_threads_132209;
                    struct memblock_device defunc_7_map_res_mem_130930;
                    
                    defunc_7_map_res_mem_130930.references = NULL;
                    
                    int32_t local_memory_capacity_133752;
                    
                    local_memory_capacity_133752 = ctx->opencl.max_local_memory;
                    if (sle64((int64_t) 0,
                              sext_i32_i64(local_memory_capacity_133752)) &&
                        suff_outer_par_120809) {
                        struct memblock_device mem_130872;
                        
                        mem_130872.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_130872,
                                                  bytes_130268, "mem_130872")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_130872,
                                                                  (int64_t) 0,
                                                                  defunc_3_map_res_mem_130404,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  l_n_m_114584,
                                                                  m_114533) !=
                            0) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_130875;
                        
                        mem_130875.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_130875,
                                                  bytes_130271, "mem_130875")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                  mem_130875,
                                                                  (int64_t) 0,
                                                                  defunc_3_map_res_mem_130405,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  l_n_m_114584,
                                                                  m_114533) !=
                            0) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_130878;
                        
                        mem_130878.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_130878,
                                                  binop_y_130121,
                                                  "mem_130878")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                  mem_130878,
                                                                  (int64_t) 0,
                                                                  mem_130122,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_114534,
                                                                  m_114533) !=
                            0) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_130881;
                        
                        mem_130881.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_130881,
                                                  binop_y_130121,
                                                  "mem_130881")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                  mem_130881,
                                                                  (int64_t) 0,
                                                                  mem_130861,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_114534,
                                                                  m_114533) !=
                            0) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_130884;
                        
                        mem_130884.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_130884,
                                                  binop_y_130121,
                                                  "mem_130884")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                  mem_130884,
                                                                  (int64_t) 0,
                                                                  mem_130865,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_114534,
                                                                  m_114533) !=
                            0) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_130903;
                        
                        mem_130903.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_130903,
                                                  bytes_130271, "mem_130903")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_132109;
                        
                        color_132109.references = NULL;
                        if (memblock_alloc_device(ctx, &color_132109,
                                                  total_sizze_132210,
                                                  "color_132109")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120811,
                                                                1,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120811,
                                                                2,
                                                                sizeof(l_window_114538),
                                                                &l_window_114538));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120811,
                                                                3,
                                                                sizeof(t_jump_114541),
                                                                &t_jump_114541));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120811,
                                                                4,
                                                                sizeof(l_n_m_114584),
                                                                &l_n_m_114584));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120811,
                                                                5,
                                                                sizeof(i_114610),
                                                                &i_114610));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120811,
                                                                6,
                                                                sizeof(num_groups_120883),
                                                                &num_groups_120883));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120811,
                                                                7,
                                                                sizeof(num_threads_132209),
                                                                &num_threads_132209));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120811,
                                                                8,
                                                                sizeof(defunc_3_map_res_mem_130117.mem),
                                                                &defunc_3_map_res_mem_130117.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120811,
                                                                9,
                                                                sizeof(mem_130872.mem),
                                                                &mem_130872.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120811,
                                                                10,
                                                                sizeof(mem_130875.mem),
                                                                &mem_130875.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120811,
                                                                11,
                                                                sizeof(mem_130878.mem),
                                                                &mem_130878.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120811,
                                                                12,
                                                                sizeof(mem_130881.mem),
                                                                &mem_130881.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120811,
                                                                13,
                                                                sizeof(mem_130884.mem),
                                                                &mem_130884.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120811,
                                                                14,
                                                                sizeof(mem_130903.mem),
                                                                &mem_130903.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120811,
                                                                15,
                                                                sizeof(color_132109.mem),
                                                                &color_132109.mem));
                        if (1 * ((size_t) num_groups_120883 *
                                 (size_t) segmap_group_sizze_120882) != 0) {
                            const size_t global_work_sizze_135786[1] =
                                         {(size_t) num_groups_120883 *
                                         (size_t) segmap_group_sizze_120882};
                            const size_t local_work_sizze_135790[1] =
                                         {segmap_group_sizze_120882};
                            int64_t time_start_135787 = 0, time_end_135788 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.segmap_120811");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135786[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135790[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) 0);
                                time_start_135787 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_120811,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135786,
                                                                            local_work_sizze_135790,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_120811_runs,
                                                                                                                      &ctx->mainzisegmap_120811_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135788 = get_wall_time();
                                
                                long time_diff_135789 = time_end_135788 -
                                     time_start_135787;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_120811", time_diff_135789);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_130872,
                                                  "mem_130872") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_130875,
                                                  "mem_130875") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_130878,
                                                  "mem_130878") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_130881,
                                                  "mem_130881") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_130884,
                                                  "mem_130884") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_132109,
                                                  "color_132109") != 0)
                            return 1;
                        
                        struct memblock_device mem_130928;
                        
                        mem_130928.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_130928,
                                                  bytes_130399, "mem_130928")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                  mem_130928,
                                                                  (int64_t) 0,
                                                                  mem_130903,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  m_114533,
                                                                  l_n_m_114584) !=
                            0) {
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_unref_device(ctx, &mem_130903,
                                                  "mem_130903") != 0)
                            return 1;
                        if (memblock_set_device(ctx,
                                                &defunc_7_map_res_mem_130930,
                                                &mem_130928, "mem_130928") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_130928,
                                                  "mem_130928") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_132109,
                                                  "color_132109") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_130903,
                                                  "mem_130903") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_130884,
                                                  "mem_130884") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_130881,
                                                  "mem_130881") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_130878,
                                                  "mem_130878") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_130875,
                                                  "mem_130875") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_130872,
                                                  "mem_130872") != 0)
                            return 1;
                    } else {
                        int64_t segmap_usable_groups_121243 =
                                sdiv_up64(nest_sizze_118236,
                                          segmap_group_sizze_121242);
                        struct memblock_device defunc_7_map_res_mem_130924;
                        
                        defunc_7_map_res_mem_130924.references = NULL;
                        
                        int32_t local_memory_capacity_133751;
                        
                        local_memory_capacity_133751 =
                            ctx->opencl.max_local_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_133751)) &&
                            suff_outer_par_121246) {
                            struct memblock_device mem_130908;
                            
                            mem_130908.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_130908,
                                                      bytes_130399,
                                                      "mem_130908")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120951,
                                                                    1,
                                                                    sizeof(m_114533),
                                                                    &m_114533));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120951,
                                                                    2,
                                                                    sizeof(n_114534),
                                                                    &n_114534));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120951,
                                                                    3,
                                                                    sizeof(l_window_114538),
                                                                    &l_window_114538));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120951,
                                                                    4,
                                                                    sizeof(t_jump_114541),
                                                                    &t_jump_114541));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120951,
                                                                    5,
                                                                    sizeof(l_n_m_114584),
                                                                    &l_n_m_114584));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120951,
                                                                    6,
                                                                    sizeof(i_114610),
                                                                    &i_114610));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120951,
                                                                    7,
                                                                    sizeof(defunc_3_map_res_mem_130117.mem),
                                                                    &defunc_3_map_res_mem_130117.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120951,
                                                                    8,
                                                                    sizeof(mem_130122.mem),
                                                                    &mem_130122.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120951,
                                                                    9,
                                                                    sizeof(defunc_3_map_res_mem_130404.mem),
                                                                    &defunc_3_map_res_mem_130404.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120951,
                                                                    10,
                                                                    sizeof(defunc_3_map_res_mem_130405.mem),
                                                                    &defunc_3_map_res_mem_130405.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120951,
                                                                    11,
                                                                    sizeof(mem_130861.mem),
                                                                    &mem_130861.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120951,
                                                                    12,
                                                                    sizeof(mem_130865.mem),
                                                                    &mem_130865.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_120951,
                                                                    13,
                                                                    sizeof(mem_130908.mem),
                                                                    &mem_130908.mem));
                            if (1 * ((size_t) segmap_usable_groups_121243 *
                                     (size_t) segmap_group_sizze_121242) != 0) {
                                const size_t global_work_sizze_135791[1] =
                                             {(size_t) segmap_usable_groups_121243 *
                                             (size_t) segmap_group_sizze_121242};
                                const size_t local_work_sizze_135795[1] =
                                             {segmap_group_sizze_121242};
                                int64_t time_start_135792 = 0, time_end_135793 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [",
                                            "main.segmap_120951");
                                    fprintf(ctx->log, "%zu",
                                            global_work_sizze_135791[0]);
                                    fprintf(ctx->log,
                                            "] and local work size [");
                                    fprintf(ctx->log, "%zu",
                                            local_work_sizze_135795[0]);
                                    fprintf(ctx->log,
                                            "]; local memory parameters sum to %d bytes.\n",
                                            (int) 0);
                                    time_start_135792 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_120951,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_135791,
                                                                                local_work_sizze_135795,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_120951_runs,
                                                                                                                          &ctx->mainzisegmap_120951_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_135793 = get_wall_time();
                                    
                                    long time_diff_135794 = time_end_135793 -
                                         time_start_135792;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_120951",
                                            time_diff_135794);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_130924,
                                                    &mem_130908,
                                                    "mem_130908") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_130908,
                                                      "mem_130908") != 0)
                                return 1;
                        } else {
                            struct memblock_device mem_130913;
                            
                            mem_130913.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_130913,
                                                      bytes_130399,
                                                      "mem_130913")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(l_window_114538 * (int64_t) 2,
                                      segred_group_sizze_121321)) {
                                int64_t segment_sizze_nonzzero_133605 =
                                        smax64((int64_t) 1, l_window_114538);
                                int64_t num_threads_133606 = num_groups_121322 *
                                        segred_group_sizze_121321;
                                
                                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_114533 *
                                                         l_n_m_114584), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) l_window_114538, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_121321,
                                                                segment_sizze_nonzzero_133605),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(m_114533 *
                                                                               l_n_m_114584,
                                                                               squot64(segred_group_sizze_121321,
                                                                                       segment_sizze_nonzzero_133605))),
                                            '\n');
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121098,
                                                                        1,
                                                                        (int64_t) 4 *
                                                                        segred_group_sizze_121321,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121098,
                                                                        2,
                                                                        sizeof(m_114533),
                                                                        &m_114533));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121098,
                                                                        3,
                                                                        sizeof(n_114534),
                                                                        &n_114534));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121098,
                                                                        4,
                                                                        sizeof(l_window_114538),
                                                                        &l_window_114538));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121098,
                                                                        5,
                                                                        sizeof(t_jump_114541),
                                                                        &t_jump_114541));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121098,
                                                                        6,
                                                                        sizeof(l_n_m_114584),
                                                                        &l_n_m_114584));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121098,
                                                                        7,
                                                                        sizeof(i_114610),
                                                                        &i_114610));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121098,
                                                                        8,
                                                                        sizeof(num_groups_121322),
                                                                        &num_groups_121322));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121098,
                                                                        9,
                                                                        sizeof(segment_sizze_nonzzero_133605),
                                                                        &segment_sizze_nonzzero_133605));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121098,
                                                                        10,
                                                                        sizeof(defunc_3_map_res_mem_130117.mem),
                                                                        &defunc_3_map_res_mem_130117.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121098,
                                                                        11,
                                                                        sizeof(mem_130122.mem),
                                                                        &mem_130122.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121098,
                                                                        12,
                                                                        sizeof(defunc_3_map_res_mem_130404.mem),
                                                                        &defunc_3_map_res_mem_130404.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121098,
                                                                        13,
                                                                        sizeof(defunc_3_map_res_mem_130405.mem),
                                                                        &defunc_3_map_res_mem_130405.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121098,
                                                                        14,
                                                                        sizeof(mem_130861.mem),
                                                                        &mem_130861.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121098,
                                                                        15,
                                                                        sizeof(mem_130913.mem),
                                                                        &mem_130913.mem));
                                if (1 * ((size_t) num_groups_121322 *
                                         (size_t) segred_group_sizze_121321) !=
                                    0) {
                                    const size_t global_work_sizze_135796[1] =
                                                 {(size_t) num_groups_121322 *
                                                 (size_t) segred_group_sizze_121321};
                                    const size_t local_work_sizze_135800[1] =
                                                 {segred_group_sizze_121321};
                                    int64_t time_start_135797 = 0,
                                            time_end_135798 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [",
                                                "main.segred_small_121098");
                                        fprintf(ctx->log, "%zu",
                                                global_work_sizze_135796[0]);
                                        fprintf(ctx->log,
                                                "] and local work size [");
                                        fprintf(ctx->log, "%zu",
                                                local_work_sizze_135800[0]);
                                        fprintf(ctx->log,
                                                "]; local memory parameters sum to %d bytes.\n",
                                                (int) (0 + (int64_t) 4 *
                                                       segred_group_sizze_121321));
                                        time_start_135797 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_small_121098,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_135796,
                                                                                    local_work_sizze_135800,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_small_121098_runs,
                                                                                                                              &ctx->mainzisegred_small_121098_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_135798 = get_wall_time();
                                        
                                        long time_diff_135799 =
                                             time_end_135798 -
                                             time_start_135797;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_small_121098",
                                                time_diff_135799);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_133630 =
                                        sdiv_up64(num_groups_121322,
                                                  smax64((int64_t) 1, m_114533 *
                                                         l_n_m_114584));
                                int64_t elements_per_thread_133631 =
                                        sdiv_up64(l_window_114538,
                                                  segred_group_sizze_121321 *
                                                  groups_per_segment_133630);
                                int64_t virt_num_groups_133632 =
                                        groups_per_segment_133630 * (m_114533 *
                                                                     l_n_m_114584);
                                int64_t num_threads_133633 = num_groups_121322 *
                                        segred_group_sizze_121321;
                                int64_t threads_per_segment_133634 =
                                        groups_per_segment_133630 *
                                        segred_group_sizze_121321;
                                
                                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_114533 *
                                                         l_n_m_114584), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) l_window_114538, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_133632,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_121322,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_121321,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_133631,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_133630,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_133635;
                                
                                segred_tmp_mem_133635.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_133635,
                                                          (int64_t) 4 *
                                                          virt_num_groups_133632,
                                                          "segred_tmp_mem_133635")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_133637
                                                       =
                                                       ctx->mainzicounter_mem_133637;
                                
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        1, 1,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        2,
                                                                        (int64_t) 4 *
                                                                        segred_group_sizze_121321,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        3,
                                                                        sizeof(m_114533),
                                                                        &m_114533));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        4,
                                                                        sizeof(n_114534),
                                                                        &n_114534));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        5,
                                                                        sizeof(l_window_114538),
                                                                        &l_window_114538));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        6,
                                                                        sizeof(t_jump_114541),
                                                                        &t_jump_114541));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        7,
                                                                        sizeof(l_n_m_114584),
                                                                        &l_n_m_114584));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        8,
                                                                        sizeof(i_114610),
                                                                        &i_114610));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        9,
                                                                        sizeof(num_groups_121322),
                                                                        &num_groups_121322));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        10,
                                                                        sizeof(groups_per_segment_133630),
                                                                        &groups_per_segment_133630));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        11,
                                                                        sizeof(elements_per_thread_133631),
                                                                        &elements_per_thread_133631));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        12,
                                                                        sizeof(virt_num_groups_133632),
                                                                        &virt_num_groups_133632));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        13,
                                                                        sizeof(threads_per_segment_133634),
                                                                        &threads_per_segment_133634));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        14,
                                                                        sizeof(defunc_3_map_res_mem_130117.mem),
                                                                        &defunc_3_map_res_mem_130117.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        15,
                                                                        sizeof(mem_130122.mem),
                                                                        &mem_130122.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        16,
                                                                        sizeof(defunc_3_map_res_mem_130404.mem),
                                                                        &defunc_3_map_res_mem_130404.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        17,
                                                                        sizeof(defunc_3_map_res_mem_130405.mem),
                                                                        &defunc_3_map_res_mem_130405.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        18,
                                                                        sizeof(mem_130861.mem),
                                                                        &mem_130861.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        19,
                                                                        sizeof(mem_130913.mem),
                                                                        &mem_130913.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        20,
                                                                        sizeof(segred_tmp_mem_133635.mem),
                                                                        &segred_tmp_mem_133635.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121098,
                                                                        21,
                                                                        sizeof(mainzicounter_mem_133637.mem),
                                                                        &mainzicounter_mem_133637.mem));
                                if (1 * ((size_t) num_groups_121322 *
                                         (size_t) segred_group_sizze_121321) !=
                                    0) {
                                    const size_t global_work_sizze_135802[1] =
                                                 {(size_t) num_groups_121322 *
                                                 (size_t) segred_group_sizze_121321};
                                    const size_t local_work_sizze_135806[1] =
                                                 {segred_group_sizze_121321};
                                    int64_t time_start_135803 = 0,
                                            time_end_135804 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [",
                                                "main.segred_large_121098");
                                        fprintf(ctx->log, "%zu",
                                                global_work_sizze_135802[0]);
                                        fprintf(ctx->log,
                                                "] and local work size [");
                                        fprintf(ctx->log, "%zu",
                                                local_work_sizze_135806[0]);
                                        fprintf(ctx->log,
                                                "]; local memory parameters sum to %d bytes.\n",
                                                (int) (0 + 1 + (int64_t) 4 *
                                                       segred_group_sizze_121321));
                                        time_start_135803 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_large_121098,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_135802,
                                                                                    local_work_sizze_135806,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_large_121098_runs,
                                                                                                                              &ctx->mainzisegred_large_121098_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_135804 = get_wall_time();
                                        
                                        long time_diff_135805 =
                                             time_end_135804 -
                                             time_start_135803;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_large_121098",
                                                time_diff_135805);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_133635,
                                                          "segred_tmp_mem_133635") !=
                                    0)
                                    return 1;
                            }
                            
                            int64_t segmap_usable_groups_121358 =
                                    sdiv_up64(nest_sizze_118236,
                                              segmap_group_sizze_121357);
                            struct memblock_device mem_130918;
                            
                            mem_130918.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_130918,
                                                      bytes_130399,
                                                      "mem_130918")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121079,
                                                                    1,
                                                                    sizeof(m_114533),
                                                                    &m_114533));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121079,
                                                                    2,
                                                                    sizeof(l_n_m_114584),
                                                                    &l_n_m_114584));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121079,
                                                                    3,
                                                                    sizeof(mem_130913.mem),
                                                                    &mem_130913.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121079,
                                                                    4,
                                                                    sizeof(mem_130918.mem),
                                                                    &mem_130918.mem));
                            if (1 * ((size_t) segmap_usable_groups_121358 *
                                     (size_t) segmap_group_sizze_121357) != 0) {
                                const size_t global_work_sizze_135807[1] =
                                             {(size_t) segmap_usable_groups_121358 *
                                             (size_t) segmap_group_sizze_121357};
                                const size_t local_work_sizze_135811[1] =
                                             {segmap_group_sizze_121357};
                                int64_t time_start_135808 = 0, time_end_135809 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [",
                                            "main.segmap_121079");
                                    fprintf(ctx->log, "%zu",
                                            global_work_sizze_135807[0]);
                                    fprintf(ctx->log,
                                            "] and local work size [");
                                    fprintf(ctx->log, "%zu",
                                            local_work_sizze_135811[0]);
                                    fprintf(ctx->log,
                                            "]; local memory parameters sum to %d bytes.\n",
                                            (int) 0);
                                    time_start_135808 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_121079,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_135807,
                                                                                local_work_sizze_135811,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_121079_runs,
                                                                                                                          &ctx->mainzisegmap_121079_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_135809 = get_wall_time();
                                    
                                    long time_diff_135810 = time_end_135809 -
                                         time_start_135808;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_121079",
                                            time_diff_135810);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_130913,
                                                      "mem_130913") != 0)
                                return 1;
                            
                            struct memblock_device mem_130923;
                            
                            mem_130923.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_130923,
                                                      bytes_130399,
                                                      "mem_130923")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(l_window_114538 * (int64_t) 2,
                                      segred_group_sizze_121365)) {
                                int64_t segment_sizze_nonzzero_133683 =
                                        smax64((int64_t) 1, l_window_114538);
                                int64_t num_threads_133684 = num_groups_121366 *
                                        segred_group_sizze_121365;
                                
                                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_114533 *
                                                         l_n_m_114584), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) l_window_114538, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_121365,
                                                                segment_sizze_nonzzero_133683),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(m_114533 *
                                                                               l_n_m_114584,
                                                                               squot64(segred_group_sizze_121365,
                                                                                       segment_sizze_nonzzero_133683))),
                                            '\n');
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121036,
                                                                        1,
                                                                        (int64_t) 4 *
                                                                        segred_group_sizze_121365,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121036,
                                                                        2,
                                                                        sizeof(m_114533),
                                                                        &m_114533));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121036,
                                                                        3,
                                                                        sizeof(n_114534),
                                                                        &n_114534));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121036,
                                                                        4,
                                                                        sizeof(l_window_114538),
                                                                        &l_window_114538));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121036,
                                                                        5,
                                                                        sizeof(t_jump_114541),
                                                                        &t_jump_114541));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121036,
                                                                        6,
                                                                        sizeof(l_n_m_114584),
                                                                        &l_n_m_114584));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121036,
                                                                        7,
                                                                        sizeof(i_114610),
                                                                        &i_114610));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121036,
                                                                        8,
                                                                        sizeof(num_groups_121366),
                                                                        &num_groups_121366));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121036,
                                                                        9,
                                                                        sizeof(segment_sizze_nonzzero_133683),
                                                                        &segment_sizze_nonzzero_133683));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121036,
                                                                        10,
                                                                        sizeof(defunc_3_map_res_mem_130117.mem),
                                                                        &defunc_3_map_res_mem_130117.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121036,
                                                                        11,
                                                                        sizeof(mem_130122.mem),
                                                                        &mem_130122.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121036,
                                                                        12,
                                                                        sizeof(defunc_3_map_res_mem_130404.mem),
                                                                        &defunc_3_map_res_mem_130404.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121036,
                                                                        13,
                                                                        sizeof(defunc_3_map_res_mem_130405.mem),
                                                                        &defunc_3_map_res_mem_130405.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121036,
                                                                        14,
                                                                        sizeof(mem_130861.mem),
                                                                        &mem_130861.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121036,
                                                                        15,
                                                                        sizeof(mem_130865.mem),
                                                                        &mem_130865.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121036,
                                                                        16,
                                                                        sizeof(mem_130918.mem),
                                                                        &mem_130918.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121036,
                                                                        17,
                                                                        sizeof(mem_130923.mem),
                                                                        &mem_130923.mem));
                                if (1 * ((size_t) num_groups_121366 *
                                         (size_t) segred_group_sizze_121365) !=
                                    0) {
                                    const size_t global_work_sizze_135812[1] =
                                                 {(size_t) num_groups_121366 *
                                                 (size_t) segred_group_sizze_121365};
                                    const size_t local_work_sizze_135816[1] =
                                                 {segred_group_sizze_121365};
                                    int64_t time_start_135813 = 0,
                                            time_end_135814 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [",
                                                "main.segred_small_121036");
                                        fprintf(ctx->log, "%zu",
                                                global_work_sizze_135812[0]);
                                        fprintf(ctx->log,
                                                "] and local work size [");
                                        fprintf(ctx->log, "%zu",
                                                local_work_sizze_135816[0]);
                                        fprintf(ctx->log,
                                                "]; local memory parameters sum to %d bytes.\n",
                                                (int) (0 + (int64_t) 4 *
                                                       segred_group_sizze_121365));
                                        time_start_135813 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_small_121036,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_135812,
                                                                                    local_work_sizze_135816,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_small_121036_runs,
                                                                                                                              &ctx->mainzisegred_small_121036_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_135814 = get_wall_time();
                                        
                                        long time_diff_135815 =
                                             time_end_135814 -
                                             time_start_135813;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_small_121036",
                                                time_diff_135815);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_133708 =
                                        sdiv_up64(num_groups_121366,
                                                  smax64((int64_t) 1, m_114533 *
                                                         l_n_m_114584));
                                int64_t elements_per_thread_133709 =
                                        sdiv_up64(l_window_114538,
                                                  segred_group_sizze_121365 *
                                                  groups_per_segment_133708);
                                int64_t virt_num_groups_133710 =
                                        groups_per_segment_133708 * (m_114533 *
                                                                     l_n_m_114584);
                                int64_t num_threads_133711 = num_groups_121366 *
                                        segred_group_sizze_121365;
                                int64_t threads_per_segment_133712 =
                                        groups_per_segment_133708 *
                                        segred_group_sizze_121365;
                                
                                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_114533 *
                                                         l_n_m_114584), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) l_window_114538, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_133710,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_121366,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_121365,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_133709,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_133708,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_133713;
                                
                                segred_tmp_mem_133713.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_133713,
                                                          (int64_t) 4 *
                                                          virt_num_groups_133710,
                                                          "segred_tmp_mem_133713")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_133715
                                                       =
                                                       ctx->mainzicounter_mem_133715;
                                
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        1, 1,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        2,
                                                                        (int64_t) 4 *
                                                                        segred_group_sizze_121365,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        3,
                                                                        sizeof(m_114533),
                                                                        &m_114533));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        4,
                                                                        sizeof(n_114534),
                                                                        &n_114534));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        5,
                                                                        sizeof(l_window_114538),
                                                                        &l_window_114538));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        6,
                                                                        sizeof(t_jump_114541),
                                                                        &t_jump_114541));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        7,
                                                                        sizeof(l_n_m_114584),
                                                                        &l_n_m_114584));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        8,
                                                                        sizeof(i_114610),
                                                                        &i_114610));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        9,
                                                                        sizeof(num_groups_121366),
                                                                        &num_groups_121366));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        10,
                                                                        sizeof(groups_per_segment_133708),
                                                                        &groups_per_segment_133708));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        11,
                                                                        sizeof(elements_per_thread_133709),
                                                                        &elements_per_thread_133709));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        12,
                                                                        sizeof(virt_num_groups_133710),
                                                                        &virt_num_groups_133710));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        13,
                                                                        sizeof(threads_per_segment_133712),
                                                                        &threads_per_segment_133712));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        14,
                                                                        sizeof(defunc_3_map_res_mem_130117.mem),
                                                                        &defunc_3_map_res_mem_130117.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        15,
                                                                        sizeof(mem_130122.mem),
                                                                        &mem_130122.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        16,
                                                                        sizeof(defunc_3_map_res_mem_130404.mem),
                                                                        &defunc_3_map_res_mem_130404.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        17,
                                                                        sizeof(defunc_3_map_res_mem_130405.mem),
                                                                        &defunc_3_map_res_mem_130405.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        18,
                                                                        sizeof(mem_130861.mem),
                                                                        &mem_130861.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        19,
                                                                        sizeof(mem_130865.mem),
                                                                        &mem_130865.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        20,
                                                                        sizeof(mem_130918.mem),
                                                                        &mem_130918.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        21,
                                                                        sizeof(mem_130923.mem),
                                                                        &mem_130923.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        22,
                                                                        sizeof(segred_tmp_mem_133713.mem),
                                                                        &segred_tmp_mem_133713.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121036,
                                                                        23,
                                                                        sizeof(mainzicounter_mem_133715.mem),
                                                                        &mainzicounter_mem_133715.mem));
                                if (1 * ((size_t) num_groups_121366 *
                                         (size_t) segred_group_sizze_121365) !=
                                    0) {
                                    const size_t global_work_sizze_135818[1] =
                                                 {(size_t) num_groups_121366 *
                                                 (size_t) segred_group_sizze_121365};
                                    const size_t local_work_sizze_135822[1] =
                                                 {segred_group_sizze_121365};
                                    int64_t time_start_135819 = 0,
                                            time_end_135820 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [",
                                                "main.segred_large_121036");
                                        fprintf(ctx->log, "%zu",
                                                global_work_sizze_135818[0]);
                                        fprintf(ctx->log,
                                                "] and local work size [");
                                        fprintf(ctx->log, "%zu",
                                                local_work_sizze_135822[0]);
                                        fprintf(ctx->log,
                                                "]; local memory parameters sum to %d bytes.\n",
                                                (int) (0 + 1 + (int64_t) 4 *
                                                       segred_group_sizze_121365));
                                        time_start_135819 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_large_121036,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_135818,
                                                                                    local_work_sizze_135822,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_large_121036_runs,
                                                                                                                              &ctx->mainzisegred_large_121036_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_135820 = get_wall_time();
                                        
                                        long time_diff_135821 =
                                             time_end_135820 -
                                             time_start_135819;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_large_121036",
                                                time_diff_135821);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_133713,
                                                          "segred_tmp_mem_133713") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_unref_device(ctx, &mem_130918,
                                                      "mem_130918") != 0)
                                return 1;
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_130924,
                                                    &mem_130923,
                                                    "mem_130923") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_130923,
                                                      "mem_130923") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_130918,
                                                      "mem_130918") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_130913,
                                                      "mem_130913") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx,
                                                &defunc_7_map_res_mem_130930,
                                                &defunc_7_map_res_mem_130924,
                                                "defunc_7_map_res_mem_130924") !=
                            0)
                            return 1;
                        if (memblock_unref_device(ctx,
                                                  &defunc_7_map_res_mem_130924,
                                                  "defunc_7_map_res_mem_130924") !=
                            0)
                            return 1;
                    }
                    if (memblock_set_device(ctx,
                                            &defunc_12_lifted_use_version_res_mem_131169,
                                            &defunc_7_map_res_mem_130930,
                                            "defunc_7_map_res_mem_130930") != 0)
                        return 1;
                    if (memblock_set_device(ctx,
                                            &defunc_12_lifted_use_version_res_mem_131170,
                                            &mem_130869, "mem_130869") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_7_map_res_mem_130930,
                                              "defunc_7_map_res_mem_130930") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130869, "mem_130869") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_115257 = (int64_t) 1 == l_degree_114540;
                    struct memblock_device x_mem_131167;
                    
                    x_mem_131167.references = NULL;
                    
                    struct memblock_device x_mem_131168;
                    
                    x_mem_131168.references = NULL;
                    if (match_lit_115257) {
                        bool suff_outer_par_121410;
                        
                        suff_outer_par_121410 =
                            ctx->sizes.mainzisuff_outer_par_15 <= m_114533;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_15", (long) m_114533,
                                    suff_outer_par_121410 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_121512;
                        
                        segmap_group_sizze_121512 =
                            ctx->sizes.mainzisegmap_group_sizze_121414;
                        
                        int64_t num_groups_121513;
                        int32_t max_num_groups_133753;
                        
                        max_num_groups_133753 =
                            ctx->sizes.mainzisegmap_num_groups_121416;
                        num_groups_121513 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(m_114533,
                                                                                 segmap_group_sizze_121512),
                                                                       sext_i32_i64(max_num_groups_133753))));
                        
                        int64_t segmap_group_sizze_122007;
                        
                        segmap_group_sizze_122007 =
                            ctx->sizes.mainzisegmap_group_sizze_121614;
                        
                        bool suff_outer_par_122011;
                        
                        suff_outer_par_122011 =
                            ctx->sizes.mainzisuff_outer_par_16 <=
                            nest_sizze_118236;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_16",
                                    (long) nest_sizze_118236,
                                    suff_outer_par_122011 ? "true" : "false");
                        
                        int64_t nest_sizze_122115 = l_window_114538 *
                                nest_sizze_118236;
                        int64_t segred_group_sizze_122116;
                        
                        segred_group_sizze_122116 =
                            ctx->sizes.mainzisegred_group_sizze_121812;
                        
                        int64_t num_groups_122117;
                        int32_t max_num_groups_133754;
                        
                        max_num_groups_133754 =
                            ctx->sizes.mainzisegred_num_groups_121814;
                        num_groups_122117 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_122115,
                                                                                 segred_group_sizze_122116),
                                                                       sext_i32_i64(max_num_groups_133754))));
                        
                        int64_t segmap_group_sizze_122162;
                        
                        segmap_group_sizze_122162 =
                            ctx->sizes.mainzisegmap_group_sizze_121793;
                        
                        int64_t segred_group_sizze_122181;
                        
                        segred_group_sizze_122181 =
                            ctx->sizes.mainzisegred_group_sizze_121723;
                        
                        int64_t num_groups_122182;
                        int32_t max_num_groups_133755;
                        
                        max_num_groups_133755 =
                            ctx->sizes.mainzisegred_num_groups_121725;
                        num_groups_122182 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_122115,
                                                                                 segred_group_sizze_122181),
                                                                       sext_i32_i64(max_num_groups_133755))));
                        
                        int64_t num_threads_132215 = segmap_group_sizze_121512 *
                                num_groups_121513;
                        int64_t total_sizze_132216 = bytes_130238 *
                                num_threads_132215;
                        int64_t total_sizze_132217 = bytes_130238 *
                                num_threads_132215;
                        struct memblock_device defunc_7_map_res_mem_131039;
                        
                        defunc_7_map_res_mem_131039.references = NULL;
                        
                        struct memblock_device defunc_7_map_res_mem_131040;
                        
                        defunc_7_map_res_mem_131040.references = NULL;
                        
                        int32_t local_memory_capacity_133977;
                        
                        local_memory_capacity_133977 =
                            ctx->opencl.max_local_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_133977)) &&
                            suff_outer_par_121410) {
                            struct memblock_device mem_130933;
                            
                            mem_130933.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_130933,
                                                      bytes_130268,
                                                      "mem_130933")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_130933,
                                                                      (int64_t) 0,
                                                                      defunc_3_map_res_mem_130404,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_114584,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_130936;
                            
                            mem_130936.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_130936,
                                                      bytes_130271,
                                                      "mem_130936")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_130936,
                                                                      (int64_t) 0,
                                                                      defunc_3_map_res_mem_130405,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_114584,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_130939;
                            
                            mem_130939.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_130939,
                                                      binop_y_130121,
                                                      "mem_130939")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_130939,
                                                                      (int64_t) 0,
                                                                      mem_130122,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_114534,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_130942;
                            
                            mem_130942.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_130942,
                                                      binop_y_130121,
                                                      "mem_130942")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_130942,
                                                                      (int64_t) 0,
                                                                      mem_130861,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_114534,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_130945;
                            
                            mem_130945.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_130945,
                                                      binop_y_130121,
                                                      "mem_130945")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_130945,
                                                                      (int64_t) 0,
                                                                      mem_130865,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_114534,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_130979;
                            
                            mem_130979.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_130979,
                                                      bytes_130271,
                                                      "mem_130979")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_130982;
                            
                            mem_130982.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_130982,
                                                      bytes_130271,
                                                      "mem_130982")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_132110;
                            
                            color_132110.references = NULL;
                            if (memblock_alloc_device(ctx, &color_132110,
                                                      total_sizze_132216,
                                                      "color_132110")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_132111;
                            
                            color_132111.references = NULL;
                            if (memblock_alloc_device(ctx, &color_132111,
                                                      total_sizze_132217,
                                                      "color_132111")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121412,
                                                                    1,
                                                                    sizeof(m_114533),
                                                                    &m_114533));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121412,
                                                                    2,
                                                                    sizeof(l_window_114538),
                                                                    &l_window_114538));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121412,
                                                                    3,
                                                                    sizeof(t_jump_114541),
                                                                    &t_jump_114541));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121412,
                                                                    4,
                                                                    sizeof(l_n_m_114584),
                                                                    &l_n_m_114584));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121412,
                                                                    5,
                                                                    sizeof(i_114610),
                                                                    &i_114610));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121412,
                                                                    6,
                                                                    sizeof(num_groups_121513),
                                                                    &num_groups_121513));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121412,
                                                                    7,
                                                                    sizeof(num_threads_132215),
                                                                    &num_threads_132215));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121412,
                                                                    8,
                                                                    sizeof(defunc_3_map_res_mem_130117.mem),
                                                                    &defunc_3_map_res_mem_130117.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121412,
                                                                    9,
                                                                    sizeof(mem_130933.mem),
                                                                    &mem_130933.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121412,
                                                                    10,
                                                                    sizeof(mem_130936.mem),
                                                                    &mem_130936.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121412,
                                                                    11,
                                                                    sizeof(mem_130939.mem),
                                                                    &mem_130939.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121412,
                                                                    12,
                                                                    sizeof(mem_130942.mem),
                                                                    &mem_130942.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121412,
                                                                    13,
                                                                    sizeof(mem_130945.mem),
                                                                    &mem_130945.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121412,
                                                                    14,
                                                                    sizeof(mem_130979.mem),
                                                                    &mem_130979.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121412,
                                                                    15,
                                                                    sizeof(mem_130982.mem),
                                                                    &mem_130982.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121412,
                                                                    16,
                                                                    sizeof(color_132110.mem),
                                                                    &color_132110.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121412,
                                                                    17,
                                                                    sizeof(color_132111.mem),
                                                                    &color_132111.mem));
                            if (1 * ((size_t) num_groups_121513 *
                                     (size_t) segmap_group_sizze_121512) != 0) {
                                const size_t global_work_sizze_135823[1] =
                                             {(size_t) num_groups_121513 *
                                             (size_t) segmap_group_sizze_121512};
                                const size_t local_work_sizze_135827[1] =
                                             {segmap_group_sizze_121512};
                                int64_t time_start_135824 = 0, time_end_135825 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [",
                                            "main.segmap_121412");
                                    fprintf(ctx->log, "%zu",
                                            global_work_sizze_135823[0]);
                                    fprintf(ctx->log,
                                            "] and local work size [");
                                    fprintf(ctx->log, "%zu",
                                            local_work_sizze_135827[0]);
                                    fprintf(ctx->log,
                                            "]; local memory parameters sum to %d bytes.\n",
                                            (int) 0);
                                    time_start_135824 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_121412,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_135823,
                                                                                local_work_sizze_135827,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_121412_runs,
                                                                                                                          &ctx->mainzisegmap_121412_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_135825 = get_wall_time();
                                    
                                    long time_diff_135826 = time_end_135825 -
                                         time_start_135824;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_121412",
                                            time_diff_135826);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_130933,
                                                      "mem_130933") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_130936,
                                                      "mem_130936") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_130939,
                                                      "mem_130939") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_130942,
                                                      "mem_130942") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_130945,
                                                      "mem_130945") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_132110,
                                                      "color_132110") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_132111,
                                                      "color_132111") != 0)
                                return 1;
                            
                            struct memblock_device mem_131032;
                            
                            mem_131032.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131032,
                                                      bytes_130399,
                                                      "mem_131032")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131032,
                                                                      (int64_t) 0,
                                                                      mem_130979,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      m_114533,
                                                                      l_n_m_114584) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_130979,
                                                      "mem_130979") != 0)
                                return 1;
                            
                            struct memblock_device mem_131037;
                            
                            mem_131037.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131037,
                                                      bytes_130399,
                                                      "mem_131037")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131037,
                                                                      (int64_t) 0,
                                                                      mem_130982,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      m_114533,
                                                                      l_n_m_114584) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_130982,
                                                      "mem_130982") != 0)
                                return 1;
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_131039,
                                                    &mem_131032,
                                                    "mem_131032") != 0)
                                return 1;
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_131040,
                                                    &mem_131037,
                                                    "mem_131037") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131037,
                                                      "mem_131037") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131032,
                                                      "mem_131032") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_132111,
                                                      "color_132111") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_132110,
                                                      "color_132110") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_130982,
                                                      "mem_130982") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_130979,
                                                      "mem_130979") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_130945,
                                                      "mem_130945") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_130942,
                                                      "mem_130942") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_130939,
                                                      "mem_130939") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_130936,
                                                      "mem_130936") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_130933,
                                                      "mem_130933") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_122008 =
                                    sdiv_up64(nest_sizze_118236,
                                              segmap_group_sizze_122007);
                            struct memblock_device defunc_7_map_res_mem_131027;
                            
                            defunc_7_map_res_mem_131027.references = NULL;
                            
                            struct memblock_device defunc_7_map_res_mem_131028;
                            
                            defunc_7_map_res_mem_131028.references = NULL;
                            
                            int32_t local_memory_capacity_133976;
                            
                            local_memory_capacity_133976 =
                                ctx->opencl.max_local_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_133976)) &&
                                suff_outer_par_122011) {
                                struct memblock_device mem_130987;
                                
                                mem_130987.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_130987,
                                                          bytes_130399,
                                                          "mem_130987")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_130991;
                                
                                mem_130991.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_130991,
                                                          bytes_130399,
                                                          "mem_130991")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121611,
                                                                        1,
                                                                        sizeof(m_114533),
                                                                        &m_114533));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121611,
                                                                        2,
                                                                        sizeof(n_114534),
                                                                        &n_114534));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121611,
                                                                        3,
                                                                        sizeof(l_window_114538),
                                                                        &l_window_114538));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121611,
                                                                        4,
                                                                        sizeof(t_jump_114541),
                                                                        &t_jump_114541));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121611,
                                                                        5,
                                                                        sizeof(l_n_m_114584),
                                                                        &l_n_m_114584));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121611,
                                                                        6,
                                                                        sizeof(i_114610),
                                                                        &i_114610));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121611,
                                                                        7,
                                                                        sizeof(defunc_3_map_res_mem_130117.mem),
                                                                        &defunc_3_map_res_mem_130117.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121611,
                                                                        8,
                                                                        sizeof(mem_130122.mem),
                                                                        &mem_130122.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121611,
                                                                        9,
                                                                        sizeof(defunc_3_map_res_mem_130404.mem),
                                                                        &defunc_3_map_res_mem_130404.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121611,
                                                                        10,
                                                                        sizeof(defunc_3_map_res_mem_130405.mem),
                                                                        &defunc_3_map_res_mem_130405.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121611,
                                                                        11,
                                                                        sizeof(mem_130861.mem),
                                                                        &mem_130861.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121611,
                                                                        12,
                                                                        sizeof(mem_130865.mem),
                                                                        &mem_130865.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121611,
                                                                        13,
                                                                        sizeof(mem_130987.mem),
                                                                        &mem_130987.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121611,
                                                                        14,
                                                                        sizeof(mem_130991.mem),
                                                                        &mem_130991.mem));
                                if (1 * ((size_t) segmap_usable_groups_122008 *
                                         (size_t) segmap_group_sizze_122007) !=
                                    0) {
                                    const size_t global_work_sizze_135828[1] =
                                                 {(size_t) segmap_usable_groups_122008 *
                                                 (size_t) segmap_group_sizze_122007};
                                    const size_t local_work_sizze_135832[1] =
                                                 {segmap_group_sizze_122007};
                                    int64_t time_start_135829 = 0,
                                            time_end_135830 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [",
                                                "main.segmap_121611");
                                        fprintf(ctx->log, "%zu",
                                                global_work_sizze_135828[0]);
                                        fprintf(ctx->log,
                                                "] and local work size [");
                                        fprintf(ctx->log, "%zu",
                                                local_work_sizze_135832[0]);
                                        fprintf(ctx->log,
                                                "]; local memory parameters sum to %d bytes.\n",
                                                (int) 0);
                                        time_start_135829 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_121611,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_135828,
                                                                                    local_work_sizze_135832,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_121611_runs,
                                                                                                                              &ctx->mainzisegmap_121611_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_135830 = get_wall_time();
                                        
                                        long time_diff_135831 =
                                             time_end_135830 -
                                             time_start_135829;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_121611",
                                                time_diff_135831);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx,
                                                        &defunc_7_map_res_mem_131027,
                                                        &mem_130987,
                                                        "mem_130987") != 0)
                                    return 1;
                                if (memblock_set_device(ctx,
                                                        &defunc_7_map_res_mem_131028,
                                                        &mem_130991,
                                                        "mem_130991") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_130991,
                                                          "mem_130991") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_130987,
                                                          "mem_130987") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_130996;
                                
                                mem_130996.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_130996,
                                                          bytes_130399,
                                                          "mem_130996")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131000;
                                
                                mem_131000.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131000,
                                                          bytes_130399,
                                                          "mem_131000")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131004;
                                
                                mem_131004.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131004,
                                                          bytes_130399,
                                                          "mem_131004")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(l_window_114538 * (int64_t) 2,
                                          segred_group_sizze_122116)) {
                                    int64_t segment_sizze_nonzzero_133791 =
                                            smax64((int64_t) 1,
                                                   l_window_114538);
                                    int64_t num_threads_133792 =
                                            num_groups_122117 *
                                            segred_group_sizze_122116;
                                    
                                    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_114533 *
                                                             l_n_m_114584),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) l_window_114538,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_122116,
                                                                    segment_sizze_nonzzero_133791),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(m_114533 *
                                                                                   l_n_m_114584,
                                                                                   squot64(segred_group_sizze_122116,
                                                                                           segment_sizze_nonzzero_133791))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121818,
                                                                            1,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_122116,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121818,
                                                                            2,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_122116,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121818,
                                                                            3,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_122116,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121818,
                                                                            4,
                                                                            sizeof(m_114533),
                                                                            &m_114533));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121818,
                                                                            5,
                                                                            sizeof(n_114534),
                                                                            &n_114534));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121818,
                                                                            6,
                                                                            sizeof(l_window_114538),
                                                                            &l_window_114538));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121818,
                                                                            7,
                                                                            sizeof(t_jump_114541),
                                                                            &t_jump_114541));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121818,
                                                                            8,
                                                                            sizeof(l_n_m_114584),
                                                                            &l_n_m_114584));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121818,
                                                                            9,
                                                                            sizeof(i_114610),
                                                                            &i_114610));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121818,
                                                                            10,
                                                                            sizeof(num_groups_122117),
                                                                            &num_groups_122117));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121818,
                                                                            11,
                                                                            sizeof(segment_sizze_nonzzero_133791),
                                                                            &segment_sizze_nonzzero_133791));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121818,
                                                                            12,
                                                                            sizeof(defunc_3_map_res_mem_130117.mem),
                                                                            &defunc_3_map_res_mem_130117.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121818,
                                                                            13,
                                                                            sizeof(mem_130122.mem),
                                                                            &mem_130122.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121818,
                                                                            14,
                                                                            sizeof(defunc_3_map_res_mem_130404.mem),
                                                                            &defunc_3_map_res_mem_130404.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121818,
                                                                            15,
                                                                            sizeof(defunc_3_map_res_mem_130405.mem),
                                                                            &defunc_3_map_res_mem_130405.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121818,
                                                                            16,
                                                                            sizeof(mem_130861.mem),
                                                                            &mem_130861.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121818,
                                                                            17,
                                                                            sizeof(mem_130996.mem),
                                                                            &mem_130996.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121818,
                                                                            18,
                                                                            sizeof(mem_131000.mem),
                                                                            &mem_131000.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121818,
                                                                            19,
                                                                            sizeof(mem_131004.mem),
                                                                            &mem_131004.mem));
                                    if (1 * ((size_t) num_groups_122117 *
                                             (size_t) segred_group_sizze_122116) !=
                                        0) {
                                        const size_t global_work_sizze_135833[1]
                                                     =
                                                     {(size_t) num_groups_122117 *
                                                     (size_t) segred_group_sizze_122116};
                                        const size_t local_work_sizze_135837[1]
                                                     =
                                                     {segred_group_sizze_122116};
                                        int64_t time_start_135834 = 0,
                                                time_end_135835 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [",
                                                    "main.segred_small_121818");
                                            fprintf(ctx->log, "%zu",
                                                    global_work_sizze_135833[0]);
                                            fprintf(ctx->log,
                                                    "] and local work size [");
                                            fprintf(ctx->log, "%zu",
                                                    local_work_sizze_135837[0]);
                                            fprintf(ctx->log,
                                                    "]; local memory parameters sum to %d bytes.\n",
                                                    (int) (0 + (int64_t) 4 *
                                                           segred_group_sizze_122116 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_122116 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_122116));
                                            time_start_135834 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_121818,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_135833,
                                                                                        local_work_sizze_135837,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_121818_runs,
                                                                                                                                  &ctx->mainzisegred_small_121818_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_135835 = get_wall_time();
                                            
                                            long time_diff_135836 =
                                                 time_end_135835 -
                                                 time_start_135834;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_121818",
                                                    time_diff_135836);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_133826 =
                                            sdiv_up64(num_groups_122117,
                                                      smax64((int64_t) 1,
                                                             m_114533 *
                                                             l_n_m_114584));
                                    int64_t elements_per_thread_133827 =
                                            sdiv_up64(l_window_114538,
                                                      segred_group_sizze_122116 *
                                                      groups_per_segment_133826);
                                    int64_t virt_num_groups_133828 =
                                            groups_per_segment_133826 *
                                            (m_114533 * l_n_m_114584);
                                    int64_t num_threads_133829 =
                                            num_groups_122117 *
                                            segred_group_sizze_122116;
                                    int64_t threads_per_segment_133830 =
                                            groups_per_segment_133826 *
                                            segred_group_sizze_122116;
                                    
                                    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_114533 *
                                                             l_n_m_114584),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) l_window_114538,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_133828,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_122117,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_122116,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_133827,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_133826,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_133831;
                                    
                                    segred_tmp_mem_133831.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_133831,
                                                              (int64_t) 4 *
                                                              virt_num_groups_133828,
                                                              "segred_tmp_mem_133831")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_133833;
                                    
                                    segred_tmp_mem_133833.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_133833,
                                                              (int64_t) 4 *
                                                              virt_num_groups_133828,
                                                              "segred_tmp_mem_133833")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_133835;
                                    
                                    segred_tmp_mem_133835.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_133835,
                                                              (int64_t) 4 *
                                                              virt_num_groups_133828,
                                                              "segred_tmp_mem_133835")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_133837 =
                                    ctx->mainzicounter_mem_133837;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            1,
                                                                            1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            2,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_122116,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            3,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_122116,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            4,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_122116,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            5,
                                                                            sizeof(m_114533),
                                                                            &m_114533));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            6,
                                                                            sizeof(n_114534),
                                                                            &n_114534));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            7,
                                                                            sizeof(l_window_114538),
                                                                            &l_window_114538));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            8,
                                                                            sizeof(t_jump_114541),
                                                                            &t_jump_114541));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            9,
                                                                            sizeof(l_n_m_114584),
                                                                            &l_n_m_114584));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            10,
                                                                            sizeof(i_114610),
                                                                            &i_114610));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            11,
                                                                            sizeof(num_groups_122117),
                                                                            &num_groups_122117));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            12,
                                                                            sizeof(groups_per_segment_133826),
                                                                            &groups_per_segment_133826));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            13,
                                                                            sizeof(elements_per_thread_133827),
                                                                            &elements_per_thread_133827));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            14,
                                                                            sizeof(virt_num_groups_133828),
                                                                            &virt_num_groups_133828));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            15,
                                                                            sizeof(threads_per_segment_133830),
                                                                            &threads_per_segment_133830));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            16,
                                                                            sizeof(defunc_3_map_res_mem_130117.mem),
                                                                            &defunc_3_map_res_mem_130117.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            17,
                                                                            sizeof(mem_130122.mem),
                                                                            &mem_130122.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            18,
                                                                            sizeof(defunc_3_map_res_mem_130404.mem),
                                                                            &defunc_3_map_res_mem_130404.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            19,
                                                                            sizeof(defunc_3_map_res_mem_130405.mem),
                                                                            &defunc_3_map_res_mem_130405.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            20,
                                                                            sizeof(mem_130861.mem),
                                                                            &mem_130861.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            21,
                                                                            sizeof(mem_130996.mem),
                                                                            &mem_130996.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            22,
                                                                            sizeof(mem_131000.mem),
                                                                            &mem_131000.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            23,
                                                                            sizeof(mem_131004.mem),
                                                                            &mem_131004.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            24,
                                                                            sizeof(segred_tmp_mem_133831.mem),
                                                                            &segred_tmp_mem_133831.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            25,
                                                                            sizeof(segred_tmp_mem_133833.mem),
                                                                            &segred_tmp_mem_133833.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            26,
                                                                            sizeof(segred_tmp_mem_133835.mem),
                                                                            &segred_tmp_mem_133835.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121818,
                                                                            27,
                                                                            sizeof(mainzicounter_mem_133837.mem),
                                                                            &mainzicounter_mem_133837.mem));
                                    if (1 * ((size_t) num_groups_122117 *
                                             (size_t) segred_group_sizze_122116) !=
                                        0) {
                                        const size_t global_work_sizze_135839[1]
                                                     =
                                                     {(size_t) num_groups_122117 *
                                                     (size_t) segred_group_sizze_122116};
                                        const size_t local_work_sizze_135843[1]
                                                     =
                                                     {segred_group_sizze_122116};
                                        int64_t time_start_135840 = 0,
                                                time_end_135841 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [",
                                                    "main.segred_large_121818");
                                            fprintf(ctx->log, "%zu",
                                                    global_work_sizze_135839[0]);
                                            fprintf(ctx->log,
                                                    "] and local work size [");
                                            fprintf(ctx->log, "%zu",
                                                    local_work_sizze_135843[0]);
                                            fprintf(ctx->log,
                                                    "]; local memory parameters sum to %d bytes.\n",
                                                    (int) (0 + 1 + (int64_t) 4 *
                                                           segred_group_sizze_122116 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_122116 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_122116));
                                            time_start_135840 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_121818,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_135839,
                                                                                        local_work_sizze_135843,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_121818_runs,
                                                                                                                                  &ctx->mainzisegred_large_121818_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_135841 = get_wall_time();
                                            
                                            long time_diff_135842 =
                                                 time_end_135841 -
                                                 time_start_135840;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_121818",
                                                    time_diff_135842);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_133835,
                                                              "segred_tmp_mem_133835") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_133833,
                                                              "segred_tmp_mem_133833") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_133831,
                                                              "segred_tmp_mem_133831") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_122163 =
                                        sdiv_up64(nest_sizze_118236,
                                                  segmap_group_sizze_122162);
                                struct memblock_device mem_131009;
                                
                                mem_131009.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131009,
                                                          bytes_130399,
                                                          "mem_131009")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131013;
                                
                                mem_131013.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131013,
                                                          bytes_130399,
                                                          "mem_131013")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131017;
                                
                                mem_131017.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131017,
                                                          bytes_130399,
                                                          "mem_131017")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121790,
                                                                        1,
                                                                        sizeof(m_114533),
                                                                        &m_114533));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121790,
                                                                        2,
                                                                        sizeof(l_n_m_114584),
                                                                        &l_n_m_114584));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121790,
                                                                        3,
                                                                        sizeof(mem_130996.mem),
                                                                        &mem_130996.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121790,
                                                                        4,
                                                                        sizeof(mem_131000.mem),
                                                                        &mem_131000.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121790,
                                                                        5,
                                                                        sizeof(mem_131004.mem),
                                                                        &mem_131004.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121790,
                                                                        6,
                                                                        sizeof(mem_131009.mem),
                                                                        &mem_131009.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121790,
                                                                        7,
                                                                        sizeof(mem_131013.mem),
                                                                        &mem_131013.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_121790,
                                                                        8,
                                                                        sizeof(mem_131017.mem),
                                                                        &mem_131017.mem));
                                if (1 * ((size_t) segmap_usable_groups_122163 *
                                         (size_t) segmap_group_sizze_122162) !=
                                    0) {
                                    const size_t global_work_sizze_135844[1] =
                                                 {(size_t) segmap_usable_groups_122163 *
                                                 (size_t) segmap_group_sizze_122162};
                                    const size_t local_work_sizze_135848[1] =
                                                 {segmap_group_sizze_122162};
                                    int64_t time_start_135845 = 0,
                                            time_end_135846 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [",
                                                "main.segmap_121790");
                                        fprintf(ctx->log, "%zu",
                                                global_work_sizze_135844[0]);
                                        fprintf(ctx->log,
                                                "] and local work size [");
                                        fprintf(ctx->log, "%zu",
                                                local_work_sizze_135848[0]);
                                        fprintf(ctx->log,
                                                "]; local memory parameters sum to %d bytes.\n",
                                                (int) 0);
                                        time_start_135845 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_121790,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_135844,
                                                                                    local_work_sizze_135848,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_121790_runs,
                                                                                                                              &ctx->mainzisegmap_121790_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_135846 = get_wall_time();
                                        
                                        long time_diff_135847 =
                                             time_end_135846 -
                                             time_start_135845;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_121790",
                                                time_diff_135847);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_130996,
                                                          "mem_130996") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131000,
                                                          "mem_131000") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131004,
                                                          "mem_131004") != 0)
                                    return 1;
                                
                                struct memblock_device mem_131022;
                                
                                mem_131022.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131022,
                                                          bytes_130399,
                                                          "mem_131022")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131026;
                                
                                mem_131026.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131026,
                                                          bytes_130399,
                                                          "mem_131026")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(l_window_114538 * (int64_t) 2,
                                          segred_group_sizze_122181)) {
                                    int64_t segment_sizze_nonzzero_133895 =
                                            smax64((int64_t) 1,
                                                   l_window_114538);
                                    int64_t num_threads_133896 =
                                            num_groups_122182 *
                                            segred_group_sizze_122181;
                                    
                                    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_114533 *
                                                             l_n_m_114584),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) l_window_114538,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_122181,
                                                                    segment_sizze_nonzzero_133895),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(m_114533 *
                                                                                   l_n_m_114584,
                                                                                   squot64(segred_group_sizze_122181,
                                                                                           segment_sizze_nonzzero_133895))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            1,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_122181,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            2,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_122181,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            3,
                                                                            sizeof(m_114533),
                                                                            &m_114533));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            4,
                                                                            sizeof(n_114534),
                                                                            &n_114534));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            5,
                                                                            sizeof(l_window_114538),
                                                                            &l_window_114538));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            6,
                                                                            sizeof(t_jump_114541),
                                                                            &t_jump_114541));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            7,
                                                                            sizeof(l_n_m_114584),
                                                                            &l_n_m_114584));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            8,
                                                                            sizeof(i_114610),
                                                                            &i_114610));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            9,
                                                                            sizeof(num_groups_122182),
                                                                            &num_groups_122182));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            10,
                                                                            sizeof(segment_sizze_nonzzero_133895),
                                                                            &segment_sizze_nonzzero_133895));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            11,
                                                                            sizeof(defunc_3_map_res_mem_130117.mem),
                                                                            &defunc_3_map_res_mem_130117.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            12,
                                                                            sizeof(mem_130122.mem),
                                                                            &mem_130122.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            13,
                                                                            sizeof(defunc_3_map_res_mem_130404.mem),
                                                                            &defunc_3_map_res_mem_130404.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            14,
                                                                            sizeof(defunc_3_map_res_mem_130405.mem),
                                                                            &defunc_3_map_res_mem_130405.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            15,
                                                                            sizeof(mem_130861.mem),
                                                                            &mem_130861.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            16,
                                                                            sizeof(mem_130865.mem),
                                                                            &mem_130865.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            17,
                                                                            sizeof(mem_131009.mem),
                                                                            &mem_131009.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            18,
                                                                            sizeof(mem_131013.mem),
                                                                            &mem_131013.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            19,
                                                                            sizeof(mem_131017.mem),
                                                                            &mem_131017.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            20,
                                                                            sizeof(mem_131022.mem),
                                                                            &mem_131022.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_121729,
                                                                            21,
                                                                            sizeof(mem_131026.mem),
                                                                            &mem_131026.mem));
                                    if (1 * ((size_t) num_groups_122182 *
                                             (size_t) segred_group_sizze_122181) !=
                                        0) {
                                        const size_t global_work_sizze_135849[1]
                                                     =
                                                     {(size_t) num_groups_122182 *
                                                     (size_t) segred_group_sizze_122181};
                                        const size_t local_work_sizze_135853[1]
                                                     =
                                                     {segred_group_sizze_122181};
                                        int64_t time_start_135850 = 0,
                                                time_end_135851 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [",
                                                    "main.segred_small_121729");
                                            fprintf(ctx->log, "%zu",
                                                    global_work_sizze_135849[0]);
                                            fprintf(ctx->log,
                                                    "] and local work size [");
                                            fprintf(ctx->log, "%zu",
                                                    local_work_sizze_135853[0]);
                                            fprintf(ctx->log,
                                                    "]; local memory parameters sum to %d bytes.\n",
                                                    (int) (0 + (int64_t) 4 *
                                                           segred_group_sizze_122181 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_122181));
                                            time_start_135850 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_121729,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_135849,
                                                                                        local_work_sizze_135853,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_121729_runs,
                                                                                                                                  &ctx->mainzisegred_small_121729_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_135851 = get_wall_time();
                                            
                                            long time_diff_135852 =
                                                 time_end_135851 -
                                                 time_start_135850;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_121729",
                                                    time_diff_135852);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_133925 =
                                            sdiv_up64(num_groups_122182,
                                                      smax64((int64_t) 1,
                                                             m_114533 *
                                                             l_n_m_114584));
                                    int64_t elements_per_thread_133926 =
                                            sdiv_up64(l_window_114538,
                                                      segred_group_sizze_122181 *
                                                      groups_per_segment_133925);
                                    int64_t virt_num_groups_133927 =
                                            groups_per_segment_133925 *
                                            (m_114533 * l_n_m_114584);
                                    int64_t num_threads_133928 =
                                            num_groups_122182 *
                                            segred_group_sizze_122181;
                                    int64_t threads_per_segment_133929 =
                                            groups_per_segment_133925 *
                                            segred_group_sizze_122181;
                                    
                                    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_114533 *
                                                             l_n_m_114584),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) l_window_114538,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_133927,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_122182,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_122181,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_133926,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_133925,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_133930;
                                    
                                    segred_tmp_mem_133930.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_133930,
                                                              (int64_t) 4 *
                                                              virt_num_groups_133927,
                                                              "segred_tmp_mem_133930")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_133932;
                                    
                                    segred_tmp_mem_133932.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_133932,
                                                              (int64_t) 4 *
                                                              virt_num_groups_133927,
                                                              "segred_tmp_mem_133932")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_133934 =
                                    ctx->mainzicounter_mem_133934;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            1,
                                                                            1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            2,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_122181,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            3,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_122181,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            4,
                                                                            sizeof(m_114533),
                                                                            &m_114533));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            5,
                                                                            sizeof(n_114534),
                                                                            &n_114534));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            6,
                                                                            sizeof(l_window_114538),
                                                                            &l_window_114538));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            7,
                                                                            sizeof(t_jump_114541),
                                                                            &t_jump_114541));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            8,
                                                                            sizeof(l_n_m_114584),
                                                                            &l_n_m_114584));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            9,
                                                                            sizeof(i_114610),
                                                                            &i_114610));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            10,
                                                                            sizeof(num_groups_122182),
                                                                            &num_groups_122182));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            11,
                                                                            sizeof(groups_per_segment_133925),
                                                                            &groups_per_segment_133925));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            12,
                                                                            sizeof(elements_per_thread_133926),
                                                                            &elements_per_thread_133926));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            13,
                                                                            sizeof(virt_num_groups_133927),
                                                                            &virt_num_groups_133927));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            14,
                                                                            sizeof(threads_per_segment_133929),
                                                                            &threads_per_segment_133929));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            15,
                                                                            sizeof(defunc_3_map_res_mem_130117.mem),
                                                                            &defunc_3_map_res_mem_130117.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            16,
                                                                            sizeof(mem_130122.mem),
                                                                            &mem_130122.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            17,
                                                                            sizeof(defunc_3_map_res_mem_130404.mem),
                                                                            &defunc_3_map_res_mem_130404.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            18,
                                                                            sizeof(defunc_3_map_res_mem_130405.mem),
                                                                            &defunc_3_map_res_mem_130405.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            19,
                                                                            sizeof(mem_130861.mem),
                                                                            &mem_130861.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            20,
                                                                            sizeof(mem_130865.mem),
                                                                            &mem_130865.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            21,
                                                                            sizeof(mem_131009.mem),
                                                                            &mem_131009.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            22,
                                                                            sizeof(mem_131013.mem),
                                                                            &mem_131013.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            23,
                                                                            sizeof(mem_131017.mem),
                                                                            &mem_131017.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            24,
                                                                            sizeof(mem_131022.mem),
                                                                            &mem_131022.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            25,
                                                                            sizeof(mem_131026.mem),
                                                                            &mem_131026.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            26,
                                                                            sizeof(segred_tmp_mem_133930.mem),
                                                                            &segred_tmp_mem_133930.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            27,
                                                                            sizeof(segred_tmp_mem_133932.mem),
                                                                            &segred_tmp_mem_133932.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_121729,
                                                                            28,
                                                                            sizeof(mainzicounter_mem_133934.mem),
                                                                            &mainzicounter_mem_133934.mem));
                                    if (1 * ((size_t) num_groups_122182 *
                                             (size_t) segred_group_sizze_122181) !=
                                        0) {
                                        const size_t global_work_sizze_135855[1]
                                                     =
                                                     {(size_t) num_groups_122182 *
                                                     (size_t) segred_group_sizze_122181};
                                        const size_t local_work_sizze_135859[1]
                                                     =
                                                     {segred_group_sizze_122181};
                                        int64_t time_start_135856 = 0,
                                                time_end_135857 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [",
                                                    "main.segred_large_121729");
                                            fprintf(ctx->log, "%zu",
                                                    global_work_sizze_135855[0]);
                                            fprintf(ctx->log,
                                                    "] and local work size [");
                                            fprintf(ctx->log, "%zu",
                                                    local_work_sizze_135859[0]);
                                            fprintf(ctx->log,
                                                    "]; local memory parameters sum to %d bytes.\n",
                                                    (int) (0 + 1 + (int64_t) 4 *
                                                           segred_group_sizze_122181 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_122181));
                                            time_start_135856 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_121729,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_135855,
                                                                                        local_work_sizze_135859,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_121729_runs,
                                                                                                                                  &ctx->mainzisegred_large_121729_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_135857 = get_wall_time();
                                            
                                            long time_diff_135858 =
                                                 time_end_135857 -
                                                 time_start_135856;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_121729",
                                                    time_diff_135858);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_133932,
                                                              "segred_tmp_mem_133932") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_133930,
                                                              "segred_tmp_mem_133930") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_131009,
                                                          "mem_131009") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131013,
                                                          "mem_131013") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131017,
                                                          "mem_131017") != 0)
                                    return 1;
                                if (memblock_set_device(ctx,
                                                        &defunc_7_map_res_mem_131027,
                                                        &mem_131022,
                                                        "mem_131022") != 0)
                                    return 1;
                                if (memblock_set_device(ctx,
                                                        &defunc_7_map_res_mem_131028,
                                                        &mem_131026,
                                                        "mem_131026") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131026,
                                                          "mem_131026") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131022,
                                                          "mem_131022") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131017,
                                                          "mem_131017") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131013,
                                                          "mem_131013") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131009,
                                                          "mem_131009") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131004,
                                                          "mem_131004") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131000,
                                                          "mem_131000") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_130996,
                                                          "mem_130996") != 0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_131039,
                                                    &defunc_7_map_res_mem_131027,
                                                    "defunc_7_map_res_mem_131027") !=
                                0)
                                return 1;
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_131040,
                                                    &defunc_7_map_res_mem_131028,
                                                    "defunc_7_map_res_mem_131028") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &defunc_7_map_res_mem_131028,
                                                      "defunc_7_map_res_mem_131028") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &defunc_7_map_res_mem_131027,
                                                      "defunc_7_map_res_mem_131027") !=
                                0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &x_mem_131167,
                                                &defunc_7_map_res_mem_131039,
                                                "defunc_7_map_res_mem_131039") !=
                            0)
                            return 1;
                        if (memblock_set_device(ctx, &x_mem_131168,
                                                &defunc_7_map_res_mem_131040,
                                                "defunc_7_map_res_mem_131040") !=
                            0)
                            return 1;
                        if (memblock_unref_device(ctx,
                                                  &defunc_7_map_res_mem_131040,
                                                  "defunc_7_map_res_mem_131040") !=
                            0)
                            return 1;
                        if (memblock_unref_device(ctx,
                                                  &defunc_7_map_res_mem_131039,
                                                  "defunc_7_map_res_mem_131039") !=
                            0)
                            return 1;
                    } else {
                        bool suff_outer_par_122243;
                        
                        suff_outer_par_122243 =
                            ctx->sizes.mainzisuff_outer_par_17 <= m_114533;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_17", (long) m_114533,
                                    suff_outer_par_122243 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_122377;
                        
                        segmap_group_sizze_122377 =
                            ctx->sizes.mainzisegmap_group_sizze_122247;
                        
                        int64_t num_groups_122378;
                        int32_t max_num_groups_133978;
                        
                        max_num_groups_133978 =
                            ctx->sizes.mainzisegmap_num_groups_122249;
                        num_groups_122378 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(m_114533,
                                                                                 segmap_group_sizze_122377),
                                                                       sext_i32_i64(max_num_groups_133978))));
                        
                        int64_t segmap_group_sizze_123020;
                        
                        segmap_group_sizze_123020 =
                            ctx->sizes.mainzisegmap_group_sizze_122511;
                        
                        bool suff_outer_par_123024;
                        
                        suff_outer_par_123024 =
                            ctx->sizes.mainzisuff_outer_par_18 <=
                            nest_sizze_118236;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_18",
                                    (long) nest_sizze_118236,
                                    suff_outer_par_123024 ? "true" : "false");
                        
                        int64_t nest_sizze_123160 = l_window_114538 *
                                nest_sizze_118236;
                        int64_t segred_group_sizze_123161;
                        
                        segred_group_sizze_123161 =
                            ctx->sizes.mainzisegred_group_sizze_122777;
                        
                        int64_t num_groups_123162;
                        int32_t max_num_groups_133979;
                        
                        max_num_groups_133979 =
                            ctx->sizes.mainzisegred_num_groups_122779;
                        num_groups_123162 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_123160,
                                                                                 segred_group_sizze_123161),
                                                                       sext_i32_i64(max_num_groups_133979))));
                        
                        int64_t segmap_group_sizze_123217;
                        
                        segmap_group_sizze_123217 =
                            ctx->sizes.mainzisegmap_group_sizze_122739;
                        
                        int64_t segred_group_sizze_123257;
                        
                        segred_group_sizze_123257 =
                            ctx->sizes.mainzisegred_group_sizze_122656;
                        
                        int64_t num_groups_123258;
                        int32_t max_num_groups_133980;
                        
                        max_num_groups_133980 =
                            ctx->sizes.mainzisegred_num_groups_122658;
                        num_groups_123258 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_123160,
                                                                                 segred_group_sizze_123257),
                                                                       sext_i32_i64(max_num_groups_133980))));
                        
                        int64_t num_threads_132222 = segmap_group_sizze_122377 *
                                num_groups_122378;
                        int64_t total_sizze_132223 = bytes_130238 *
                                num_threads_132222;
                        int64_t total_sizze_132224 = bytes_130238 *
                                num_threads_132222;
                        struct memblock_device defunc_7_map_res_mem_131165;
                        
                        defunc_7_map_res_mem_131165.references = NULL;
                        
                        struct memblock_device defunc_7_map_res_mem_131166;
                        
                        defunc_7_map_res_mem_131166.references = NULL;
                        
                        int32_t local_memory_capacity_134232;
                        
                        local_memory_capacity_134232 =
                            ctx->opencl.max_local_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_134232)) &&
                            suff_outer_par_122243) {
                            struct memblock_device mem_131043;
                            
                            mem_131043.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131043,
                                                      bytes_130268,
                                                      "mem_131043")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_131043,
                                                                      (int64_t) 0,
                                                                      defunc_3_map_res_mem_130404,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_114584,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131046;
                            
                            mem_131046.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131046,
                                                      bytes_130271,
                                                      "mem_131046")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131046,
                                                                      (int64_t) 0,
                                                                      defunc_3_map_res_mem_130405,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      l_n_m_114584,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131049;
                            
                            mem_131049.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131049,
                                                      binop_y_130121,
                                                      "mem_131049")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131049,
                                                                      (int64_t) 0,
                                                                      mem_130122,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_114534,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131052;
                            
                            mem_131052.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131052,
                                                      binop_y_130121,
                                                      "mem_131052")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131052,
                                                                      (int64_t) 0,
                                                                      mem_130861,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_114534,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131055;
                            
                            mem_131055.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131055,
                                                      binop_y_130121,
                                                      "mem_131055")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131055,
                                                                      (int64_t) 0,
                                                                      mem_130865,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_114534,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131089;
                            
                            mem_131089.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131089,
                                                      bytes_130271,
                                                      "mem_131089")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131092;
                            
                            mem_131092.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131092,
                                                      bytes_130271,
                                                      "mem_131092")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_132112;
                            
                            color_132112.references = NULL;
                            if (memblock_alloc_device(ctx, &color_132112,
                                                      total_sizze_132223,
                                                      "color_132112")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_132113;
                            
                            color_132113.references = NULL;
                            if (memblock_alloc_device(ctx, &color_132113,
                                                      total_sizze_132224,
                                                      "color_132113")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122245,
                                                                    1,
                                                                    sizeof(m_114533),
                                                                    &m_114533));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122245,
                                                                    2,
                                                                    sizeof(l_window_114538),
                                                                    &l_window_114538));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122245,
                                                                    3,
                                                                    sizeof(t_jump_114541),
                                                                    &t_jump_114541));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122245,
                                                                    4,
                                                                    sizeof(l_n_m_114584),
                                                                    &l_n_m_114584));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122245,
                                                                    5,
                                                                    sizeof(i_114610),
                                                                    &i_114610));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122245,
                                                                    6,
                                                                    sizeof(num_groups_122378),
                                                                    &num_groups_122378));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122245,
                                                                    7,
                                                                    sizeof(num_threads_132222),
                                                                    &num_threads_132222));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122245,
                                                                    8,
                                                                    sizeof(defunc_3_map_res_mem_130117.mem),
                                                                    &defunc_3_map_res_mem_130117.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122245,
                                                                    9,
                                                                    sizeof(mem_131043.mem),
                                                                    &mem_131043.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122245,
                                                                    10,
                                                                    sizeof(mem_131046.mem),
                                                                    &mem_131046.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122245,
                                                                    11,
                                                                    sizeof(mem_131049.mem),
                                                                    &mem_131049.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122245,
                                                                    12,
                                                                    sizeof(mem_131052.mem),
                                                                    &mem_131052.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122245,
                                                                    13,
                                                                    sizeof(mem_131055.mem),
                                                                    &mem_131055.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122245,
                                                                    14,
                                                                    sizeof(mem_131089.mem),
                                                                    &mem_131089.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122245,
                                                                    15,
                                                                    sizeof(mem_131092.mem),
                                                                    &mem_131092.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122245,
                                                                    16,
                                                                    sizeof(color_132112.mem),
                                                                    &color_132112.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122245,
                                                                    17,
                                                                    sizeof(color_132113.mem),
                                                                    &color_132113.mem));
                            if (1 * ((size_t) num_groups_122378 *
                                     (size_t) segmap_group_sizze_122377) != 0) {
                                const size_t global_work_sizze_135860[1] =
                                             {(size_t) num_groups_122378 *
                                             (size_t) segmap_group_sizze_122377};
                                const size_t local_work_sizze_135864[1] =
                                             {segmap_group_sizze_122377};
                                int64_t time_start_135861 = 0, time_end_135862 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [",
                                            "main.segmap_122245");
                                    fprintf(ctx->log, "%zu",
                                            global_work_sizze_135860[0]);
                                    fprintf(ctx->log,
                                            "] and local work size [");
                                    fprintf(ctx->log, "%zu",
                                            local_work_sizze_135864[0]);
                                    fprintf(ctx->log,
                                            "]; local memory parameters sum to %d bytes.\n",
                                            (int) 0);
                                    time_start_135861 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_122245,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_135860,
                                                                                local_work_sizze_135864,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_122245_runs,
                                                                                                                          &ctx->mainzisegmap_122245_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_135862 = get_wall_time();
                                    
                                    long time_diff_135863 = time_end_135862 -
                                         time_start_135861;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_122245",
                                            time_diff_135863);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_131043,
                                                      "mem_131043") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131046,
                                                      "mem_131046") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131049,
                                                      "mem_131049") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131052,
                                                      "mem_131052") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131055,
                                                      "mem_131055") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_132112,
                                                      "color_132112") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_132113,
                                                      "color_132113") != 0)
                                return 1;
                            
                            struct memblock_device mem_131158;
                            
                            mem_131158.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131158,
                                                      bytes_130399,
                                                      "mem_131158")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131158,
                                                                      (int64_t) 0,
                                                                      mem_131089,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      m_114533,
                                                                      l_n_m_114584) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_131089,
                                                      "mem_131089") != 0)
                                return 1;
                            
                            struct memblock_device mem_131163;
                            
                            mem_131163.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131163,
                                                      bytes_130399,
                                                      "mem_131163")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131163,
                                                                      (int64_t) 0,
                                                                      mem_131092,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      m_114533,
                                                                      l_n_m_114584) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_131092,
                                                      "mem_131092") != 0)
                                return 1;
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_131165,
                                                    &mem_131158,
                                                    "mem_131158") != 0)
                                return 1;
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_131166,
                                                    &mem_131163,
                                                    "mem_131163") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131163,
                                                      "mem_131163") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131158,
                                                      "mem_131158") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_132113,
                                                      "color_132113") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_132112,
                                                      "color_132112") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131092,
                                                      "mem_131092") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131089,
                                                      "mem_131089") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131055,
                                                      "mem_131055") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131052,
                                                      "mem_131052") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131049,
                                                      "mem_131049") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131046,
                                                      "mem_131046") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131043,
                                                      "mem_131043") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_123021 =
                                    sdiv_up64(nest_sizze_118236,
                                              segmap_group_sizze_123020);
                            struct memblock_device defunc_7_map_res_mem_131153;
                            
                            defunc_7_map_res_mem_131153.references = NULL;
                            
                            struct memblock_device defunc_7_map_res_mem_131154;
                            
                            defunc_7_map_res_mem_131154.references = NULL;
                            
                            int32_t local_memory_capacity_134231;
                            
                            local_memory_capacity_134231 =
                                ctx->opencl.max_local_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_134231)) &&
                                suff_outer_par_123024) {
                                struct memblock_device mem_131097;
                                
                                mem_131097.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131097,
                                                          bytes_130399,
                                                          "mem_131097")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131101;
                                
                                mem_131101.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131101,
                                                          bytes_130399,
                                                          "mem_131101")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122508,
                                                                        1,
                                                                        sizeof(m_114533),
                                                                        &m_114533));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122508,
                                                                        2,
                                                                        sizeof(n_114534),
                                                                        &n_114534));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122508,
                                                                        3,
                                                                        sizeof(l_window_114538),
                                                                        &l_window_114538));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122508,
                                                                        4,
                                                                        sizeof(t_jump_114541),
                                                                        &t_jump_114541));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122508,
                                                                        5,
                                                                        sizeof(l_n_m_114584),
                                                                        &l_n_m_114584));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122508,
                                                                        6,
                                                                        sizeof(i_114610),
                                                                        &i_114610));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122508,
                                                                        7,
                                                                        sizeof(defunc_3_map_res_mem_130117.mem),
                                                                        &defunc_3_map_res_mem_130117.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122508,
                                                                        8,
                                                                        sizeof(mem_130122.mem),
                                                                        &mem_130122.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122508,
                                                                        9,
                                                                        sizeof(defunc_3_map_res_mem_130404.mem),
                                                                        &defunc_3_map_res_mem_130404.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122508,
                                                                        10,
                                                                        sizeof(defunc_3_map_res_mem_130405.mem),
                                                                        &defunc_3_map_res_mem_130405.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122508,
                                                                        11,
                                                                        sizeof(mem_130861.mem),
                                                                        &mem_130861.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122508,
                                                                        12,
                                                                        sizeof(mem_130865.mem),
                                                                        &mem_130865.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122508,
                                                                        13,
                                                                        sizeof(mem_131097.mem),
                                                                        &mem_131097.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122508,
                                                                        14,
                                                                        sizeof(mem_131101.mem),
                                                                        &mem_131101.mem));
                                if (1 * ((size_t) segmap_usable_groups_123021 *
                                         (size_t) segmap_group_sizze_123020) !=
                                    0) {
                                    const size_t global_work_sizze_135865[1] =
                                                 {(size_t) segmap_usable_groups_123021 *
                                                 (size_t) segmap_group_sizze_123020};
                                    const size_t local_work_sizze_135869[1] =
                                                 {segmap_group_sizze_123020};
                                    int64_t time_start_135866 = 0,
                                            time_end_135867 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [",
                                                "main.segmap_122508");
                                        fprintf(ctx->log, "%zu",
                                                global_work_sizze_135865[0]);
                                        fprintf(ctx->log,
                                                "] and local work size [");
                                        fprintf(ctx->log, "%zu",
                                                local_work_sizze_135869[0]);
                                        fprintf(ctx->log,
                                                "]; local memory parameters sum to %d bytes.\n",
                                                (int) 0);
                                        time_start_135866 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_122508,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_135865,
                                                                                    local_work_sizze_135869,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_122508_runs,
                                                                                                                              &ctx->mainzisegmap_122508_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_135867 = get_wall_time();
                                        
                                        long time_diff_135868 =
                                             time_end_135867 -
                                             time_start_135866;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_122508",
                                                time_diff_135868);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx,
                                                        &defunc_7_map_res_mem_131153,
                                                        &mem_131097,
                                                        "mem_131097") != 0)
                                    return 1;
                                if (memblock_set_device(ctx,
                                                        &defunc_7_map_res_mem_131154,
                                                        &mem_131101,
                                                        "mem_131101") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131101,
                                                          "mem_131101") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131097,
                                                          "mem_131097") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_131106;
                                
                                mem_131106.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131106,
                                                          bytes_130399,
                                                          "mem_131106")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131110;
                                
                                mem_131110.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131110,
                                                          bytes_130399,
                                                          "mem_131110")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131114;
                                
                                mem_131114.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131114,
                                                          bytes_130399,
                                                          "mem_131114")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131118;
                                
                                mem_131118.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131118,
                                                          bytes_130399,
                                                          "mem_131118")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131122;
                                
                                mem_131122.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131122,
                                                          bytes_130399,
                                                          "mem_131122")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(l_window_114538 * (int64_t) 2,
                                          segred_group_sizze_123161)) {
                                    int64_t segment_sizze_nonzzero_134020 =
                                            smax64((int64_t) 1,
                                                   l_window_114538);
                                    int64_t num_threads_134021 =
                                            num_groups_123162 *
                                            segred_group_sizze_123161;
                                    
                                    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_114533 *
                                                             l_n_m_114584),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) l_window_114538,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_123161,
                                                                    segment_sizze_nonzzero_134020),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(m_114533 *
                                                                                   l_n_m_114584,
                                                                                   squot64(segred_group_sizze_123161,
                                                                                           segment_sizze_nonzzero_134020))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            1,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_123161,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            2,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_123161,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            3,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_123161,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            4,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_123161,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            5,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_123161,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            6,
                                                                            sizeof(m_114533),
                                                                            &m_114533));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            7,
                                                                            sizeof(n_114534),
                                                                            &n_114534));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            8,
                                                                            sizeof(l_window_114538),
                                                                            &l_window_114538));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            9,
                                                                            sizeof(t_jump_114541),
                                                                            &t_jump_114541));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            10,
                                                                            sizeof(l_n_m_114584),
                                                                            &l_n_m_114584));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            11,
                                                                            sizeof(i_114610),
                                                                            &i_114610));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            12,
                                                                            sizeof(num_groups_123162),
                                                                            &num_groups_123162));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            13,
                                                                            sizeof(segment_sizze_nonzzero_134020),
                                                                            &segment_sizze_nonzzero_134020));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            14,
                                                                            sizeof(defunc_3_map_res_mem_130117.mem),
                                                                            &defunc_3_map_res_mem_130117.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            15,
                                                                            sizeof(mem_130122.mem),
                                                                            &mem_130122.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            16,
                                                                            sizeof(defunc_3_map_res_mem_130404.mem),
                                                                            &defunc_3_map_res_mem_130404.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            17,
                                                                            sizeof(defunc_3_map_res_mem_130405.mem),
                                                                            &defunc_3_map_res_mem_130405.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            18,
                                                                            sizeof(mem_130861.mem),
                                                                            &mem_130861.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            19,
                                                                            sizeof(mem_131106.mem),
                                                                            &mem_131106.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            20,
                                                                            sizeof(mem_131110.mem),
                                                                            &mem_131110.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            21,
                                                                            sizeof(mem_131114.mem),
                                                                            &mem_131114.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            22,
                                                                            sizeof(mem_131118.mem),
                                                                            &mem_131118.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122783,
                                                                            23,
                                                                            sizeof(mem_131122.mem),
                                                                            &mem_131122.mem));
                                    if (1 * ((size_t) num_groups_123162 *
                                             (size_t) segred_group_sizze_123161) !=
                                        0) {
                                        const size_t global_work_sizze_135870[1]
                                                     =
                                                     {(size_t) num_groups_123162 *
                                                     (size_t) segred_group_sizze_123161};
                                        const size_t local_work_sizze_135874[1]
                                                     =
                                                     {segred_group_sizze_123161};
                                        int64_t time_start_135871 = 0,
                                                time_end_135872 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [",
                                                    "main.segred_small_122783");
                                            fprintf(ctx->log, "%zu",
                                                    global_work_sizze_135870[0]);
                                            fprintf(ctx->log,
                                                    "] and local work size [");
                                            fprintf(ctx->log, "%zu",
                                                    local_work_sizze_135874[0]);
                                            fprintf(ctx->log,
                                                    "]; local memory parameters sum to %d bytes.\n",
                                                    (int) (0 + (int64_t) 4 *
                                                           segred_group_sizze_123161 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_123161 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_123161 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_123161 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_123161));
                                            time_start_135871 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_122783,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_135870,
                                                                                        local_work_sizze_135874,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_122783_runs,
                                                                                                                                  &ctx->mainzisegred_small_122783_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_135872 = get_wall_time();
                                            
                                            long time_diff_135873 =
                                                 time_end_135872 -
                                                 time_start_135871;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_122783",
                                                    time_diff_135873);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_134065 =
                                            sdiv_up64(num_groups_123162,
                                                      smax64((int64_t) 1,
                                                             m_114533 *
                                                             l_n_m_114584));
                                    int64_t elements_per_thread_134066 =
                                            sdiv_up64(l_window_114538,
                                                      segred_group_sizze_123161 *
                                                      groups_per_segment_134065);
                                    int64_t virt_num_groups_134067 =
                                            groups_per_segment_134065 *
                                            (m_114533 * l_n_m_114584);
                                    int64_t num_threads_134068 =
                                            num_groups_123162 *
                                            segred_group_sizze_123161;
                                    int64_t threads_per_segment_134069 =
                                            groups_per_segment_134065 *
                                            segred_group_sizze_123161;
                                    
                                    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_114533 *
                                                             l_n_m_114584),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) l_window_114538,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_134067,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_123162,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_123161,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_134066,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_134065,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_134070;
                                    
                                    segred_tmp_mem_134070.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_134070,
                                                              (int64_t) 4 *
                                                              virt_num_groups_134067,
                                                              "segred_tmp_mem_134070")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_134072;
                                    
                                    segred_tmp_mem_134072.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_134072,
                                                              (int64_t) 4 *
                                                              virt_num_groups_134067,
                                                              "segred_tmp_mem_134072")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_134074;
                                    
                                    segred_tmp_mem_134074.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_134074,
                                                              (int64_t) 4 *
                                                              virt_num_groups_134067,
                                                              "segred_tmp_mem_134074")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_134076;
                                    
                                    segred_tmp_mem_134076.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_134076,
                                                              (int64_t) 4 *
                                                              virt_num_groups_134067,
                                                              "segred_tmp_mem_134076")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_134078;
                                    
                                    segred_tmp_mem_134078.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_134078,
                                                              (int64_t) 4 *
                                                              virt_num_groups_134067,
                                                              "segred_tmp_mem_134078")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_134080 =
                                    ctx->mainzicounter_mem_134080;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            1,
                                                                            1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            2,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_123161,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            3,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_123161,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            4,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_123161,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            5,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_123161,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            6,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_123161,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            7,
                                                                            sizeof(m_114533),
                                                                            &m_114533));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            8,
                                                                            sizeof(n_114534),
                                                                            &n_114534));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            9,
                                                                            sizeof(l_window_114538),
                                                                            &l_window_114538));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            10,
                                                                            sizeof(t_jump_114541),
                                                                            &t_jump_114541));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            11,
                                                                            sizeof(l_n_m_114584),
                                                                            &l_n_m_114584));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            12,
                                                                            sizeof(i_114610),
                                                                            &i_114610));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            13,
                                                                            sizeof(num_groups_123162),
                                                                            &num_groups_123162));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            14,
                                                                            sizeof(groups_per_segment_134065),
                                                                            &groups_per_segment_134065));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            15,
                                                                            sizeof(elements_per_thread_134066),
                                                                            &elements_per_thread_134066));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            16,
                                                                            sizeof(virt_num_groups_134067),
                                                                            &virt_num_groups_134067));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            17,
                                                                            sizeof(threads_per_segment_134069),
                                                                            &threads_per_segment_134069));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            18,
                                                                            sizeof(defunc_3_map_res_mem_130117.mem),
                                                                            &defunc_3_map_res_mem_130117.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            19,
                                                                            sizeof(mem_130122.mem),
                                                                            &mem_130122.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            20,
                                                                            sizeof(defunc_3_map_res_mem_130404.mem),
                                                                            &defunc_3_map_res_mem_130404.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            21,
                                                                            sizeof(defunc_3_map_res_mem_130405.mem),
                                                                            &defunc_3_map_res_mem_130405.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            22,
                                                                            sizeof(mem_130861.mem),
                                                                            &mem_130861.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            23,
                                                                            sizeof(mem_131106.mem),
                                                                            &mem_131106.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            24,
                                                                            sizeof(mem_131110.mem),
                                                                            &mem_131110.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            25,
                                                                            sizeof(mem_131114.mem),
                                                                            &mem_131114.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            26,
                                                                            sizeof(mem_131118.mem),
                                                                            &mem_131118.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            27,
                                                                            sizeof(mem_131122.mem),
                                                                            &mem_131122.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            28,
                                                                            sizeof(segred_tmp_mem_134070.mem),
                                                                            &segred_tmp_mem_134070.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            29,
                                                                            sizeof(segred_tmp_mem_134072.mem),
                                                                            &segred_tmp_mem_134072.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            30,
                                                                            sizeof(segred_tmp_mem_134074.mem),
                                                                            &segred_tmp_mem_134074.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            31,
                                                                            sizeof(segred_tmp_mem_134076.mem),
                                                                            &segred_tmp_mem_134076.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            32,
                                                                            sizeof(segred_tmp_mem_134078.mem),
                                                                            &segred_tmp_mem_134078.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122783,
                                                                            33,
                                                                            sizeof(mainzicounter_mem_134080.mem),
                                                                            &mainzicounter_mem_134080.mem));
                                    if (1 * ((size_t) num_groups_123162 *
                                             (size_t) segred_group_sizze_123161) !=
                                        0) {
                                        const size_t global_work_sizze_135876[1]
                                                     =
                                                     {(size_t) num_groups_123162 *
                                                     (size_t) segred_group_sizze_123161};
                                        const size_t local_work_sizze_135880[1]
                                                     =
                                                     {segred_group_sizze_123161};
                                        int64_t time_start_135877 = 0,
                                                time_end_135878 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [",
                                                    "main.segred_large_122783");
                                            fprintf(ctx->log, "%zu",
                                                    global_work_sizze_135876[0]);
                                            fprintf(ctx->log,
                                                    "] and local work size [");
                                            fprintf(ctx->log, "%zu",
                                                    local_work_sizze_135880[0]);
                                            fprintf(ctx->log,
                                                    "]; local memory parameters sum to %d bytes.\n",
                                                    (int) (0 + 1 + (int64_t) 4 *
                                                           segred_group_sizze_123161 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_123161 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_123161 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_123161 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_123161));
                                            time_start_135877 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_122783,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_135876,
                                                                                        local_work_sizze_135880,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_122783_runs,
                                                                                                                                  &ctx->mainzisegred_large_122783_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_135878 = get_wall_time();
                                            
                                            long time_diff_135879 =
                                                 time_end_135878 -
                                                 time_start_135877;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_122783",
                                                    time_diff_135879);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_134078,
                                                              "segred_tmp_mem_134078") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_134076,
                                                              "segred_tmp_mem_134076") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_134074,
                                                              "segred_tmp_mem_134074") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_134072,
                                                              "segred_tmp_mem_134072") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_134070,
                                                              "segred_tmp_mem_134070") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_123218 =
                                        sdiv_up64(nest_sizze_118236,
                                                  segmap_group_sizze_123217);
                                struct memblock_device mem_131127;
                                
                                mem_131127.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131127,
                                                          bytes_130399,
                                                          "mem_131127")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131131;
                                
                                mem_131131.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131131,
                                                          bytes_130399,
                                                          "mem_131131")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131135;
                                
                                mem_131135.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131135,
                                                          bytes_130399,
                                                          "mem_131135")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131139;
                                
                                mem_131139.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131139,
                                                          bytes_130399,
                                                          "mem_131139")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131143;
                                
                                mem_131143.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131143,
                                                          bytes_130399,
                                                          "mem_131143")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122736,
                                                                        1,
                                                                        sizeof(m_114533),
                                                                        &m_114533));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122736,
                                                                        2,
                                                                        sizeof(l_n_m_114584),
                                                                        &l_n_m_114584));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122736,
                                                                        3,
                                                                        sizeof(mem_131106.mem),
                                                                        &mem_131106.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122736,
                                                                        4,
                                                                        sizeof(mem_131110.mem),
                                                                        &mem_131110.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122736,
                                                                        5,
                                                                        sizeof(mem_131114.mem),
                                                                        &mem_131114.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122736,
                                                                        6,
                                                                        sizeof(mem_131118.mem),
                                                                        &mem_131118.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122736,
                                                                        7,
                                                                        sizeof(mem_131122.mem),
                                                                        &mem_131122.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122736,
                                                                        8,
                                                                        sizeof(mem_131127.mem),
                                                                        &mem_131127.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122736,
                                                                        9,
                                                                        sizeof(mem_131131.mem),
                                                                        &mem_131131.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122736,
                                                                        10,
                                                                        sizeof(mem_131135.mem),
                                                                        &mem_131135.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122736,
                                                                        11,
                                                                        sizeof(mem_131139.mem),
                                                                        &mem_131139.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_122736,
                                                                        12,
                                                                        sizeof(mem_131143.mem),
                                                                        &mem_131143.mem));
                                if (1 * ((size_t) segmap_usable_groups_123218 *
                                         (size_t) segmap_group_sizze_123217) !=
                                    0) {
                                    const size_t global_work_sizze_135881[1] =
                                                 {(size_t) segmap_usable_groups_123218 *
                                                 (size_t) segmap_group_sizze_123217};
                                    const size_t local_work_sizze_135885[1] =
                                                 {segmap_group_sizze_123217};
                                    int64_t time_start_135882 = 0,
                                            time_end_135883 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [",
                                                "main.segmap_122736");
                                        fprintf(ctx->log, "%zu",
                                                global_work_sizze_135881[0]);
                                        fprintf(ctx->log,
                                                "] and local work size [");
                                        fprintf(ctx->log, "%zu",
                                                local_work_sizze_135885[0]);
                                        fprintf(ctx->log,
                                                "]; local memory parameters sum to %d bytes.\n",
                                                (int) 0);
                                        time_start_135882 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_122736,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_135881,
                                                                                    local_work_sizze_135885,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_122736_runs,
                                                                                                                              &ctx->mainzisegmap_122736_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_135883 = get_wall_time();
                                        
                                        long time_diff_135884 =
                                             time_end_135883 -
                                             time_start_135882;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_122736",
                                                time_diff_135884);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_131106,
                                                          "mem_131106") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131110,
                                                          "mem_131110") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131114,
                                                          "mem_131114") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131118,
                                                          "mem_131118") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131122,
                                                          "mem_131122") != 0)
                                    return 1;
                                
                                struct memblock_device mem_131148;
                                
                                mem_131148.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131148,
                                                          bytes_130399,
                                                          "mem_131148")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131152;
                                
                                mem_131152.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131152,
                                                          bytes_130399,
                                                          "mem_131152")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(l_window_114538 * (int64_t) 2,
                                          segred_group_sizze_123257)) {
                                    int64_t segment_sizze_nonzzero_134150 =
                                            smax64((int64_t) 1,
                                                   l_window_114538);
                                    int64_t num_threads_134151 =
                                            num_groups_123258 *
                                            segred_group_sizze_123257;
                                    
                                    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_114533 *
                                                             l_n_m_114584),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) l_window_114538,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_123257,
                                                                    segment_sizze_nonzzero_134150),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(m_114533 *
                                                                                   l_n_m_114584,
                                                                                   squot64(segred_group_sizze_123257,
                                                                                           segment_sizze_nonzzero_134150))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            1,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_123257,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            2,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_123257,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            3,
                                                                            sizeof(m_114533),
                                                                            &m_114533));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            4,
                                                                            sizeof(n_114534),
                                                                            &n_114534));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            5,
                                                                            sizeof(l_window_114538),
                                                                            &l_window_114538));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            6,
                                                                            sizeof(t_jump_114541),
                                                                            &t_jump_114541));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            7,
                                                                            sizeof(l_n_m_114584),
                                                                            &l_n_m_114584));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            8,
                                                                            sizeof(i_114610),
                                                                            &i_114610));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            9,
                                                                            sizeof(num_groups_123258),
                                                                            &num_groups_123258));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            10,
                                                                            sizeof(segment_sizze_nonzzero_134150),
                                                                            &segment_sizze_nonzzero_134150));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            11,
                                                                            sizeof(defunc_3_map_res_mem_130117.mem),
                                                                            &defunc_3_map_res_mem_130117.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            12,
                                                                            sizeof(mem_130122.mem),
                                                                            &mem_130122.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            13,
                                                                            sizeof(defunc_3_map_res_mem_130404.mem),
                                                                            &defunc_3_map_res_mem_130404.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            14,
                                                                            sizeof(defunc_3_map_res_mem_130405.mem),
                                                                            &defunc_3_map_res_mem_130405.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            15,
                                                                            sizeof(mem_130861.mem),
                                                                            &mem_130861.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            16,
                                                                            sizeof(mem_130865.mem),
                                                                            &mem_130865.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            17,
                                                                            sizeof(mem_131127.mem),
                                                                            &mem_131127.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            18,
                                                                            sizeof(mem_131131.mem),
                                                                            &mem_131131.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            19,
                                                                            sizeof(mem_131135.mem),
                                                                            &mem_131135.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            20,
                                                                            sizeof(mem_131139.mem),
                                                                            &mem_131139.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            21,
                                                                            sizeof(mem_131143.mem),
                                                                            &mem_131143.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            22,
                                                                            sizeof(mem_131148.mem),
                                                                            &mem_131148.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_122662,
                                                                            23,
                                                                            sizeof(mem_131152.mem),
                                                                            &mem_131152.mem));
                                    if (1 * ((size_t) num_groups_123258 *
                                             (size_t) segred_group_sizze_123257) !=
                                        0) {
                                        const size_t global_work_sizze_135886[1]
                                                     =
                                                     {(size_t) num_groups_123258 *
                                                     (size_t) segred_group_sizze_123257};
                                        const size_t local_work_sizze_135890[1]
                                                     =
                                                     {segred_group_sizze_123257};
                                        int64_t time_start_135887 = 0,
                                                time_end_135888 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [",
                                                    "main.segred_small_122662");
                                            fprintf(ctx->log, "%zu",
                                                    global_work_sizze_135886[0]);
                                            fprintf(ctx->log,
                                                    "] and local work size [");
                                            fprintf(ctx->log, "%zu",
                                                    local_work_sizze_135890[0]);
                                            fprintf(ctx->log,
                                                    "]; local memory parameters sum to %d bytes.\n",
                                                    (int) (0 + (int64_t) 4 *
                                                           segred_group_sizze_123257 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_123257));
                                            time_start_135887 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_122662,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_135886,
                                                                                        local_work_sizze_135890,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_122662_runs,
                                                                                                                                  &ctx->mainzisegred_small_122662_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_135888 = get_wall_time();
                                            
                                            long time_diff_135889 =
                                                 time_end_135888 -
                                                 time_start_135887;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_122662",
                                                    time_diff_135889);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_134180 =
                                            sdiv_up64(num_groups_123258,
                                                      smax64((int64_t) 1,
                                                             m_114533 *
                                                             l_n_m_114584));
                                    int64_t elements_per_thread_134181 =
                                            sdiv_up64(l_window_114538,
                                                      segred_group_sizze_123257 *
                                                      groups_per_segment_134180);
                                    int64_t virt_num_groups_134182 =
                                            groups_per_segment_134180 *
                                            (m_114533 * l_n_m_114584);
                                    int64_t num_threads_134183 =
                                            num_groups_123258 *
                                            segred_group_sizze_123257;
                                    int64_t threads_per_segment_134184 =
                                            groups_per_segment_134180 *
                                            segred_group_sizze_123257;
                                    
                                    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_114533 *
                                                             l_n_m_114584),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) l_window_114538,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_134182,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_123258,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_123257,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_134181,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_134180,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_134185;
                                    
                                    segred_tmp_mem_134185.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_134185,
                                                              (int64_t) 4 *
                                                              virt_num_groups_134182,
                                                              "segred_tmp_mem_134185")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_134187;
                                    
                                    segred_tmp_mem_134187.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_134187,
                                                              (int64_t) 4 *
                                                              virt_num_groups_134182,
                                                              "segred_tmp_mem_134187")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_134189 =
                                    ctx->mainzicounter_mem_134189;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            1,
                                                                            1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            2,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_123257,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            3,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_123257,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            4,
                                                                            sizeof(m_114533),
                                                                            &m_114533));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            5,
                                                                            sizeof(n_114534),
                                                                            &n_114534));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            6,
                                                                            sizeof(l_window_114538),
                                                                            &l_window_114538));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            7,
                                                                            sizeof(t_jump_114541),
                                                                            &t_jump_114541));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            8,
                                                                            sizeof(l_n_m_114584),
                                                                            &l_n_m_114584));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            9,
                                                                            sizeof(i_114610),
                                                                            &i_114610));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            10,
                                                                            sizeof(num_groups_123258),
                                                                            &num_groups_123258));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            11,
                                                                            sizeof(groups_per_segment_134180),
                                                                            &groups_per_segment_134180));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            12,
                                                                            sizeof(elements_per_thread_134181),
                                                                            &elements_per_thread_134181));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            13,
                                                                            sizeof(virt_num_groups_134182),
                                                                            &virt_num_groups_134182));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            14,
                                                                            sizeof(threads_per_segment_134184),
                                                                            &threads_per_segment_134184));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            15,
                                                                            sizeof(defunc_3_map_res_mem_130117.mem),
                                                                            &defunc_3_map_res_mem_130117.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            16,
                                                                            sizeof(mem_130122.mem),
                                                                            &mem_130122.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            17,
                                                                            sizeof(defunc_3_map_res_mem_130404.mem),
                                                                            &defunc_3_map_res_mem_130404.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            18,
                                                                            sizeof(defunc_3_map_res_mem_130405.mem),
                                                                            &defunc_3_map_res_mem_130405.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            19,
                                                                            sizeof(mem_130861.mem),
                                                                            &mem_130861.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            20,
                                                                            sizeof(mem_130865.mem),
                                                                            &mem_130865.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            21,
                                                                            sizeof(mem_131127.mem),
                                                                            &mem_131127.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            22,
                                                                            sizeof(mem_131131.mem),
                                                                            &mem_131131.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            23,
                                                                            sizeof(mem_131135.mem),
                                                                            &mem_131135.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            24,
                                                                            sizeof(mem_131139.mem),
                                                                            &mem_131139.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            25,
                                                                            sizeof(mem_131143.mem),
                                                                            &mem_131143.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            26,
                                                                            sizeof(mem_131148.mem),
                                                                            &mem_131148.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            27,
                                                                            sizeof(mem_131152.mem),
                                                                            &mem_131152.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            28,
                                                                            sizeof(segred_tmp_mem_134185.mem),
                                                                            &segred_tmp_mem_134185.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            29,
                                                                            sizeof(segred_tmp_mem_134187.mem),
                                                                            &segred_tmp_mem_134187.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_122662,
                                                                            30,
                                                                            sizeof(mainzicounter_mem_134189.mem),
                                                                            &mainzicounter_mem_134189.mem));
                                    if (1 * ((size_t) num_groups_123258 *
                                             (size_t) segred_group_sizze_123257) !=
                                        0) {
                                        const size_t global_work_sizze_135892[1]
                                                     =
                                                     {(size_t) num_groups_123258 *
                                                     (size_t) segred_group_sizze_123257};
                                        const size_t local_work_sizze_135896[1]
                                                     =
                                                     {segred_group_sizze_123257};
                                        int64_t time_start_135893 = 0,
                                                time_end_135894 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [",
                                                    "main.segred_large_122662");
                                            fprintf(ctx->log, "%zu",
                                                    global_work_sizze_135892[0]);
                                            fprintf(ctx->log,
                                                    "] and local work size [");
                                            fprintf(ctx->log, "%zu",
                                                    local_work_sizze_135896[0]);
                                            fprintf(ctx->log,
                                                    "]; local memory parameters sum to %d bytes.\n",
                                                    (int) (0 + 1 + (int64_t) 4 *
                                                           segred_group_sizze_123257 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_123257));
                                            time_start_135893 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_122662,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_135892,
                                                                                        local_work_sizze_135896,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_122662_runs,
                                                                                                                                  &ctx->mainzisegred_large_122662_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_135894 = get_wall_time();
                                            
                                            long time_diff_135895 =
                                                 time_end_135894 -
                                                 time_start_135893;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_122662",
                                                    time_diff_135895);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_134187,
                                                              "segred_tmp_mem_134187") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_134185,
                                                              "segred_tmp_mem_134185") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_131127,
                                                          "mem_131127") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131131,
                                                          "mem_131131") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131135,
                                                          "mem_131135") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131139,
                                                          "mem_131139") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131143,
                                                          "mem_131143") != 0)
                                    return 1;
                                if (memblock_set_device(ctx,
                                                        &defunc_7_map_res_mem_131153,
                                                        &mem_131148,
                                                        "mem_131148") != 0)
                                    return 1;
                                if (memblock_set_device(ctx,
                                                        &defunc_7_map_res_mem_131154,
                                                        &mem_131152,
                                                        "mem_131152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131152,
                                                          "mem_131152") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131148,
                                                          "mem_131148") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131143,
                                                          "mem_131143") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131139,
                                                          "mem_131139") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131135,
                                                          "mem_131135") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131131,
                                                          "mem_131131") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131127,
                                                          "mem_131127") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131122,
                                                          "mem_131122") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131118,
                                                          "mem_131118") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131114,
                                                          "mem_131114") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131110,
                                                          "mem_131110") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131106,
                                                          "mem_131106") != 0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_131165,
                                                    &defunc_7_map_res_mem_131153,
                                                    "defunc_7_map_res_mem_131153") !=
                                0)
                                return 1;
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_131166,
                                                    &defunc_7_map_res_mem_131154,
                                                    "defunc_7_map_res_mem_131154") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &defunc_7_map_res_mem_131154,
                                                      "defunc_7_map_res_mem_131154") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &defunc_7_map_res_mem_131153,
                                                      "defunc_7_map_res_mem_131153") !=
                                0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &x_mem_131167,
                                                &defunc_7_map_res_mem_131165,
                                                "defunc_7_map_res_mem_131165") !=
                            0)
                            return 1;
                        if (memblock_set_device(ctx, &x_mem_131168,
                                                &defunc_7_map_res_mem_131166,
                                                "defunc_7_map_res_mem_131166") !=
                            0)
                            return 1;
                        if (memblock_unref_device(ctx,
                                                  &defunc_7_map_res_mem_131166,
                                                  "defunc_7_map_res_mem_131166") !=
                            0)
                            return 1;
                        if (memblock_unref_device(ctx,
                                                  &defunc_7_map_res_mem_131165,
                                                  "defunc_7_map_res_mem_131165") !=
                            0)
                            return 1;
                    }
                    if (memblock_set_device(ctx,
                                            &defunc_12_lifted_use_version_res_mem_131169,
                                            &x_mem_131167, "x_mem_131167") != 0)
                        return 1;
                    if (memblock_set_device(ctx,
                                            &defunc_12_lifted_use_version_res_mem_131170,
                                            &x_mem_131168, "x_mem_131168") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &x_mem_131168,
                                              "x_mem_131168") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &x_mem_131167,
                                              "x_mem_131167") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &defunc_11_loess_l_res_mem_131230,
                                        &defunc_12_lifted_use_version_res_mem_131169,
                                        "defunc_12_lifted_use_version_res_mem_131169") !=
                    0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_11_loess_l_res_mem_131231,
                                        &defunc_12_lifted_use_version_res_mem_131170,
                                        "defunc_12_lifted_use_version_res_mem_131170") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx,
                                          &defunc_12_lifted_use_version_res_mem_131170,
                                          "defunc_12_lifted_use_version_res_mem_131170") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx,
                                          &defunc_12_lifted_use_version_res_mem_131169,
                                          "defunc_12_lifted_use_version_res_mem_131169") !=
                    0)
                    return 1;
            } else {
                bool match_lit_115486 = (int64_t) 0 == l_degree_114540;
                int64_t binop_y_131178 = (int64_t) 4 * l_window_114538;
                int64_t bytes_131177 = smax64((int64_t) 0, binop_y_131178);
                struct memblock_device
                defunc_12_lifted_use_version_res_mem_131228;
                
                defunc_12_lifted_use_version_res_mem_131228.references = NULL;
                
                struct memblock_device
                defunc_12_lifted_use_version_res_mem_131229;
                
                defunc_12_lifted_use_version_res_mem_131229.references = NULL;
                if (match_lit_115486) {
                    struct memblock_device mem_131174;
                    
                    mem_131174.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_131174, bytes_130399,
                                              "mem_131174")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f32(ctx, mem_131174,
                                                      m_114533 * l_n_m_114584,
                                                      0.0F) != 0) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_131184;
                    
                    mem_131184.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_131184, bytes_130399,
                                              "mem_131184")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123347,
                                                            1, (int64_t) 4 *
                                                            l_window_114538,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123347,
                                                            2, (int64_t) 4 *
                                                            l_window_114538,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123347,
                                                            3, bytes_131177,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123347,
                                                            4, sizeof(m_114533),
                                                            &m_114533));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123347,
                                                            5, sizeof(n_114534),
                                                            &n_114534));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123347,
                                                            6,
                                                            sizeof(l_window_114538),
                                                            &l_window_114538));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123347,
                                                            7,
                                                            sizeof(t_jump_114541),
                                                            &t_jump_114541));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123347,
                                                            8,
                                                            sizeof(l_n_m_114584),
                                                            &l_n_m_114584));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123347,
                                                            9, sizeof(i_114610),
                                                            &i_114610));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123347,
                                                            10,
                                                            sizeof(defunc_3_map_res_mem_130117.mem),
                                                            &defunc_3_map_res_mem_130117.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123347,
                                                            11,
                                                            sizeof(mem_130122.mem),
                                                            &mem_130122.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123347,
                                                            12,
                                                            sizeof(defunc_3_map_res_mem_130404.mem),
                                                            &defunc_3_map_res_mem_130404.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123347,
                                                            13,
                                                            sizeof(defunc_3_map_res_mem_130405.mem),
                                                            &defunc_3_map_res_mem_130405.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123347,
                                                            14,
                                                            sizeof(mem_130861.mem),
                                                            &mem_130861.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123347,
                                                            15,
                                                            sizeof(mem_130865.mem),
                                                            &mem_130865.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123347,
                                                            16,
                                                            sizeof(mem_131184.mem),
                                                            &mem_131184.mem));
                    if (1 * ((size_t) nest_sizze_118236 *
                             (size_t) l_window_114538) != 0) {
                        const size_t global_work_sizze_135897[1] =
                                     {(size_t) nest_sizze_118236 *
                                     (size_t) l_window_114538};
                        const size_t local_work_sizze_135901[1] =
                                     {l_window_114538};
                        int64_t time_start_135898 = 0, time_end_135899 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [",
                                    "main.segmap_intragroup_123347");
                            fprintf(ctx->log, "%zu",
                                    global_work_sizze_135897[0]);
                            fprintf(ctx->log, "] and local work size [");
                            fprintf(ctx->log, "%zu",
                                    local_work_sizze_135901[0]);
                            fprintf(ctx->log,
                                    "]; local memory parameters sum to %d bytes.\n",
                                    (int) (0 + (int64_t) 4 * l_window_114538 +
                                           (int64_t) 4 * l_window_114538 +
                                           bytes_131177));
                            time_start_135898 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_intragroup_123347,
                                                                        1, NULL,
                                                                        global_work_sizze_135897,
                                                                        local_work_sizze_135901,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_intragroup_123347_runs,
                                                                                                                  &ctx->mainzisegmap_intragroup_123347_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_135899 = get_wall_time();
                            
                            long time_diff_135900 = time_end_135899 -
                                 time_start_135898;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_123347",
                                    time_diff_135900);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_set_device(ctx,
                                            &defunc_12_lifted_use_version_res_mem_131228,
                                            &mem_131184, "mem_131184") != 0)
                        return 1;
                    if (memblock_set_device(ctx,
                                            &defunc_12_lifted_use_version_res_mem_131229,
                                            &mem_131174, "mem_131174") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_131184, "mem_131184") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_131174, "mem_131174") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_115543 = (int64_t) 1 == l_degree_114540;
                    struct memblock_device x_mem_131226;
                    
                    x_mem_131226.references = NULL;
                    
                    struct memblock_device x_mem_131227;
                    
                    x_mem_131227.references = NULL;
                    if (match_lit_115543) {
                        struct memblock_device mem_131197;
                        
                        mem_131197.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_131197,
                                                  bytes_130399, "mem_131197")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_131201;
                        
                        mem_131201.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_131201,
                                                  bytes_130399, "mem_131201")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                1, (int64_t) 4 *
                                                                l_window_114538,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                2, (int64_t) 4 *
                                                                l_window_114538,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                3, (int64_t) 4 *
                                                                l_window_114538,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                4, (int64_t) 4 *
                                                                l_window_114538,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                5, (int64_t) 4 *
                                                                l_window_114538,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                6, bytes_131177,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                7, bytes_131177,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                8,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                9,
                                                                sizeof(n_114534),
                                                                &n_114534));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                10,
                                                                sizeof(l_window_114538),
                                                                &l_window_114538));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                11,
                                                                sizeof(t_jump_114541),
                                                                &t_jump_114541));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                12,
                                                                sizeof(l_n_m_114584),
                                                                &l_n_m_114584));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                13,
                                                                sizeof(i_114610),
                                                                &i_114610));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                14,
                                                                sizeof(defunc_3_map_res_mem_130117.mem),
                                                                &defunc_3_map_res_mem_130117.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                15,
                                                                sizeof(mem_130122.mem),
                                                                &mem_130122.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                16,
                                                                sizeof(defunc_3_map_res_mem_130404.mem),
                                                                &defunc_3_map_res_mem_130404.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                17,
                                                                sizeof(defunc_3_map_res_mem_130405.mem),
                                                                &defunc_3_map_res_mem_130405.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                18,
                                                                sizeof(mem_130861.mem),
                                                                &mem_130861.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                19,
                                                                sizeof(mem_130865.mem),
                                                                &mem_130865.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                20,
                                                                sizeof(mem_131197.mem),
                                                                &mem_131197.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123476,
                                                                21,
                                                                sizeof(mem_131201.mem),
                                                                &mem_131201.mem));
                        if (1 * ((size_t) nest_sizze_118236 *
                                 (size_t) l_window_114538) != 0) {
                            const size_t global_work_sizze_135902[1] =
                                         {(size_t) nest_sizze_118236 *
                                         (size_t) l_window_114538};
                            const size_t local_work_sizze_135906[1] =
                                         {l_window_114538};
                            int64_t time_start_135903 = 0, time_end_135904 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.segmap_intragroup_123476");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135902[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135906[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + (int64_t) 4 *
                                               l_window_114538 + (int64_t) 4 *
                                               l_window_114538 + (int64_t) 4 *
                                               l_window_114538 + (int64_t) 4 *
                                               l_window_114538 + (int64_t) 4 *
                                               l_window_114538 + bytes_131177 +
                                               bytes_131177));
                                time_start_135903 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_intragroup_123476,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135902,
                                                                            local_work_sizze_135906,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_intragroup_123476_runs,
                                                                                                                      &ctx->mainzisegmap_intragroup_123476_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135904 = get_wall_time();
                                
                                long time_diff_135905 = time_end_135904 -
                                     time_start_135903;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_123476",
                                        time_diff_135905);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &x_mem_131226, &mem_131197,
                                                "mem_131197") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &x_mem_131227, &mem_131201,
                                                "mem_131201") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131201,
                                                  "mem_131201") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131197,
                                                  "mem_131197") != 0)
                            return 1;
                    } else {
                        struct memblock_device mem_131221;
                        
                        mem_131221.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_131221,
                                                  bytes_130399, "mem_131221")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_131225;
                        
                        mem_131225.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_131225,
                                                  bytes_130399, "mem_131225")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                1, (int64_t) 4 *
                                                                l_window_114538,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                2, (int64_t) 4 *
                                                                l_window_114538,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                3, (int64_t) 4 *
                                                                l_window_114538,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                4, (int64_t) 4 *
                                                                l_window_114538,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                5, (int64_t) 4 *
                                                                l_window_114538,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                6, (int64_t) 4 *
                                                                l_window_114538,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                7, (int64_t) 4 *
                                                                l_window_114538,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                8, bytes_131177,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                9, bytes_131177,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                10,
                                                                bytes_131177,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                11,
                                                                bytes_131177,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                12,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                13,
                                                                sizeof(n_114534),
                                                                &n_114534));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                14,
                                                                sizeof(l_window_114538),
                                                                &l_window_114538));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                15,
                                                                sizeof(t_jump_114541),
                                                                &t_jump_114541));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                16,
                                                                sizeof(l_n_m_114584),
                                                                &l_n_m_114584));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                17,
                                                                sizeof(i_114610),
                                                                &i_114610));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                18,
                                                                sizeof(defunc_3_map_res_mem_130117.mem),
                                                                &defunc_3_map_res_mem_130117.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                19,
                                                                sizeof(mem_130122.mem),
                                                                &mem_130122.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                20,
                                                                sizeof(defunc_3_map_res_mem_130404.mem),
                                                                &defunc_3_map_res_mem_130404.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                21,
                                                                sizeof(defunc_3_map_res_mem_130405.mem),
                                                                &defunc_3_map_res_mem_130405.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                22,
                                                                sizeof(mem_130861.mem),
                                                                &mem_130861.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                23,
                                                                sizeof(mem_130865.mem),
                                                                &mem_130865.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                24,
                                                                sizeof(mem_131221.mem),
                                                                &mem_131221.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_123686,
                                                                25,
                                                                sizeof(mem_131225.mem),
                                                                &mem_131225.mem));
                        if (1 * ((size_t) nest_sizze_118236 *
                                 (size_t) l_window_114538) != 0) {
                            const size_t global_work_sizze_135907[1] =
                                         {(size_t) nest_sizze_118236 *
                                         (size_t) l_window_114538};
                            const size_t local_work_sizze_135911[1] =
                                         {l_window_114538};
                            int64_t time_start_135908 = 0, time_end_135909 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.segmap_intragroup_123686");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135907[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135911[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + (int64_t) 4 *
                                               l_window_114538 + (int64_t) 4 *
                                               l_window_114538 + (int64_t) 4 *
                                               l_window_114538 + (int64_t) 4 *
                                               l_window_114538 + (int64_t) 4 *
                                               l_window_114538 + (int64_t) 4 *
                                               l_window_114538 + (int64_t) 4 *
                                               l_window_114538 + bytes_131177 +
                                               bytes_131177 + bytes_131177 +
                                               bytes_131177));
                                time_start_135908 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_intragroup_123686,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135907,
                                                                            local_work_sizze_135911,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_intragroup_123686_runs,
                                                                                                                      &ctx->mainzisegmap_intragroup_123686_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135909 = get_wall_time();
                                
                                long time_diff_135910 = time_end_135909 -
                                     time_start_135908;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_123686",
                                        time_diff_135910);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &x_mem_131226, &mem_131221,
                                                "mem_131221") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &x_mem_131227, &mem_131225,
                                                "mem_131225") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131225,
                                                  "mem_131225") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131221,
                                                  "mem_131221") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx,
                                            &defunc_12_lifted_use_version_res_mem_131228,
                                            &x_mem_131226, "x_mem_131226") != 0)
                        return 1;
                    if (memblock_set_device(ctx,
                                            &defunc_12_lifted_use_version_res_mem_131229,
                                            &x_mem_131227, "x_mem_131227") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &x_mem_131227,
                                              "x_mem_131227") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &x_mem_131226,
                                              "x_mem_131226") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &defunc_11_loess_l_res_mem_131230,
                                        &defunc_12_lifted_use_version_res_mem_131228,
                                        "defunc_12_lifted_use_version_res_mem_131228") !=
                    0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_11_loess_l_res_mem_131231,
                                        &defunc_12_lifted_use_version_res_mem_131229,
                                        "defunc_12_lifted_use_version_res_mem_131229") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx,
                                          &defunc_12_lifted_use_version_res_mem_131229,
                                          "defunc_12_lifted_use_version_res_mem_131229") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx,
                                          &defunc_12_lifted_use_version_res_mem_131228,
                                          "defunc_12_lifted_use_version_res_mem_131228") !=
                    0)
                    return 1;
            }
            
            struct memblock_device L_l_mem_131238;
            
            L_l_mem_131238.references = NULL;
            if (cond_114941) {
                bool zzero_115791 = l_jump_114542 == (int64_t) 0;
                bool nonzzero_115792 = !zzero_115791;
                bool nonzzero_cert_115793;
                
                if (!nonzzero_115792) {
                    ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                           "division by zero",
                                           "-> #0  stl.fut:55:27-34\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:54:3-67:14\n   #4  stl.fut:252:21-67\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:250:15-253:43\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n");
                    if (memblock_unref_device(ctx, &L_l_mem_131238,
                                              "L_l_mem_131238") != 0)
                        return 1;
                    if (memblock_unref_device(ctx,
                                              &defunc_11_loess_l_res_mem_131231,
                                              "defunc_11_loess_l_res_mem_131231") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx,
                                              &defunc_11_loess_l_res_mem_131230,
                                              "defunc_11_loess_l_res_mem_131230") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130856,
                                              "defunc_3_map_res_mem_130856") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_4_map_res_mem_130745,
                                              "defunc_4_map_res_mem_130745") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130667,
                                              "mem_param_130667") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130659,
                                              "mem_param_130659") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &loopres_mem_131660,
                                              "loopres_mem_131660") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &loopres_mem_131652,
                                              "loopres_mem_131652") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130645,
                                              "mem_param_130645") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130637,
                                              "mem_param_130637") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130629,
                                              "mem_param_130629") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &stl_res_mem_131994,
                                              "stl_res_mem_131994") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &stl_res_mem_131986,
                                              "stl_res_mem_131986") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &stl_res_mem_131978,
                                              "stl_res_mem_131978") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130865, "mem_130865") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130861, "mem_130861") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130750, "mem_130750") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130672, "mem_130672") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130621, "mem_130621") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130618, "mem_130618") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130615, "mem_130615") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130611, "mem_130611") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130607,
                                              "defunc_3_map_res_mem_130607") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130606,
                                              "defunc_3_map_res_mem_130606") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130405,
                                              "defunc_3_map_res_mem_130405") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130404,
                                              "defunc_3_map_res_mem_130404") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130203,
                                              "defunc_3_map_res_mem_130203") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130127, "mem_130127") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130122, "mem_130122") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                                              "defunc_3_map_res_mem_130117") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                                              "defunc_3_map_res_mem_130116") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &out_mem_132283,
                                              "out_mem_132283") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &out_mem_132282,
                                              "out_mem_132282") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &out_mem_132281,
                                              "out_mem_132281") != 0)
                        return 1;
                    return 1;
                }
                
                int64_t y_115794 = sub64(l_n_m_114584, (int64_t) 1);
                int64_t segmap_group_sizze_124053;
                
                segmap_group_sizze_124053 =
                    ctx->sizes.mainzisegmap_group_sizze_123941;
                
                int64_t segmap_usable_groups_124054 =
                        sdiv_up64(nest_sizze_116859, segmap_group_sizze_124053);
                struct memblock_device mem_131236;
                
                mem_131236.references = NULL;
                if (memblock_alloc_device(ctx, &mem_131236, bytes_130119,
                                          "mem_131236")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_123938,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_123938,
                                                        3, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_123938,
                                                        4, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_123938,
                                                        5,
                                                        sizeof(l_jump_114542),
                                                        &l_jump_114542));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_123938,
                                                        6, sizeof(l_n_m_114584),
                                                        &l_n_m_114584));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_123938,
                                                        7, sizeof(i_114610),
                                                        &i_114610));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_123938,
                                                        8, sizeof(y_115794),
                                                        &y_115794));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_123938,
                                                        9,
                                                        sizeof(defunc_11_loess_l_res_mem_131230.mem),
                                                        &defunc_11_loess_l_res_mem_131230.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_123938,
                                                        10,
                                                        sizeof(defunc_11_loess_l_res_mem_131231.mem),
                                                        &defunc_11_loess_l_res_mem_131231.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_123938,
                                                        11,
                                                        sizeof(mem_131236.mem),
                                                        &mem_131236.mem));
                if (1 * ((size_t) segmap_usable_groups_124054 *
                         (size_t) segmap_group_sizze_124053) != 0) {
                    const size_t global_work_sizze_135912[1] =
                                 {(size_t) segmap_usable_groups_124054 *
                                 (size_t) segmap_group_sizze_124053};
                    const size_t local_work_sizze_135916[1] =
                                 {segmap_group_sizze_124053};
                    int64_t time_start_135913 = 0, time_end_135914 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segmap_123938");
                        fprintf(ctx->log, "%zu", global_work_sizze_135912[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135916[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_135913 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_123938,
                                                                    1, NULL,
                                                                    global_work_sizze_135912,
                                                                    local_work_sizze_135916,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_123938_runs,
                                                                                                              &ctx->mainzisegmap_123938_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135914 = get_wall_time();
                        
                        long time_diff_135915 = time_end_135914 -
                             time_start_135913;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_123938", time_diff_135915);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &L_l_mem_131238, &mem_131236,
                                        "mem_131236") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131236, "mem_131236") != 0)
                    return 1;
            } else {
                bool dim_match_115847 = n_114534 == l_n_m_114584;
                bool empty_or_match_cert_115848;
                
                if (!dim_match_115847) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Value of (core language) shape (", m_114533,
                                  ", ", l_n_m_114584,
                                  ") cannot match shape of type `[", m_114533,
                                  "][", n_114534, "]t`.",
                                  "-> #0  stl.fut:255:15-36\n   #1  stl.fut:394:3-405:33\n   #2  stl.fut:381:1-405:33\n");
                    if (memblock_unref_device(ctx, &L_l_mem_131238,
                                              "L_l_mem_131238") != 0)
                        return 1;
                    if (memblock_unref_device(ctx,
                                              &defunc_11_loess_l_res_mem_131231,
                                              "defunc_11_loess_l_res_mem_131231") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx,
                                              &defunc_11_loess_l_res_mem_131230,
                                              "defunc_11_loess_l_res_mem_131230") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130856,
                                              "defunc_3_map_res_mem_130856") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_4_map_res_mem_130745,
                                              "defunc_4_map_res_mem_130745") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130667,
                                              "mem_param_130667") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130659,
                                              "mem_param_130659") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &loopres_mem_131660,
                                              "loopres_mem_131660") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &loopres_mem_131652,
                                              "loopres_mem_131652") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130645,
                                              "mem_param_130645") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130637,
                                              "mem_param_130637") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130629,
                                              "mem_param_130629") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &stl_res_mem_131994,
                                              "stl_res_mem_131994") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &stl_res_mem_131986,
                                              "stl_res_mem_131986") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &stl_res_mem_131978,
                                              "stl_res_mem_131978") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130865, "mem_130865") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130861, "mem_130861") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130750, "mem_130750") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130672, "mem_130672") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130621, "mem_130621") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130618, "mem_130618") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130615, "mem_130615") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130611, "mem_130611") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130607,
                                              "defunc_3_map_res_mem_130607") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130606,
                                              "defunc_3_map_res_mem_130606") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130405,
                                              "defunc_3_map_res_mem_130405") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130404,
                                              "defunc_3_map_res_mem_130404") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130203,
                                              "defunc_3_map_res_mem_130203") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130127, "mem_130127") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130122, "mem_130122") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                                              "defunc_3_map_res_mem_130117") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                                              "defunc_3_map_res_mem_130116") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &out_mem_132283,
                                              "out_mem_132283") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &out_mem_132282,
                                              "out_mem_132282") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &out_mem_132281,
                                              "out_mem_132281") != 0)
                        return 1;
                    return 1;
                }
                if (memblock_set_device(ctx, &L_l_mem_131238,
                                        &defunc_11_loess_l_res_mem_131230,
                                        "defunc_11_loess_l_res_mem_131230") !=
                    0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &defunc_11_loess_l_res_mem_131230,
                                      "defunc_11_loess_l_res_mem_131230") != 0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_11_loess_l_res_mem_131231,
                                      "defunc_11_loess_l_res_mem_131231") != 0)
                return 1;
            
            struct memblock_device mem_131243;
            
            mem_131243.references = NULL;
            if (memblock_alloc_device(ctx, &mem_131243, bytes_130119,
                                      "mem_131243")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124116, 1,
                                                    sizeof(m_114533),
                                                    &m_114533));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124116, 2,
                                                    sizeof(n_114534),
                                                    &n_114534));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124116, 3,
                                                    sizeof(n_p_114536),
                                                    &n_p_114536));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124116, 4,
                                                    sizeof(C_len_114582),
                                                    &C_len_114582));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124116, 5,
                                                    sizeof(L_l_ixfn_131237),
                                                    &L_l_ixfn_131237));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124116, 6,
                                                    sizeof(mem_130750.mem),
                                                    &mem_130750.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124116, 7,
                                                    sizeof(L_l_mem_131238.mem),
                                                    &L_l_mem_131238.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124116, 8,
                                                    sizeof(mem_131243.mem),
                                                    &mem_131243.mem));
            if (1 * ((size_t) segmap_usable_groups_124140 *
                     (size_t) segmap_group_sizze_124139) != 0) {
                const size_t global_work_sizze_135917[1] =
                             {(size_t) segmap_usable_groups_124140 *
                             (size_t) segmap_group_sizze_124139};
                const size_t local_work_sizze_135921[1] =
                             {segmap_group_sizze_124139};
                int64_t time_start_135918 = 0, time_end_135919 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log, "Launching %s with global work size [",
                            "main.segmap_124116");
                    fprintf(ctx->log, "%zu", global_work_sizze_135917[0]);
                    fprintf(ctx->log, "] and local work size [");
                    fprintf(ctx->log, "%zu", local_work_sizze_135921[0]);
                    fprintf(ctx->log,
                            "]; local memory parameters sum to %d bytes.\n",
                            (int) 0);
                    time_start_135918 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_124116,
                                                                1, NULL,
                                                                global_work_sizze_135917,
                                                                local_work_sizze_135921,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_124116_runs,
                                                                                                          &ctx->mainzisegmap_124116_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_135919 = get_wall_time();
                    
                    long time_diff_135920 = time_end_135919 - time_start_135918;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_124116", time_diff_135920);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &L_l_mem_131238, "L_l_mem_131238") !=
                0)
                return 1;
            
            struct memblock_device defunc_4_map_res_mem_131267;
            
            defunc_4_map_res_mem_131267.references = NULL;
            
            int32_t local_memory_capacity_134351;
            
            local_memory_capacity_134351 = ctx->opencl.max_local_memory;
            if (sle64(bytes_130785 + srem64((int64_t) 8 - srem64(bytes_130785,
                                                                 (int64_t) 8),
                                            (int64_t) 8) + (bytes_130785 +
                                                            srem64((int64_t) 8 -
                                                                   srem64(bytes_130785,
                                                                          (int64_t) 8),
                                                                   (int64_t) 8)),
                      sext_i32_i64(local_memory_capacity_134351)) &&
                intra_suff_and_fits_124171) {
                struct memblock_device mem_131256;
                
                mem_131256.references = NULL;
                if (memblock_alloc_device(ctx, &mem_131256, bytes_130119,
                                          "mem_131256")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_124166,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_124166,
                                                        3, bytes_130785, NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_124166,
                                                        4, bytes_130785, NULL));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_124166,
                                                        5, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_124166,
                                                        6, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_124166,
                                                        7,
                                                        sizeof(Y_mem_130086.mem),
                                                        &Y_mem_130086.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_124166,
                                                        8,
                                                        sizeof(defunc_3_map_res_mem_130116.mem),
                                                        &defunc_3_map_res_mem_130116.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_124166,
                                                        9,
                                                        sizeof(mem_131243.mem),
                                                        &mem_131243.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_124166,
                                                        10,
                                                        sizeof(mem_131256.mem),
                                                        &mem_131256.mem));
                if (1 * ((size_t) m_114533 * (size_t) n_114534) != 0) {
                    const size_t global_work_sizze_135922[1] =
                                 {(size_t) m_114533 * (size_t) n_114534};
                    const size_t local_work_sizze_135926[1] = {n_114534};
                    int64_t time_start_135923 = 0, time_end_135924 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segmap_intragroup_124166");
                        fprintf(ctx->log, "%zu", global_work_sizze_135922[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135926[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) (0 + bytes_130785 + bytes_130785));
                        time_start_135923 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_intragroup_124166,
                                                                    1, NULL,
                                                                    global_work_sizze_135922,
                                                                    local_work_sizze_135926,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_intragroup_124166_runs,
                                                                                                              &ctx->mainzisegmap_intragroup_124166_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135924 = get_wall_time();
                        
                        long time_diff_135925 = time_end_135924 -
                             time_start_135923;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_intragroup_124166",
                                time_diff_135925);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &defunc_4_map_res_mem_131267,
                                        &mem_131256, "mem_131256") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131256, "mem_131256") != 0)
                    return 1;
            } else {
                struct memblock_device mem_131261;
                
                mem_131261.references = NULL;
                if (memblock_alloc_device(ctx, &mem_131261, bytes_130119,
                                          "mem_131261")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124239,
                                                        1, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124239,
                                                        2, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124239,
                                                        3,
                                                        sizeof(Y_mem_130086.mem),
                                                        &Y_mem_130086.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124239,
                                                        4,
                                                        sizeof(mem_131243.mem),
                                                        &mem_131243.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124239,
                                                        5,
                                                        sizeof(mem_131261.mem),
                                                        &mem_131261.mem));
                if (1 * ((size_t) segmap_usable_groups_124263 *
                         (size_t) segmap_group_sizze_124262) != 0) {
                    const size_t global_work_sizze_135927[1] =
                                 {(size_t) segmap_usable_groups_124263 *
                                 (size_t) segmap_group_sizze_124262};
                    const size_t local_work_sizze_135931[1] =
                                 {segmap_group_sizze_124262};
                    int64_t time_start_135928 = 0, time_end_135929 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segmap_124239");
                        fprintf(ctx->log, "%zu", global_work_sizze_135927[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135931[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_135928 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_124239,
                                                                    1, NULL,
                                                                    global_work_sizze_135927,
                                                                    local_work_sizze_135931,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_124239_runs,
                                                                                                              &ctx->mainzisegmap_124239_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135929 = get_wall_time();
                        
                        long time_diff_135930 = time_end_135929 -
                             time_start_135928;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_124239", time_diff_135930);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                
                struct memblock_device mem_131266;
                
                mem_131266.references = NULL;
                if (memblock_alloc_device(ctx, &mem_131266, bytes_130119,
                                          "mem_131266")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124202,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124202,
                                                        3, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124202,
                                                        4, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124202,
                                                        5,
                                                        sizeof(defunc_3_map_res_mem_130116.mem),
                                                        &defunc_3_map_res_mem_130116.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124202,
                                                        6,
                                                        sizeof(mem_131261.mem),
                                                        &mem_131261.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124202,
                                                        7,
                                                        sizeof(mem_131266.mem),
                                                        &mem_131266.mem));
                if (1 * ((size_t) segmap_usable_groups_124276 *
                         (size_t) segmap_group_sizze_124275) != 0) {
                    const size_t global_work_sizze_135932[1] =
                                 {(size_t) segmap_usable_groups_124276 *
                                 (size_t) segmap_group_sizze_124275};
                    const size_t local_work_sizze_135936[1] =
                                 {segmap_group_sizze_124275};
                    int64_t time_start_135933 = 0, time_end_135934 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segmap_124202");
                        fprintf(ctx->log, "%zu", global_work_sizze_135932[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_135936[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_135933 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_124202,
                                                                    1, NULL,
                                                                    global_work_sizze_135932,
                                                                    local_work_sizze_135936,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_124202_runs,
                                                                                                              &ctx->mainzisegmap_124202_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_135934 = get_wall_time();
                        
                        long time_diff_135935 = time_end_135934 -
                             time_start_135933;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_124202", time_diff_135935);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_131261, "mem_131261") != 0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_4_map_res_mem_131267,
                                        &mem_131266, "mem_131266") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131266, "mem_131266") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131261, "mem_131261") != 0)
                    return 1;
            }
            
            struct memblock_device defunc_11_loess_l_res_mem_131632;
            
            defunc_11_loess_l_res_mem_131632.references = NULL;
            
            struct memblock_device defunc_11_loess_l_res_mem_131633;
            
            defunc_11_loess_l_res_mem_131633.references = NULL;
            if (cond_115017) {
                bool match_lit_115878 = (int64_t) 0 == t_degree_114539;
                struct memblock_device
                defunc_12_lifted_use_version_res_mem_131571;
                
                defunc_12_lifted_use_version_res_mem_131571.references = NULL;
                
                struct memblock_device
                defunc_12_lifted_use_version_res_mem_131572;
                
                defunc_12_lifted_use_version_res_mem_131572.references = NULL;
                if (match_lit_115878) {
                    struct memblock_device mem_131271;
                    
                    mem_131271.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_131271, bytes_130601,
                                              "mem_131271")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f32(ctx, mem_131271,
                                                      m_114533 * t_n_m_114591,
                                                      0.0F) != 0) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    bool suff_outer_par_124289;
                    
                    suff_outer_par_124289 =
                        ctx->sizes.mainzisuff_outer_par_20 <= m_114533;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_20", (long) m_114533,
                                suff_outer_par_124289 ? "true" : "false");
                    
                    int64_t segmap_group_sizze_124362;
                    
                    segmap_group_sizze_124362 =
                        ctx->sizes.mainzisegmap_group_sizze_124293;
                    
                    int64_t num_groups_124363;
                    int32_t max_num_groups_134352;
                    
                    max_num_groups_134352 =
                        ctx->sizes.mainzisegmap_num_groups_124295;
                    num_groups_124363 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(m_114533,
                                                                             segmap_group_sizze_124362),
                                                                   sext_i32_i64(max_num_groups_134352))));
                    
                    int64_t segmap_group_sizze_124722;
                    
                    segmap_group_sizze_124722 =
                        ctx->sizes.mainzisegmap_group_sizze_124434;
                    
                    bool suff_outer_par_124726;
                    
                    suff_outer_par_124726 =
                        ctx->sizes.mainzisuff_outer_par_21 <= nest_sizze_119536;
                    if (ctx->logging)
                        fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                "main.suff_outer_par_21",
                                (long) nest_sizze_119536,
                                suff_outer_par_124726 ? "true" : "false");
                    
                    int64_t nest_sizze_124800 = t_window_114537 *
                            nest_sizze_119536;
                    int64_t segred_group_sizze_124801;
                    
                    segred_group_sizze_124801 =
                        ctx->sizes.mainzisegred_group_sizze_124572;
                    
                    int64_t num_groups_124802;
                    int32_t max_num_groups_134353;
                    
                    max_num_groups_134353 =
                        ctx->sizes.mainzisegred_num_groups_124574;
                    num_groups_124802 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_124800,
                                                                             segred_group_sizze_124801),
                                                                   sext_i32_i64(max_num_groups_134353))));
                    
                    int64_t segmap_group_sizze_124837;
                    
                    segmap_group_sizze_124837 =
                        ctx->sizes.mainzisegmap_group_sizze_124562;
                    
                    int64_t segred_group_sizze_124845;
                    
                    segred_group_sizze_124845 =
                        ctx->sizes.mainzisegred_group_sizze_124510;
                    
                    int64_t num_groups_124846;
                    int32_t max_num_groups_134354;
                    
                    max_num_groups_134354 =
                        ctx->sizes.mainzisegred_num_groups_124512;
                    num_groups_124846 = sext_i64_i32(smax64((int64_t) 1,
                                                            smin64(sdiv_up64(nest_sizze_124800,
                                                                             segred_group_sizze_124845),
                                                                   sext_i32_i64(max_num_groups_134354))));
                    
                    int64_t num_threads_132237 = segmap_group_sizze_124362 *
                            num_groups_124363;
                    int64_t total_sizze_132238 = bytes_130440 *
                            num_threads_132237;
                    struct memblock_device defunc_7_map_res_mem_131332;
                    
                    defunc_7_map_res_mem_131332.references = NULL;
                    
                    int32_t local_memory_capacity_134529;
                    
                    local_memory_capacity_134529 = ctx->opencl.max_local_memory;
                    if (sle64((int64_t) 0,
                              sext_i32_i64(local_memory_capacity_134529)) &&
                        suff_outer_par_124289) {
                        struct memblock_device mem_131274;
                        
                        mem_131274.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_131274,
                                                  bytes_130470, "mem_131274")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                  mem_131274,
                                                                  (int64_t) 0,
                                                                  defunc_3_map_res_mem_130606,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  t_n_m_114591,
                                                                  m_114533) !=
                            0) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_131277;
                        
                        mem_131277.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_131277,
                                                  bytes_130473, "mem_131277")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                  mem_131277,
                                                                  (int64_t) 0,
                                                                  defunc_3_map_res_mem_130607,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  t_n_m_114591,
                                                                  m_114533) !=
                            0) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_131280;
                        
                        mem_131280.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_131280,
                                                  binop_y_130121,
                                                  "mem_131280")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                  mem_131280,
                                                                  (int64_t) 0,
                                                                  mem_130122,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_114534,
                                                                  m_114533) !=
                            0) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_131283;
                        
                        mem_131283.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_131283,
                                                  binop_y_130121,
                                                  "mem_131283")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                  mem_131283,
                                                                  (int64_t) 0,
                                                                  mem_130861,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_114534,
                                                                  m_114533) !=
                            0) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_131286;
                        
                        mem_131286.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_131286,
                                                  binop_y_130121,
                                                  "mem_131286")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                  mem_131286,
                                                                  (int64_t) 0,
                                                                  defunc_4_map_res_mem_131267,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  n_114534,
                                                                  m_114533) !=
                            0) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_131305;
                        
                        mem_131305.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_131305,
                                                  bytes_130473, "mem_131305")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device color_132123;
                        
                        color_132123.references = NULL;
                        if (memblock_alloc_device(ctx, &color_132123,
                                                  total_sizze_132238,
                                                  "color_132123")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124291,
                                                                1,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124291,
                                                                2,
                                                                sizeof(t_window_114537),
                                                                &t_window_114537));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124291,
                                                                3,
                                                                sizeof(t_jump_114541),
                                                                &t_jump_114541));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124291,
                                                                4,
                                                                sizeof(t_n_m_114591),
                                                                &t_n_m_114591));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124291,
                                                                5,
                                                                sizeof(i_114610),
                                                                &i_114610));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124291,
                                                                6,
                                                                sizeof(num_groups_124363),
                                                                &num_groups_124363));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124291,
                                                                7,
                                                                sizeof(num_threads_132237),
                                                                &num_threads_132237));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124291,
                                                                8,
                                                                sizeof(defunc_3_map_res_mem_130117.mem),
                                                                &defunc_3_map_res_mem_130117.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124291,
                                                                9,
                                                                sizeof(mem_131274.mem),
                                                                &mem_131274.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124291,
                                                                10,
                                                                sizeof(mem_131277.mem),
                                                                &mem_131277.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124291,
                                                                11,
                                                                sizeof(mem_131280.mem),
                                                                &mem_131280.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124291,
                                                                12,
                                                                sizeof(mem_131283.mem),
                                                                &mem_131283.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124291,
                                                                13,
                                                                sizeof(mem_131286.mem),
                                                                &mem_131286.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124291,
                                                                14,
                                                                sizeof(mem_131305.mem),
                                                                &mem_131305.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124291,
                                                                15,
                                                                sizeof(color_132123.mem),
                                                                &color_132123.mem));
                        if (1 * ((size_t) num_groups_124363 *
                                 (size_t) segmap_group_sizze_124362) != 0) {
                            const size_t global_work_sizze_135937[1] =
                                         {(size_t) num_groups_124363 *
                                         (size_t) segmap_group_sizze_124362};
                            const size_t local_work_sizze_135941[1] =
                                         {segmap_group_sizze_124362};
                            int64_t time_start_135938 = 0, time_end_135939 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.segmap_124291");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_135937[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_135941[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) 0);
                                time_start_135938 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_124291,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_135937,
                                                                            local_work_sizze_135941,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_124291_runs,
                                                                                                                      &ctx->mainzisegmap_124291_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_135939 = get_wall_time();
                                
                                long time_diff_135940 = time_end_135939 -
                                     time_start_135938;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_124291", time_diff_135940);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_unref_device(ctx, &mem_131274,
                                                  "mem_131274") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131277,
                                                  "mem_131277") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131280,
                                                  "mem_131280") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131283,
                                                  "mem_131283") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131286,
                                                  "mem_131286") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_132123,
                                                  "color_132123") != 0)
                            return 1;
                        
                        struct memblock_device mem_131330;
                        
                        mem_131330.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_131330,
                                                  bytes_130601, "mem_131330")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                  mem_131330,
                                                                  (int64_t) 0,
                                                                  mem_131305,
                                                                  (int64_t) 0,
                                                                  (int64_t) 1,
                                                                  m_114533,
                                                                  t_n_m_114591) !=
                            0) {
                            err = 1;
                            goto cleanup;
                        }
                        if (memblock_unref_device(ctx, &mem_131305,
                                                  "mem_131305") != 0)
                            return 1;
                        if (memblock_set_device(ctx,
                                                &defunc_7_map_res_mem_131332,
                                                &mem_131330, "mem_131330") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131330,
                                                  "mem_131330") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &color_132123,
                                                  "color_132123") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131305,
                                                  "mem_131305") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131286,
                                                  "mem_131286") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131283,
                                                  "mem_131283") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131280,
                                                  "mem_131280") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131277,
                                                  "mem_131277") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131274,
                                                  "mem_131274") != 0)
                            return 1;
                    } else {
                        int64_t segmap_usable_groups_124723 =
                                sdiv_up64(nest_sizze_119536,
                                          segmap_group_sizze_124722);
                        struct memblock_device defunc_7_map_res_mem_131326;
                        
                        defunc_7_map_res_mem_131326.references = NULL;
                        
                        int32_t local_memory_capacity_134528;
                        
                        local_memory_capacity_134528 =
                            ctx->opencl.max_local_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_134528)) &&
                            suff_outer_par_124726) {
                            struct memblock_device mem_131310;
                            
                            mem_131310.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131310,
                                                      bytes_130601,
                                                      "mem_131310")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124431,
                                                                    1,
                                                                    sizeof(m_114533),
                                                                    &m_114533));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124431,
                                                                    2,
                                                                    sizeof(n_114534),
                                                                    &n_114534));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124431,
                                                                    3,
                                                                    sizeof(t_window_114537),
                                                                    &t_window_114537));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124431,
                                                                    4,
                                                                    sizeof(t_jump_114541),
                                                                    &t_jump_114541));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124431,
                                                                    5,
                                                                    sizeof(t_n_m_114591),
                                                                    &t_n_m_114591));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124431,
                                                                    6,
                                                                    sizeof(i_114610),
                                                                    &i_114610));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124431,
                                                                    7,
                                                                    sizeof(defunc_3_map_res_mem_130117.mem),
                                                                    &defunc_3_map_res_mem_130117.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124431,
                                                                    8,
                                                                    sizeof(mem_130122.mem),
                                                                    &mem_130122.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124431,
                                                                    9,
                                                                    sizeof(defunc_3_map_res_mem_130606.mem),
                                                                    &defunc_3_map_res_mem_130606.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124431,
                                                                    10,
                                                                    sizeof(defunc_3_map_res_mem_130607.mem),
                                                                    &defunc_3_map_res_mem_130607.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124431,
                                                                    11,
                                                                    sizeof(mem_130861.mem),
                                                                    &mem_130861.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124431,
                                                                    12,
                                                                    sizeof(defunc_4_map_res_mem_131267.mem),
                                                                    &defunc_4_map_res_mem_131267.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124431,
                                                                    13,
                                                                    sizeof(mem_131310.mem),
                                                                    &mem_131310.mem));
                            if (1 * ((size_t) segmap_usable_groups_124723 *
                                     (size_t) segmap_group_sizze_124722) != 0) {
                                const size_t global_work_sizze_135942[1] =
                                             {(size_t) segmap_usable_groups_124723 *
                                             (size_t) segmap_group_sizze_124722};
                                const size_t local_work_sizze_135946[1] =
                                             {segmap_group_sizze_124722};
                                int64_t time_start_135943 = 0, time_end_135944 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [",
                                            "main.segmap_124431");
                                    fprintf(ctx->log, "%zu",
                                            global_work_sizze_135942[0]);
                                    fprintf(ctx->log,
                                            "] and local work size [");
                                    fprintf(ctx->log, "%zu",
                                            local_work_sizze_135946[0]);
                                    fprintf(ctx->log,
                                            "]; local memory parameters sum to %d bytes.\n",
                                            (int) 0);
                                    time_start_135943 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_124431,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_135942,
                                                                                local_work_sizze_135946,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_124431_runs,
                                                                                                                          &ctx->mainzisegmap_124431_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_135944 = get_wall_time();
                                    
                                    long time_diff_135945 = time_end_135944 -
                                         time_start_135943;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_124431",
                                            time_diff_135945);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_131326,
                                                    &mem_131310,
                                                    "mem_131310") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131310,
                                                      "mem_131310") != 0)
                                return 1;
                        } else {
                            struct memblock_device mem_131315;
                            
                            mem_131315.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131315,
                                                      bytes_130601,
                                                      "mem_131315")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(t_window_114537 * (int64_t) 2,
                                      segred_group_sizze_124801)) {
                                int64_t segment_sizze_nonzzero_134382 =
                                        smax64((int64_t) 1, t_window_114537);
                                int64_t num_threads_134383 = num_groups_124802 *
                                        segred_group_sizze_124801;
                                
                                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_114533 *
                                                         t_n_m_114591), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) t_window_114537, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_124801,
                                                                segment_sizze_nonzzero_134382),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(m_114533 *
                                                                               t_n_m_114591,
                                                                               squot64(segred_group_sizze_124801,
                                                                                       segment_sizze_nonzzero_134382))),
                                            '\n');
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124578,
                                                                        1,
                                                                        (int64_t) 4 *
                                                                        segred_group_sizze_124801,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124578,
                                                                        2,
                                                                        sizeof(m_114533),
                                                                        &m_114533));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124578,
                                                                        3,
                                                                        sizeof(n_114534),
                                                                        &n_114534));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124578,
                                                                        4,
                                                                        sizeof(t_window_114537),
                                                                        &t_window_114537));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124578,
                                                                        5,
                                                                        sizeof(t_jump_114541),
                                                                        &t_jump_114541));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124578,
                                                                        6,
                                                                        sizeof(t_n_m_114591),
                                                                        &t_n_m_114591));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124578,
                                                                        7,
                                                                        sizeof(i_114610),
                                                                        &i_114610));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124578,
                                                                        8,
                                                                        sizeof(num_groups_124802),
                                                                        &num_groups_124802));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124578,
                                                                        9,
                                                                        sizeof(segment_sizze_nonzzero_134382),
                                                                        &segment_sizze_nonzzero_134382));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124578,
                                                                        10,
                                                                        sizeof(defunc_3_map_res_mem_130117.mem),
                                                                        &defunc_3_map_res_mem_130117.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124578,
                                                                        11,
                                                                        sizeof(mem_130122.mem),
                                                                        &mem_130122.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124578,
                                                                        12,
                                                                        sizeof(defunc_3_map_res_mem_130606.mem),
                                                                        &defunc_3_map_res_mem_130606.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124578,
                                                                        13,
                                                                        sizeof(defunc_3_map_res_mem_130607.mem),
                                                                        &defunc_3_map_res_mem_130607.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124578,
                                                                        14,
                                                                        sizeof(mem_130861.mem),
                                                                        &mem_130861.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124578,
                                                                        15,
                                                                        sizeof(mem_131315.mem),
                                                                        &mem_131315.mem));
                                if (1 * ((size_t) num_groups_124802 *
                                         (size_t) segred_group_sizze_124801) !=
                                    0) {
                                    const size_t global_work_sizze_135947[1] =
                                                 {(size_t) num_groups_124802 *
                                                 (size_t) segred_group_sizze_124801};
                                    const size_t local_work_sizze_135951[1] =
                                                 {segred_group_sizze_124801};
                                    int64_t time_start_135948 = 0,
                                            time_end_135949 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [",
                                                "main.segred_small_124578");
                                        fprintf(ctx->log, "%zu",
                                                global_work_sizze_135947[0]);
                                        fprintf(ctx->log,
                                                "] and local work size [");
                                        fprintf(ctx->log, "%zu",
                                                local_work_sizze_135951[0]);
                                        fprintf(ctx->log,
                                                "]; local memory parameters sum to %d bytes.\n",
                                                (int) (0 + (int64_t) 4 *
                                                       segred_group_sizze_124801));
                                        time_start_135948 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_small_124578,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_135947,
                                                                                    local_work_sizze_135951,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_small_124578_runs,
                                                                                                                              &ctx->mainzisegred_small_124578_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_135949 = get_wall_time();
                                        
                                        long time_diff_135950 =
                                             time_end_135949 -
                                             time_start_135948;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_small_124578",
                                                time_diff_135950);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_134407 =
                                        sdiv_up64(num_groups_124802,
                                                  smax64((int64_t) 1, m_114533 *
                                                         t_n_m_114591));
                                int64_t elements_per_thread_134408 =
                                        sdiv_up64(t_window_114537,
                                                  segred_group_sizze_124801 *
                                                  groups_per_segment_134407);
                                int64_t virt_num_groups_134409 =
                                        groups_per_segment_134407 * (m_114533 *
                                                                     t_n_m_114591);
                                int64_t num_threads_134410 = num_groups_124802 *
                                        segred_group_sizze_124801;
                                int64_t threads_per_segment_134411 =
                                        groups_per_segment_134407 *
                                        segred_group_sizze_124801;
                                
                                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_114533 *
                                                         t_n_m_114591), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) t_window_114537, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_134409,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_124802,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_124801,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_134408,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_134407,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_134412;
                                
                                segred_tmp_mem_134412.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_134412,
                                                          (int64_t) 4 *
                                                          virt_num_groups_134409,
                                                          "segred_tmp_mem_134412")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_134414
                                                       =
                                                       ctx->mainzicounter_mem_134414;
                                
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        1, 1,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        2,
                                                                        (int64_t) 4 *
                                                                        segred_group_sizze_124801,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        3,
                                                                        sizeof(m_114533),
                                                                        &m_114533));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        4,
                                                                        sizeof(n_114534),
                                                                        &n_114534));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        5,
                                                                        sizeof(t_window_114537),
                                                                        &t_window_114537));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        6,
                                                                        sizeof(t_jump_114541),
                                                                        &t_jump_114541));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        7,
                                                                        sizeof(t_n_m_114591),
                                                                        &t_n_m_114591));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        8,
                                                                        sizeof(i_114610),
                                                                        &i_114610));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        9,
                                                                        sizeof(num_groups_124802),
                                                                        &num_groups_124802));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        10,
                                                                        sizeof(groups_per_segment_134407),
                                                                        &groups_per_segment_134407));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        11,
                                                                        sizeof(elements_per_thread_134408),
                                                                        &elements_per_thread_134408));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        12,
                                                                        sizeof(virt_num_groups_134409),
                                                                        &virt_num_groups_134409));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        13,
                                                                        sizeof(threads_per_segment_134411),
                                                                        &threads_per_segment_134411));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        14,
                                                                        sizeof(defunc_3_map_res_mem_130117.mem),
                                                                        &defunc_3_map_res_mem_130117.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        15,
                                                                        sizeof(mem_130122.mem),
                                                                        &mem_130122.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        16,
                                                                        sizeof(defunc_3_map_res_mem_130606.mem),
                                                                        &defunc_3_map_res_mem_130606.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        17,
                                                                        sizeof(defunc_3_map_res_mem_130607.mem),
                                                                        &defunc_3_map_res_mem_130607.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        18,
                                                                        sizeof(mem_130861.mem),
                                                                        &mem_130861.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        19,
                                                                        sizeof(mem_131315.mem),
                                                                        &mem_131315.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        20,
                                                                        sizeof(segred_tmp_mem_134412.mem),
                                                                        &segred_tmp_mem_134412.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124578,
                                                                        21,
                                                                        sizeof(mainzicounter_mem_134414.mem),
                                                                        &mainzicounter_mem_134414.mem));
                                if (1 * ((size_t) num_groups_124802 *
                                         (size_t) segred_group_sizze_124801) !=
                                    0) {
                                    const size_t global_work_sizze_135953[1] =
                                                 {(size_t) num_groups_124802 *
                                                 (size_t) segred_group_sizze_124801};
                                    const size_t local_work_sizze_135957[1] =
                                                 {segred_group_sizze_124801};
                                    int64_t time_start_135954 = 0,
                                            time_end_135955 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [",
                                                "main.segred_large_124578");
                                        fprintf(ctx->log, "%zu",
                                                global_work_sizze_135953[0]);
                                        fprintf(ctx->log,
                                                "] and local work size [");
                                        fprintf(ctx->log, "%zu",
                                                local_work_sizze_135957[0]);
                                        fprintf(ctx->log,
                                                "]; local memory parameters sum to %d bytes.\n",
                                                (int) (0 + 1 + (int64_t) 4 *
                                                       segred_group_sizze_124801));
                                        time_start_135954 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_large_124578,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_135953,
                                                                                    local_work_sizze_135957,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_large_124578_runs,
                                                                                                                              &ctx->mainzisegred_large_124578_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_135955 = get_wall_time();
                                        
                                        long time_diff_135956 =
                                             time_end_135955 -
                                             time_start_135954;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_large_124578",
                                                time_diff_135956);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_134412,
                                                          "segred_tmp_mem_134412") !=
                                    0)
                                    return 1;
                            }
                            
                            int64_t segmap_usable_groups_124838 =
                                    sdiv_up64(nest_sizze_119536,
                                              segmap_group_sizze_124837);
                            struct memblock_device mem_131320;
                            
                            mem_131320.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131320,
                                                      bytes_130601,
                                                      "mem_131320")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124559,
                                                                    1,
                                                                    sizeof(m_114533),
                                                                    &m_114533));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124559,
                                                                    2,
                                                                    sizeof(t_n_m_114591),
                                                                    &t_n_m_114591));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124559,
                                                                    3,
                                                                    sizeof(mem_131315.mem),
                                                                    &mem_131315.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124559,
                                                                    4,
                                                                    sizeof(mem_131320.mem),
                                                                    &mem_131320.mem));
                            if (1 * ((size_t) segmap_usable_groups_124838 *
                                     (size_t) segmap_group_sizze_124837) != 0) {
                                const size_t global_work_sizze_135958[1] =
                                             {(size_t) segmap_usable_groups_124838 *
                                             (size_t) segmap_group_sizze_124837};
                                const size_t local_work_sizze_135962[1] =
                                             {segmap_group_sizze_124837};
                                int64_t time_start_135959 = 0, time_end_135960 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [",
                                            "main.segmap_124559");
                                    fprintf(ctx->log, "%zu",
                                            global_work_sizze_135958[0]);
                                    fprintf(ctx->log,
                                            "] and local work size [");
                                    fprintf(ctx->log, "%zu",
                                            local_work_sizze_135962[0]);
                                    fprintf(ctx->log,
                                            "]; local memory parameters sum to %d bytes.\n",
                                            (int) 0);
                                    time_start_135959 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_124559,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_135958,
                                                                                local_work_sizze_135962,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_124559_runs,
                                                                                                                          &ctx->mainzisegmap_124559_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_135960 = get_wall_time();
                                    
                                    long time_diff_135961 = time_end_135960 -
                                         time_start_135959;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_124559",
                                            time_diff_135961);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_131315,
                                                      "mem_131315") != 0)
                                return 1;
                            
                            struct memblock_device mem_131325;
                            
                            mem_131325.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131325,
                                                      bytes_130601,
                                                      "mem_131325")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64(t_window_114537 * (int64_t) 2,
                                      segred_group_sizze_124845)) {
                                int64_t segment_sizze_nonzzero_134460 =
                                        smax64((int64_t) 1, t_window_114537);
                                int64_t num_threads_134461 = num_groups_124846 *
                                        segred_group_sizze_124845;
                                
                                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_114533 *
                                                         t_n_m_114591), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) t_window_114537, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segments_per_group",
                                            (long long) squot64(segred_group_sizze_124845,
                                                                segment_sizze_nonzzero_134460),
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "required_groups",
                                            (long long) sext_i64_i32(sdiv_up64(m_114533 *
                                                                               t_n_m_114591,
                                                                               squot64(segred_group_sizze_124845,
                                                                                       segment_sizze_nonzzero_134460))),
                                            '\n');
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124516,
                                                                        1,
                                                                        (int64_t) 4 *
                                                                        segred_group_sizze_124845,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124516,
                                                                        2,
                                                                        sizeof(m_114533),
                                                                        &m_114533));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124516,
                                                                        3,
                                                                        sizeof(n_114534),
                                                                        &n_114534));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124516,
                                                                        4,
                                                                        sizeof(t_window_114537),
                                                                        &t_window_114537));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124516,
                                                                        5,
                                                                        sizeof(t_jump_114541),
                                                                        &t_jump_114541));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124516,
                                                                        6,
                                                                        sizeof(t_n_m_114591),
                                                                        &t_n_m_114591));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124516,
                                                                        7,
                                                                        sizeof(i_114610),
                                                                        &i_114610));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124516,
                                                                        8,
                                                                        sizeof(num_groups_124846),
                                                                        &num_groups_124846));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124516,
                                                                        9,
                                                                        sizeof(segment_sizze_nonzzero_134460),
                                                                        &segment_sizze_nonzzero_134460));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124516,
                                                                        10,
                                                                        sizeof(defunc_3_map_res_mem_130117.mem),
                                                                        &defunc_3_map_res_mem_130117.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124516,
                                                                        11,
                                                                        sizeof(mem_130122.mem),
                                                                        &mem_130122.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124516,
                                                                        12,
                                                                        sizeof(defunc_3_map_res_mem_130606.mem),
                                                                        &defunc_3_map_res_mem_130606.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124516,
                                                                        13,
                                                                        sizeof(defunc_3_map_res_mem_130607.mem),
                                                                        &defunc_3_map_res_mem_130607.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124516,
                                                                        14,
                                                                        sizeof(mem_130861.mem),
                                                                        &mem_130861.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124516,
                                                                        15,
                                                                        sizeof(defunc_4_map_res_mem_131267.mem),
                                                                        &defunc_4_map_res_mem_131267.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124516,
                                                                        16,
                                                                        sizeof(mem_131320.mem),
                                                                        &mem_131320.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_124516,
                                                                        17,
                                                                        sizeof(mem_131325.mem),
                                                                        &mem_131325.mem));
                                if (1 * ((size_t) num_groups_124846 *
                                         (size_t) segred_group_sizze_124845) !=
                                    0) {
                                    const size_t global_work_sizze_135963[1] =
                                                 {(size_t) num_groups_124846 *
                                                 (size_t) segred_group_sizze_124845};
                                    const size_t local_work_sizze_135967[1] =
                                                 {segred_group_sizze_124845};
                                    int64_t time_start_135964 = 0,
                                            time_end_135965 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [",
                                                "main.segred_small_124516");
                                        fprintf(ctx->log, "%zu",
                                                global_work_sizze_135963[0]);
                                        fprintf(ctx->log,
                                                "] and local work size [");
                                        fprintf(ctx->log, "%zu",
                                                local_work_sizze_135967[0]);
                                        fprintf(ctx->log,
                                                "]; local memory parameters sum to %d bytes.\n",
                                                (int) (0 + (int64_t) 4 *
                                                       segred_group_sizze_124845));
                                        time_start_135964 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_small_124516,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_135963,
                                                                                    local_work_sizze_135967,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_small_124516_runs,
                                                                                                                              &ctx->mainzisegred_small_124516_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_135965 = get_wall_time();
                                        
                                        long time_diff_135966 =
                                             time_end_135965 -
                                             time_start_135964;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_small_124516",
                                                time_diff_135966);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                            } else {
                                int64_t groups_per_segment_134485 =
                                        sdiv_up64(num_groups_124846,
                                                  smax64((int64_t) 1, m_114533 *
                                                         t_n_m_114591));
                                int64_t elements_per_thread_134486 =
                                        sdiv_up64(t_window_114537,
                                                  segred_group_sizze_124845 *
                                                  groups_per_segment_134485);
                                int64_t virt_num_groups_134487 =
                                        groups_per_segment_134485 * (m_114533 *
                                                                     t_n_m_114591);
                                int64_t num_threads_134488 = num_groups_124846 *
                                        segred_group_sizze_124845;
                                int64_t threads_per_segment_134489 =
                                        groups_per_segment_134485 *
                                        segred_group_sizze_124845;
                                
                                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_114533 *
                                                         t_n_m_114591), '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "segment_size",
                                            (long long) t_window_114537, '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "virt_num_groups",
                                            (long long) virt_num_groups_134487,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "num_groups",
                                            (long long) num_groups_124846,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "group_size",
                                            (long long) segred_group_sizze_124845,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_thread",
                                            (long long) elements_per_thread_134486,
                                            '\n');
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "groups_per_segment",
                                            (long long) groups_per_segment_134485,
                                            '\n');
                                
                                struct memblock_device segred_tmp_mem_134490;
                                
                                segred_tmp_mem_134490.references = NULL;
                                if (memblock_alloc_device(ctx,
                                                          &segred_tmp_mem_134490,
                                                          (int64_t) 4 *
                                                          virt_num_groups_134487,
                                                          "segred_tmp_mem_134490")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mainzicounter_mem_134492
                                                       =
                                                       ctx->mainzicounter_mem_134492;
                                
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        1, 1,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        2,
                                                                        (int64_t) 4 *
                                                                        segred_group_sizze_124845,
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        3,
                                                                        sizeof(m_114533),
                                                                        &m_114533));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        4,
                                                                        sizeof(n_114534),
                                                                        &n_114534));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        5,
                                                                        sizeof(t_window_114537),
                                                                        &t_window_114537));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        6,
                                                                        sizeof(t_jump_114541),
                                                                        &t_jump_114541));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        7,
                                                                        sizeof(t_n_m_114591),
                                                                        &t_n_m_114591));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        8,
                                                                        sizeof(i_114610),
                                                                        &i_114610));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        9,
                                                                        sizeof(num_groups_124846),
                                                                        &num_groups_124846));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        10,
                                                                        sizeof(groups_per_segment_134485),
                                                                        &groups_per_segment_134485));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        11,
                                                                        sizeof(elements_per_thread_134486),
                                                                        &elements_per_thread_134486));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        12,
                                                                        sizeof(virt_num_groups_134487),
                                                                        &virt_num_groups_134487));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        13,
                                                                        sizeof(threads_per_segment_134489),
                                                                        &threads_per_segment_134489));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        14,
                                                                        sizeof(defunc_3_map_res_mem_130117.mem),
                                                                        &defunc_3_map_res_mem_130117.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        15,
                                                                        sizeof(mem_130122.mem),
                                                                        &mem_130122.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        16,
                                                                        sizeof(defunc_3_map_res_mem_130606.mem),
                                                                        &defunc_3_map_res_mem_130606.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        17,
                                                                        sizeof(defunc_3_map_res_mem_130607.mem),
                                                                        &defunc_3_map_res_mem_130607.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        18,
                                                                        sizeof(mem_130861.mem),
                                                                        &mem_130861.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        19,
                                                                        sizeof(defunc_4_map_res_mem_131267.mem),
                                                                        &defunc_4_map_res_mem_131267.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        20,
                                                                        sizeof(mem_131320.mem),
                                                                        &mem_131320.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        21,
                                                                        sizeof(mem_131325.mem),
                                                                        &mem_131325.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        22,
                                                                        sizeof(segred_tmp_mem_134490.mem),
                                                                        &segred_tmp_mem_134490.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_124516,
                                                                        23,
                                                                        sizeof(mainzicounter_mem_134492.mem),
                                                                        &mainzicounter_mem_134492.mem));
                                if (1 * ((size_t) num_groups_124846 *
                                         (size_t) segred_group_sizze_124845) !=
                                    0) {
                                    const size_t global_work_sizze_135969[1] =
                                                 {(size_t) num_groups_124846 *
                                                 (size_t) segred_group_sizze_124845};
                                    const size_t local_work_sizze_135973[1] =
                                                 {segred_group_sizze_124845};
                                    int64_t time_start_135970 = 0,
                                            time_end_135971 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [",
                                                "main.segred_large_124516");
                                        fprintf(ctx->log, "%zu",
                                                global_work_sizze_135969[0]);
                                        fprintf(ctx->log,
                                                "] and local work size [");
                                        fprintf(ctx->log, "%zu",
                                                local_work_sizze_135973[0]);
                                        fprintf(ctx->log,
                                                "]; local memory parameters sum to %d bytes.\n",
                                                (int) (0 + 1 + (int64_t) 4 *
                                                       segred_group_sizze_124845));
                                        time_start_135970 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegred_large_124516,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_135969,
                                                                                    local_work_sizze_135973,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegred_large_124516_runs,
                                                                                                                              &ctx->mainzisegred_large_124516_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_135971 = get_wall_time();
                                        
                                        long time_diff_135972 =
                                             time_end_135971 -
                                             time_start_135970;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segred_large_124516",
                                                time_diff_135972);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx,
                                                          &segred_tmp_mem_134490,
                                                          "segred_tmp_mem_134490") !=
                                    0)
                                    return 1;
                            }
                            if (memblock_unref_device(ctx, &mem_131320,
                                                      "mem_131320") != 0)
                                return 1;
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_131326,
                                                    &mem_131325,
                                                    "mem_131325") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131325,
                                                      "mem_131325") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131320,
                                                      "mem_131320") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131315,
                                                      "mem_131315") != 0)
                                return 1;
                        }
                        if (memblock_set_device(ctx,
                                                &defunc_7_map_res_mem_131332,
                                                &defunc_7_map_res_mem_131326,
                                                "defunc_7_map_res_mem_131326") !=
                            0)
                            return 1;
                        if (memblock_unref_device(ctx,
                                                  &defunc_7_map_res_mem_131326,
                                                  "defunc_7_map_res_mem_131326") !=
                            0)
                            return 1;
                    }
                    if (memblock_set_device(ctx,
                                            &defunc_12_lifted_use_version_res_mem_131571,
                                            &defunc_7_map_res_mem_131332,
                                            "defunc_7_map_res_mem_131332") != 0)
                        return 1;
                    if (memblock_set_device(ctx,
                                            &defunc_12_lifted_use_version_res_mem_131572,
                                            &mem_131271, "mem_131271") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_7_map_res_mem_131332,
                                              "defunc_7_map_res_mem_131332") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_131271, "mem_131271") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_115949 = (int64_t) 1 == t_degree_114539;
                    struct memblock_device x_mem_131569;
                    
                    x_mem_131569.references = NULL;
                    
                    struct memblock_device x_mem_131570;
                    
                    x_mem_131570.references = NULL;
                    if (match_lit_115949) {
                        bool suff_outer_par_124890;
                        
                        suff_outer_par_124890 =
                            ctx->sizes.mainzisuff_outer_par_22 <= m_114533;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_22", (long) m_114533,
                                    suff_outer_par_124890 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_124992;
                        
                        segmap_group_sizze_124992 =
                            ctx->sizes.mainzisegmap_group_sizze_124894;
                        
                        int64_t num_groups_124993;
                        int32_t max_num_groups_134530;
                        
                        max_num_groups_134530 =
                            ctx->sizes.mainzisegmap_num_groups_124896;
                        num_groups_124993 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(m_114533,
                                                                                 segmap_group_sizze_124992),
                                                                       sext_i32_i64(max_num_groups_134530))));
                        
                        int64_t segmap_group_sizze_125487;
                        
                        segmap_group_sizze_125487 =
                            ctx->sizes.mainzisegmap_group_sizze_125094;
                        
                        bool suff_outer_par_125491;
                        
                        suff_outer_par_125491 =
                            ctx->sizes.mainzisuff_outer_par_23 <=
                            nest_sizze_119536;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_23",
                                    (long) nest_sizze_119536,
                                    suff_outer_par_125491 ? "true" : "false");
                        
                        int64_t nest_sizze_125595 = t_window_114537 *
                                nest_sizze_119536;
                        int64_t segred_group_sizze_125596;
                        
                        segred_group_sizze_125596 =
                            ctx->sizes.mainzisegred_group_sizze_125292;
                        
                        int64_t num_groups_125597;
                        int32_t max_num_groups_134531;
                        
                        max_num_groups_134531 =
                            ctx->sizes.mainzisegred_num_groups_125294;
                        num_groups_125597 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_125595,
                                                                                 segred_group_sizze_125596),
                                                                       sext_i32_i64(max_num_groups_134531))));
                        
                        int64_t segmap_group_sizze_125642;
                        
                        segmap_group_sizze_125642 =
                            ctx->sizes.mainzisegmap_group_sizze_125273;
                        
                        int64_t segred_group_sizze_125661;
                        
                        segred_group_sizze_125661 =
                            ctx->sizes.mainzisegred_group_sizze_125203;
                        
                        int64_t num_groups_125662;
                        int32_t max_num_groups_134532;
                        
                        max_num_groups_134532 =
                            ctx->sizes.mainzisegred_num_groups_125205;
                        num_groups_125662 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_125595,
                                                                                 segred_group_sizze_125661),
                                                                       sext_i32_i64(max_num_groups_134532))));
                        
                        int64_t num_threads_132243 = segmap_group_sizze_124992 *
                                num_groups_124993;
                        int64_t total_sizze_132244 = bytes_130440 *
                                num_threads_132243;
                        int64_t total_sizze_132245 = bytes_130440 *
                                num_threads_132243;
                        struct memblock_device defunc_7_map_res_mem_131441;
                        
                        defunc_7_map_res_mem_131441.references = NULL;
                        
                        struct memblock_device defunc_7_map_res_mem_131442;
                        
                        defunc_7_map_res_mem_131442.references = NULL;
                        
                        int32_t local_memory_capacity_134754;
                        
                        local_memory_capacity_134754 =
                            ctx->opencl.max_local_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_134754)) &&
                            suff_outer_par_124890) {
                            struct memblock_device mem_131335;
                            
                            mem_131335.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131335,
                                                      bytes_130470,
                                                      "mem_131335")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_131335,
                                                                      (int64_t) 0,
                                                                      defunc_3_map_res_mem_130606,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_114591,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131338;
                            
                            mem_131338.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131338,
                                                      bytes_130473,
                                                      "mem_131338")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131338,
                                                                      (int64_t) 0,
                                                                      defunc_3_map_res_mem_130607,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_114591,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131341;
                            
                            mem_131341.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131341,
                                                      binop_y_130121,
                                                      "mem_131341")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131341,
                                                                      (int64_t) 0,
                                                                      mem_130122,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_114534,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131344;
                            
                            mem_131344.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131344,
                                                      binop_y_130121,
                                                      "mem_131344")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131344,
                                                                      (int64_t) 0,
                                                                      mem_130861,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_114534,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131347;
                            
                            mem_131347.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131347,
                                                      binop_y_130121,
                                                      "mem_131347")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131347,
                                                                      (int64_t) 0,
                                                                      defunc_4_map_res_mem_131267,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_114534,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131381;
                            
                            mem_131381.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131381,
                                                      bytes_130473,
                                                      "mem_131381")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131384;
                            
                            mem_131384.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131384,
                                                      bytes_130473,
                                                      "mem_131384")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_132124;
                            
                            color_132124.references = NULL;
                            if (memblock_alloc_device(ctx, &color_132124,
                                                      total_sizze_132244,
                                                      "color_132124")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_132125;
                            
                            color_132125.references = NULL;
                            if (memblock_alloc_device(ctx, &color_132125,
                                                      total_sizze_132245,
                                                      "color_132125")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124892,
                                                                    1,
                                                                    sizeof(m_114533),
                                                                    &m_114533));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124892,
                                                                    2,
                                                                    sizeof(t_window_114537),
                                                                    &t_window_114537));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124892,
                                                                    3,
                                                                    sizeof(t_jump_114541),
                                                                    &t_jump_114541));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124892,
                                                                    4,
                                                                    sizeof(t_n_m_114591),
                                                                    &t_n_m_114591));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124892,
                                                                    5,
                                                                    sizeof(i_114610),
                                                                    &i_114610));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124892,
                                                                    6,
                                                                    sizeof(num_groups_124993),
                                                                    &num_groups_124993));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124892,
                                                                    7,
                                                                    sizeof(num_threads_132243),
                                                                    &num_threads_132243));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124892,
                                                                    8,
                                                                    sizeof(defunc_3_map_res_mem_130117.mem),
                                                                    &defunc_3_map_res_mem_130117.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124892,
                                                                    9,
                                                                    sizeof(mem_131335.mem),
                                                                    &mem_131335.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124892,
                                                                    10,
                                                                    sizeof(mem_131338.mem),
                                                                    &mem_131338.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124892,
                                                                    11,
                                                                    sizeof(mem_131341.mem),
                                                                    &mem_131341.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124892,
                                                                    12,
                                                                    sizeof(mem_131344.mem),
                                                                    &mem_131344.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124892,
                                                                    13,
                                                                    sizeof(mem_131347.mem),
                                                                    &mem_131347.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124892,
                                                                    14,
                                                                    sizeof(mem_131381.mem),
                                                                    &mem_131381.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124892,
                                                                    15,
                                                                    sizeof(mem_131384.mem),
                                                                    &mem_131384.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124892,
                                                                    16,
                                                                    sizeof(color_132124.mem),
                                                                    &color_132124.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_124892,
                                                                    17,
                                                                    sizeof(color_132125.mem),
                                                                    &color_132125.mem));
                            if (1 * ((size_t) num_groups_124993 *
                                     (size_t) segmap_group_sizze_124992) != 0) {
                                const size_t global_work_sizze_135974[1] =
                                             {(size_t) num_groups_124993 *
                                             (size_t) segmap_group_sizze_124992};
                                const size_t local_work_sizze_135978[1] =
                                             {segmap_group_sizze_124992};
                                int64_t time_start_135975 = 0, time_end_135976 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [",
                                            "main.segmap_124892");
                                    fprintf(ctx->log, "%zu",
                                            global_work_sizze_135974[0]);
                                    fprintf(ctx->log,
                                            "] and local work size [");
                                    fprintf(ctx->log, "%zu",
                                            local_work_sizze_135978[0]);
                                    fprintf(ctx->log,
                                            "]; local memory parameters sum to %d bytes.\n",
                                            (int) 0);
                                    time_start_135975 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_124892,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_135974,
                                                                                local_work_sizze_135978,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_124892_runs,
                                                                                                                          &ctx->mainzisegmap_124892_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_135976 = get_wall_time();
                                    
                                    long time_diff_135977 = time_end_135976 -
                                         time_start_135975;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_124892",
                                            time_diff_135977);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_131335,
                                                      "mem_131335") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131338,
                                                      "mem_131338") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131341,
                                                      "mem_131341") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131344,
                                                      "mem_131344") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131347,
                                                      "mem_131347") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_132124,
                                                      "color_132124") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_132125,
                                                      "color_132125") != 0)
                                return 1;
                            
                            struct memblock_device mem_131434;
                            
                            mem_131434.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131434,
                                                      bytes_130601,
                                                      "mem_131434")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131434,
                                                                      (int64_t) 0,
                                                                      mem_131381,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      m_114533,
                                                                      t_n_m_114591) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_131381,
                                                      "mem_131381") != 0)
                                return 1;
                            
                            struct memblock_device mem_131439;
                            
                            mem_131439.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131439,
                                                      bytes_130601,
                                                      "mem_131439")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131439,
                                                                      (int64_t) 0,
                                                                      mem_131384,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      m_114533,
                                                                      t_n_m_114591) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_131384,
                                                      "mem_131384") != 0)
                                return 1;
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_131441,
                                                    &mem_131434,
                                                    "mem_131434") != 0)
                                return 1;
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_131442,
                                                    &mem_131439,
                                                    "mem_131439") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131439,
                                                      "mem_131439") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131434,
                                                      "mem_131434") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_132125,
                                                      "color_132125") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_132124,
                                                      "color_132124") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131384,
                                                      "mem_131384") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131381,
                                                      "mem_131381") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131347,
                                                      "mem_131347") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131344,
                                                      "mem_131344") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131341,
                                                      "mem_131341") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131338,
                                                      "mem_131338") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131335,
                                                      "mem_131335") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_125488 =
                                    sdiv_up64(nest_sizze_119536,
                                              segmap_group_sizze_125487);
                            struct memblock_device defunc_7_map_res_mem_131429;
                            
                            defunc_7_map_res_mem_131429.references = NULL;
                            
                            struct memblock_device defunc_7_map_res_mem_131430;
                            
                            defunc_7_map_res_mem_131430.references = NULL;
                            
                            int32_t local_memory_capacity_134753;
                            
                            local_memory_capacity_134753 =
                                ctx->opencl.max_local_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_134753)) &&
                                suff_outer_par_125491) {
                                struct memblock_device mem_131389;
                                
                                mem_131389.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131389,
                                                          bytes_130601,
                                                          "mem_131389")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131393;
                                
                                mem_131393.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131393,
                                                          bytes_130601,
                                                          "mem_131393")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125091,
                                                                        1,
                                                                        sizeof(m_114533),
                                                                        &m_114533));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125091,
                                                                        2,
                                                                        sizeof(n_114534),
                                                                        &n_114534));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125091,
                                                                        3,
                                                                        sizeof(t_window_114537),
                                                                        &t_window_114537));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125091,
                                                                        4,
                                                                        sizeof(t_jump_114541),
                                                                        &t_jump_114541));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125091,
                                                                        5,
                                                                        sizeof(t_n_m_114591),
                                                                        &t_n_m_114591));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125091,
                                                                        6,
                                                                        sizeof(i_114610),
                                                                        &i_114610));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125091,
                                                                        7,
                                                                        sizeof(defunc_3_map_res_mem_130117.mem),
                                                                        &defunc_3_map_res_mem_130117.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125091,
                                                                        8,
                                                                        sizeof(mem_130122.mem),
                                                                        &mem_130122.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125091,
                                                                        9,
                                                                        sizeof(defunc_3_map_res_mem_130606.mem),
                                                                        &defunc_3_map_res_mem_130606.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125091,
                                                                        10,
                                                                        sizeof(defunc_3_map_res_mem_130607.mem),
                                                                        &defunc_3_map_res_mem_130607.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125091,
                                                                        11,
                                                                        sizeof(mem_130861.mem),
                                                                        &mem_130861.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125091,
                                                                        12,
                                                                        sizeof(defunc_4_map_res_mem_131267.mem),
                                                                        &defunc_4_map_res_mem_131267.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125091,
                                                                        13,
                                                                        sizeof(mem_131389.mem),
                                                                        &mem_131389.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125091,
                                                                        14,
                                                                        sizeof(mem_131393.mem),
                                                                        &mem_131393.mem));
                                if (1 * ((size_t) segmap_usable_groups_125488 *
                                         (size_t) segmap_group_sizze_125487) !=
                                    0) {
                                    const size_t global_work_sizze_135979[1] =
                                                 {(size_t) segmap_usable_groups_125488 *
                                                 (size_t) segmap_group_sizze_125487};
                                    const size_t local_work_sizze_135983[1] =
                                                 {segmap_group_sizze_125487};
                                    int64_t time_start_135980 = 0,
                                            time_end_135981 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [",
                                                "main.segmap_125091");
                                        fprintf(ctx->log, "%zu",
                                                global_work_sizze_135979[0]);
                                        fprintf(ctx->log,
                                                "] and local work size [");
                                        fprintf(ctx->log, "%zu",
                                                local_work_sizze_135983[0]);
                                        fprintf(ctx->log,
                                                "]; local memory parameters sum to %d bytes.\n",
                                                (int) 0);
                                        time_start_135980 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_125091,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_135979,
                                                                                    local_work_sizze_135983,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_125091_runs,
                                                                                                                              &ctx->mainzisegmap_125091_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_135981 = get_wall_time();
                                        
                                        long time_diff_135982 =
                                             time_end_135981 -
                                             time_start_135980;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_125091",
                                                time_diff_135982);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx,
                                                        &defunc_7_map_res_mem_131429,
                                                        &mem_131389,
                                                        "mem_131389") != 0)
                                    return 1;
                                if (memblock_set_device(ctx,
                                                        &defunc_7_map_res_mem_131430,
                                                        &mem_131393,
                                                        "mem_131393") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131393,
                                                          "mem_131393") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131389,
                                                          "mem_131389") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_131398;
                                
                                mem_131398.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131398,
                                                          bytes_130601,
                                                          "mem_131398")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131402;
                                
                                mem_131402.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131402,
                                                          bytes_130601,
                                                          "mem_131402")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131406;
                                
                                mem_131406.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131406,
                                                          bytes_130601,
                                                          "mem_131406")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(t_window_114537 * (int64_t) 2,
                                          segred_group_sizze_125596)) {
                                    int64_t segment_sizze_nonzzero_134568 =
                                            smax64((int64_t) 1,
                                                   t_window_114537);
                                    int64_t num_threads_134569 =
                                            num_groups_125597 *
                                            segred_group_sizze_125596;
                                    
                                    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_114533 *
                                                             t_n_m_114591),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) t_window_114537,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_125596,
                                                                    segment_sizze_nonzzero_134568),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(m_114533 *
                                                                                   t_n_m_114591,
                                                                                   squot64(segred_group_sizze_125596,
                                                                                           segment_sizze_nonzzero_134568))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125298,
                                                                            1,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_125596,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125298,
                                                                            2,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_125596,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125298,
                                                                            3,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_125596,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125298,
                                                                            4,
                                                                            sizeof(m_114533),
                                                                            &m_114533));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125298,
                                                                            5,
                                                                            sizeof(n_114534),
                                                                            &n_114534));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125298,
                                                                            6,
                                                                            sizeof(t_window_114537),
                                                                            &t_window_114537));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125298,
                                                                            7,
                                                                            sizeof(t_jump_114541),
                                                                            &t_jump_114541));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125298,
                                                                            8,
                                                                            sizeof(t_n_m_114591),
                                                                            &t_n_m_114591));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125298,
                                                                            9,
                                                                            sizeof(i_114610),
                                                                            &i_114610));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125298,
                                                                            10,
                                                                            sizeof(num_groups_125597),
                                                                            &num_groups_125597));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125298,
                                                                            11,
                                                                            sizeof(segment_sizze_nonzzero_134568),
                                                                            &segment_sizze_nonzzero_134568));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125298,
                                                                            12,
                                                                            sizeof(defunc_3_map_res_mem_130117.mem),
                                                                            &defunc_3_map_res_mem_130117.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125298,
                                                                            13,
                                                                            sizeof(mem_130122.mem),
                                                                            &mem_130122.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125298,
                                                                            14,
                                                                            sizeof(defunc_3_map_res_mem_130606.mem),
                                                                            &defunc_3_map_res_mem_130606.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125298,
                                                                            15,
                                                                            sizeof(defunc_3_map_res_mem_130607.mem),
                                                                            &defunc_3_map_res_mem_130607.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125298,
                                                                            16,
                                                                            sizeof(mem_130861.mem),
                                                                            &mem_130861.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125298,
                                                                            17,
                                                                            sizeof(mem_131398.mem),
                                                                            &mem_131398.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125298,
                                                                            18,
                                                                            sizeof(mem_131402.mem),
                                                                            &mem_131402.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125298,
                                                                            19,
                                                                            sizeof(mem_131406.mem),
                                                                            &mem_131406.mem));
                                    if (1 * ((size_t) num_groups_125597 *
                                             (size_t) segred_group_sizze_125596) !=
                                        0) {
                                        const size_t global_work_sizze_135984[1]
                                                     =
                                                     {(size_t) num_groups_125597 *
                                                     (size_t) segred_group_sizze_125596};
                                        const size_t local_work_sizze_135988[1]
                                                     =
                                                     {segred_group_sizze_125596};
                                        int64_t time_start_135985 = 0,
                                                time_end_135986 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [",
                                                    "main.segred_small_125298");
                                            fprintf(ctx->log, "%zu",
                                                    global_work_sizze_135984[0]);
                                            fprintf(ctx->log,
                                                    "] and local work size [");
                                            fprintf(ctx->log, "%zu",
                                                    local_work_sizze_135988[0]);
                                            fprintf(ctx->log,
                                                    "]; local memory parameters sum to %d bytes.\n",
                                                    (int) (0 + (int64_t) 4 *
                                                           segred_group_sizze_125596 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_125596 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_125596));
                                            time_start_135985 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_125298,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_135984,
                                                                                        local_work_sizze_135988,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_125298_runs,
                                                                                                                                  &ctx->mainzisegred_small_125298_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_135986 = get_wall_time();
                                            
                                            long time_diff_135987 =
                                                 time_end_135986 -
                                                 time_start_135985;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_125298",
                                                    time_diff_135987);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_134603 =
                                            sdiv_up64(num_groups_125597,
                                                      smax64((int64_t) 1,
                                                             m_114533 *
                                                             t_n_m_114591));
                                    int64_t elements_per_thread_134604 =
                                            sdiv_up64(t_window_114537,
                                                      segred_group_sizze_125596 *
                                                      groups_per_segment_134603);
                                    int64_t virt_num_groups_134605 =
                                            groups_per_segment_134603 *
                                            (m_114533 * t_n_m_114591);
                                    int64_t num_threads_134606 =
                                            num_groups_125597 *
                                            segred_group_sizze_125596;
                                    int64_t threads_per_segment_134607 =
                                            groups_per_segment_134603 *
                                            segred_group_sizze_125596;
                                    
                                    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_114533 *
                                                             t_n_m_114591),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) t_window_114537,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_134605,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_125597,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_125596,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_134604,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_134603,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_134608;
                                    
                                    segred_tmp_mem_134608.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_134608,
                                                              (int64_t) 4 *
                                                              virt_num_groups_134605,
                                                              "segred_tmp_mem_134608")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_134610;
                                    
                                    segred_tmp_mem_134610.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_134610,
                                                              (int64_t) 4 *
                                                              virt_num_groups_134605,
                                                              "segred_tmp_mem_134610")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_134612;
                                    
                                    segred_tmp_mem_134612.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_134612,
                                                              (int64_t) 4 *
                                                              virt_num_groups_134605,
                                                              "segred_tmp_mem_134612")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_134614 =
                                    ctx->mainzicounter_mem_134614;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            1,
                                                                            1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            2,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_125596,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            3,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_125596,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            4,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_125596,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            5,
                                                                            sizeof(m_114533),
                                                                            &m_114533));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            6,
                                                                            sizeof(n_114534),
                                                                            &n_114534));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            7,
                                                                            sizeof(t_window_114537),
                                                                            &t_window_114537));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            8,
                                                                            sizeof(t_jump_114541),
                                                                            &t_jump_114541));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            9,
                                                                            sizeof(t_n_m_114591),
                                                                            &t_n_m_114591));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            10,
                                                                            sizeof(i_114610),
                                                                            &i_114610));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            11,
                                                                            sizeof(num_groups_125597),
                                                                            &num_groups_125597));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            12,
                                                                            sizeof(groups_per_segment_134603),
                                                                            &groups_per_segment_134603));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            13,
                                                                            sizeof(elements_per_thread_134604),
                                                                            &elements_per_thread_134604));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            14,
                                                                            sizeof(virt_num_groups_134605),
                                                                            &virt_num_groups_134605));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            15,
                                                                            sizeof(threads_per_segment_134607),
                                                                            &threads_per_segment_134607));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            16,
                                                                            sizeof(defunc_3_map_res_mem_130117.mem),
                                                                            &defunc_3_map_res_mem_130117.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            17,
                                                                            sizeof(mem_130122.mem),
                                                                            &mem_130122.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            18,
                                                                            sizeof(defunc_3_map_res_mem_130606.mem),
                                                                            &defunc_3_map_res_mem_130606.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            19,
                                                                            sizeof(defunc_3_map_res_mem_130607.mem),
                                                                            &defunc_3_map_res_mem_130607.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            20,
                                                                            sizeof(mem_130861.mem),
                                                                            &mem_130861.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            21,
                                                                            sizeof(mem_131398.mem),
                                                                            &mem_131398.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            22,
                                                                            sizeof(mem_131402.mem),
                                                                            &mem_131402.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            23,
                                                                            sizeof(mem_131406.mem),
                                                                            &mem_131406.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            24,
                                                                            sizeof(segred_tmp_mem_134608.mem),
                                                                            &segred_tmp_mem_134608.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            25,
                                                                            sizeof(segred_tmp_mem_134610.mem),
                                                                            &segred_tmp_mem_134610.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            26,
                                                                            sizeof(segred_tmp_mem_134612.mem),
                                                                            &segred_tmp_mem_134612.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125298,
                                                                            27,
                                                                            sizeof(mainzicounter_mem_134614.mem),
                                                                            &mainzicounter_mem_134614.mem));
                                    if (1 * ((size_t) num_groups_125597 *
                                             (size_t) segred_group_sizze_125596) !=
                                        0) {
                                        const size_t global_work_sizze_135990[1]
                                                     =
                                                     {(size_t) num_groups_125597 *
                                                     (size_t) segred_group_sizze_125596};
                                        const size_t local_work_sizze_135994[1]
                                                     =
                                                     {segred_group_sizze_125596};
                                        int64_t time_start_135991 = 0,
                                                time_end_135992 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [",
                                                    "main.segred_large_125298");
                                            fprintf(ctx->log, "%zu",
                                                    global_work_sizze_135990[0]);
                                            fprintf(ctx->log,
                                                    "] and local work size [");
                                            fprintf(ctx->log, "%zu",
                                                    local_work_sizze_135994[0]);
                                            fprintf(ctx->log,
                                                    "]; local memory parameters sum to %d bytes.\n",
                                                    (int) (0 + 1 + (int64_t) 4 *
                                                           segred_group_sizze_125596 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_125596 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_125596));
                                            time_start_135991 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_125298,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_135990,
                                                                                        local_work_sizze_135994,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_125298_runs,
                                                                                                                                  &ctx->mainzisegred_large_125298_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_135992 = get_wall_time();
                                            
                                            long time_diff_135993 =
                                                 time_end_135992 -
                                                 time_start_135991;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_125298",
                                                    time_diff_135993);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_134612,
                                                              "segred_tmp_mem_134612") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_134610,
                                                              "segred_tmp_mem_134610") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_134608,
                                                              "segred_tmp_mem_134608") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_125643 =
                                        sdiv_up64(nest_sizze_119536,
                                                  segmap_group_sizze_125642);
                                struct memblock_device mem_131411;
                                
                                mem_131411.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131411,
                                                          bytes_130601,
                                                          "mem_131411")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131415;
                                
                                mem_131415.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131415,
                                                          bytes_130601,
                                                          "mem_131415")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131419;
                                
                                mem_131419.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131419,
                                                          bytes_130601,
                                                          "mem_131419")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125270,
                                                                        1,
                                                                        sizeof(m_114533),
                                                                        &m_114533));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125270,
                                                                        2,
                                                                        sizeof(t_n_m_114591),
                                                                        &t_n_m_114591));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125270,
                                                                        3,
                                                                        sizeof(mem_131398.mem),
                                                                        &mem_131398.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125270,
                                                                        4,
                                                                        sizeof(mem_131402.mem),
                                                                        &mem_131402.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125270,
                                                                        5,
                                                                        sizeof(mem_131406.mem),
                                                                        &mem_131406.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125270,
                                                                        6,
                                                                        sizeof(mem_131411.mem),
                                                                        &mem_131411.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125270,
                                                                        7,
                                                                        sizeof(mem_131415.mem),
                                                                        &mem_131415.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125270,
                                                                        8,
                                                                        sizeof(mem_131419.mem),
                                                                        &mem_131419.mem));
                                if (1 * ((size_t) segmap_usable_groups_125643 *
                                         (size_t) segmap_group_sizze_125642) !=
                                    0) {
                                    const size_t global_work_sizze_135995[1] =
                                                 {(size_t) segmap_usable_groups_125643 *
                                                 (size_t) segmap_group_sizze_125642};
                                    const size_t local_work_sizze_135999[1] =
                                                 {segmap_group_sizze_125642};
                                    int64_t time_start_135996 = 0,
                                            time_end_135997 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [",
                                                "main.segmap_125270");
                                        fprintf(ctx->log, "%zu",
                                                global_work_sizze_135995[0]);
                                        fprintf(ctx->log,
                                                "] and local work size [");
                                        fprintf(ctx->log, "%zu",
                                                local_work_sizze_135999[0]);
                                        fprintf(ctx->log,
                                                "]; local memory parameters sum to %d bytes.\n",
                                                (int) 0);
                                        time_start_135996 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_125270,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_135995,
                                                                                    local_work_sizze_135999,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_125270_runs,
                                                                                                                              &ctx->mainzisegmap_125270_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_135997 = get_wall_time();
                                        
                                        long time_diff_135998 =
                                             time_end_135997 -
                                             time_start_135996;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_125270",
                                                time_diff_135998);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_131398,
                                                          "mem_131398") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131402,
                                                          "mem_131402") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131406,
                                                          "mem_131406") != 0)
                                    return 1;
                                
                                struct memblock_device mem_131424;
                                
                                mem_131424.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131424,
                                                          bytes_130601,
                                                          "mem_131424")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131428;
                                
                                mem_131428.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131428,
                                                          bytes_130601,
                                                          "mem_131428")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(t_window_114537 * (int64_t) 2,
                                          segred_group_sizze_125661)) {
                                    int64_t segment_sizze_nonzzero_134672 =
                                            smax64((int64_t) 1,
                                                   t_window_114537);
                                    int64_t num_threads_134673 =
                                            num_groups_125662 *
                                            segred_group_sizze_125661;
                                    
                                    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_114533 *
                                                             t_n_m_114591),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) t_window_114537,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_125661,
                                                                    segment_sizze_nonzzero_134672),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(m_114533 *
                                                                                   t_n_m_114591,
                                                                                   squot64(segred_group_sizze_125661,
                                                                                           segment_sizze_nonzzero_134672))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            1,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_125661,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            2,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_125661,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            3,
                                                                            sizeof(m_114533),
                                                                            &m_114533));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            4,
                                                                            sizeof(n_114534),
                                                                            &n_114534));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            5,
                                                                            sizeof(t_window_114537),
                                                                            &t_window_114537));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            6,
                                                                            sizeof(t_jump_114541),
                                                                            &t_jump_114541));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            7,
                                                                            sizeof(t_n_m_114591),
                                                                            &t_n_m_114591));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            8,
                                                                            sizeof(i_114610),
                                                                            &i_114610));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            9,
                                                                            sizeof(num_groups_125662),
                                                                            &num_groups_125662));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            10,
                                                                            sizeof(segment_sizze_nonzzero_134672),
                                                                            &segment_sizze_nonzzero_134672));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            11,
                                                                            sizeof(defunc_3_map_res_mem_130117.mem),
                                                                            &defunc_3_map_res_mem_130117.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            12,
                                                                            sizeof(mem_130122.mem),
                                                                            &mem_130122.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            13,
                                                                            sizeof(defunc_3_map_res_mem_130606.mem),
                                                                            &defunc_3_map_res_mem_130606.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            14,
                                                                            sizeof(defunc_3_map_res_mem_130607.mem),
                                                                            &defunc_3_map_res_mem_130607.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            15,
                                                                            sizeof(mem_130861.mem),
                                                                            &mem_130861.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            16,
                                                                            sizeof(defunc_4_map_res_mem_131267.mem),
                                                                            &defunc_4_map_res_mem_131267.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            17,
                                                                            sizeof(mem_131411.mem),
                                                                            &mem_131411.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            18,
                                                                            sizeof(mem_131415.mem),
                                                                            &mem_131415.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            19,
                                                                            sizeof(mem_131419.mem),
                                                                            &mem_131419.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            20,
                                                                            sizeof(mem_131424.mem),
                                                                            &mem_131424.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_125209,
                                                                            21,
                                                                            sizeof(mem_131428.mem),
                                                                            &mem_131428.mem));
                                    if (1 * ((size_t) num_groups_125662 *
                                             (size_t) segred_group_sizze_125661) !=
                                        0) {
                                        const size_t global_work_sizze_136000[1]
                                                     =
                                                     {(size_t) num_groups_125662 *
                                                     (size_t) segred_group_sizze_125661};
                                        const size_t local_work_sizze_136004[1]
                                                     =
                                                     {segred_group_sizze_125661};
                                        int64_t time_start_136001 = 0,
                                                time_end_136002 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [",
                                                    "main.segred_small_125209");
                                            fprintf(ctx->log, "%zu",
                                                    global_work_sizze_136000[0]);
                                            fprintf(ctx->log,
                                                    "] and local work size [");
                                            fprintf(ctx->log, "%zu",
                                                    local_work_sizze_136004[0]);
                                            fprintf(ctx->log,
                                                    "]; local memory parameters sum to %d bytes.\n",
                                                    (int) (0 + (int64_t) 4 *
                                                           segred_group_sizze_125661 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_125661));
                                            time_start_136001 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_125209,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_136000,
                                                                                        local_work_sizze_136004,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_125209_runs,
                                                                                                                                  &ctx->mainzisegred_small_125209_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_136002 = get_wall_time();
                                            
                                            long time_diff_136003 =
                                                 time_end_136002 -
                                                 time_start_136001;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_125209",
                                                    time_diff_136003);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_134702 =
                                            sdiv_up64(num_groups_125662,
                                                      smax64((int64_t) 1,
                                                             m_114533 *
                                                             t_n_m_114591));
                                    int64_t elements_per_thread_134703 =
                                            sdiv_up64(t_window_114537,
                                                      segred_group_sizze_125661 *
                                                      groups_per_segment_134702);
                                    int64_t virt_num_groups_134704 =
                                            groups_per_segment_134702 *
                                            (m_114533 * t_n_m_114591);
                                    int64_t num_threads_134705 =
                                            num_groups_125662 *
                                            segred_group_sizze_125661;
                                    int64_t threads_per_segment_134706 =
                                            groups_per_segment_134702 *
                                            segred_group_sizze_125661;
                                    
                                    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_114533 *
                                                             t_n_m_114591),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) t_window_114537,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_134704,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_125662,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_125661,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_134703,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_134702,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_134707;
                                    
                                    segred_tmp_mem_134707.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_134707,
                                                              (int64_t) 4 *
                                                              virt_num_groups_134704,
                                                              "segred_tmp_mem_134707")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_134709;
                                    
                                    segred_tmp_mem_134709.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_134709,
                                                              (int64_t) 4 *
                                                              virt_num_groups_134704,
                                                              "segred_tmp_mem_134709")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_134711 =
                                    ctx->mainzicounter_mem_134711;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            1,
                                                                            1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            2,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_125661,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            3,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_125661,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            4,
                                                                            sizeof(m_114533),
                                                                            &m_114533));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            5,
                                                                            sizeof(n_114534),
                                                                            &n_114534));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            6,
                                                                            sizeof(t_window_114537),
                                                                            &t_window_114537));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            7,
                                                                            sizeof(t_jump_114541),
                                                                            &t_jump_114541));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            8,
                                                                            sizeof(t_n_m_114591),
                                                                            &t_n_m_114591));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            9,
                                                                            sizeof(i_114610),
                                                                            &i_114610));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            10,
                                                                            sizeof(num_groups_125662),
                                                                            &num_groups_125662));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            11,
                                                                            sizeof(groups_per_segment_134702),
                                                                            &groups_per_segment_134702));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            12,
                                                                            sizeof(elements_per_thread_134703),
                                                                            &elements_per_thread_134703));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            13,
                                                                            sizeof(virt_num_groups_134704),
                                                                            &virt_num_groups_134704));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            14,
                                                                            sizeof(threads_per_segment_134706),
                                                                            &threads_per_segment_134706));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            15,
                                                                            sizeof(defunc_3_map_res_mem_130117.mem),
                                                                            &defunc_3_map_res_mem_130117.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            16,
                                                                            sizeof(mem_130122.mem),
                                                                            &mem_130122.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            17,
                                                                            sizeof(defunc_3_map_res_mem_130606.mem),
                                                                            &defunc_3_map_res_mem_130606.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            18,
                                                                            sizeof(defunc_3_map_res_mem_130607.mem),
                                                                            &defunc_3_map_res_mem_130607.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            19,
                                                                            sizeof(mem_130861.mem),
                                                                            &mem_130861.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            20,
                                                                            sizeof(defunc_4_map_res_mem_131267.mem),
                                                                            &defunc_4_map_res_mem_131267.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            21,
                                                                            sizeof(mem_131411.mem),
                                                                            &mem_131411.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            22,
                                                                            sizeof(mem_131415.mem),
                                                                            &mem_131415.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            23,
                                                                            sizeof(mem_131419.mem),
                                                                            &mem_131419.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            24,
                                                                            sizeof(mem_131424.mem),
                                                                            &mem_131424.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            25,
                                                                            sizeof(mem_131428.mem),
                                                                            &mem_131428.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            26,
                                                                            sizeof(segred_tmp_mem_134707.mem),
                                                                            &segred_tmp_mem_134707.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            27,
                                                                            sizeof(segred_tmp_mem_134709.mem),
                                                                            &segred_tmp_mem_134709.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_125209,
                                                                            28,
                                                                            sizeof(mainzicounter_mem_134711.mem),
                                                                            &mainzicounter_mem_134711.mem));
                                    if (1 * ((size_t) num_groups_125662 *
                                             (size_t) segred_group_sizze_125661) !=
                                        0) {
                                        const size_t global_work_sizze_136006[1]
                                                     =
                                                     {(size_t) num_groups_125662 *
                                                     (size_t) segred_group_sizze_125661};
                                        const size_t local_work_sizze_136010[1]
                                                     =
                                                     {segred_group_sizze_125661};
                                        int64_t time_start_136007 = 0,
                                                time_end_136008 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [",
                                                    "main.segred_large_125209");
                                            fprintf(ctx->log, "%zu",
                                                    global_work_sizze_136006[0]);
                                            fprintf(ctx->log,
                                                    "] and local work size [");
                                            fprintf(ctx->log, "%zu",
                                                    local_work_sizze_136010[0]);
                                            fprintf(ctx->log,
                                                    "]; local memory parameters sum to %d bytes.\n",
                                                    (int) (0 + 1 + (int64_t) 4 *
                                                           segred_group_sizze_125661 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_125661));
                                            time_start_136007 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_125209,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_136006,
                                                                                        local_work_sizze_136010,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_125209_runs,
                                                                                                                                  &ctx->mainzisegred_large_125209_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_136008 = get_wall_time();
                                            
                                            long time_diff_136009 =
                                                 time_end_136008 -
                                                 time_start_136007;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_125209",
                                                    time_diff_136009);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_134709,
                                                              "segred_tmp_mem_134709") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_134707,
                                                              "segred_tmp_mem_134707") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_131411,
                                                          "mem_131411") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131415,
                                                          "mem_131415") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131419,
                                                          "mem_131419") != 0)
                                    return 1;
                                if (memblock_set_device(ctx,
                                                        &defunc_7_map_res_mem_131429,
                                                        &mem_131424,
                                                        "mem_131424") != 0)
                                    return 1;
                                if (memblock_set_device(ctx,
                                                        &defunc_7_map_res_mem_131430,
                                                        &mem_131428,
                                                        "mem_131428") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131428,
                                                          "mem_131428") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131424,
                                                          "mem_131424") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131419,
                                                          "mem_131419") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131415,
                                                          "mem_131415") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131411,
                                                          "mem_131411") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131406,
                                                          "mem_131406") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131402,
                                                          "mem_131402") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131398,
                                                          "mem_131398") != 0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_131441,
                                                    &defunc_7_map_res_mem_131429,
                                                    "defunc_7_map_res_mem_131429") !=
                                0)
                                return 1;
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_131442,
                                                    &defunc_7_map_res_mem_131430,
                                                    "defunc_7_map_res_mem_131430") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &defunc_7_map_res_mem_131430,
                                                      "defunc_7_map_res_mem_131430") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &defunc_7_map_res_mem_131429,
                                                      "defunc_7_map_res_mem_131429") !=
                                0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &x_mem_131569,
                                                &defunc_7_map_res_mem_131441,
                                                "defunc_7_map_res_mem_131441") !=
                            0)
                            return 1;
                        if (memblock_set_device(ctx, &x_mem_131570,
                                                &defunc_7_map_res_mem_131442,
                                                "defunc_7_map_res_mem_131442") !=
                            0)
                            return 1;
                        if (memblock_unref_device(ctx,
                                                  &defunc_7_map_res_mem_131442,
                                                  "defunc_7_map_res_mem_131442") !=
                            0)
                            return 1;
                        if (memblock_unref_device(ctx,
                                                  &defunc_7_map_res_mem_131441,
                                                  "defunc_7_map_res_mem_131441") !=
                            0)
                            return 1;
                    } else {
                        bool suff_outer_par_125723;
                        
                        suff_outer_par_125723 =
                            ctx->sizes.mainzisuff_outer_par_24 <= m_114533;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_24", (long) m_114533,
                                    suff_outer_par_125723 ? "true" : "false");
                        
                        int64_t segmap_group_sizze_125857;
                        
                        segmap_group_sizze_125857 =
                            ctx->sizes.mainzisegmap_group_sizze_125727;
                        
                        int64_t num_groups_125858;
                        int32_t max_num_groups_134755;
                        
                        max_num_groups_134755 =
                            ctx->sizes.mainzisegmap_num_groups_125729;
                        num_groups_125858 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(m_114533,
                                                                                 segmap_group_sizze_125857),
                                                                       sext_i32_i64(max_num_groups_134755))));
                        
                        int64_t segmap_group_sizze_126500;
                        
                        segmap_group_sizze_126500 =
                            ctx->sizes.mainzisegmap_group_sizze_125991;
                        
                        bool suff_outer_par_126504;
                        
                        suff_outer_par_126504 =
                            ctx->sizes.mainzisuff_outer_par_25 <=
                            nest_sizze_119536;
                        if (ctx->logging)
                            fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                                    "main.suff_outer_par_25",
                                    (long) nest_sizze_119536,
                                    suff_outer_par_126504 ? "true" : "false");
                        
                        int64_t nest_sizze_126640 = t_window_114537 *
                                nest_sizze_119536;
                        int64_t segred_group_sizze_126641;
                        
                        segred_group_sizze_126641 =
                            ctx->sizes.mainzisegred_group_sizze_126257;
                        
                        int64_t num_groups_126642;
                        int32_t max_num_groups_134756;
                        
                        max_num_groups_134756 =
                            ctx->sizes.mainzisegred_num_groups_126259;
                        num_groups_126642 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_126640,
                                                                                 segred_group_sizze_126641),
                                                                       sext_i32_i64(max_num_groups_134756))));
                        
                        int64_t segmap_group_sizze_126697;
                        
                        segmap_group_sizze_126697 =
                            ctx->sizes.mainzisegmap_group_sizze_126219;
                        
                        int64_t segred_group_sizze_126737;
                        
                        segred_group_sizze_126737 =
                            ctx->sizes.mainzisegred_group_sizze_126136;
                        
                        int64_t num_groups_126738;
                        int32_t max_num_groups_134757;
                        
                        max_num_groups_134757 =
                            ctx->sizes.mainzisegred_num_groups_126138;
                        num_groups_126738 = sext_i64_i32(smax64((int64_t) 1,
                                                                smin64(sdiv_up64(nest_sizze_126640,
                                                                                 segred_group_sizze_126737),
                                                                       sext_i32_i64(max_num_groups_134757))));
                        
                        int64_t num_threads_132250 = segmap_group_sizze_125857 *
                                num_groups_125858;
                        int64_t total_sizze_132251 = bytes_130440 *
                                num_threads_132250;
                        int64_t total_sizze_132252 = bytes_130440 *
                                num_threads_132250;
                        struct memblock_device defunc_7_map_res_mem_131567;
                        
                        defunc_7_map_res_mem_131567.references = NULL;
                        
                        struct memblock_device defunc_7_map_res_mem_131568;
                        
                        defunc_7_map_res_mem_131568.references = NULL;
                        
                        int32_t local_memory_capacity_135009;
                        
                        local_memory_capacity_135009 =
                            ctx->opencl.max_local_memory;
                        if (sle64((int64_t) 0,
                                  sext_i32_i64(local_memory_capacity_135009)) &&
                            suff_outer_par_125723) {
                            struct memblock_device mem_131445;
                            
                            mem_131445.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131445,
                                                      bytes_130470,
                                                      "mem_131445")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_i64(ctx,
                                                                      mem_131445,
                                                                      (int64_t) 0,
                                                                      defunc_3_map_res_mem_130606,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_114591,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131448;
                            
                            mem_131448.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131448,
                                                      bytes_130473,
                                                      "mem_131448")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131448,
                                                                      (int64_t) 0,
                                                                      defunc_3_map_res_mem_130607,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      t_n_m_114591,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131451;
                            
                            mem_131451.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131451,
                                                      binop_y_130121,
                                                      "mem_131451")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131451,
                                                                      (int64_t) 0,
                                                                      mem_130122,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_114534,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131454;
                            
                            mem_131454.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131454,
                                                      binop_y_130121,
                                                      "mem_131454")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131454,
                                                                      (int64_t) 0,
                                                                      mem_130861,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_114534,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131457;
                            
                            mem_131457.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131457,
                                                      binop_y_130121,
                                                      "mem_131457")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131457,
                                                                      (int64_t) 0,
                                                                      defunc_4_map_res_mem_131267,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      n_114534,
                                                                      m_114533) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131491;
                            
                            mem_131491.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131491,
                                                      bytes_130473,
                                                      "mem_131491")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131494;
                            
                            mem_131494.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131494,
                                                      bytes_130473,
                                                      "mem_131494")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_132126;
                            
                            color_132126.references = NULL;
                            if (memblock_alloc_device(ctx, &color_132126,
                                                      total_sizze_132251,
                                                      "color_132126")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device color_132127;
                            
                            color_132127.references = NULL;
                            if (memblock_alloc_device(ctx, &color_132127,
                                                      total_sizze_132252,
                                                      "color_132127")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125725,
                                                                    1,
                                                                    sizeof(m_114533),
                                                                    &m_114533));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125725,
                                                                    2,
                                                                    sizeof(t_window_114537),
                                                                    &t_window_114537));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125725,
                                                                    3,
                                                                    sizeof(t_jump_114541),
                                                                    &t_jump_114541));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125725,
                                                                    4,
                                                                    sizeof(t_n_m_114591),
                                                                    &t_n_m_114591));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125725,
                                                                    5,
                                                                    sizeof(i_114610),
                                                                    &i_114610));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125725,
                                                                    6,
                                                                    sizeof(num_groups_125858),
                                                                    &num_groups_125858));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125725,
                                                                    7,
                                                                    sizeof(num_threads_132250),
                                                                    &num_threads_132250));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125725,
                                                                    8,
                                                                    sizeof(defunc_3_map_res_mem_130117.mem),
                                                                    &defunc_3_map_res_mem_130117.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125725,
                                                                    9,
                                                                    sizeof(mem_131445.mem),
                                                                    &mem_131445.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125725,
                                                                    10,
                                                                    sizeof(mem_131448.mem),
                                                                    &mem_131448.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125725,
                                                                    11,
                                                                    sizeof(mem_131451.mem),
                                                                    &mem_131451.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125725,
                                                                    12,
                                                                    sizeof(mem_131454.mem),
                                                                    &mem_131454.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125725,
                                                                    13,
                                                                    sizeof(mem_131457.mem),
                                                                    &mem_131457.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125725,
                                                                    14,
                                                                    sizeof(mem_131491.mem),
                                                                    &mem_131491.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125725,
                                                                    15,
                                                                    sizeof(mem_131494.mem),
                                                                    &mem_131494.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125725,
                                                                    16,
                                                                    sizeof(color_132126.mem),
                                                                    &color_132126.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125725,
                                                                    17,
                                                                    sizeof(color_132127.mem),
                                                                    &color_132127.mem));
                            if (1 * ((size_t) num_groups_125858 *
                                     (size_t) segmap_group_sizze_125857) != 0) {
                                const size_t global_work_sizze_136011[1] =
                                             {(size_t) num_groups_125858 *
                                             (size_t) segmap_group_sizze_125857};
                                const size_t local_work_sizze_136015[1] =
                                             {segmap_group_sizze_125857};
                                int64_t time_start_136012 = 0, time_end_136013 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [",
                                            "main.segmap_125725");
                                    fprintf(ctx->log, "%zu",
                                            global_work_sizze_136011[0]);
                                    fprintf(ctx->log,
                                            "] and local work size [");
                                    fprintf(ctx->log, "%zu",
                                            local_work_sizze_136015[0]);
                                    fprintf(ctx->log,
                                            "]; local memory parameters sum to %d bytes.\n",
                                            (int) 0);
                                    time_start_136012 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_125725,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_136011,
                                                                                local_work_sizze_136015,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_125725_runs,
                                                                                                                          &ctx->mainzisegmap_125725_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_136013 = get_wall_time();
                                    
                                    long time_diff_136014 = time_end_136013 -
                                         time_start_136012;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_125725",
                                            time_diff_136014);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_131445,
                                                      "mem_131445") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131448,
                                                      "mem_131448") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131451,
                                                      "mem_131451") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131454,
                                                      "mem_131454") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131457,
                                                      "mem_131457") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_132126,
                                                      "color_132126") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_132127,
                                                      "color_132127") != 0)
                                return 1;
                            
                            struct memblock_device mem_131560;
                            
                            mem_131560.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131560,
                                                      bytes_130601,
                                                      "mem_131560")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131560,
                                                                      (int64_t) 0,
                                                                      mem_131491,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      m_114533,
                                                                      t_n_m_114591) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_131491,
                                                      "mem_131491") != 0)
                                return 1;
                            
                            struct memblock_device mem_131565;
                            
                            mem_131565.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131565,
                                                      bytes_130601,
                                                      "mem_131565")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (futrts_builtinzhgpu_map_transpose_f32(ctx,
                                                                      mem_131565,
                                                                      (int64_t) 0,
                                                                      mem_131494,
                                                                      (int64_t) 0,
                                                                      (int64_t) 1,
                                                                      m_114533,
                                                                      t_n_m_114591) !=
                                0) {
                                err = 1;
                                goto cleanup;
                            }
                            if (memblock_unref_device(ctx, &mem_131494,
                                                      "mem_131494") != 0)
                                return 1;
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_131567,
                                                    &mem_131560,
                                                    "mem_131560") != 0)
                                return 1;
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_131568,
                                                    &mem_131565,
                                                    "mem_131565") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131565,
                                                      "mem_131565") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131560,
                                                      "mem_131560") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_132127,
                                                      "color_132127") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &color_132126,
                                                      "color_132126") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131494,
                                                      "mem_131494") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131491,
                                                      "mem_131491") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131457,
                                                      "mem_131457") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131454,
                                                      "mem_131454") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131451,
                                                      "mem_131451") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131448,
                                                      "mem_131448") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131445,
                                                      "mem_131445") != 0)
                                return 1;
                        } else {
                            int64_t segmap_usable_groups_126501 =
                                    sdiv_up64(nest_sizze_119536,
                                              segmap_group_sizze_126500);
                            struct memblock_device defunc_7_map_res_mem_131555;
                            
                            defunc_7_map_res_mem_131555.references = NULL;
                            
                            struct memblock_device defunc_7_map_res_mem_131556;
                            
                            defunc_7_map_res_mem_131556.references = NULL;
                            
                            int32_t local_memory_capacity_135008;
                            
                            local_memory_capacity_135008 =
                                ctx->opencl.max_local_memory;
                            if (sle64((int64_t) 0,
                                      sext_i32_i64(local_memory_capacity_135008)) &&
                                suff_outer_par_126504) {
                                struct memblock_device mem_131499;
                                
                                mem_131499.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131499,
                                                          bytes_130601,
                                                          "mem_131499")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131503;
                                
                                mem_131503.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131503,
                                                          bytes_130601,
                                                          "mem_131503")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125988,
                                                                        1,
                                                                        sizeof(m_114533),
                                                                        &m_114533));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125988,
                                                                        2,
                                                                        sizeof(n_114534),
                                                                        &n_114534));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125988,
                                                                        3,
                                                                        sizeof(t_window_114537),
                                                                        &t_window_114537));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125988,
                                                                        4,
                                                                        sizeof(t_jump_114541),
                                                                        &t_jump_114541));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125988,
                                                                        5,
                                                                        sizeof(t_n_m_114591),
                                                                        &t_n_m_114591));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125988,
                                                                        6,
                                                                        sizeof(i_114610),
                                                                        &i_114610));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125988,
                                                                        7,
                                                                        sizeof(defunc_3_map_res_mem_130117.mem),
                                                                        &defunc_3_map_res_mem_130117.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125988,
                                                                        8,
                                                                        sizeof(mem_130122.mem),
                                                                        &mem_130122.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125988,
                                                                        9,
                                                                        sizeof(defunc_3_map_res_mem_130606.mem),
                                                                        &defunc_3_map_res_mem_130606.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125988,
                                                                        10,
                                                                        sizeof(defunc_3_map_res_mem_130607.mem),
                                                                        &defunc_3_map_res_mem_130607.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125988,
                                                                        11,
                                                                        sizeof(mem_130861.mem),
                                                                        &mem_130861.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125988,
                                                                        12,
                                                                        sizeof(defunc_4_map_res_mem_131267.mem),
                                                                        &defunc_4_map_res_mem_131267.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125988,
                                                                        13,
                                                                        sizeof(mem_131499.mem),
                                                                        &mem_131499.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_125988,
                                                                        14,
                                                                        sizeof(mem_131503.mem),
                                                                        &mem_131503.mem));
                                if (1 * ((size_t) segmap_usable_groups_126501 *
                                         (size_t) segmap_group_sizze_126500) !=
                                    0) {
                                    const size_t global_work_sizze_136016[1] =
                                                 {(size_t) segmap_usable_groups_126501 *
                                                 (size_t) segmap_group_sizze_126500};
                                    const size_t local_work_sizze_136020[1] =
                                                 {segmap_group_sizze_126500};
                                    int64_t time_start_136017 = 0,
                                            time_end_136018 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [",
                                                "main.segmap_125988");
                                        fprintf(ctx->log, "%zu",
                                                global_work_sizze_136016[0]);
                                        fprintf(ctx->log,
                                                "] and local work size [");
                                        fprintf(ctx->log, "%zu",
                                                local_work_sizze_136020[0]);
                                        fprintf(ctx->log,
                                                "]; local memory parameters sum to %d bytes.\n",
                                                (int) 0);
                                        time_start_136017 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_125988,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_136016,
                                                                                    local_work_sizze_136020,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_125988_runs,
                                                                                                                              &ctx->mainzisegmap_125988_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_136018 = get_wall_time();
                                        
                                        long time_diff_136019 =
                                             time_end_136018 -
                                             time_start_136017;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_125988",
                                                time_diff_136019);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_set_device(ctx,
                                                        &defunc_7_map_res_mem_131555,
                                                        &mem_131499,
                                                        "mem_131499") != 0)
                                    return 1;
                                if (memblock_set_device(ctx,
                                                        &defunc_7_map_res_mem_131556,
                                                        &mem_131503,
                                                        "mem_131503") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131503,
                                                          "mem_131503") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131499,
                                                          "mem_131499") != 0)
                                    return 1;
                            } else {
                                struct memblock_device mem_131508;
                                
                                mem_131508.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131508,
                                                          bytes_130601,
                                                          "mem_131508")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131512;
                                
                                mem_131512.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131512,
                                                          bytes_130601,
                                                          "mem_131512")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131516;
                                
                                mem_131516.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131516,
                                                          bytes_130601,
                                                          "mem_131516")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131520;
                                
                                mem_131520.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131520,
                                                          bytes_130601,
                                                          "mem_131520")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131524;
                                
                                mem_131524.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131524,
                                                          bytes_130601,
                                                          "mem_131524")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(t_window_114537 * (int64_t) 2,
                                          segred_group_sizze_126641)) {
                                    int64_t segment_sizze_nonzzero_134797 =
                                            smax64((int64_t) 1,
                                                   t_window_114537);
                                    int64_t num_threads_134798 =
                                            num_groups_126642 *
                                            segred_group_sizze_126641;
                                    
                                    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_114533 *
                                                             t_n_m_114591),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) t_window_114537,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_126641,
                                                                    segment_sizze_nonzzero_134797),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(m_114533 *
                                                                                   t_n_m_114591,
                                                                                   squot64(segred_group_sizze_126641,
                                                                                           segment_sizze_nonzzero_134797))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            1,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_126641,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            2,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_126641,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            3,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_126641,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            4,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_126641,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            5,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_126641,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            6,
                                                                            sizeof(m_114533),
                                                                            &m_114533));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            7,
                                                                            sizeof(n_114534),
                                                                            &n_114534));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            8,
                                                                            sizeof(t_window_114537),
                                                                            &t_window_114537));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            9,
                                                                            sizeof(t_jump_114541),
                                                                            &t_jump_114541));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            10,
                                                                            sizeof(t_n_m_114591),
                                                                            &t_n_m_114591));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            11,
                                                                            sizeof(i_114610),
                                                                            &i_114610));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            12,
                                                                            sizeof(num_groups_126642),
                                                                            &num_groups_126642));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            13,
                                                                            sizeof(segment_sizze_nonzzero_134797),
                                                                            &segment_sizze_nonzzero_134797));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            14,
                                                                            sizeof(defunc_3_map_res_mem_130117.mem),
                                                                            &defunc_3_map_res_mem_130117.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            15,
                                                                            sizeof(mem_130122.mem),
                                                                            &mem_130122.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            16,
                                                                            sizeof(defunc_3_map_res_mem_130606.mem),
                                                                            &defunc_3_map_res_mem_130606.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            17,
                                                                            sizeof(defunc_3_map_res_mem_130607.mem),
                                                                            &defunc_3_map_res_mem_130607.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            18,
                                                                            sizeof(mem_130861.mem),
                                                                            &mem_130861.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            19,
                                                                            sizeof(mem_131508.mem),
                                                                            &mem_131508.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            20,
                                                                            sizeof(mem_131512.mem),
                                                                            &mem_131512.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            21,
                                                                            sizeof(mem_131516.mem),
                                                                            &mem_131516.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            22,
                                                                            sizeof(mem_131520.mem),
                                                                            &mem_131520.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126263,
                                                                            23,
                                                                            sizeof(mem_131524.mem),
                                                                            &mem_131524.mem));
                                    if (1 * ((size_t) num_groups_126642 *
                                             (size_t) segred_group_sizze_126641) !=
                                        0) {
                                        const size_t global_work_sizze_136021[1]
                                                     =
                                                     {(size_t) num_groups_126642 *
                                                     (size_t) segred_group_sizze_126641};
                                        const size_t local_work_sizze_136025[1]
                                                     =
                                                     {segred_group_sizze_126641};
                                        int64_t time_start_136022 = 0,
                                                time_end_136023 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [",
                                                    "main.segred_small_126263");
                                            fprintf(ctx->log, "%zu",
                                                    global_work_sizze_136021[0]);
                                            fprintf(ctx->log,
                                                    "] and local work size [");
                                            fprintf(ctx->log, "%zu",
                                                    local_work_sizze_136025[0]);
                                            fprintf(ctx->log,
                                                    "]; local memory parameters sum to %d bytes.\n",
                                                    (int) (0 + (int64_t) 4 *
                                                           segred_group_sizze_126641 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_126641 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_126641 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_126641 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_126641));
                                            time_start_136022 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_126263,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_136021,
                                                                                        local_work_sizze_136025,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_126263_runs,
                                                                                                                                  &ctx->mainzisegred_small_126263_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_136023 = get_wall_time();
                                            
                                            long time_diff_136024 =
                                                 time_end_136023 -
                                                 time_start_136022;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_126263",
                                                    time_diff_136024);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_134842 =
                                            sdiv_up64(num_groups_126642,
                                                      smax64((int64_t) 1,
                                                             m_114533 *
                                                             t_n_m_114591));
                                    int64_t elements_per_thread_134843 =
                                            sdiv_up64(t_window_114537,
                                                      segred_group_sizze_126641 *
                                                      groups_per_segment_134842);
                                    int64_t virt_num_groups_134844 =
                                            groups_per_segment_134842 *
                                            (m_114533 * t_n_m_114591);
                                    int64_t num_threads_134845 =
                                            num_groups_126642 *
                                            segred_group_sizze_126641;
                                    int64_t threads_per_segment_134846 =
                                            groups_per_segment_134842 *
                                            segred_group_sizze_126641;
                                    
                                    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_114533 *
                                                             t_n_m_114591),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) t_window_114537,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_134844,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_126642,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_126641,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_134843,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_134842,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_134847;
                                    
                                    segred_tmp_mem_134847.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_134847,
                                                              (int64_t) 4 *
                                                              virt_num_groups_134844,
                                                              "segred_tmp_mem_134847")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_134849;
                                    
                                    segred_tmp_mem_134849.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_134849,
                                                              (int64_t) 4 *
                                                              virt_num_groups_134844,
                                                              "segred_tmp_mem_134849")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_134851;
                                    
                                    segred_tmp_mem_134851.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_134851,
                                                              (int64_t) 4 *
                                                              virt_num_groups_134844,
                                                              "segred_tmp_mem_134851")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_134853;
                                    
                                    segred_tmp_mem_134853.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_134853,
                                                              (int64_t) 4 *
                                                              virt_num_groups_134844,
                                                              "segred_tmp_mem_134853")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_134855;
                                    
                                    segred_tmp_mem_134855.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_134855,
                                                              (int64_t) 4 *
                                                              virt_num_groups_134844,
                                                              "segred_tmp_mem_134855")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_134857 =
                                    ctx->mainzicounter_mem_134857;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            1,
                                                                            1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            2,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_126641,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            3,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_126641,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            4,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_126641,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            5,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_126641,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            6,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_126641,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            7,
                                                                            sizeof(m_114533),
                                                                            &m_114533));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            8,
                                                                            sizeof(n_114534),
                                                                            &n_114534));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            9,
                                                                            sizeof(t_window_114537),
                                                                            &t_window_114537));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            10,
                                                                            sizeof(t_jump_114541),
                                                                            &t_jump_114541));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            11,
                                                                            sizeof(t_n_m_114591),
                                                                            &t_n_m_114591));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            12,
                                                                            sizeof(i_114610),
                                                                            &i_114610));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            13,
                                                                            sizeof(num_groups_126642),
                                                                            &num_groups_126642));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            14,
                                                                            sizeof(groups_per_segment_134842),
                                                                            &groups_per_segment_134842));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            15,
                                                                            sizeof(elements_per_thread_134843),
                                                                            &elements_per_thread_134843));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            16,
                                                                            sizeof(virt_num_groups_134844),
                                                                            &virt_num_groups_134844));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            17,
                                                                            sizeof(threads_per_segment_134846),
                                                                            &threads_per_segment_134846));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            18,
                                                                            sizeof(defunc_3_map_res_mem_130117.mem),
                                                                            &defunc_3_map_res_mem_130117.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            19,
                                                                            sizeof(mem_130122.mem),
                                                                            &mem_130122.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            20,
                                                                            sizeof(defunc_3_map_res_mem_130606.mem),
                                                                            &defunc_3_map_res_mem_130606.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            21,
                                                                            sizeof(defunc_3_map_res_mem_130607.mem),
                                                                            &defunc_3_map_res_mem_130607.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            22,
                                                                            sizeof(mem_130861.mem),
                                                                            &mem_130861.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            23,
                                                                            sizeof(mem_131508.mem),
                                                                            &mem_131508.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            24,
                                                                            sizeof(mem_131512.mem),
                                                                            &mem_131512.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            25,
                                                                            sizeof(mem_131516.mem),
                                                                            &mem_131516.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            26,
                                                                            sizeof(mem_131520.mem),
                                                                            &mem_131520.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            27,
                                                                            sizeof(mem_131524.mem),
                                                                            &mem_131524.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            28,
                                                                            sizeof(segred_tmp_mem_134847.mem),
                                                                            &segred_tmp_mem_134847.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            29,
                                                                            sizeof(segred_tmp_mem_134849.mem),
                                                                            &segred_tmp_mem_134849.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            30,
                                                                            sizeof(segred_tmp_mem_134851.mem),
                                                                            &segred_tmp_mem_134851.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            31,
                                                                            sizeof(segred_tmp_mem_134853.mem),
                                                                            &segred_tmp_mem_134853.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            32,
                                                                            sizeof(segred_tmp_mem_134855.mem),
                                                                            &segred_tmp_mem_134855.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126263,
                                                                            33,
                                                                            sizeof(mainzicounter_mem_134857.mem),
                                                                            &mainzicounter_mem_134857.mem));
                                    if (1 * ((size_t) num_groups_126642 *
                                             (size_t) segred_group_sizze_126641) !=
                                        0) {
                                        const size_t global_work_sizze_136027[1]
                                                     =
                                                     {(size_t) num_groups_126642 *
                                                     (size_t) segred_group_sizze_126641};
                                        const size_t local_work_sizze_136031[1]
                                                     =
                                                     {segred_group_sizze_126641};
                                        int64_t time_start_136028 = 0,
                                                time_end_136029 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [",
                                                    "main.segred_large_126263");
                                            fprintf(ctx->log, "%zu",
                                                    global_work_sizze_136027[0]);
                                            fprintf(ctx->log,
                                                    "] and local work size [");
                                            fprintf(ctx->log, "%zu",
                                                    local_work_sizze_136031[0]);
                                            fprintf(ctx->log,
                                                    "]; local memory parameters sum to %d bytes.\n",
                                                    (int) (0 + 1 + (int64_t) 4 *
                                                           segred_group_sizze_126641 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_126641 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_126641 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_126641 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_126641));
                                            time_start_136028 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_126263,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_136027,
                                                                                        local_work_sizze_136031,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_126263_runs,
                                                                                                                                  &ctx->mainzisegred_large_126263_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_136029 = get_wall_time();
                                            
                                            long time_diff_136030 =
                                                 time_end_136029 -
                                                 time_start_136028;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_126263",
                                                    time_diff_136030);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_134855,
                                                              "segred_tmp_mem_134855") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_134853,
                                                              "segred_tmp_mem_134853") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_134851,
                                                              "segred_tmp_mem_134851") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_134849,
                                                              "segred_tmp_mem_134849") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_134847,
                                                              "segred_tmp_mem_134847") !=
                                        0)
                                        return 1;
                                }
                                
                                int64_t segmap_usable_groups_126698 =
                                        sdiv_up64(nest_sizze_119536,
                                                  segmap_group_sizze_126697);
                                struct memblock_device mem_131529;
                                
                                mem_131529.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131529,
                                                          bytes_130601,
                                                          "mem_131529")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131533;
                                
                                mem_131533.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131533,
                                                          bytes_130601,
                                                          "mem_131533")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131537;
                                
                                mem_131537.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131537,
                                                          bytes_130601,
                                                          "mem_131537")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131541;
                                
                                mem_131541.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131541,
                                                          bytes_130601,
                                                          "mem_131541")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131545;
                                
                                mem_131545.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131545,
                                                          bytes_130601,
                                                          "mem_131545")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_126216,
                                                                        1,
                                                                        sizeof(m_114533),
                                                                        &m_114533));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_126216,
                                                                        2,
                                                                        sizeof(t_n_m_114591),
                                                                        &t_n_m_114591));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_126216,
                                                                        3,
                                                                        sizeof(mem_131508.mem),
                                                                        &mem_131508.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_126216,
                                                                        4,
                                                                        sizeof(mem_131512.mem),
                                                                        &mem_131512.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_126216,
                                                                        5,
                                                                        sizeof(mem_131516.mem),
                                                                        &mem_131516.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_126216,
                                                                        6,
                                                                        sizeof(mem_131520.mem),
                                                                        &mem_131520.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_126216,
                                                                        7,
                                                                        sizeof(mem_131524.mem),
                                                                        &mem_131524.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_126216,
                                                                        8,
                                                                        sizeof(mem_131529.mem),
                                                                        &mem_131529.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_126216,
                                                                        9,
                                                                        sizeof(mem_131533.mem),
                                                                        &mem_131533.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_126216,
                                                                        10,
                                                                        sizeof(mem_131537.mem),
                                                                        &mem_131537.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_126216,
                                                                        11,
                                                                        sizeof(mem_131541.mem),
                                                                        &mem_131541.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_126216,
                                                                        12,
                                                                        sizeof(mem_131545.mem),
                                                                        &mem_131545.mem));
                                if (1 * ((size_t) segmap_usable_groups_126698 *
                                         (size_t) segmap_group_sizze_126697) !=
                                    0) {
                                    const size_t global_work_sizze_136032[1] =
                                                 {(size_t) segmap_usable_groups_126698 *
                                                 (size_t) segmap_group_sizze_126697};
                                    const size_t local_work_sizze_136036[1] =
                                                 {segmap_group_sizze_126697};
                                    int64_t time_start_136033 = 0,
                                            time_end_136034 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [",
                                                "main.segmap_126216");
                                        fprintf(ctx->log, "%zu",
                                                global_work_sizze_136032[0]);
                                        fprintf(ctx->log,
                                                "] and local work size [");
                                        fprintf(ctx->log, "%zu",
                                                local_work_sizze_136036[0]);
                                        fprintf(ctx->log,
                                                "]; local memory parameters sum to %d bytes.\n",
                                                (int) 0);
                                        time_start_136033 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainzisegmap_126216,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_136032,
                                                                                    local_work_sizze_136036,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainzisegmap_126216_runs,
                                                                                                                              &ctx->mainzisegmap_126216_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_136034 = get_wall_time();
                                        
                                        long time_diff_136035 =
                                             time_end_136034 -
                                             time_start_136033;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.segmap_126216",
                                                time_diff_136035);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "");
                                if (memblock_unref_device(ctx, &mem_131508,
                                                          "mem_131508") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131512,
                                                          "mem_131512") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131516,
                                                          "mem_131516") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131520,
                                                          "mem_131520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131524,
                                                          "mem_131524") != 0)
                                    return 1;
                                
                                struct memblock_device mem_131550;
                                
                                mem_131550.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131550,
                                                          bytes_130601,
                                                          "mem_131550")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                
                                struct memblock_device mem_131554;
                                
                                mem_131554.references = NULL;
                                if (memblock_alloc_device(ctx, &mem_131554,
                                                          bytes_130601,
                                                          "mem_131554")) {
                                    err = 1;
                                    goto cleanup;
                                }
                                if (slt64(t_window_114537 * (int64_t) 2,
                                          segred_group_sizze_126737)) {
                                    int64_t segment_sizze_nonzzero_134927 =
                                            smax64((int64_t) 1,
                                                   t_window_114537);
                                    int64_t num_threads_134928 =
                                            num_groups_126738 *
                                            segred_group_sizze_126737;
                                    
                                    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_114533 *
                                                             t_n_m_114591),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) t_window_114537,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segments_per_group",
                                                (long long) squot64(segred_group_sizze_126737,
                                                                    segment_sizze_nonzzero_134927),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "required_groups",
                                                (long long) sext_i64_i32(sdiv_up64(m_114533 *
                                                                                   t_n_m_114591,
                                                                                   squot64(segred_group_sizze_126737,
                                                                                           segment_sizze_nonzzero_134927))),
                                                '\n');
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            1,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_126737,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            2,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_126737,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            3,
                                                                            sizeof(m_114533),
                                                                            &m_114533));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            4,
                                                                            sizeof(n_114534),
                                                                            &n_114534));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            5,
                                                                            sizeof(t_window_114537),
                                                                            &t_window_114537));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            6,
                                                                            sizeof(t_jump_114541),
                                                                            &t_jump_114541));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            7,
                                                                            sizeof(t_n_m_114591),
                                                                            &t_n_m_114591));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            8,
                                                                            sizeof(i_114610),
                                                                            &i_114610));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            9,
                                                                            sizeof(num_groups_126738),
                                                                            &num_groups_126738));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            10,
                                                                            sizeof(segment_sizze_nonzzero_134927),
                                                                            &segment_sizze_nonzzero_134927));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            11,
                                                                            sizeof(defunc_3_map_res_mem_130117.mem),
                                                                            &defunc_3_map_res_mem_130117.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            12,
                                                                            sizeof(mem_130122.mem),
                                                                            &mem_130122.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            13,
                                                                            sizeof(defunc_3_map_res_mem_130606.mem),
                                                                            &defunc_3_map_res_mem_130606.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            14,
                                                                            sizeof(defunc_3_map_res_mem_130607.mem),
                                                                            &defunc_3_map_res_mem_130607.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            15,
                                                                            sizeof(mem_130861.mem),
                                                                            &mem_130861.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            16,
                                                                            sizeof(defunc_4_map_res_mem_131267.mem),
                                                                            &defunc_4_map_res_mem_131267.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            17,
                                                                            sizeof(mem_131529.mem),
                                                                            &mem_131529.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            18,
                                                                            sizeof(mem_131533.mem),
                                                                            &mem_131533.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            19,
                                                                            sizeof(mem_131537.mem),
                                                                            &mem_131537.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            20,
                                                                            sizeof(mem_131541.mem),
                                                                            &mem_131541.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            21,
                                                                            sizeof(mem_131545.mem),
                                                                            &mem_131545.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            22,
                                                                            sizeof(mem_131550.mem),
                                                                            &mem_131550.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_126142,
                                                                            23,
                                                                            sizeof(mem_131554.mem),
                                                                            &mem_131554.mem));
                                    if (1 * ((size_t) num_groups_126738 *
                                             (size_t) segred_group_sizze_126737) !=
                                        0) {
                                        const size_t global_work_sizze_136037[1]
                                                     =
                                                     {(size_t) num_groups_126738 *
                                                     (size_t) segred_group_sizze_126737};
                                        const size_t local_work_sizze_136041[1]
                                                     =
                                                     {segred_group_sizze_126737};
                                        int64_t time_start_136038 = 0,
                                                time_end_136039 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [",
                                                    "main.segred_small_126142");
                                            fprintf(ctx->log, "%zu",
                                                    global_work_sizze_136037[0]);
                                            fprintf(ctx->log,
                                                    "] and local work size [");
                                            fprintf(ctx->log, "%zu",
                                                    local_work_sizze_136041[0]);
                                            fprintf(ctx->log,
                                                    "]; local memory parameters sum to %d bytes.\n",
                                                    (int) (0 + (int64_t) 4 *
                                                           segred_group_sizze_126737 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_126737));
                                            time_start_136038 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_small_126142,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_136037,
                                                                                        local_work_sizze_136041,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_small_126142_runs,
                                                                                                                                  &ctx->mainzisegred_small_126142_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_136039 = get_wall_time();
                                            
                                            long time_diff_136040 =
                                                 time_end_136039 -
                                                 time_start_136038;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_small_126142",
                                                    time_diff_136040);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                } else {
                                    int64_t groups_per_segment_134957 =
                                            sdiv_up64(num_groups_126738,
                                                      smax64((int64_t) 1,
                                                             m_114533 *
                                                             t_n_m_114591));
                                    int64_t elements_per_thread_134958 =
                                            sdiv_up64(t_window_114537,
                                                      segred_group_sizze_126737 *
                                                      groups_per_segment_134957);
                                    int64_t virt_num_groups_134959 =
                                            groups_per_segment_134957 *
                                            (m_114533 * t_n_m_114591);
                                    int64_t num_threads_134960 =
                                            num_groups_126738 *
                                            segred_group_sizze_126737;
                                    int64_t threads_per_segment_134961 =
                                            groups_per_segment_134957 *
                                            segred_group_sizze_126737;
                                    
                                    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_114533 *
                                                             t_n_m_114591),
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "segment_size",
                                                (long long) t_window_114537,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "virt_num_groups",
                                                (long long) virt_num_groups_134959,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "num_groups",
                                                (long long) num_groups_126738,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "group_size",
                                                (long long) segred_group_sizze_126737,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "elems_per_thread",
                                                (long long) elements_per_thread_134958,
                                                '\n');
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s: %llu%c",
                                                "groups_per_segment",
                                                (long long) groups_per_segment_134957,
                                                '\n');
                                    
                                    struct memblock_device
                                    segred_tmp_mem_134962;
                                    
                                    segred_tmp_mem_134962.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_134962,
                                                              (int64_t) 4 *
                                                              virt_num_groups_134959,
                                                              "segred_tmp_mem_134962")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    segred_tmp_mem_134964;
                                    
                                    segred_tmp_mem_134964.references = NULL;
                                    if (memblock_alloc_device(ctx,
                                                              &segred_tmp_mem_134964,
                                                              (int64_t) 4 *
                                                              virt_num_groups_134959,
                                                              "segred_tmp_mem_134964")) {
                                        err = 1;
                                        goto cleanup;
                                    }
                                    
                                    struct memblock_device
                                    mainzicounter_mem_134966 =
                                    ctx->mainzicounter_mem_134966;
                                    
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            1,
                                                                            1,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            2,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_126737,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            3,
                                                                            (int64_t) 4 *
                                                                            segred_group_sizze_126737,
                                                                            NULL));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            4,
                                                                            sizeof(m_114533),
                                                                            &m_114533));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            5,
                                                                            sizeof(n_114534),
                                                                            &n_114534));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            6,
                                                                            sizeof(t_window_114537),
                                                                            &t_window_114537));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            7,
                                                                            sizeof(t_jump_114541),
                                                                            &t_jump_114541));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            8,
                                                                            sizeof(t_n_m_114591),
                                                                            &t_n_m_114591));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            9,
                                                                            sizeof(i_114610),
                                                                            &i_114610));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            10,
                                                                            sizeof(num_groups_126738),
                                                                            &num_groups_126738));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            11,
                                                                            sizeof(groups_per_segment_134957),
                                                                            &groups_per_segment_134957));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            12,
                                                                            sizeof(elements_per_thread_134958),
                                                                            &elements_per_thread_134958));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            13,
                                                                            sizeof(virt_num_groups_134959),
                                                                            &virt_num_groups_134959));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            14,
                                                                            sizeof(threads_per_segment_134961),
                                                                            &threads_per_segment_134961));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            15,
                                                                            sizeof(defunc_3_map_res_mem_130117.mem),
                                                                            &defunc_3_map_res_mem_130117.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            16,
                                                                            sizeof(mem_130122.mem),
                                                                            &mem_130122.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            17,
                                                                            sizeof(defunc_3_map_res_mem_130606.mem),
                                                                            &defunc_3_map_res_mem_130606.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            18,
                                                                            sizeof(defunc_3_map_res_mem_130607.mem),
                                                                            &defunc_3_map_res_mem_130607.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            19,
                                                                            sizeof(mem_130861.mem),
                                                                            &mem_130861.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            20,
                                                                            sizeof(defunc_4_map_res_mem_131267.mem),
                                                                            &defunc_4_map_res_mem_131267.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            21,
                                                                            sizeof(mem_131529.mem),
                                                                            &mem_131529.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            22,
                                                                            sizeof(mem_131533.mem),
                                                                            &mem_131533.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            23,
                                                                            sizeof(mem_131537.mem),
                                                                            &mem_131537.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            24,
                                                                            sizeof(mem_131541.mem),
                                                                            &mem_131541.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            25,
                                                                            sizeof(mem_131545.mem),
                                                                            &mem_131545.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            26,
                                                                            sizeof(mem_131550.mem),
                                                                            &mem_131550.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            27,
                                                                            sizeof(mem_131554.mem),
                                                                            &mem_131554.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            28,
                                                                            sizeof(segred_tmp_mem_134962.mem),
                                                                            &segred_tmp_mem_134962.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            29,
                                                                            sizeof(segred_tmp_mem_134964.mem),
                                                                            &segred_tmp_mem_134964.mem));
                                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_126142,
                                                                            30,
                                                                            sizeof(mainzicounter_mem_134966.mem),
                                                                            &mainzicounter_mem_134966.mem));
                                    if (1 * ((size_t) num_groups_126738 *
                                             (size_t) segred_group_sizze_126737) !=
                                        0) {
                                        const size_t global_work_sizze_136043[1]
                                                     =
                                                     {(size_t) num_groups_126738 *
                                                     (size_t) segred_group_sizze_126737};
                                        const size_t local_work_sizze_136047[1]
                                                     =
                                                     {segred_group_sizze_126737};
                                        int64_t time_start_136044 = 0,
                                                time_end_136045 = 0;
                                        
                                        if (ctx->debugging) {
                                            fprintf(ctx->log,
                                                    "Launching %s with global work size [",
                                                    "main.segred_large_126142");
                                            fprintf(ctx->log, "%zu",
                                                    global_work_sizze_136043[0]);
                                            fprintf(ctx->log,
                                                    "] and local work size [");
                                            fprintf(ctx->log, "%zu",
                                                    local_work_sizze_136047[0]);
                                            fprintf(ctx->log,
                                                    "]; local memory parameters sum to %d bytes.\n",
                                                    (int) (0 + 1 + (int64_t) 4 *
                                                           segred_group_sizze_126737 +
                                                           (int64_t) 4 *
                                                           segred_group_sizze_126737));
                                            time_start_136044 = get_wall_time();
                                        }
                                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                        ctx->mainzisegred_large_126142,
                                                                                        1,
                                                                                        NULL,
                                                                                        global_work_sizze_136043,
                                                                                        local_work_sizze_136047,
                                                                                        0,
                                                                                        NULL,
                                                                                        ctx->profiling_paused ||
                                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                                  &ctx->mainzisegred_large_126142_runs,
                                                                                                                                  &ctx->mainzisegred_large_126142_total_runtime)));
                                        if (ctx->debugging) {
                                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                            time_end_136045 = get_wall_time();
                                            
                                            long time_diff_136046 =
                                                 time_end_136045 -
                                                 time_start_136044;
                                            
                                            fprintf(ctx->log,
                                                    "kernel %s runtime: %ldus\n",
                                                    "main.segred_large_126142",
                                                    time_diff_136046);
                                        }
                                    }
                                    if (ctx->debugging)
                                        fprintf(ctx->log, "%s\n", "");
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_134964,
                                                              "segred_tmp_mem_134964") !=
                                        0)
                                        return 1;
                                    if (memblock_unref_device(ctx,
                                                              &segred_tmp_mem_134962,
                                                              "segred_tmp_mem_134962") !=
                                        0)
                                        return 1;
                                }
                                if (memblock_unref_device(ctx, &mem_131529,
                                                          "mem_131529") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131533,
                                                          "mem_131533") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131537,
                                                          "mem_131537") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131541,
                                                          "mem_131541") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131545,
                                                          "mem_131545") != 0)
                                    return 1;
                                if (memblock_set_device(ctx,
                                                        &defunc_7_map_res_mem_131555,
                                                        &mem_131550,
                                                        "mem_131550") != 0)
                                    return 1;
                                if (memblock_set_device(ctx,
                                                        &defunc_7_map_res_mem_131556,
                                                        &mem_131554,
                                                        "mem_131554") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131554,
                                                          "mem_131554") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131550,
                                                          "mem_131550") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131545,
                                                          "mem_131545") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131541,
                                                          "mem_131541") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131537,
                                                          "mem_131537") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131533,
                                                          "mem_131533") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131529,
                                                          "mem_131529") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131524,
                                                          "mem_131524") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131520,
                                                          "mem_131520") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131516,
                                                          "mem_131516") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131512,
                                                          "mem_131512") != 0)
                                    return 1;
                                if (memblock_unref_device(ctx, &mem_131508,
                                                          "mem_131508") != 0)
                                    return 1;
                            }
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_131567,
                                                    &defunc_7_map_res_mem_131555,
                                                    "defunc_7_map_res_mem_131555") !=
                                0)
                                return 1;
                            if (memblock_set_device(ctx,
                                                    &defunc_7_map_res_mem_131568,
                                                    &defunc_7_map_res_mem_131556,
                                                    "defunc_7_map_res_mem_131556") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &defunc_7_map_res_mem_131556,
                                                      "defunc_7_map_res_mem_131556") !=
                                0)
                                return 1;
                            if (memblock_unref_device(ctx,
                                                      &defunc_7_map_res_mem_131555,
                                                      "defunc_7_map_res_mem_131555") !=
                                0)
                                return 1;
                        }
                        if (memblock_set_device(ctx, &x_mem_131569,
                                                &defunc_7_map_res_mem_131567,
                                                "defunc_7_map_res_mem_131567") !=
                            0)
                            return 1;
                        if (memblock_set_device(ctx, &x_mem_131570,
                                                &defunc_7_map_res_mem_131568,
                                                "defunc_7_map_res_mem_131568") !=
                            0)
                            return 1;
                        if (memblock_unref_device(ctx,
                                                  &defunc_7_map_res_mem_131568,
                                                  "defunc_7_map_res_mem_131568") !=
                            0)
                            return 1;
                        if (memblock_unref_device(ctx,
                                                  &defunc_7_map_res_mem_131567,
                                                  "defunc_7_map_res_mem_131567") !=
                            0)
                            return 1;
                    }
                    if (memblock_set_device(ctx,
                                            &defunc_12_lifted_use_version_res_mem_131571,
                                            &x_mem_131569, "x_mem_131569") != 0)
                        return 1;
                    if (memblock_set_device(ctx,
                                            &defunc_12_lifted_use_version_res_mem_131572,
                                            &x_mem_131570, "x_mem_131570") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &x_mem_131570,
                                              "x_mem_131570") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &x_mem_131569,
                                              "x_mem_131569") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &defunc_11_loess_l_res_mem_131632,
                                        &defunc_12_lifted_use_version_res_mem_131571,
                                        "defunc_12_lifted_use_version_res_mem_131571") !=
                    0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_11_loess_l_res_mem_131633,
                                        &defunc_12_lifted_use_version_res_mem_131572,
                                        "defunc_12_lifted_use_version_res_mem_131572") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx,
                                          &defunc_12_lifted_use_version_res_mem_131572,
                                          "defunc_12_lifted_use_version_res_mem_131572") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx,
                                          &defunc_12_lifted_use_version_res_mem_131571,
                                          "defunc_12_lifted_use_version_res_mem_131571") !=
                    0)
                    return 1;
            } else {
                bool match_lit_116178 = (int64_t) 0 == t_degree_114539;
                int64_t binop_y_131580 = (int64_t) 4 * t_window_114537;
                int64_t bytes_131579 = smax64((int64_t) 0, binop_y_131580);
                struct memblock_device
                defunc_12_lifted_use_version_res_mem_131630;
                
                defunc_12_lifted_use_version_res_mem_131630.references = NULL;
                
                struct memblock_device
                defunc_12_lifted_use_version_res_mem_131631;
                
                defunc_12_lifted_use_version_res_mem_131631.references = NULL;
                if (match_lit_116178) {
                    struct memblock_device mem_131576;
                    
                    mem_131576.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_131576, bytes_130601,
                                              "mem_131576")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (futrts_builtinzhreplicate_f32(ctx, mem_131576,
                                                      m_114533 * t_n_m_114591,
                                                      0.0F) != 0) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mem_131586;
                    
                    mem_131586.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_131586, bytes_130601,
                                              "mem_131586")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126827,
                                                            1, (int64_t) 4 *
                                                            t_window_114537,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126827,
                                                            2, (int64_t) 4 *
                                                            t_window_114537,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126827,
                                                            3, bytes_131579,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126827,
                                                            4, sizeof(m_114533),
                                                            &m_114533));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126827,
                                                            5, sizeof(n_114534),
                                                            &n_114534));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126827,
                                                            6,
                                                            sizeof(t_window_114537),
                                                            &t_window_114537));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126827,
                                                            7,
                                                            sizeof(t_jump_114541),
                                                            &t_jump_114541));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126827,
                                                            8,
                                                            sizeof(t_n_m_114591),
                                                            &t_n_m_114591));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126827,
                                                            9, sizeof(i_114610),
                                                            &i_114610));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126827,
                                                            10,
                                                            sizeof(defunc_3_map_res_mem_130117.mem),
                                                            &defunc_3_map_res_mem_130117.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126827,
                                                            11,
                                                            sizeof(mem_130122.mem),
                                                            &mem_130122.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126827,
                                                            12,
                                                            sizeof(defunc_3_map_res_mem_130606.mem),
                                                            &defunc_3_map_res_mem_130606.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126827,
                                                            13,
                                                            sizeof(defunc_3_map_res_mem_130607.mem),
                                                            &defunc_3_map_res_mem_130607.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126827,
                                                            14,
                                                            sizeof(mem_130861.mem),
                                                            &mem_130861.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126827,
                                                            15,
                                                            sizeof(defunc_4_map_res_mem_131267.mem),
                                                            &defunc_4_map_res_mem_131267.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126827,
                                                            16,
                                                            sizeof(mem_131586.mem),
                                                            &mem_131586.mem));
                    if (1 * ((size_t) nest_sizze_119536 *
                             (size_t) t_window_114537) != 0) {
                        const size_t global_work_sizze_136048[1] =
                                     {(size_t) nest_sizze_119536 *
                                     (size_t) t_window_114537};
                        const size_t local_work_sizze_136052[1] =
                                     {t_window_114537};
                        int64_t time_start_136049 = 0, time_end_136050 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [",
                                    "main.segmap_intragroup_126827");
                            fprintf(ctx->log, "%zu",
                                    global_work_sizze_136048[0]);
                            fprintf(ctx->log, "] and local work size [");
                            fprintf(ctx->log, "%zu",
                                    local_work_sizze_136052[0]);
                            fprintf(ctx->log,
                                    "]; local memory parameters sum to %d bytes.\n",
                                    (int) (0 + (int64_t) 4 * t_window_114537 +
                                           (int64_t) 4 * t_window_114537 +
                                           bytes_131579));
                            time_start_136049 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_intragroup_126827,
                                                                        1, NULL,
                                                                        global_work_sizze_136048,
                                                                        local_work_sizze_136052,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_intragroup_126827_runs,
                                                                                                                  &ctx->mainzisegmap_intragroup_126827_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_136050 = get_wall_time();
                            
                            long time_diff_136051 = time_end_136050 -
                                 time_start_136049;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_126827",
                                    time_diff_136051);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_set_device(ctx,
                                            &defunc_12_lifted_use_version_res_mem_131630,
                                            &mem_131586, "mem_131586") != 0)
                        return 1;
                    if (memblock_set_device(ctx,
                                            &defunc_12_lifted_use_version_res_mem_131631,
                                            &mem_131576, "mem_131576") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_131586, "mem_131586") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_131576, "mem_131576") !=
                        0)
                        return 1;
                } else {
                    bool match_lit_116235 = (int64_t) 1 == t_degree_114539;
                    struct memblock_device x_mem_131628;
                    
                    x_mem_131628.references = NULL;
                    
                    struct memblock_device x_mem_131629;
                    
                    x_mem_131629.references = NULL;
                    if (match_lit_116235) {
                        struct memblock_device mem_131599;
                        
                        mem_131599.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_131599,
                                                  bytes_130601, "mem_131599")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_131603;
                        
                        mem_131603.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_131603,
                                                  bytes_130601, "mem_131603")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                1, (int64_t) 4 *
                                                                t_window_114537,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                2, (int64_t) 4 *
                                                                t_window_114537,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                3, (int64_t) 4 *
                                                                t_window_114537,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                4, (int64_t) 4 *
                                                                t_window_114537,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                5, (int64_t) 4 *
                                                                t_window_114537,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                6, bytes_131579,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                7, bytes_131579,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                8,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                9,
                                                                sizeof(n_114534),
                                                                &n_114534));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                10,
                                                                sizeof(t_window_114537),
                                                                &t_window_114537));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                11,
                                                                sizeof(t_jump_114541),
                                                                &t_jump_114541));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                12,
                                                                sizeof(t_n_m_114591),
                                                                &t_n_m_114591));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                13,
                                                                sizeof(i_114610),
                                                                &i_114610));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                14,
                                                                sizeof(defunc_3_map_res_mem_130117.mem),
                                                                &defunc_3_map_res_mem_130117.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                15,
                                                                sizeof(mem_130122.mem),
                                                                &mem_130122.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                16,
                                                                sizeof(defunc_3_map_res_mem_130606.mem),
                                                                &defunc_3_map_res_mem_130606.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                17,
                                                                sizeof(defunc_3_map_res_mem_130607.mem),
                                                                &defunc_3_map_res_mem_130607.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                18,
                                                                sizeof(mem_130861.mem),
                                                                &mem_130861.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                19,
                                                                sizeof(defunc_4_map_res_mem_131267.mem),
                                                                &defunc_4_map_res_mem_131267.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                20,
                                                                sizeof(mem_131599.mem),
                                                                &mem_131599.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_126956,
                                                                21,
                                                                sizeof(mem_131603.mem),
                                                                &mem_131603.mem));
                        if (1 * ((size_t) nest_sizze_119536 *
                                 (size_t) t_window_114537) != 0) {
                            const size_t global_work_sizze_136053[1] =
                                         {(size_t) nest_sizze_119536 *
                                         (size_t) t_window_114537};
                            const size_t local_work_sizze_136057[1] =
                                         {t_window_114537};
                            int64_t time_start_136054 = 0, time_end_136055 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.segmap_intragroup_126956");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_136053[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_136057[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + (int64_t) 4 *
                                               t_window_114537 + (int64_t) 4 *
                                               t_window_114537 + (int64_t) 4 *
                                               t_window_114537 + (int64_t) 4 *
                                               t_window_114537 + (int64_t) 4 *
                                               t_window_114537 + bytes_131579 +
                                               bytes_131579));
                                time_start_136054 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_intragroup_126956,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_136053,
                                                                            local_work_sizze_136057,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_intragroup_126956_runs,
                                                                                                                      &ctx->mainzisegmap_intragroup_126956_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_136055 = get_wall_time();
                                
                                long time_diff_136056 = time_end_136055 -
                                     time_start_136054;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_126956",
                                        time_diff_136056);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &x_mem_131628, &mem_131599,
                                                "mem_131599") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &x_mem_131629, &mem_131603,
                                                "mem_131603") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131603,
                                                  "mem_131603") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131599,
                                                  "mem_131599") != 0)
                            return 1;
                    } else {
                        struct memblock_device mem_131623;
                        
                        mem_131623.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_131623,
                                                  bytes_130601, "mem_131623")) {
                            err = 1;
                            goto cleanup;
                        }
                        
                        struct memblock_device mem_131627;
                        
                        mem_131627.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_131627,
                                                  bytes_130601, "mem_131627")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "\n# SegMap");
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                1, (int64_t) 4 *
                                                                t_window_114537,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                2, (int64_t) 4 *
                                                                t_window_114537,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                3, (int64_t) 4 *
                                                                t_window_114537,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                4, (int64_t) 4 *
                                                                t_window_114537,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                5, (int64_t) 4 *
                                                                t_window_114537,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                6, (int64_t) 4 *
                                                                t_window_114537,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                7, (int64_t) 4 *
                                                                t_window_114537,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                8, bytes_131579,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                9, bytes_131579,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                10,
                                                                bytes_131579,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                11,
                                                                bytes_131579,
                                                                NULL));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                12,
                                                                sizeof(m_114533),
                                                                &m_114533));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                13,
                                                                sizeof(n_114534),
                                                                &n_114534));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                14,
                                                                sizeof(t_window_114537),
                                                                &t_window_114537));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                15,
                                                                sizeof(t_jump_114541),
                                                                &t_jump_114541));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                16,
                                                                sizeof(t_n_m_114591),
                                                                &t_n_m_114591));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                17,
                                                                sizeof(i_114610),
                                                                &i_114610));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                18,
                                                                sizeof(defunc_3_map_res_mem_130117.mem),
                                                                &defunc_3_map_res_mem_130117.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                19,
                                                                sizeof(mem_130122.mem),
                                                                &mem_130122.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                20,
                                                                sizeof(defunc_3_map_res_mem_130606.mem),
                                                                &defunc_3_map_res_mem_130606.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                21,
                                                                sizeof(defunc_3_map_res_mem_130607.mem),
                                                                &defunc_3_map_res_mem_130607.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                22,
                                                                sizeof(mem_130861.mem),
                                                                &mem_130861.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                23,
                                                                sizeof(defunc_4_map_res_mem_131267.mem),
                                                                &defunc_4_map_res_mem_131267.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                24,
                                                                sizeof(mem_131623.mem),
                                                                &mem_131623.mem));
                        OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127166,
                                                                25,
                                                                sizeof(mem_131627.mem),
                                                                &mem_131627.mem));
                        if (1 * ((size_t) nest_sizze_119536 *
                                 (size_t) t_window_114537) != 0) {
                            const size_t global_work_sizze_136058[1] =
                                         {(size_t) nest_sizze_119536 *
                                         (size_t) t_window_114537};
                            const size_t local_work_sizze_136062[1] =
                                         {t_window_114537};
                            int64_t time_start_136059 = 0, time_end_136060 = 0;
                            
                            if (ctx->debugging) {
                                fprintf(ctx->log,
                                        "Launching %s with global work size [",
                                        "main.segmap_intragroup_127166");
                                fprintf(ctx->log, "%zu",
                                        global_work_sizze_136058[0]);
                                fprintf(ctx->log, "] and local work size [");
                                fprintf(ctx->log, "%zu",
                                        local_work_sizze_136062[0]);
                                fprintf(ctx->log,
                                        "]; local memory parameters sum to %d bytes.\n",
                                        (int) (0 + (int64_t) 4 *
                                               t_window_114537 + (int64_t) 4 *
                                               t_window_114537 + (int64_t) 4 *
                                               t_window_114537 + (int64_t) 4 *
                                               t_window_114537 + (int64_t) 4 *
                                               t_window_114537 + (int64_t) 4 *
                                               t_window_114537 + (int64_t) 4 *
                                               t_window_114537 + bytes_131579 +
                                               bytes_131579 + bytes_131579 +
                                               bytes_131579));
                                time_start_136059 = get_wall_time();
                            }
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                            ctx->mainzisegmap_intragroup_127166,
                                                                            1,
                                                                            NULL,
                                                                            global_work_sizze_136058,
                                                                            local_work_sizze_136062,
                                                                            0,
                                                                            NULL,
                                                                            ctx->profiling_paused ||
                                                                            !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                      &ctx->mainzisegmap_intragroup_127166_runs,
                                                                                                                      &ctx->mainzisegmap_intragroup_127166_total_runtime)));
                            if (ctx->debugging) {
                                OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                time_end_136060 = get_wall_time();
                                
                                long time_diff_136061 = time_end_136060 -
                                     time_start_136059;
                                
                                fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                        "main.segmap_intragroup_127166",
                                        time_diff_136061);
                            }
                        }
                        if (ctx->debugging)
                            fprintf(ctx->log, "%s\n", "");
                        if (memblock_set_device(ctx, &x_mem_131628, &mem_131623,
                                                "mem_131623") != 0)
                            return 1;
                        if (memblock_set_device(ctx, &x_mem_131629, &mem_131627,
                                                "mem_131627") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131627,
                                                  "mem_131627") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131623,
                                                  "mem_131623") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx,
                                            &defunc_12_lifted_use_version_res_mem_131630,
                                            &x_mem_131628, "x_mem_131628") != 0)
                        return 1;
                    if (memblock_set_device(ctx,
                                            &defunc_12_lifted_use_version_res_mem_131631,
                                            &x_mem_131629, "x_mem_131629") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &x_mem_131629,
                                              "x_mem_131629") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &x_mem_131628,
                                              "x_mem_131628") != 0)
                        return 1;
                }
                if (memblock_set_device(ctx, &defunc_11_loess_l_res_mem_131632,
                                        &defunc_12_lifted_use_version_res_mem_131630,
                                        "defunc_12_lifted_use_version_res_mem_131630") !=
                    0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_11_loess_l_res_mem_131633,
                                        &defunc_12_lifted_use_version_res_mem_131631,
                                        "defunc_12_lifted_use_version_res_mem_131631") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx,
                                          &defunc_12_lifted_use_version_res_mem_131631,
                                          "defunc_12_lifted_use_version_res_mem_131631") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx,
                                          &defunc_12_lifted_use_version_res_mem_131630,
                                          "defunc_12_lifted_use_version_res_mem_131630") !=
                    0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &defunc_4_map_res_mem_131267,
                                      "defunc_4_map_res_mem_131267") != 0)
                return 1;
            
            struct memblock_device trend_l_mem_131640;
            
            trend_l_mem_131640.references = NULL;
            if (cond_114942) {
                bool zzero_116483 = t_jump_114541 == (int64_t) 0;
                bool nonzzero_116484 = !zzero_116483;
                bool nonzzero_cert_116485;
                
                if (!nonzzero_116484) {
                    ctx->error = msgprintf("Error: %s\n\nBacktrace:\n%s",
                                           "division by zero",
                                           "-> #0  stl.fut:55:27-34\n   #1  /prelude/soacs.fut:59:3-10\n   #2  /prelude/array.fut:195:3-17\n   #3  stl.fut:54:3-67:14\n   #4  stl.fut:300:23-69\n   #5  /prelude/soacs.fut:67:19-23\n   #6  /prelude/soacs.fut:67:3-37\n   #7  stl.fut:299:15-301:43\n   #8  stl.fut:394:3-405:33\n   #9  stl.fut:381:1-405:33\n");
                    if (memblock_unref_device(ctx, &trend_l_mem_131640,
                                              "trend_l_mem_131640") != 0)
                        return 1;
                    if (memblock_unref_device(ctx,
                                              &defunc_11_loess_l_res_mem_131633,
                                              "defunc_11_loess_l_res_mem_131633") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx,
                                              &defunc_11_loess_l_res_mem_131632,
                                              "defunc_11_loess_l_res_mem_131632") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_4_map_res_mem_131267,
                                              "defunc_4_map_res_mem_131267") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_131243, "mem_131243") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &L_l_mem_131238,
                                              "L_l_mem_131238") != 0)
                        return 1;
                    if (memblock_unref_device(ctx,
                                              &defunc_11_loess_l_res_mem_131231,
                                              "defunc_11_loess_l_res_mem_131231") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx,
                                              &defunc_11_loess_l_res_mem_131230,
                                              "defunc_11_loess_l_res_mem_131230") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130856,
                                              "defunc_3_map_res_mem_130856") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_4_map_res_mem_130745,
                                              "defunc_4_map_res_mem_130745") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130667,
                                              "mem_param_130667") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130659,
                                              "mem_param_130659") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &loopres_mem_131660,
                                              "loopres_mem_131660") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &loopres_mem_131652,
                                              "loopres_mem_131652") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130645,
                                              "mem_param_130645") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130637,
                                              "mem_param_130637") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130629,
                                              "mem_param_130629") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &stl_res_mem_131994,
                                              "stl_res_mem_131994") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &stl_res_mem_131986,
                                              "stl_res_mem_131986") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &stl_res_mem_131978,
                                              "stl_res_mem_131978") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130865, "mem_130865") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130861, "mem_130861") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130750, "mem_130750") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130672, "mem_130672") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130621, "mem_130621") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130618, "mem_130618") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130615, "mem_130615") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130611, "mem_130611") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130607,
                                              "defunc_3_map_res_mem_130607") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130606,
                                              "defunc_3_map_res_mem_130606") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130405,
                                              "defunc_3_map_res_mem_130405") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130404,
                                              "defunc_3_map_res_mem_130404") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130203,
                                              "defunc_3_map_res_mem_130203") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130127, "mem_130127") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130122, "mem_130122") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                                              "defunc_3_map_res_mem_130117") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                                              "defunc_3_map_res_mem_130116") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &out_mem_132283,
                                              "out_mem_132283") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &out_mem_132282,
                                              "out_mem_132282") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &out_mem_132281,
                                              "out_mem_132281") != 0)
                        return 1;
                    return 1;
                }
                
                int64_t y_116486 = sub64(t_n_m_114591, (int64_t) 1);
                int64_t segmap_group_sizze_127533;
                
                segmap_group_sizze_127533 =
                    ctx->sizes.mainzisegmap_group_sizze_127421;
                
                int64_t segmap_usable_groups_127534 =
                        sdiv_up64(nest_sizze_116859, segmap_group_sizze_127533);
                struct memblock_device mem_131638;
                
                mem_131638.references = NULL;
                if (memblock_alloc_device(ctx, &mem_131638, bytes_130119,
                                          "mem_131638")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127418,
                                                        1,
                                                        sizeof(ctx->failure_is_an_option),
                                                        &ctx->failure_is_an_option));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127418,
                                                        3, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127418,
                                                        4, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127418,
                                                        5,
                                                        sizeof(t_jump_114541),
                                                        &t_jump_114541));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127418,
                                                        6, sizeof(t_n_m_114591),
                                                        &t_n_m_114591));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127418,
                                                        7, sizeof(i_114610),
                                                        &i_114610));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127418,
                                                        8, sizeof(y_116486),
                                                        &y_116486));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127418,
                                                        9,
                                                        sizeof(defunc_11_loess_l_res_mem_131632.mem),
                                                        &defunc_11_loess_l_res_mem_131632.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127418,
                                                        10,
                                                        sizeof(defunc_11_loess_l_res_mem_131633.mem),
                                                        &defunc_11_loess_l_res_mem_131633.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127418,
                                                        11,
                                                        sizeof(mem_131638.mem),
                                                        &mem_131638.mem));
                if (1 * ((size_t) segmap_usable_groups_127534 *
                         (size_t) segmap_group_sizze_127533) != 0) {
                    const size_t global_work_sizze_136063[1] =
                                 {(size_t) segmap_usable_groups_127534 *
                                 (size_t) segmap_group_sizze_127533};
                    const size_t local_work_sizze_136067[1] =
                                 {segmap_group_sizze_127533};
                    int64_t time_start_136064 = 0, time_end_136065 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segmap_127418");
                        fprintf(ctx->log, "%zu", global_work_sizze_136063[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_136067[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_136064 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_127418,
                                                                    1, NULL,
                                                                    global_work_sizze_136063,
                                                                    local_work_sizze_136067,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_127418_runs,
                                                                                                              &ctx->mainzisegmap_127418_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_136065 = get_wall_time();
                        
                        long time_diff_136066 = time_end_136065 -
                             time_start_136064;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_127418", time_diff_136066);
                    }
                }
                ctx->failure_is_an_option = 1;
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_set_device(ctx, &trend_l_mem_131640, &mem_131638,
                                        "mem_131638") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131638, "mem_131638") != 0)
                    return 1;
            } else {
                bool dim_match_116539 = n_114534 == t_n_m_114591;
                bool empty_or_match_cert_116540;
                
                if (!dim_match_116539) {
                    ctx->error =
                        msgprintf("Error: %s%lld%s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                                  "Value of (core language) shape (", m_114533,
                                  ", ", t_n_m_114591,
                                  ") cannot match shape of type `[", m_114533,
                                  "][", n_114534, "]t`.",
                                  "-> #0  stl.fut:303:15-36\n   #1  stl.fut:394:3-405:33\n   #2  stl.fut:381:1-405:33\n");
                    if (memblock_unref_device(ctx, &trend_l_mem_131640,
                                              "trend_l_mem_131640") != 0)
                        return 1;
                    if (memblock_unref_device(ctx,
                                              &defunc_11_loess_l_res_mem_131633,
                                              "defunc_11_loess_l_res_mem_131633") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx,
                                              &defunc_11_loess_l_res_mem_131632,
                                              "defunc_11_loess_l_res_mem_131632") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_4_map_res_mem_131267,
                                              "defunc_4_map_res_mem_131267") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_131243, "mem_131243") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &L_l_mem_131238,
                                              "L_l_mem_131238") != 0)
                        return 1;
                    if (memblock_unref_device(ctx,
                                              &defunc_11_loess_l_res_mem_131231,
                                              "defunc_11_loess_l_res_mem_131231") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx,
                                              &defunc_11_loess_l_res_mem_131230,
                                              "defunc_11_loess_l_res_mem_131230") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130856,
                                              "defunc_3_map_res_mem_130856") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_4_map_res_mem_130745,
                                              "defunc_4_map_res_mem_130745") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130667,
                                              "mem_param_130667") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130659,
                                              "mem_param_130659") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &loopres_mem_131660,
                                              "loopres_mem_131660") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &loopres_mem_131652,
                                              "loopres_mem_131652") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130645,
                                              "mem_param_130645") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130637,
                                              "mem_param_130637") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_130629,
                                              "mem_param_130629") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &stl_res_mem_131994,
                                              "stl_res_mem_131994") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &stl_res_mem_131986,
                                              "stl_res_mem_131986") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &stl_res_mem_131978,
                                              "stl_res_mem_131978") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130865, "mem_130865") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130861, "mem_130861") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130750, "mem_130750") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130672, "mem_130672") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130621, "mem_130621") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130618, "mem_130618") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130615, "mem_130615") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130611, "mem_130611") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130607,
                                              "defunc_3_map_res_mem_130607") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130606,
                                              "defunc_3_map_res_mem_130606") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130405,
                                              "defunc_3_map_res_mem_130405") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130404,
                                              "defunc_3_map_res_mem_130404") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130203,
                                              "defunc_3_map_res_mem_130203") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130127, "mem_130127") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_130122, "mem_130122") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                                              "defunc_3_map_res_mem_130117") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                                              "defunc_3_map_res_mem_130116") !=
                        0)
                        return 1;
                    if (memblock_unref_device(ctx, &out_mem_132283,
                                              "out_mem_132283") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &out_mem_132282,
                                              "out_mem_132282") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &out_mem_132281,
                                              "out_mem_132281") != 0)
                        return 1;
                    return 1;
                }
                if (memblock_set_device(ctx, &trend_l_mem_131640,
                                        &defunc_11_loess_l_res_mem_131632,
                                        "defunc_11_loess_l_res_mem_131632") !=
                    0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &defunc_11_loess_l_res_mem_131632,
                                      "defunc_11_loess_l_res_mem_131632") != 0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_11_loess_l_res_mem_131633,
                                      "defunc_11_loess_l_res_mem_131633") != 0)
                return 1;
            
            int64_t ctx_param_ext_tmp_132987 = trend_l_ixfn_131639;
            int64_t ctx_param_ext_tmp_132988 = trend_l_ixfn_131639;
            struct memblock_device mem_param_tmp_132989;
            
            mem_param_tmp_132989.references = NULL;
            if (memblock_set_device(ctx, &mem_param_tmp_132989, &mem_131243,
                                    "mem_131243") != 0)
                return 1;
            
            struct memblock_device mem_param_tmp_132990;
            
            mem_param_tmp_132990.references = NULL;
            if (memblock_set_device(ctx, &mem_param_tmp_132990,
                                    &trend_l_mem_131640,
                                    "trend_l_mem_131640") != 0)
                return 1;
            ctx_param_ext_130661 = ctx_param_ext_tmp_132987;
            ctx_param_ext_130663 = ctx_param_ext_tmp_132988;
            if (memblock_set_device(ctx, &mem_param_130659,
                                    &mem_param_tmp_132989,
                                    "mem_param_tmp_132989") != 0)
                return 1;
            if (memblock_set_device(ctx, &mem_param_130667,
                                    &mem_param_tmp_132990,
                                    "mem_param_tmp_132990") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_param_tmp_132990,
                                      "mem_param_tmp_132990") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_param_tmp_132989,
                                      "mem_param_tmp_132989") != 0)
                return 1;
            if (memblock_unref_device(ctx, &trend_l_mem_131640,
                                      "trend_l_mem_131640") != 0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_11_loess_l_res_mem_131633,
                                      "defunc_11_loess_l_res_mem_131633") != 0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_11_loess_l_res_mem_131632,
                                      "defunc_11_loess_l_res_mem_131632") != 0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_4_map_res_mem_131267,
                                      "defunc_4_map_res_mem_131267") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_131243, "mem_131243") != 0)
                return 1;
            if (memblock_unref_device(ctx, &L_l_mem_131238, "L_l_mem_131238") !=
                0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_11_loess_l_res_mem_131231,
                                      "defunc_11_loess_l_res_mem_131231") != 0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_11_loess_l_res_mem_131230,
                                      "defunc_11_loess_l_res_mem_131230") != 0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130856,
                                      "defunc_3_map_res_mem_130856") != 0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_4_map_res_mem_130745,
                                      "defunc_4_map_res_mem_130745") != 0)
                return 1;
        }
        loopres_ixfn_131654 = ctx_param_ext_130661;
        loopres_ixfn_131656 = ctx_param_ext_130663;
        if (memblock_set_device(ctx, &loopres_mem_131652, &mem_param_130659,
                                "mem_param_130659") != 0)
            return 1;
        if (memblock_set_device(ctx, &loopres_mem_131660, &mem_param_130667,
                                "mem_param_130667") != 0)
            return 1;
        
        bool cond_116542 = slt64(i_outer_115022, y_114943);
        int64_t sizze_116543;
        
        if (cond_116542) {
            sizze_116543 = n_114534;
        } else {
            sizze_116543 = loopz2081Uz2085Uz2089U_115023;
        }
        
        int64_t weights_l_ixfn_131965;
        
        if (cond_116542) {
            weights_l_ixfn_131965 = m_114533;
        } else {
            weights_l_ixfn_131965 = ctx_param_ext_130638;
        }
        
        int64_t weights_l_ixfn_131966;
        
        if (cond_116542) {
            weights_l_ixfn_131966 = n_114534;
        } else {
            weights_l_ixfn_131966 = ctx_param_ext_130639;
        }
        
        int64_t weights_l_ixfn_131967;
        
        if (cond_116542) {
            weights_l_ixfn_131967 = n_114534;
        } else {
            weights_l_ixfn_131967 = ctx_param_ext_130641;
        }
        
        int64_t weights_l_ixfn_131968;
        
        if (cond_116542) {
            weights_l_ixfn_131968 = (int64_t) 1;
        } else {
            weights_l_ixfn_131968 = ctx_param_ext_130643;
        }
        
        int64_t weights_l_ixfn_131969;
        
        if (cond_116542) {
            weights_l_ixfn_131969 = (int64_t) 0;
        } else {
            weights_l_ixfn_131969 = ctx_param_ext_130640;
        }
        
        struct memblock_device weights_l_mem_131970;
        
        weights_l_mem_131970.references = NULL;
        if (cond_116542) {
            int64_t segmap_group_sizze_127629;
            
            segmap_group_sizze_127629 =
                ctx->sizes.mainzisegmap_group_sizze_127599;
            
            int64_t segmap_usable_groups_127630 = sdiv_up64(nest_sizze_116859,
                                                            segmap_group_sizze_127629);
            struct memblock_device mem_131665;
            
            mem_131665.references = NULL;
            if (memblock_alloc_device(ctx, &mem_131665, bytes_130119,
                                      "mem_131665")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127596, 1,
                                                    sizeof(m_114533),
                                                    &m_114533));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127596, 2,
                                                    sizeof(n_114534),
                                                    &n_114534));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127596, 3,
                                                    sizeof(loopres_ixfn_131656),
                                                    &loopres_ixfn_131656));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127596, 4,
                                                    sizeof(Y_mem_130086.mem),
                                                    &Y_mem_130086.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127596, 5,
                                                    sizeof(loopres_mem_131652.mem),
                                                    &loopres_mem_131652.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127596, 6,
                                                    sizeof(loopres_mem_131660.mem),
                                                    &loopres_mem_131660.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127596, 7,
                                                    sizeof(mem_131665.mem),
                                                    &mem_131665.mem));
            if (1 * ((size_t) segmap_usable_groups_127630 *
                     (size_t) segmap_group_sizze_127629) != 0) {
                const size_t global_work_sizze_136068[1] =
                             {(size_t) segmap_usable_groups_127630 *
                             (size_t) segmap_group_sizze_127629};
                const size_t local_work_sizze_136072[1] =
                             {segmap_group_sizze_127629};
                int64_t time_start_136069 = 0, time_end_136070 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log, "Launching %s with global work size [",
                            "main.segmap_127596");
                    fprintf(ctx->log, "%zu", global_work_sizze_136068[0]);
                    fprintf(ctx->log, "] and local work size [");
                    fprintf(ctx->log, "%zu", local_work_sizze_136072[0]);
                    fprintf(ctx->log,
                            "]; local memory parameters sum to %d bytes.\n",
                            (int) 0);
                    time_start_136069 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_127596,
                                                                1, NULL,
                                                                global_work_sizze_136068,
                                                                local_work_sizze_136072,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_127596_runs,
                                                                                                          &ctx->mainzisegmap_127596_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_136070 = get_wall_time();
                    
                    long time_diff_136071 = time_end_136070 - time_start_136069;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_127596", time_diff_136071);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int64_t segmap_group_sizze_127684;
            
            segmap_group_sizze_127684 =
                ctx->sizes.mainzisegmap_group_sizze_127654;
            
            int64_t segmap_usable_groups_127685 = sdiv_up64(nest_sizze_116859,
                                                            segmap_group_sizze_127684);
            struct memblock_device mem_131670;
            
            mem_131670.references = NULL;
            if (memblock_alloc_device(ctx, &mem_131670, bytes_130119,
                                      "mem_131670")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127651, 1,
                                                    sizeof(ctx->failure_is_an_option),
                                                    &ctx->failure_is_an_option));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127651, 3,
                                                    sizeof(m_114533),
                                                    &m_114533));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127651, 4,
                                                    sizeof(n_114534),
                                                    &n_114534));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127651, 5,
                                                    sizeof(defunc_3_map_res_mem_130116.mem),
                                                    &defunc_3_map_res_mem_130116.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127651, 6,
                                                    sizeof(mem_131665.mem),
                                                    &mem_131665.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127651, 7,
                                                    sizeof(mem_131670.mem),
                                                    &mem_131670.mem));
            if (1 * ((size_t) segmap_usable_groups_127685 *
                     (size_t) segmap_group_sizze_127684) != 0) {
                const size_t global_work_sizze_136073[1] =
                             {(size_t) segmap_usable_groups_127685 *
                             (size_t) segmap_group_sizze_127684};
                const size_t local_work_sizze_136077[1] =
                             {segmap_group_sizze_127684};
                int64_t time_start_136074 = 0, time_end_136075 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log, "Launching %s with global work size [",
                            "main.segmap_127651");
                    fprintf(ctx->log, "%zu", global_work_sizze_136073[0]);
                    fprintf(ctx->log, "] and local work size [");
                    fprintf(ctx->log, "%zu", local_work_sizze_136077[0]);
                    fprintf(ctx->log,
                            "]; local memory parameters sum to %d bytes.\n",
                            (int) 0);
                    time_start_136074 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_127651,
                                                                1, NULL,
                                                                global_work_sizze_136073,
                                                                local_work_sizze_136077,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_127651_runs,
                                                                                                          &ctx->mainzisegmap_127651_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_136075 = get_wall_time();
                    
                    long time_diff_136076 = time_end_136075 - time_start_136074;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_127651", time_diff_136076);
                }
            }
            ctx->failure_is_an_option = 1;
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            
            int32_t iters_116571;
            
            if (empty_slice_114994) {
                iters_116571 = 0;
            } else {
                iters_116571 = 16;
            }
            
            bool loop_nonempty_116572 = slt32(0, iters_116571);
            bool loop_not_taken_116573 = !loop_nonempty_116572;
            bool protect_assert_disj_116574 = bounds_check_114613 ||
                 loop_not_taken_116573;
            bool index_certs_116575;
            
            if (!protect_assert_disj_116574) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", i_114610,
                              "] out of bounds for array of shape [", n_114534,
                              "].",
                              "-> #0  /prelude/array.fut:26:29-34\n   #1  lib/github.com/diku-dk/sorts/radix_sort.fut:25:24-35\n   #2  lib/github.com/diku-dk/sorts/radix_sort.fut:53:31-62\n   #3  lib/github.com/diku-dk/sorts/radix_sort.fut:104:6-36\n   #4  stl.fut:334:35-77\n   #5  stl.fut:333:28-335:40\n   #6  stl.fut:394:3-405:33\n   #7  stl.fut:381:1-405:33\n");
                if (memblock_unref_device(ctx, &mem_131670, "mem_131670") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131665, "mem_131665") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &weights_l_mem_131970,
                                          "weights_l_mem_131970") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_130667,
                                          "mem_param_130667") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_130659,
                                          "mem_param_130659") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &loopres_mem_131660,
                                          "loopres_mem_131660") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &loopres_mem_131652,
                                          "loopres_mem_131652") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_130645,
                                          "mem_param_130645") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_130637,
                                          "mem_param_130637") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_130629,
                                          "mem_param_130629") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &stl_res_mem_131994,
                                          "stl_res_mem_131994") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &stl_res_mem_131986,
                                          "stl_res_mem_131986") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &stl_res_mem_131978,
                                          "stl_res_mem_131978") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130865, "mem_130865") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130861, "mem_130861") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130750, "mem_130750") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130672, "mem_130672") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130621, "mem_130621") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130618, "mem_130618") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130615, "mem_130615") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130611, "mem_130611") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130607,
                                          "defunc_3_map_res_mem_130607") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130606,
                                          "defunc_3_map_res_mem_130606") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130405,
                                          "defunc_3_map_res_mem_130405") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130404,
                                          "defunc_3_map_res_mem_130404") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130203,
                                          "defunc_3_map_res_mem_130203") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130127, "mem_130127") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130122, "mem_130122") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                                          "defunc_3_map_res_mem_130117") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                                          "defunc_3_map_res_mem_130116") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &out_mem_132283,
                                          "out_mem_132283") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &out_mem_132282,
                                          "out_mem_132282") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &out_mem_132281,
                                          "out_mem_132281") != 0)
                    return 1;
                return 1;
            }
            
            bool suff_outer_par_127706;
            
            suff_outer_par_127706 = ctx->sizes.mainzisuff_outer_par_26 <=
                m_114533;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_outer_par_26", (long) m_114533,
                        suff_outer_par_127706 ? "true" : "false");
            
            bool suff_intra_par_127891;
            
            suff_intra_par_127891 = ctx->sizes.mainzisuff_intra_par_27 <=
                n_114534;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_intra_par_27", (long) n_114534,
                        suff_intra_par_127891 ? "true" : "false");
            
            bool intra_suff_and_fits_127894 = fits_116767 &&
                 suff_intra_par_127891;
            int64_t segmap_group_sizze_127801;
            
            segmap_group_sizze_127801 =
                ctx->sizes.mainzisegmap_group_sizze_127710;
            
            int64_t num_groups_127802;
            int32_t max_num_groups_135110;
            
            max_num_groups_135110 = ctx->sizes.mainzisegmap_num_groups_127712;
            num_groups_127802 = sext_i64_i32(smax64((int64_t) 1,
                                                    smin64(sdiv_up64(m_114533,
                                                                     segmap_group_sizze_127801),
                                                           sext_i32_i64(max_num_groups_135110))));
            
            bool suff_intra_par_128302;
            
            suff_intra_par_128302 = ctx->sizes.mainzisuff_intra_par_28 <=
                n_114534;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_intra_par_28", (long) n_114534,
                        suff_intra_par_128302 ? "true" : "false");
            
            bool intra_suff_and_fits_128303 = fits_116767 &&
                 suff_intra_par_128302;
            int64_t segscan_group_sizze_128388;
            
            segscan_group_sizze_128388 =
                ctx->sizes.mainzisegscan_group_sizze_128137;
            
            int64_t num_groups_128389;
            int32_t max_num_groups_135111;
            
            max_num_groups_135111 = ctx->sizes.mainzisegscan_num_groups_128139;
            num_groups_128389 = sext_i64_i32(smax64((int64_t) 1,
                                                    smin64(sdiv_up64(nest_sizze_116859,
                                                                     segscan_group_sizze_128388),
                                                           sext_i32_i64(max_num_groups_135111))));
            
            int64_t segmap_group_sizze_128456;
            
            segmap_group_sizze_128456 =
                ctx->sizes.mainzisegmap_group_sizze_128094;
            
            int64_t segmap_usable_groups_128457 =
                    sdiv_up_safe64(nest_sizze_116859,
                                   segmap_group_sizze_128456);
            int64_t double_buffer_sizze_132055 = (int64_t) 4 * n_114534;
            int64_t double_buffer_sizze_132059 = (int64_t) 4 * n_114534;
            int64_t num_threads_132263 = segmap_group_sizze_127801 *
                    num_groups_127802;
            int64_t total_sizze_132264 = double_buffer_sizze_132055 *
                    num_threads_132263;
            int64_t total_sizze_132265 = bytes_130785 * num_threads_132263;
            int64_t total_sizze_132266 = bytes_130785 * num_threads_132263;
            int64_t total_sizze_132267 = bytes_130089 * num_threads_132263;
            int64_t total_sizze_132268 = bytes_130089 * num_threads_132263;
            int64_t total_sizze_132269 = bytes_130089 * num_threads_132263;
            int64_t total_sizze_132270 = bytes_130089 * num_threads_132263;
            int64_t total_sizze_132272 = m_114533 * double_buffer_sizze_132059;
            struct memblock_device defunc_3_map_res_mem_131929;
            
            defunc_3_map_res_mem_131929.references = NULL;
            
            int32_t local_memory_capacity_135312;
            
            local_memory_capacity_135312 = ctx->opencl.max_local_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_135312)) &&
                suff_outer_par_127706) {
                struct memblock_device mem_131673;
                
                mem_131673.references = NULL;
                if (memblock_alloc_device(ctx, &mem_131673, binop_y_130121,
                                          "mem_131673")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_131673,
                                                          (int64_t) 0,
                                                          mem_131670,
                                                          (int64_t) 0,
                                                          (int64_t) 1, n_114534,
                                                          m_114533) != 0) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_131787;
                
                mem_131787.references = NULL;
                if (memblock_alloc_device(ctx, &mem_131787, binop_y_130121,
                                          "mem_131787")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_132135;
                
                color_132135.references = NULL;
                if (memblock_alloc_device(ctx, &color_132135,
                                          total_sizze_132264, "color_132135")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_132136;
                
                color_132136.references = NULL;
                if (memblock_alloc_device(ctx, &color_132136,
                                          total_sizze_132265, "color_132136")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_132137;
                
                color_132137.references = NULL;
                if (memblock_alloc_device(ctx, &color_132137,
                                          total_sizze_132266, "color_132137")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_132138;
                
                color_132138.references = NULL;
                if (memblock_alloc_device(ctx, &color_132138,
                                          total_sizze_132267, "color_132138")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_132139;
                
                color_132139.references = NULL;
                if (memblock_alloc_device(ctx, &color_132139,
                                          total_sizze_132268, "color_132139")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_132140;
                
                color_132140.references = NULL;
                if (memblock_alloc_device(ctx, &color_132140,
                                          total_sizze_132269, "color_132140")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device color_132141;
                
                color_132141.references = NULL;
                if (memblock_alloc_device(ctx, &color_132141,
                                          total_sizze_132270, "color_132141")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127708,
                                                        1, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127708,
                                                        2, sizeof(n_114534),
                                                        &n_114534));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127708,
                                                        3, sizeof(i_114610),
                                                        &i_114610));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127708,
                                                        4, sizeof(iters_116571),
                                                        &iters_116571));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127708,
                                                        5,
                                                        sizeof(num_groups_127802),
                                                        &num_groups_127802));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127708,
                                                        6,
                                                        sizeof(num_threads_132263),
                                                        &num_threads_132263));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127708,
                                                        7,
                                                        sizeof(mem_131673.mem),
                                                        &mem_131673.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127708,
                                                        8,
                                                        sizeof(mem_131787.mem),
                                                        &mem_131787.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127708,
                                                        9,
                                                        sizeof(color_132135.mem),
                                                        &color_132135.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127708,
                                                        10,
                                                        sizeof(color_132136.mem),
                                                        &color_132136.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127708,
                                                        11,
                                                        sizeof(color_132137.mem),
                                                        &color_132137.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127708,
                                                        12,
                                                        sizeof(color_132138.mem),
                                                        &color_132138.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127708,
                                                        13,
                                                        sizeof(color_132139.mem),
                                                        &color_132139.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127708,
                                                        14,
                                                        sizeof(color_132140.mem),
                                                        &color_132140.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_127708,
                                                        15,
                                                        sizeof(color_132141.mem),
                                                        &color_132141.mem));
                if (1 * ((size_t) num_groups_127802 *
                         (size_t) segmap_group_sizze_127801) != 0) {
                    const size_t global_work_sizze_136078[1] =
                                 {(size_t) num_groups_127802 *
                                 (size_t) segmap_group_sizze_127801};
                    const size_t local_work_sizze_136082[1] =
                                 {segmap_group_sizze_127801};
                    int64_t time_start_136079 = 0, time_end_136080 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segmap_127708");
                        fprintf(ctx->log, "%zu", global_work_sizze_136078[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_136082[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_136079 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_127708,
                                                                    1, NULL,
                                                                    global_work_sizze_136078,
                                                                    local_work_sizze_136082,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_127708_runs,
                                                                                                              &ctx->mainzisegmap_127708_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_136080 = get_wall_time();
                        
                        long time_diff_136081 = time_end_136080 -
                             time_start_136079;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_127708", time_diff_136081);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_131673, "mem_131673") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132135, "color_132135") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132136, "color_132136") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132137, "color_132137") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132138, "color_132138") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132139, "color_132139") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132140, "color_132140") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132141, "color_132141") !=
                    0)
                    return 1;
                
                struct memblock_device mem_131922;
                
                mem_131922.references = NULL;
                if (memblock_alloc_device(ctx, &mem_131922, bytes_130119,
                                          "mem_131922")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_131922,
                                                          (int64_t) 0,
                                                          mem_131787,
                                                          (int64_t) 0,
                                                          (int64_t) 1, m_114533,
                                                          n_114534) != 0) {
                    err = 1;
                    goto cleanup;
                }
                if (memblock_unref_device(ctx, &mem_131787, "mem_131787") != 0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_3_map_res_mem_131929,
                                        &mem_131922, "mem_131922") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131922, "mem_131922") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132141, "color_132141") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132140, "color_132140") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132139, "color_132139") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132138, "color_132138") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132137, "color_132137") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132136, "color_132136") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &color_132135, "color_132135") !=
                    0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131787, "mem_131787") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131673, "mem_131673") != 0)
                    return 1;
            } else {
                struct memblock_device defunc_3_map_res_mem_131918;
                
                defunc_3_map_res_mem_131918.references = NULL;
                
                int32_t local_memory_capacity_135311;
                
                local_memory_capacity_135311 = ctx->opencl.max_local_memory;
                if (sle64(bytes_130785 + srem64((int64_t) 8 -
                                                srem64(bytes_130785,
                                                       (int64_t) 8),
                                                (int64_t) 8) + (bytes_130785 +
                                                                srem64((int64_t) 8 -
                                                                       srem64(bytes_130785,
                                                                              (int64_t) 8),
                                                                       (int64_t) 8)) +
                          (bytes_130089 + srem64((int64_t) 8 -
                                                 srem64(bytes_130089,
                                                        (int64_t) 8),
                                                 (int64_t) 8)) + (bytes_130089 +
                                                                  srem64((int64_t) 8 -
                                                                         srem64(bytes_130089,
                                                                                (int64_t) 8),
                                                                         (int64_t) 8)) +
                          (bytes_130089 + srem64((int64_t) 8 -
                                                 srem64(bytes_130089,
                                                        (int64_t) 8),
                                                 (int64_t) 8)) + (bytes_130089 +
                                                                  srem64((int64_t) 8 -
                                                                         srem64(bytes_130089,
                                                                                (int64_t) 8),
                                                                         (int64_t) 8)),
                          sext_i32_i64(local_memory_capacity_135311)) &&
                    intra_suff_and_fits_127894) {
                    struct memblock_device mem_131838;
                    
                    mem_131838.references = NULL;
                    if (memblock_alloc_device(ctx, &mem_131838, bytes_130119,
                                              "mem_131838")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device color_132142;
                    
                    color_132142.references = NULL;
                    if (memblock_alloc_device(ctx, &color_132142,
                                              total_sizze_132272,
                                              "color_132142")) {
                        err = 1;
                        goto cleanup;
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "\n# SegMap");
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127704,
                                                            1, bytes_130089,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127704,
                                                            2, bytes_130089,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127704,
                                                            3, bytes_130089,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127704,
                                                            4, bytes_130089,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127704,
                                                            5, bytes_130785,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127704,
                                                            6, bytes_130785,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127704,
                                                            7, sizeof(m_114533),
                                                            &m_114533));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127704,
                                                            8, sizeof(n_114534),
                                                            &n_114534));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127704,
                                                            9, sizeof(i_114610),
                                                            &i_114610));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127704,
                                                            10,
                                                            sizeof(iters_116571),
                                                            &iters_116571));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127704,
                                                            11,
                                                            sizeof(mem_131670.mem),
                                                            &mem_131670.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127704,
                                                            12,
                                                            sizeof(mem_131838.mem),
                                                            &mem_131838.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127704,
                                                            13,
                                                            sizeof(color_132142.mem),
                                                            &color_132142.mem));
                    if (1 * ((size_t) m_114533 * (size_t) n_114534) != 0) {
                        const size_t global_work_sizze_136083[1] =
                                     {(size_t) m_114533 * (size_t) n_114534};
                        const size_t local_work_sizze_136087[1] = {n_114534};
                        int64_t time_start_136084 = 0, time_end_136085 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [",
                                    "main.segmap_intragroup_127704");
                            fprintf(ctx->log, "%zu",
                                    global_work_sizze_136083[0]);
                            fprintf(ctx->log, "] and local work size [");
                            fprintf(ctx->log, "%zu",
                                    local_work_sizze_136087[0]);
                            fprintf(ctx->log,
                                    "]; local memory parameters sum to %d bytes.\n",
                                    (int) (0 + bytes_130089 + bytes_130089 +
                                           bytes_130089 + bytes_130089 +
                                           bytes_130785 + bytes_130785));
                            time_start_136084 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegmap_intragroup_127704,
                                                                        1, NULL,
                                                                        global_work_sizze_136083,
                                                                        local_work_sizze_136087,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegmap_intragroup_127704_runs,
                                                                                                                  &ctx->mainzisegmap_intragroup_127704_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_136085 = get_wall_time();
                            
                            long time_diff_136086 = time_end_136085 -
                                 time_start_136084;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segmap_intragroup_127704",
                                    time_diff_136086);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &color_132142,
                                              "color_132142") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &defunc_3_map_res_mem_131918,
                                            &mem_131838, "mem_131838") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &color_132142,
                                              "color_132142") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_131838, "mem_131838") !=
                        0)
                        return 1;
                } else {
                    struct memblock_device defunc_3_map_res_mem_131910;
                    
                    defunc_3_map_res_mem_131910.references = NULL;
                    
                    struct memblock_device mem_param_131846;
                    
                    mem_param_131846.references = NULL;
                    if (memblock_set_device(ctx, &mem_param_131846, &mem_131670,
                                            "mem_131670") != 0)
                        return 1;
                    for (int32_t i_128290 = 0; i_128290 < iters_116571;
                         i_128290++) {
                        int32_t defunc_2_radix_sort_step_arg_128292 = mul32(2,
                                                                            i_128290);
                        int32_t defunc_0_get_bit_arg_128293 = add32(1,
                                                                    defunc_2_radix_sort_step_arg_128292);
                        bool cond_f_res_128294 = defunc_0_get_bit_arg_128293 ==
                             31;
                        bool cond_f_res_128295 =
                             defunc_2_radix_sort_step_arg_128292 == 31;
                        struct memblock_device mem_131852;
                        
                        mem_131852.references = NULL;
                        if (memblock_alloc_device(ctx, &mem_131852,
                                                  bytes_130119, "mem_131852")) {
                            err = 1;
                            goto cleanup;
                        }
                        if (m_114533 * n_114534 * (int64_t) 4 > 0) {
                            OPENCL_SUCCEED_OR_RETURN(clEnqueueCopyBuffer(ctx->opencl.queue,
                                                                         mem_param_131846.mem,
                                                                         mem_131852.mem,
                                                                         (int64_t) 0,
                                                                         (int64_t) 0,
                                                                         m_114533 *
                                                                         n_114534 *
                                                                         (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));
                        }
                        
                        struct memblock_device
                        defunc_2_radix_sort_res_mem_131900;
                        
                        defunc_2_radix_sort_res_mem_131900.references = NULL;
                        
                        int32_t local_memory_capacity_135310;
                        
                        local_memory_capacity_135310 =
                            ctx->opencl.max_local_memory;
                        if (sle64(bytes_130785 + srem64((int64_t) 8 -
                                                        srem64(bytes_130785,
                                                               (int64_t) 8),
                                                        (int64_t) 8) +
                                  (bytes_130089 + srem64((int64_t) 8 -
                                                         srem64(bytes_130089,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_130089 + srem64((int64_t) 8 -
                                                         srem64(bytes_130089,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_130089 + srem64((int64_t) 8 -
                                                         srem64(bytes_130089,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_130089 + srem64((int64_t) 8 -
                                                         srem64(bytes_130089,
                                                                (int64_t) 8),
                                                         (int64_t) 8)) +
                                  (bytes_130785 + srem64((int64_t) 8 -
                                                         srem64(bytes_130785,
                                                                (int64_t) 8),
                                                         (int64_t) 8)),
                                  sext_i32_i64(local_memory_capacity_135310)) &&
                            intra_suff_and_fits_128303) {
                            struct memblock_device mem_131877;
                            
                            mem_131877.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131877,
                                                      bytes_130119,
                                                      "mem_131877")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127994,
                                                                    1,
                                                                    bytes_130785,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127994,
                                                                    2,
                                                                    bytes_130089,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127994,
                                                                    3,
                                                                    bytes_130089,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127994,
                                                                    4,
                                                                    bytes_130089,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127994,
                                                                    5,
                                                                    bytes_130089,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127994,
                                                                    6,
                                                                    bytes_130785,
                                                                    NULL));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127994,
                                                                    7,
                                                                    sizeof(m_114533),
                                                                    &m_114533));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127994,
                                                                    8,
                                                                    sizeof(n_114534),
                                                                    &n_114534));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127994,
                                                                    9,
                                                                    sizeof(i_114610),
                                                                    &i_114610));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127994,
                                                                    10,
                                                                    sizeof(defunc_2_radix_sort_step_arg_128292),
                                                                    &defunc_2_radix_sort_step_arg_128292));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127994,
                                                                    11,
                                                                    sizeof(defunc_0_get_bit_arg_128293),
                                                                    &defunc_0_get_bit_arg_128293));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127994,
                                                                    12,
                                                                    sizeof(cond_f_res_128294),
                                                                    &cond_f_res_128294));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127994,
                                                                    13,
                                                                    sizeof(cond_f_res_128295),
                                                                    &cond_f_res_128295));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127994,
                                                                    14,
                                                                    sizeof(mem_param_131846.mem),
                                                                    &mem_param_131846.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127994,
                                                                    15,
                                                                    sizeof(mem_131852.mem),
                                                                    &mem_131852.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_intragroup_127994,
                                                                    16,
                                                                    sizeof(mem_131877.mem),
                                                                    &mem_131877.mem));
                            if (1 * ((size_t) m_114533 * (size_t) n_114534) !=
                                0) {
                                const size_t global_work_sizze_136088[1] =
                                             {(size_t) m_114533 *
                                             (size_t) n_114534};
                                const size_t local_work_sizze_136092[1] =
                                             {n_114534};
                                int64_t time_start_136089 = 0, time_end_136090 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [",
                                            "main.segmap_intragroup_127994");
                                    fprintf(ctx->log, "%zu",
                                            global_work_sizze_136088[0]);
                                    fprintf(ctx->log,
                                            "] and local work size [");
                                    fprintf(ctx->log, "%zu",
                                            local_work_sizze_136092[0]);
                                    fprintf(ctx->log,
                                            "]; local memory parameters sum to %d bytes.\n",
                                            (int) (0 + bytes_130785 +
                                                   bytes_130089 + bytes_130089 +
                                                   bytes_130089 + bytes_130089 +
                                                   bytes_130785));
                                    time_start_136089 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_intragroup_127994,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_136088,
                                                                                local_work_sizze_136092,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_intragroup_127994_runs,
                                                                                                                          &ctx->mainzisegmap_intragroup_127994_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_136090 = get_wall_time();
                                    
                                    long time_diff_136091 = time_end_136090 -
                                         time_start_136089;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_intragroup_127994",
                                            time_diff_136091);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_set_device(ctx,
                                                    &defunc_2_radix_sort_res_mem_131900,
                                                    &mem_131877,
                                                    "mem_131877") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131877,
                                                      "mem_131877") != 0)
                                return 1;
                        } else {
                            struct memblock_device mem_131882;
                            
                            mem_131882.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131882,
                                                      bytes_130096,
                                                      "mem_131882")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131886;
                            
                            mem_131886.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131886,
                                                      bytes_130096,
                                                      "mem_131886")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131890;
                            
                            mem_131890.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131890,
                                                      bytes_130096,
                                                      "mem_131890")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131894;
                            
                            mem_131894.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131894,
                                                      bytes_130096,
                                                      "mem_131894")) {
                                err = 1;
                                goto cleanup;
                            }
                            
                            struct memblock_device mem_131898;
                            
                            mem_131898.references = NULL;
                            if (memblock_alloc_device(ctx, &mem_131898,
                                                      bytes_130119,
                                                      "mem_131898")) {
                                err = 1;
                                goto cleanup;
                            }
                            if (slt64((int64_t) 0, m_114533 * n_114534)) {
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s\n", "\n# SegScan");
                                
                                int64_t stage1_max_num_groups_135205;
                                
                                stage1_max_num_groups_135205 =
                                    ctx->opencl.max_group_size;
                                
                                int64_t stage1_num_groups_135206 =
                                        smin64(stage1_max_num_groups_135205,
                                               num_groups_128389);
                                int32_t num_threads_135207 =
                                        sext_i64_i32(stage1_num_groups_135206 *
                                        segscan_group_sizze_128388);
                                
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_128143,
                                                                        1,
                                                                        smax64((int64_t) 1,
                                                                               (int64_t) 8 *
                                                                               segscan_group_sizze_128388),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_128143,
                                                                        2,
                                                                        smax64((int64_t) 1,
                                                                               (int64_t) 8 *
                                                                               segscan_group_sizze_128388),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_128143,
                                                                        3,
                                                                        smax64((int64_t) 1,
                                                                               (int64_t) 8 *
                                                                               segscan_group_sizze_128388),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_128143,
                                                                        4,
                                                                        smax64((int64_t) 1,
                                                                               (int64_t) 8 *
                                                                               segscan_group_sizze_128388),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_128143,
                                                                        5,
                                                                        sizeof(m_114533),
                                                                        &m_114533));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_128143,
                                                                        6,
                                                                        sizeof(n_114534),
                                                                        &n_114534));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_128143,
                                                                        7,
                                                                        sizeof(defunc_2_radix_sort_step_arg_128292),
                                                                        &defunc_2_radix_sort_step_arg_128292));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_128143,
                                                                        8,
                                                                        sizeof(defunc_0_get_bit_arg_128293),
                                                                        &defunc_0_get_bit_arg_128293));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_128143,
                                                                        9,
                                                                        sizeof(cond_f_res_128294),
                                                                        &cond_f_res_128294));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_128143,
                                                                        10,
                                                                        sizeof(cond_f_res_128295),
                                                                        &cond_f_res_128295));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_128143,
                                                                        11,
                                                                        sizeof(num_threads_135207),
                                                                        &num_threads_135207));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_128143,
                                                                        12,
                                                                        sizeof(mem_param_131846.mem),
                                                                        &mem_param_131846.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_128143,
                                                                        13,
                                                                        sizeof(mem_131882.mem),
                                                                        &mem_131882.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_128143,
                                                                        14,
                                                                        sizeof(mem_131886.mem),
                                                                        &mem_131886.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_128143,
                                                                        15,
                                                                        sizeof(mem_131890.mem),
                                                                        &mem_131890.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_128143,
                                                                        16,
                                                                        sizeof(mem_131894.mem),
                                                                        &mem_131894.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage1_128143,
                                                                        17,
                                                                        sizeof(mem_131898.mem),
                                                                        &mem_131898.mem));
                                if (1 * ((size_t) stage1_num_groups_135206 *
                                         (size_t) segscan_group_sizze_128388) !=
                                    0) {
                                    const size_t global_work_sizze_136093[1] =
                                                 {(size_t) stage1_num_groups_135206 *
                                                 (size_t) segscan_group_sizze_128388};
                                    const size_t local_work_sizze_136097[1] =
                                                 {segscan_group_sizze_128388};
                                    int64_t time_start_136094 = 0,
                                            time_end_136095 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [",
                                                "main.scan_stage1_128143");
                                        fprintf(ctx->log, "%zu",
                                                global_work_sizze_136093[0]);
                                        fprintf(ctx->log,
                                                "] and local work size [");
                                        fprintf(ctx->log, "%zu",
                                                local_work_sizze_136097[0]);
                                        fprintf(ctx->log,
                                                "]; local memory parameters sum to %d bytes.\n",
                                                (int) (0 + smax64((int64_t) 1,
                                                                  (int64_t) 8 *
                                                                  segscan_group_sizze_128388) +
                                                       smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              segscan_group_sizze_128388) +
                                                       smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              segscan_group_sizze_128388) +
                                                       smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              segscan_group_sizze_128388)));
                                        time_start_136094 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainziscan_stage1_128143,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_136093,
                                                                                    local_work_sizze_136097,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainziscan_stage1_128143_runs,
                                                                                                                              &ctx->mainziscan_stage1_128143_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_136095 = get_wall_time();
                                        
                                        long time_diff_136096 =
                                             time_end_136095 -
                                             time_start_136094;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.scan_stage1_128143",
                                                time_diff_136096);
                                    }
                                }
                                if (ctx->debugging)
                                    fprintf(ctx->log, "%s: %llu%c",
                                            "elems_per_group",
                                            (long long) (segscan_group_sizze_128388 *
                                                         sdiv_up64(m_114533 *
                                                                   n_114534,
                                                                   sext_i32_i64(num_threads_135207))),
                                            '\n');
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_128143,
                                                                        1,
                                                                        smax64((int64_t) 1,
                                                                               (int64_t) 8 *
                                                                               stage1_num_groups_135206),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_128143,
                                                                        2,
                                                                        smax64((int64_t) 1,
                                                                               (int64_t) 8 *
                                                                               stage1_num_groups_135206),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_128143,
                                                                        3,
                                                                        smax64((int64_t) 1,
                                                                               (int64_t) 8 *
                                                                               stage1_num_groups_135206),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_128143,
                                                                        4,
                                                                        smax64((int64_t) 1,
                                                                               (int64_t) 8 *
                                                                               stage1_num_groups_135206),
                                                                        NULL));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_128143,
                                                                        5,
                                                                        sizeof(m_114533),
                                                                        &m_114533));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_128143,
                                                                        6,
                                                                        sizeof(n_114534),
                                                                        &n_114534));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_128143,
                                                                        7,
                                                                        sizeof(stage1_num_groups_135206),
                                                                        &stage1_num_groups_135206));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_128143,
                                                                        8,
                                                                        sizeof(num_threads_135207),
                                                                        &num_threads_135207));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_128143,
                                                                        9,
                                                                        sizeof(mem_131882.mem),
                                                                        &mem_131882.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_128143,
                                                                        10,
                                                                        sizeof(mem_131886.mem),
                                                                        &mem_131886.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_128143,
                                                                        11,
                                                                        sizeof(mem_131890.mem),
                                                                        &mem_131890.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage2_128143,
                                                                        12,
                                                                        sizeof(mem_131894.mem),
                                                                        &mem_131894.mem));
                                if (1 * ((size_t) (int64_t) 1 *
                                         (size_t) stage1_num_groups_135206) !=
                                    0) {
                                    const size_t global_work_sizze_136098[1] =
                                                 {(size_t) (int64_t) 1 *
                                                 (size_t) stage1_num_groups_135206};
                                    const size_t local_work_sizze_136102[1] =
                                                 {stage1_num_groups_135206};
                                    int64_t time_start_136099 = 0,
                                            time_end_136100 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [",
                                                "main.scan_stage2_128143");
                                        fprintf(ctx->log, "%zu",
                                                global_work_sizze_136098[0]);
                                        fprintf(ctx->log,
                                                "] and local work size [");
                                        fprintf(ctx->log, "%zu",
                                                local_work_sizze_136102[0]);
                                        fprintf(ctx->log,
                                                "]; local memory parameters sum to %d bytes.\n",
                                                (int) (0 + smax64((int64_t) 1,
                                                                  (int64_t) 8 *
                                                                  stage1_num_groups_135206) +
                                                       smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              stage1_num_groups_135206) +
                                                       smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              stage1_num_groups_135206) +
                                                       smax64((int64_t) 1,
                                                              (int64_t) 8 *
                                                              stage1_num_groups_135206)));
                                        time_start_136099 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainziscan_stage2_128143,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_136098,
                                                                                    local_work_sizze_136102,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainziscan_stage2_128143_runs,
                                                                                                                              &ctx->mainziscan_stage2_128143_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_136100 = get_wall_time();
                                        
                                        long time_diff_136101 =
                                             time_end_136100 -
                                             time_start_136099;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.scan_stage2_128143",
                                                time_diff_136101);
                                    }
                                }
                                
                                int32_t required_groups_135288 =
                                        sext_i64_i32(sdiv_up64(m_114533 *
                                                               n_114534,
                                                               segscan_group_sizze_128388));
                                
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_128143,
                                                                        1,
                                                                        sizeof(m_114533),
                                                                        &m_114533));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_128143,
                                                                        2,
                                                                        sizeof(n_114534),
                                                                        &n_114534));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_128143,
                                                                        3,
                                                                        sizeof(num_groups_128389),
                                                                        &num_groups_128389));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_128143,
                                                                        4,
                                                                        sizeof(num_threads_135207),
                                                                        &num_threads_135207));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_128143,
                                                                        5,
                                                                        sizeof(required_groups_135288),
                                                                        &required_groups_135288));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_128143,
                                                                        6,
                                                                        sizeof(mem_131882.mem),
                                                                        &mem_131882.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_128143,
                                                                        7,
                                                                        sizeof(mem_131886.mem),
                                                                        &mem_131886.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_128143,
                                                                        8,
                                                                        sizeof(mem_131890.mem),
                                                                        &mem_131890.mem));
                                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainziscan_stage3_128143,
                                                                        9,
                                                                        sizeof(mem_131894.mem),
                                                                        &mem_131894.mem));
                                if (1 * ((size_t) num_groups_128389 *
                                         (size_t) segscan_group_sizze_128388) !=
                                    0) {
                                    const size_t global_work_sizze_136103[1] =
                                                 {(size_t) num_groups_128389 *
                                                 (size_t) segscan_group_sizze_128388};
                                    const size_t local_work_sizze_136107[1] =
                                                 {segscan_group_sizze_128388};
                                    int64_t time_start_136104 = 0,
                                            time_end_136105 = 0;
                                    
                                    if (ctx->debugging) {
                                        fprintf(ctx->log,
                                                "Launching %s with global work size [",
                                                "main.scan_stage3_128143");
                                        fprintf(ctx->log, "%zu",
                                                global_work_sizze_136103[0]);
                                        fprintf(ctx->log,
                                                "] and local work size [");
                                        fprintf(ctx->log, "%zu",
                                                local_work_sizze_136107[0]);
                                        fprintf(ctx->log,
                                                "]; local memory parameters sum to %d bytes.\n",
                                                (int) 0);
                                        time_start_136104 = get_wall_time();
                                    }
                                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                    ctx->mainziscan_stage3_128143,
                                                                                    1,
                                                                                    NULL,
                                                                                    global_work_sizze_136103,
                                                                                    local_work_sizze_136107,
                                                                                    0,
                                                                                    NULL,
                                                                                    ctx->profiling_paused ||
                                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                              &ctx->mainziscan_stage3_128143_runs,
                                                                                                                              &ctx->mainziscan_stage3_128143_total_runtime)));
                                    if (ctx->debugging) {
                                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                        time_end_136105 = get_wall_time();
                                        
                                        long time_diff_136106 =
                                             time_end_136105 -
                                             time_start_136104;
                                        
                                        fprintf(ctx->log,
                                                "kernel %s runtime: %ldus\n",
                                                "main.scan_stage3_128143",
                                                time_diff_136106);
                                    }
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "\n# SegMap");
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128091,
                                                                    1,
                                                                    sizeof(m_114533),
                                                                    &m_114533));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128091,
                                                                    2,
                                                                    sizeof(n_114534),
                                                                    &n_114534));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128091,
                                                                    3,
                                                                    sizeof(i_114610),
                                                                    &i_114610));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128091,
                                                                    4,
                                                                    sizeof(mem_param_131846.mem),
                                                                    &mem_param_131846.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128091,
                                                                    5,
                                                                    sizeof(mem_131852.mem),
                                                                    &mem_131852.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128091,
                                                                    6,
                                                                    sizeof(mem_131882.mem),
                                                                    &mem_131882.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128091,
                                                                    7,
                                                                    sizeof(mem_131886.mem),
                                                                    &mem_131886.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128091,
                                                                    8,
                                                                    sizeof(mem_131890.mem),
                                                                    &mem_131890.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128091,
                                                                    9,
                                                                    sizeof(mem_131894.mem),
                                                                    &mem_131894.mem));
                            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128091,
                                                                    10,
                                                                    sizeof(mem_131898.mem),
                                                                    &mem_131898.mem));
                            if (1 * ((size_t) segmap_usable_groups_128457 *
                                     (size_t) segmap_group_sizze_128456) != 0) {
                                const size_t global_work_sizze_136108[1] =
                                             {(size_t) segmap_usable_groups_128457 *
                                             (size_t) segmap_group_sizze_128456};
                                const size_t local_work_sizze_136112[1] =
                                             {segmap_group_sizze_128456};
                                int64_t time_start_136109 = 0, time_end_136110 =
                                        0;
                                
                                if (ctx->debugging) {
                                    fprintf(ctx->log,
                                            "Launching %s with global work size [",
                                            "main.segmap_128091");
                                    fprintf(ctx->log, "%zu",
                                            global_work_sizze_136108[0]);
                                    fprintf(ctx->log,
                                            "] and local work size [");
                                    fprintf(ctx->log, "%zu",
                                            local_work_sizze_136112[0]);
                                    fprintf(ctx->log,
                                            "]; local memory parameters sum to %d bytes.\n",
                                            (int) 0);
                                    time_start_136109 = get_wall_time();
                                }
                                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                                ctx->mainzisegmap_128091,
                                                                                1,
                                                                                NULL,
                                                                                global_work_sizze_136108,
                                                                                local_work_sizze_136112,
                                                                                0,
                                                                                NULL,
                                                                                ctx->profiling_paused ||
                                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                          &ctx->mainzisegmap_128091_runs,
                                                                                                                          &ctx->mainzisegmap_128091_total_runtime)));
                                if (ctx->debugging) {
                                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                                    time_end_136110 = get_wall_time();
                                    
                                    long time_diff_136111 = time_end_136110 -
                                         time_start_136109;
                                    
                                    fprintf(ctx->log,
                                            "kernel %s runtime: %ldus\n",
                                            "main.segmap_128091",
                                            time_diff_136111);
                                }
                            }
                            if (ctx->debugging)
                                fprintf(ctx->log, "%s\n", "");
                            if (memblock_unref_device(ctx, &mem_131882,
                                                      "mem_131882") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131886,
                                                      "mem_131886") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131890,
                                                      "mem_131890") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131894,
                                                      "mem_131894") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131898,
                                                      "mem_131898") != 0)
                                return 1;
                            if (memblock_set_device(ctx,
                                                    &defunc_2_radix_sort_res_mem_131900,
                                                    &mem_131852,
                                                    "mem_131852") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131898,
                                                      "mem_131898") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131894,
                                                      "mem_131894") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131890,
                                                      "mem_131890") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131886,
                                                      "mem_131886") != 0)
                                return 1;
                            if (memblock_unref_device(ctx, &mem_131882,
                                                      "mem_131882") != 0)
                                return 1;
                        }
                        if (memblock_unref_device(ctx, &mem_131852,
                                                  "mem_131852") != 0)
                            return 1;
                        
                        struct memblock_device mem_param_tmp_135172;
                        
                        mem_param_tmp_135172.references = NULL;
                        if (memblock_set_device(ctx, &mem_param_tmp_135172,
                                                &defunc_2_radix_sort_res_mem_131900,
                                                "defunc_2_radix_sort_res_mem_131900") !=
                            0)
                            return 1;
                        if (memblock_set_device(ctx, &mem_param_131846,
                                                &mem_param_tmp_135172,
                                                "mem_param_tmp_135172") != 0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_param_tmp_135172,
                                                  "mem_param_tmp_135172") != 0)
                            return 1;
                        if (memblock_unref_device(ctx,
                                                  &defunc_2_radix_sort_res_mem_131900,
                                                  "defunc_2_radix_sort_res_mem_131900") !=
                            0)
                            return 1;
                        if (memblock_unref_device(ctx, &mem_131852,
                                                  "mem_131852") != 0)
                            return 1;
                    }
                    if (memblock_set_device(ctx, &defunc_3_map_res_mem_131910,
                                            &mem_param_131846,
                                            "mem_param_131846") != 0)
                        return 1;
                    if (memblock_set_device(ctx, &defunc_3_map_res_mem_131918,
                                            &defunc_3_map_res_mem_131910,
                                            "defunc_3_map_res_mem_131910") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &mem_param_131846,
                                              "mem_param_131846") != 0)
                        return 1;
                    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_131910,
                                              "defunc_3_map_res_mem_131910") !=
                        0)
                        return 1;
                }
                
                struct memblock_device mem_131927;
                
                mem_131927.references = NULL;
                if (memblock_alloc_device(ctx, &mem_131927, bytes_130119,
                                          "mem_131927")) {
                    err = 1;
                    goto cleanup;
                }
                if (m_114533 * n_114534 * (int64_t) 4 > 0) {
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueCopyBuffer(ctx->opencl.queue,
                                                                 defunc_3_map_res_mem_131918.mem,
                                                                 mem_131927.mem,
                                                                 (int64_t) 0,
                                                                 (int64_t) 0,
                                                                 m_114533 *
                                                                 n_114534 *
                                                                 (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, &defunc_3_map_res_mem_131918,
                                          "defunc_3_map_res_mem_131918") != 0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_3_map_res_mem_131929,
                                        &mem_131927, "mem_131927") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131927, "mem_131927") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &defunc_3_map_res_mem_131918,
                                          "defunc_3_map_res_mem_131918") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &mem_131670, "mem_131670") != 0)
                return 1;
            
            bool empty_slice_116689 = j_m_i_115007 == (int64_t) 0;
            int64_t m_116690 = sub64(j_m_i_115007, (int64_t) 1);
            int64_t i_p_m_t_s_116691 = add64(stl_res_114604, m_116690);
            bool zzero_leq_i_p_m_t_s_116692 = sle64((int64_t) 0,
                                                    i_p_m_t_s_116691);
            bool i_p_m_t_s_leq_w_116693 = slt64(i_p_m_t_s_116691, n_114534);
            bool zzero_lte_i_116694 = sle64((int64_t) 0, stl_res_114604);
            bool i_lte_j_116695 = sle64(stl_res_114604, stl_res_114605);
            bool y_116696 = i_p_m_t_s_leq_w_116693 && zzero_lte_i_116694;
            bool y_116697 = zzero_leq_i_p_m_t_s_116692 && y_116696;
            bool y_116698 = i_lte_j_116695 && y_116697;
            bool forwards_ok_116699 = zzero_lte_i_116694 && y_116698;
            bool ok_or_empty_116700 = empty_slice_116689 || forwards_ok_116699;
            bool index_certs_116701;
            
            if (!ok_or_empty_116700) {
                ctx->error =
                    msgprintf("Error: %s%lld%s%lld%s%lld%s\n\nBacktrace:\n%s",
                              "Index [", stl_res_114604, ":", stl_res_114605,
                              "] out of bounds for array of shape [", n_114534,
                              "].",
                              "-> #0  stl.fut:340:33-51\n   #1  stl.fut:338:13-345:28\n   #2  stl.fut:394:3-405:33\n   #3  stl.fut:381:1-405:33\n");
                if (memblock_unref_device(ctx, &defunc_3_map_res_mem_131929,
                                          "defunc_3_map_res_mem_131929") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131670, "mem_131670") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131665, "mem_131665") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &weights_l_mem_131970,
                                          "weights_l_mem_131970") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_130667,
                                          "mem_param_130667") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_130659,
                                          "mem_param_130659") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &loopres_mem_131660,
                                          "loopres_mem_131660") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &loopres_mem_131652,
                                          "loopres_mem_131652") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_130645,
                                          "mem_param_130645") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_130637,
                                          "mem_param_130637") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_param_130629,
                                          "mem_param_130629") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &stl_res_mem_131994,
                                          "stl_res_mem_131994") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &stl_res_mem_131986,
                                          "stl_res_mem_131986") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &stl_res_mem_131978,
                                          "stl_res_mem_131978") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130865, "mem_130865") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130861, "mem_130861") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130750, "mem_130750") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130672, "mem_130672") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130621, "mem_130621") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130618, "mem_130618") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130615, "mem_130615") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130611, "mem_130611") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130607,
                                          "defunc_3_map_res_mem_130607") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130606,
                                          "defunc_3_map_res_mem_130606") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130405,
                                          "defunc_3_map_res_mem_130405") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130404,
                                          "defunc_3_map_res_mem_130404") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130203,
                                          "defunc_3_map_res_mem_130203") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130127, "mem_130127") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_130122, "mem_130122") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                                          "defunc_3_map_res_mem_130117") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                                          "defunc_3_map_res_mem_130116") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &out_mem_132283,
                                          "out_mem_132283") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &out_mem_132282,
                                          "out_mem_132282") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &out_mem_132281,
                                          "out_mem_132281") != 0)
                    return 1;
                return 1;
            }
            
            bool suff_outer_par_128488;
            
            suff_outer_par_128488 = ctx->sizes.mainzisuff_outer_par_29 <=
                m_114533;
            if (ctx->logging)
                fprintf(ctx->log, "Compared %s <= %ld: %s.\n",
                        "main.suff_outer_par_29", (long) m_114533,
                        suff_outer_par_128488 ? "true" : "false");
            
            int64_t segmap_group_sizze_128505;
            
            segmap_group_sizze_128505 =
                ctx->sizes.mainzisegmap_group_sizze_128492;
            
            int64_t nest_sizze_128546 = m_114533 * j_m_i_115007;
            int64_t segred_group_sizze_128547;
            
            segred_group_sizze_128547 =
                ctx->sizes.mainzisegred_group_sizze_128533;
            
            int64_t num_groups_128548;
            int32_t max_num_groups_135313;
            
            max_num_groups_135313 = ctx->sizes.mainzisegred_num_groups_128535;
            num_groups_128548 = sext_i64_i32(smax64((int64_t) 1,
                                                    smin64(sdiv_up64(nest_sizze_128546,
                                                                     segred_group_sizze_128547),
                                                           sext_i32_i64(max_num_groups_135313))));
            
            int64_t segmap_group_sizze_128557;
            
            segmap_group_sizze_128557 =
                ctx->sizes.mainzisegmap_group_sizze_128523;
            
            struct memblock_device defunc_2_map_res_mem_131957;
            
            defunc_2_map_res_mem_131957.references = NULL;
            
            struct memblock_device defunc_2_map_res_mem_131958;
            
            defunc_2_map_res_mem_131958.references = NULL;
            
            struct memblock_device defunc_2_map_res_mem_131959;
            
            defunc_2_map_res_mem_131959.references = NULL;
            
            int32_t local_memory_capacity_135395;
            
            local_memory_capacity_135395 = ctx->opencl.max_local_memory;
            if (sle64((int64_t) 0,
                      sext_i32_i64(local_memory_capacity_135395)) &&
                suff_outer_par_128488) {
                int64_t segmap_usable_groups_128506 = sdiv_up64(m_114533,
                                                                segmap_group_sizze_128505);
                struct memblock_device mem_131932;
                
                mem_131932.references = NULL;
                if (memblock_alloc_device(ctx, &mem_131932, binop_y_130121,
                                          "mem_131932")) {
                    err = 1;
                    goto cleanup;
                }
                if (futrts_builtinzhgpu_map_transpose_f32(ctx, mem_131932,
                                                          (int64_t) 0,
                                                          defunc_3_map_res_mem_131929,
                                                          (int64_t) 0,
                                                          (int64_t) 1, n_114534,
                                                          m_114533) != 0) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_131936;
                
                mem_131936.references = NULL;
                if (memblock_alloc_device(ctx, &mem_131936, bytes_130331,
                                          "mem_131936")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_131939;
                
                mem_131939.references = NULL;
                if (memblock_alloc_device(ctx, &mem_131939, bytes_130331,
                                          "mem_131939")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_131942;
                
                mem_131942.references = NULL;
                if (memblock_alloc_device(ctx, &mem_131942, bytes_130331,
                                          "mem_131942")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128490,
                                                        1, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128490,
                                                        2,
                                                        sizeof(stl_res_114604),
                                                        &stl_res_114604));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128490,
                                                        3, sizeof(j_m_i_115007),
                                                        &j_m_i_115007));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128490,
                                                        4,
                                                        sizeof(mem_131932.mem),
                                                        &mem_131932.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128490,
                                                        5,
                                                        sizeof(mem_131936.mem),
                                                        &mem_131936.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128490,
                                                        6,
                                                        sizeof(mem_131939.mem),
                                                        &mem_131939.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128490,
                                                        7,
                                                        sizeof(mem_131942.mem),
                                                        &mem_131942.mem));
                if (1 * ((size_t) segmap_usable_groups_128506 *
                         (size_t) segmap_group_sizze_128505) != 0) {
                    const size_t global_work_sizze_136113[1] =
                                 {(size_t) segmap_usable_groups_128506 *
                                 (size_t) segmap_group_sizze_128505};
                    const size_t local_work_sizze_136117[1] =
                                 {segmap_group_sizze_128505};
                    int64_t time_start_136114 = 0, time_end_136115 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segmap_128490");
                        fprintf(ctx->log, "%zu", global_work_sizze_136113[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_136117[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_136114 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_128490,
                                                                    1, NULL,
                                                                    global_work_sizze_136113,
                                                                    local_work_sizze_136117,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_128490_runs,
                                                                                                              &ctx->mainzisegmap_128490_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_136115 = get_wall_time();
                        
                        long time_diff_136116 = time_end_136115 -
                             time_start_136114;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_128490", time_diff_136116);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_131932, "mem_131932") != 0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_2_map_res_mem_131957,
                                        &mem_131936, "mem_131936") != 0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_2_map_res_mem_131958,
                                        &mem_131939, "mem_131939") != 0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_2_map_res_mem_131959,
                                        &mem_131942, "mem_131942") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131942, "mem_131942") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131939, "mem_131939") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131936, "mem_131936") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131932, "mem_131932") != 0)
                    return 1;
            } else {
                struct memblock_device mem_131946;
                
                mem_131946.references = NULL;
                if (memblock_alloc_device(ctx, &mem_131946, bytes_130331,
                                          "mem_131946")) {
                    err = 1;
                    goto cleanup;
                }
                if (slt64(j_m_i_115007 * (int64_t) 2,
                          segred_group_sizze_128547)) {
                    int64_t segment_sizze_nonzzero_135323 = smax64((int64_t) 1,
                                                                   j_m_i_115007);
                    int64_t num_threads_135324 = num_groups_128548 *
                            segred_group_sizze_128547;
                    
                    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_114533, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) j_m_i_115007, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segments_per_group",
                                (long long) squot64(segred_group_sizze_128547,
                                                    segment_sizze_nonzzero_135323),
                                '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "required_groups",
                                (long long) sext_i64_i32(sdiv_up64(m_114533,
                                                                   squot64(segred_group_sizze_128547,
                                                                           segment_sizze_nonzzero_135323))),
                                '\n');
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_128539,
                                                            1, (int64_t) 4 *
                                                            segred_group_sizze_128547,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_128539,
                                                            2, sizeof(m_114533),
                                                            &m_114533));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_128539,
                                                            3, sizeof(n_114534),
                                                            &n_114534));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_128539,
                                                            4,
                                                            sizeof(stl_res_114604),
                                                            &stl_res_114604));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_128539,
                                                            5,
                                                            sizeof(j_m_i_115007),
                                                            &j_m_i_115007));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_128539,
                                                            6,
                                                            sizeof(num_groups_128548),
                                                            &num_groups_128548));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_128539,
                                                            7,
                                                            sizeof(segment_sizze_nonzzero_135323),
                                                            &segment_sizze_nonzzero_135323));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_128539,
                                                            8,
                                                            sizeof(defunc_3_map_res_mem_131929.mem),
                                                            &defunc_3_map_res_mem_131929.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_small_128539,
                                                            9,
                                                            sizeof(mem_131946.mem),
                                                            &mem_131946.mem));
                    if (1 * ((size_t) num_groups_128548 *
                             (size_t) segred_group_sizze_128547) != 0) {
                        const size_t global_work_sizze_136118[1] =
                                     {(size_t) num_groups_128548 *
                                     (size_t) segred_group_sizze_128547};
                        const size_t local_work_sizze_136122[1] =
                                     {segred_group_sizze_128547};
                        int64_t time_start_136119 = 0, time_end_136120 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [",
                                    "main.segred_small_128539");
                            fprintf(ctx->log, "%zu",
                                    global_work_sizze_136118[0]);
                            fprintf(ctx->log, "] and local work size [");
                            fprintf(ctx->log, "%zu",
                                    local_work_sizze_136122[0]);
                            fprintf(ctx->log,
                                    "]; local memory parameters sum to %d bytes.\n",
                                    (int) (0 + (int64_t) 4 *
                                           segred_group_sizze_128547));
                            time_start_136119 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_small_128539,
                                                                        1, NULL,
                                                                        global_work_sizze_136118,
                                                                        local_work_sizze_136122,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_small_128539_runs,
                                                                                                                  &ctx->mainzisegred_small_128539_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_136120 = get_wall_time();
                            
                            long time_diff_136121 = time_end_136120 -
                                 time_start_136119;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_small_128539",
                                    time_diff_136121);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                } else {
                    int64_t groups_per_segment_135346 =
                            sdiv_up64(num_groups_128548, smax64((int64_t) 1,
                                                                m_114533));
                    int64_t elements_per_thread_135347 = sdiv_up64(j_m_i_115007,
                                                                   segred_group_sizze_128547 *
                                                                   groups_per_segment_135346);
                    int64_t virt_num_groups_135348 = groups_per_segment_135346 *
                            m_114533;
                    int64_t num_threads_135349 = num_groups_128548 *
                            segred_group_sizze_128547;
                    int64_t threads_per_segment_135350 =
                            groups_per_segment_135346 *
                            segred_group_sizze_128547;
                    
                    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_114533, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "segment_size",
                                (long long) j_m_i_115007, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "virt_num_groups",
                                (long long) virt_num_groups_135348, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "num_groups",
                                (long long) num_groups_128548, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "group_size",
                                (long long) segred_group_sizze_128547, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "elems_per_thread",
                                (long long) elements_per_thread_135347, '\n');
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s: %llu%c", "groups_per_segment",
                                (long long) groups_per_segment_135346, '\n');
                    
                    struct memblock_device segred_tmp_mem_135351;
                    
                    segred_tmp_mem_135351.references = NULL;
                    if (memblock_alloc_device(ctx, &segred_tmp_mem_135351,
                                              (int64_t) 4 *
                                              virt_num_groups_135348,
                                              "segred_tmp_mem_135351")) {
                        err = 1;
                        goto cleanup;
                    }
                    
                    struct memblock_device mainzicounter_mem_135353 =
                                           ctx->mainzicounter_mem_135353;
                    
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_128539,
                                                            1, 1, NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_128539,
                                                            2, (int64_t) 4 *
                                                            segred_group_sizze_128547,
                                                            NULL));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_128539,
                                                            3, sizeof(m_114533),
                                                            &m_114533));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_128539,
                                                            4, sizeof(n_114534),
                                                            &n_114534));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_128539,
                                                            5,
                                                            sizeof(stl_res_114604),
                                                            &stl_res_114604));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_128539,
                                                            6,
                                                            sizeof(j_m_i_115007),
                                                            &j_m_i_115007));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_128539,
                                                            7,
                                                            sizeof(num_groups_128548),
                                                            &num_groups_128548));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_128539,
                                                            8,
                                                            sizeof(groups_per_segment_135346),
                                                            &groups_per_segment_135346));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_128539,
                                                            9,
                                                            sizeof(elements_per_thread_135347),
                                                            &elements_per_thread_135347));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_128539,
                                                            10,
                                                            sizeof(virt_num_groups_135348),
                                                            &virt_num_groups_135348));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_128539,
                                                            11,
                                                            sizeof(threads_per_segment_135350),
                                                            &threads_per_segment_135350));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_128539,
                                                            12,
                                                            sizeof(defunc_3_map_res_mem_131929.mem),
                                                            &defunc_3_map_res_mem_131929.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_128539,
                                                            13,
                                                            sizeof(mem_131946.mem),
                                                            &mem_131946.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_128539,
                                                            14,
                                                            sizeof(segred_tmp_mem_135351.mem),
                                                            &segred_tmp_mem_135351.mem));
                    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegred_large_128539,
                                                            15,
                                                            sizeof(mainzicounter_mem_135353.mem),
                                                            &mainzicounter_mem_135353.mem));
                    if (1 * ((size_t) num_groups_128548 *
                             (size_t) segred_group_sizze_128547) != 0) {
                        const size_t global_work_sizze_136124[1] =
                                     {(size_t) num_groups_128548 *
                                     (size_t) segred_group_sizze_128547};
                        const size_t local_work_sizze_136128[1] =
                                     {segred_group_sizze_128547};
                        int64_t time_start_136125 = 0, time_end_136126 = 0;
                        
                        if (ctx->debugging) {
                            fprintf(ctx->log,
                                    "Launching %s with global work size [",
                                    "main.segred_large_128539");
                            fprintf(ctx->log, "%zu",
                                    global_work_sizze_136124[0]);
                            fprintf(ctx->log, "] and local work size [");
                            fprintf(ctx->log, "%zu",
                                    local_work_sizze_136128[0]);
                            fprintf(ctx->log,
                                    "]; local memory parameters sum to %d bytes.\n",
                                    (int) (0 + 1 + (int64_t) 4 *
                                           segred_group_sizze_128547));
                            time_start_136125 = get_wall_time();
                        }
                        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                        ctx->mainzisegred_large_128539,
                                                                        1, NULL,
                                                                        global_work_sizze_136124,
                                                                        local_work_sizze_136128,
                                                                        0, NULL,
                                                                        ctx->profiling_paused ||
                                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                                  &ctx->mainzisegred_large_128539_runs,
                                                                                                                  &ctx->mainzisegred_large_128539_total_runtime)));
                        if (ctx->debugging) {
                            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                            time_end_136126 = get_wall_time();
                            
                            long time_diff_136127 = time_end_136126 -
                                 time_start_136125;
                            
                            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                    "main.segred_large_128539",
                                    time_diff_136127);
                        }
                    }
                    if (ctx->debugging)
                        fprintf(ctx->log, "%s\n", "");
                    if (memblock_unref_device(ctx, &segred_tmp_mem_135351,
                                              "segred_tmp_mem_135351") != 0)
                        return 1;
                }
                
                int64_t segmap_usable_groups_128558 = sdiv_up64(m_114533,
                                                                segmap_group_sizze_128557);
                struct memblock_device mem_131950;
                
                mem_131950.references = NULL;
                if (memblock_alloc_device(ctx, &mem_131950, bytes_130331,
                                          "mem_131950")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_131953;
                
                mem_131953.references = NULL;
                if (memblock_alloc_device(ctx, &mem_131953, bytes_130331,
                                          "mem_131953")) {
                    err = 1;
                    goto cleanup;
                }
                
                struct memblock_device mem_131956;
                
                mem_131956.references = NULL;
                if (memblock_alloc_device(ctx, &mem_131956, bytes_130331,
                                          "mem_131956")) {
                    err = 1;
                    goto cleanup;
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "\n# SegMap");
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128521,
                                                        1, sizeof(m_114533),
                                                        &m_114533));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128521,
                                                        2,
                                                        sizeof(mem_131946.mem),
                                                        &mem_131946.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128521,
                                                        3,
                                                        sizeof(mem_131950.mem),
                                                        &mem_131950.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128521,
                                                        4,
                                                        sizeof(mem_131953.mem),
                                                        &mem_131953.mem));
                OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128521,
                                                        5,
                                                        sizeof(mem_131956.mem),
                                                        &mem_131956.mem));
                if (1 * ((size_t) segmap_usable_groups_128558 *
                         (size_t) segmap_group_sizze_128557) != 0) {
                    const size_t global_work_sizze_136129[1] =
                                 {(size_t) segmap_usable_groups_128558 *
                                 (size_t) segmap_group_sizze_128557};
                    const size_t local_work_sizze_136133[1] =
                                 {segmap_group_sizze_128557};
                    int64_t time_start_136130 = 0, time_end_136131 = 0;
                    
                    if (ctx->debugging) {
                        fprintf(ctx->log,
                                "Launching %s with global work size [",
                                "main.segmap_128521");
                        fprintf(ctx->log, "%zu", global_work_sizze_136129[0]);
                        fprintf(ctx->log, "] and local work size [");
                        fprintf(ctx->log, "%zu", local_work_sizze_136133[0]);
                        fprintf(ctx->log,
                                "]; local memory parameters sum to %d bytes.\n",
                                (int) 0);
                        time_start_136130 = get_wall_time();
                    }
                    OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                    ctx->mainzisegmap_128521,
                                                                    1, NULL,
                                                                    global_work_sizze_136129,
                                                                    local_work_sizze_136133,
                                                                    0, NULL,
                                                                    ctx->profiling_paused ||
                                                                    !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                              &ctx->mainzisegmap_128521_runs,
                                                                                                              &ctx->mainzisegmap_128521_total_runtime)));
                    if (ctx->debugging) {
                        OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                        time_end_136131 = get_wall_time();
                        
                        long time_diff_136132 = time_end_136131 -
                             time_start_136130;
                        
                        fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                                "main.segmap_128521", time_diff_136132);
                    }
                }
                if (ctx->debugging)
                    fprintf(ctx->log, "%s\n", "");
                if (memblock_unref_device(ctx, &mem_131946, "mem_131946") != 0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_2_map_res_mem_131957,
                                        &mem_131950, "mem_131950") != 0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_2_map_res_mem_131958,
                                        &mem_131953, "mem_131953") != 0)
                    return 1;
                if (memblock_set_device(ctx, &defunc_2_map_res_mem_131959,
                                        &mem_131956, "mem_131956") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131956, "mem_131956") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131953, "mem_131953") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131950, "mem_131950") != 0)
                    return 1;
                if (memblock_unref_device(ctx, &mem_131946, "mem_131946") != 0)
                    return 1;
            }
            if (memblock_unref_device(ctx, &defunc_3_map_res_mem_131929,
                                      "defunc_3_map_res_mem_131929") != 0)
                return 1;
            
            int64_t segmap_group_sizze_128636;
            
            segmap_group_sizze_128636 =
                ctx->sizes.mainzisegmap_group_sizze_128582;
            
            int64_t segmap_usable_groups_128637 = sdiv_up64(nest_sizze_116859,
                                                            segmap_group_sizze_128636);
            struct memblock_device mem_131964;
            
            mem_131964.references = NULL;
            if (memblock_alloc_device(ctx, &mem_131964, bytes_130119,
                                      "mem_131964")) {
                err = 1;
                goto cleanup;
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "\n# SegMap");
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128579, 1,
                                                    sizeof(m_114533),
                                                    &m_114533));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128579, 2,
                                                    sizeof(n_114534),
                                                    &n_114534));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128579, 3,
                                                    sizeof(mem_131665.mem),
                                                    &mem_131665.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128579, 4,
                                                    sizeof(defunc_2_map_res_mem_131957.mem),
                                                    &defunc_2_map_res_mem_131957.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128579, 5,
                                                    sizeof(defunc_2_map_res_mem_131958.mem),
                                                    &defunc_2_map_res_mem_131958.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128579, 6,
                                                    sizeof(defunc_2_map_res_mem_131959.mem),
                                                    &defunc_2_map_res_mem_131959.mem));
            OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128579, 7,
                                                    sizeof(mem_131964.mem),
                                                    &mem_131964.mem));
            if (1 * ((size_t) segmap_usable_groups_128637 *
                     (size_t) segmap_group_sizze_128636) != 0) {
                const size_t global_work_sizze_136134[1] =
                             {(size_t) segmap_usable_groups_128637 *
                             (size_t) segmap_group_sizze_128636};
                const size_t local_work_sizze_136138[1] =
                             {segmap_group_sizze_128636};
                int64_t time_start_136135 = 0, time_end_136136 = 0;
                
                if (ctx->debugging) {
                    fprintf(ctx->log, "Launching %s with global work size [",
                            "main.segmap_128579");
                    fprintf(ctx->log, "%zu", global_work_sizze_136134[0]);
                    fprintf(ctx->log, "] and local work size [");
                    fprintf(ctx->log, "%zu", local_work_sizze_136138[0]);
                    fprintf(ctx->log,
                            "]; local memory parameters sum to %d bytes.\n",
                            (int) 0);
                    time_start_136135 = get_wall_time();
                }
                OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                                ctx->mainzisegmap_128579,
                                                                1, NULL,
                                                                global_work_sizze_136134,
                                                                local_work_sizze_136138,
                                                                0, NULL,
                                                                ctx->profiling_paused ||
                                                                !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                          &ctx->mainzisegmap_128579_runs,
                                                                                                          &ctx->mainzisegmap_128579_total_runtime)));
                if (ctx->debugging) {
                    OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
                    time_end_136136 = get_wall_time();
                    
                    long time_diff_136137 = time_end_136136 - time_start_136135;
                    
                    fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                            "main.segmap_128579", time_diff_136137);
                }
            }
            if (ctx->debugging)
                fprintf(ctx->log, "%s\n", "");
            if (memblock_unref_device(ctx, &mem_131665, "mem_131665") != 0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_2_map_res_mem_131957,
                                      "defunc_2_map_res_mem_131957") != 0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_2_map_res_mem_131958,
                                      "defunc_2_map_res_mem_131958") != 0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_2_map_res_mem_131959,
                                      "defunc_2_map_res_mem_131959") != 0)
                return 1;
            if (memblock_set_device(ctx, &weights_l_mem_131970, &mem_131964,
                                    "mem_131964") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_131964, "mem_131964") != 0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_2_map_res_mem_131959,
                                      "defunc_2_map_res_mem_131959") != 0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_2_map_res_mem_131958,
                                      "defunc_2_map_res_mem_131958") != 0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_2_map_res_mem_131957,
                                      "defunc_2_map_res_mem_131957") != 0)
                return 1;
            if (memblock_unref_device(ctx, &defunc_3_map_res_mem_131929,
                                      "defunc_3_map_res_mem_131929") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_131670, "mem_131670") != 0)
                return 1;
            if (memblock_unref_device(ctx, &mem_131665, "mem_131665") != 0)
                return 1;
        } else {
            if (memblock_set_device(ctx, &weights_l_mem_131970,
                                    &mem_param_130645, "mem_param_130645") != 0)
                return 1;
        }
        
        int64_t loopz2081Uz2085Uz2089U_tmp_132972 = sizze_116543;
        int64_t ctx_param_ext_tmp_132973 = loopres_ixfn_131654;
        int64_t ctx_param_ext_tmp_132974 = loopres_ixfn_131656;
        int64_t ctx_param_ext_tmp_132975 = weights_l_ixfn_131965;
        int64_t ctx_param_ext_tmp_132976 = weights_l_ixfn_131966;
        int64_t ctx_param_ext_tmp_132977 = weights_l_ixfn_131969;
        int64_t ctx_param_ext_tmp_132978 = weights_l_ixfn_131967;
        int64_t ctx_param_ext_tmp_132979 = weights_l_ixfn_131968;
        int64_t ctx_param_ext_tmp_132980 = sizze_116543;
        struct memblock_device mem_param_tmp_132981;
        
        mem_param_tmp_132981.references = NULL;
        if (memblock_set_device(ctx, &mem_param_tmp_132981, &loopres_mem_131652,
                                "loopres_mem_131652") != 0)
            return 1;
        
        struct memblock_device mem_param_tmp_132982;
        
        mem_param_tmp_132982.references = NULL;
        if (memblock_set_device(ctx, &mem_param_tmp_132982, &loopres_mem_131660,
                                "loopres_mem_131660") != 0)
            return 1;
        
        struct memblock_device mem_param_tmp_132983;
        
        mem_param_tmp_132983.references = NULL;
        if (memblock_set_device(ctx, &mem_param_tmp_132983,
                                &weights_l_mem_131970,
                                "weights_l_mem_131970") != 0)
            return 1;
        loopz2081Uz2085Uz2089U_115023 = loopz2081Uz2085Uz2089U_tmp_132972;
        ctx_param_ext_130631 = ctx_param_ext_tmp_132973;
        ctx_param_ext_130633 = ctx_param_ext_tmp_132974;
        ctx_param_ext_130638 = ctx_param_ext_tmp_132975;
        ctx_param_ext_130639 = ctx_param_ext_tmp_132976;
        ctx_param_ext_130640 = ctx_param_ext_tmp_132977;
        ctx_param_ext_130641 = ctx_param_ext_tmp_132978;
        ctx_param_ext_130643 = ctx_param_ext_tmp_132979;
        ctx_param_ext_130644 = ctx_param_ext_tmp_132980;
        if (memblock_set_device(ctx, &mem_param_130629, &mem_param_tmp_132981,
                                "mem_param_tmp_132981") != 0)
            return 1;
        if (memblock_set_device(ctx, &mem_param_130637, &mem_param_tmp_132982,
                                "mem_param_tmp_132982") != 0)
            return 1;
        if (memblock_set_device(ctx, &mem_param_130645, &mem_param_tmp_132983,
                                "mem_param_tmp_132983") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_tmp_132983,
                                  "mem_param_tmp_132983") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_tmp_132982,
                                  "mem_param_tmp_132982") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_tmp_132981,
                                  "mem_param_tmp_132981") != 0)
            return 1;
        if (memblock_unref_device(ctx, &weights_l_mem_131970,
                                  "weights_l_mem_131970") != 0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_130667, "mem_param_130667") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &mem_param_130659, "mem_param_130659") !=
            0)
            return 1;
        if (memblock_unref_device(ctx, &loopres_mem_131660,
                                  "loopres_mem_131660") != 0)
            return 1;
        if (memblock_unref_device(ctx, &loopres_mem_131652,
                                  "loopres_mem_131652") != 0)
            return 1;
    }
    sizze_115018 = loopz2081Uz2085Uz2089U_115023;
    stl_res_ixfn_131980 = ctx_param_ext_130631;
    stl_res_ixfn_131982 = ctx_param_ext_130633;
    stl_res_ixfn_131987 = ctx_param_ext_130638;
    stl_res_ixfn_131988 = ctx_param_ext_130639;
    stl_res_ixfn_131989 = ctx_param_ext_130640;
    stl_res_ixfn_131990 = ctx_param_ext_130641;
    stl_res_ixfn_131992 = ctx_param_ext_130643;
    stl_res_ixfn_131993 = ctx_param_ext_130644;
    if (memblock_set_device(ctx, &stl_res_mem_131978, &mem_param_130629,
                            "mem_param_130629") != 0)
        return 1;
    if (memblock_set_device(ctx, &stl_res_mem_131986, &mem_param_130637,
                            "mem_param_130637") != 0)
        return 1;
    if (memblock_set_device(ctx, &stl_res_mem_131994, &mem_param_130645,
                            "mem_param_130645") != 0)
        return 1;
    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                              "defunc_3_map_res_mem_130116") != 0)
        return 1;
    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                              "defunc_3_map_res_mem_130117") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130122, "mem_130122") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130127, "mem_130127") != 0)
        return 1;
    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130203,
                              "defunc_3_map_res_mem_130203") != 0)
        return 1;
    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130404,
                              "defunc_3_map_res_mem_130404") != 0)
        return 1;
    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130405,
                              "defunc_3_map_res_mem_130405") != 0)
        return 1;
    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130606,
                              "defunc_3_map_res_mem_130606") != 0)
        return 1;
    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130607,
                              "defunc_3_map_res_mem_130607") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130611, "mem_130611") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130615, "mem_130615") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130618, "mem_130618") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130621, "mem_130621") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130672, "mem_130672") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130750, "mem_130750") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130861, "mem_130861") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130865, "mem_130865") != 0)
        return 1;
    
    int64_t segmap_group_sizze_128697;
    
    segmap_group_sizze_128697 = ctx->sizes.mainzisegmap_group_sizze_128673;
    
    int64_t segmap_usable_groups_128698 = sdiv_up64(nest_sizze_116859,
                                                    segmap_group_sizze_128697);
    struct memblock_device mem_131999;
    
    mem_131999.references = NULL;
    if (memblock_alloc_device(ctx, &mem_131999, bytes_130119, "mem_131999")) {
        err = 1;
        goto cleanup;
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "\n# SegMap");
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128670, 1,
                                            sizeof(m_114533), &m_114533));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128670, 2,
                                            sizeof(n_114534), &n_114534));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128670, 3,
                                            sizeof(stl_res_ixfn_131982),
                                            &stl_res_ixfn_131982));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128670, 4,
                                            sizeof(Y_mem_130086.mem),
                                            &Y_mem_130086.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128670, 5,
                                            sizeof(stl_res_mem_131978.mem),
                                            &stl_res_mem_131978.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128670, 6,
                                            sizeof(stl_res_mem_131986.mem),
                                            &stl_res_mem_131986.mem));
    OPENCL_SUCCEED_OR_RETURN(clSetKernelArg(ctx->mainzisegmap_128670, 7,
                                            sizeof(mem_131999.mem),
                                            &mem_131999.mem));
    if (1 * ((size_t) segmap_usable_groups_128698 *
             (size_t) segmap_group_sizze_128697) != 0) {
        const size_t global_work_sizze_136139[1] =
                     {(size_t) segmap_usable_groups_128698 *
                     (size_t) segmap_group_sizze_128697};
        const size_t local_work_sizze_136143[1] = {segmap_group_sizze_128697};
        int64_t time_start_136140 = 0, time_end_136141 = 0;
        
        if (ctx->debugging) {
            fprintf(ctx->log, "Launching %s with global work size [",
                    "main.segmap_128670");
            fprintf(ctx->log, "%zu", global_work_sizze_136139[0]);
            fprintf(ctx->log, "] and local work size [");
            fprintf(ctx->log, "%zu", local_work_sizze_136143[0]);
            fprintf(ctx->log, "]; local memory parameters sum to %d bytes.\n",
                    (int) 0);
            time_start_136140 = get_wall_time();
        }
        OPENCL_SUCCEED_OR_RETURN(clEnqueueNDRangeKernel(ctx->opencl.queue,
                                                        ctx->mainzisegmap_128670,
                                                        1, NULL,
                                                        global_work_sizze_136139,
                                                        local_work_sizze_136143,
                                                        0, NULL,
                                                        ctx->profiling_paused ||
                                                        !ctx->profiling ? NULL : opencl_get_event(&ctx->opencl,
                                                                                                  &ctx->mainzisegmap_128670_runs,
                                                                                                  &ctx->mainzisegmap_128670_total_runtime)));
        if (ctx->debugging) {
            OPENCL_SUCCEED_FATAL(clFinish(ctx->opencl.queue));
            time_end_136141 = get_wall_time();
            
            long time_diff_136142 = time_end_136141 - time_start_136140;
            
            fprintf(ctx->log, "kernel %s runtime: %ldus\n",
                    "main.segmap_128670", time_diff_136142);
        }
    }
    if (ctx->debugging)
        fprintf(ctx->log, "%s\n", "");
    
    struct memblock_device mem_132003;
    
    mem_132003.references = NULL;
    if (memblock_alloc_device(ctx, &mem_132003, bytes_130119, "mem_132003")) {
        err = 1;
        goto cleanup;
    }
    if (m_114533 * n_114534 * (int64_t) 4 > 0) {
        OPENCL_SUCCEED_OR_RETURN(clEnqueueCopyBuffer(ctx->opencl.queue,
                                                     stl_res_mem_131978.mem,
                                                     mem_132003.mem,
                                                     (int64_t) 0, (int64_t) 0,
                                                     m_114533 * n_114534 *
                                                     (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, &stl_res_mem_131978, "stl_res_mem_131978") !=
        0)
        return 1;
    
    struct memblock_device mem_132008;
    
    mem_132008.references = NULL;
    if (memblock_alloc_device(ctx, &mem_132008, bytes_130119, "mem_132008")) {
        err = 1;
        goto cleanup;
    }
    if (m_114533 * n_114534 * (int64_t) 4 > 0) {
        OPENCL_SUCCEED_OR_RETURN(clEnqueueCopyBuffer(ctx->opencl.queue,
                                                     stl_res_mem_131986.mem,
                                                     mem_132008.mem,
                                                     (int64_t) 0, (int64_t) 0,
                                                     m_114533 * n_114534 *
                                                     (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, &stl_res_mem_131986, "stl_res_mem_131986") !=
        0)
        return 1;
    if (memblock_set_device(ctx, &out_mem_132281, &mem_132003, "mem_132003") !=
        0)
        return 1;
    if (memblock_set_device(ctx, &out_mem_132282, &mem_132008, "mem_132008") !=
        0)
        return 1;
    if (memblock_set_device(ctx, &out_mem_132283, &mem_131999, "mem_131999") !=
        0)
        return 1;
    (*out_mem_p_135466).references = NULL;
    if (memblock_set_device(ctx, &*out_mem_p_135466, &out_mem_132281,
                            "out_mem_132281") != 0)
        return 1;
    (*out_mem_p_135467).references = NULL;
    if (memblock_set_device(ctx, &*out_mem_p_135467, &out_mem_132282,
                            "out_mem_132282") != 0)
        return 1;
    (*out_mem_p_135468).references = NULL;
    if (memblock_set_device(ctx, &*out_mem_p_135468, &out_mem_132283,
                            "out_mem_132283") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_132008, "mem_132008") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_132003, "mem_132003") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_131999, "mem_131999") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_param_130645, "mem_param_130645") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_param_130637, "mem_param_130637") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_param_130629, "mem_param_130629") != 0)
        return 1;
    if (memblock_unref_device(ctx, &stl_res_mem_131994, "stl_res_mem_131994") !=
        0)
        return 1;
    if (memblock_unref_device(ctx, &stl_res_mem_131986, "stl_res_mem_131986") !=
        0)
        return 1;
    if (memblock_unref_device(ctx, &stl_res_mem_131978, "stl_res_mem_131978") !=
        0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130865, "mem_130865") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130861, "mem_130861") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130750, "mem_130750") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130672, "mem_130672") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130621, "mem_130621") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130618, "mem_130618") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130615, "mem_130615") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130611, "mem_130611") != 0)
        return 1;
    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130607,
                              "defunc_3_map_res_mem_130607") != 0)
        return 1;
    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130606,
                              "defunc_3_map_res_mem_130606") != 0)
        return 1;
    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130405,
                              "defunc_3_map_res_mem_130405") != 0)
        return 1;
    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130404,
                              "defunc_3_map_res_mem_130404") != 0)
        return 1;
    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130203,
                              "defunc_3_map_res_mem_130203") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130127, "mem_130127") != 0)
        return 1;
    if (memblock_unref_device(ctx, &mem_130122, "mem_130122") != 0)
        return 1;
    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130117,
                              "defunc_3_map_res_mem_130117") != 0)
        return 1;
    if (memblock_unref_device(ctx, &defunc_3_map_res_mem_130116,
                              "defunc_3_map_res_mem_130116") != 0)
        return 1;
    if (memblock_unref_device(ctx, &out_mem_132283, "out_mem_132283") != 0)
        return 1;
    if (memblock_unref_device(ctx, &out_mem_132282, "out_mem_132282") != 0)
        return 1;
    if (memblock_unref_device(ctx, &out_mem_132281, "out_mem_132281") != 0)
        return 1;
    
  cleanup:
    { }
    return err;
}
int futhark_entry_main(struct futhark_context *ctx,
                       struct futhark_f32_2d **out0,
                       struct futhark_f32_2d **out1,
                       struct futhark_f32_2d **out2, 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, const int64_t in6, const int64_t in7, const
                       int64_t in8, const int64_t in9, const int64_t in10, const
                       int64_t in11)
{
    struct memblock_device Y_mem_130086;
    
    Y_mem_130086.references = NULL;
    
    int64_t m_114533;
    int64_t n_114534;
    int64_t n_p_114536;
    int64_t t_window_114537;
    int64_t l_window_114538;
    int64_t t_degree_114539;
    int64_t l_degree_114540;
    int64_t t_jump_114541;
    int64_t l_jump_114542;
    int64_t inner_114543;
    int64_t outer_114544;
    int64_t jump_threshold_114545;
    int64_t max_group_sizze_114546;
    struct memblock_device out_mem_132281;
    
    out_mem_132281.references = NULL;
    
    struct memblock_device out_mem_132282;
    
    out_mem_132282.references = NULL;
    
    struct memblock_device out_mem_132283;
    
    out_mem_132283.references = NULL;
    
    int ret = 0;
    
    lock_lock(&ctx->lock);
    Y_mem_130086 = in0->mem;
    m_114533 = in0->shape[0];
    n_114534 = in0->shape[1];
    n_p_114536 = in1;
    t_window_114537 = in2;
    l_window_114538 = in3;
    t_degree_114539 = in4;
    l_degree_114540 = in5;
    t_jump_114541 = in6;
    l_jump_114542 = in7;
    inner_114543 = in8;
    outer_114544 = in9;
    jump_threshold_114545 = in10;
    max_group_sizze_114546 = in11;
    if (!((m_114533 == in0->shape[0] && n_114534 == in0->shape[1]) && (true &&
                                                                       (true &&
                                                                        (true &&
                                                                         (true &&
                                                                          (true &&
                                                                           (true &&
                                                                            (true &&
                                                                             (true &&
                                                                              (true &&
                                                                               (true &&
                                                                                true)))))))))))) {
        ret = 1;
        if (!ctx->error)
            ctx->error =
                msgprintf("Error: entry point arguments have invalid sizes.\n");
    } else {
        ret = futrts_entry_main(ctx, &out_mem_132281, &out_mem_132282,
                                &out_mem_132283, Y_mem_130086, m_114533,
                                n_114534, n_p_114536, t_window_114537,
                                l_window_114538, t_degree_114539,
                                l_degree_114540, t_jump_114541, l_jump_114542,
                                inner_114543, outer_114544,
                                jump_threshold_114545, max_group_sizze_114546);
        if (ret == 0) {
            assert((*out0 =
                    (struct futhark_f32_2d *) malloc(sizeof(struct futhark_f32_2d))) !=
                NULL);
            (*out0)->mem = out_mem_132281;
            (*out0)->shape[0] = m_114533;
            (*out0)->shape[1] = n_114534;
            assert((*out1 =
                    (struct futhark_f32_2d *) malloc(sizeof(struct futhark_f32_2d))) !=
                NULL);
            (*out1)->mem = out_mem_132282;
            (*out1)->shape[0] = m_114533;
            (*out1)->shape[1] = n_114534;
            assert((*out2 =
                    (struct futhark_f32_2d *) malloc(sizeof(struct futhark_f32_2d))) !=
                NULL);
            (*out2)->mem = out_mem_132283;
            (*out2)->shape[0] = m_114533;
            (*out2)->shape[1] = n_114534;
        }
    }
    lock_unlock(&ctx->lock);
    return ret;
}
